/* * Copyright (C) Texas Instruments - http://www.ti.com/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include #include #include #include #include #include #ifdef SYSFS_VSYNC_NOTIFICATION #include #endif #include #include #include #define HWC_REMOVE_DEPRECATED_VERSIONS 1 #include #include #include #include #include #include #define ASPECT_RATIO_TOLERANCE 0.02f #define min(a, b) ( { typeof(a) __a = (a), __b = (b); __a < __b ? __a : __b; } ) #define max(a, b) ( { typeof(a) __a = (a), __b = (b); __a > __b ? __a : __b; } ) #define swap(a, b) do { typeof(a) __a = (a); (a) = (b); (b) = __a; } while (0) #define WIDTH(rect) ((rect).right - (rect).left) #define HEIGHT(rect) ((rect).bottom - (rect).top) #define DIV_ROUND_UP(a, b) (((a) + (b) - 1) / (b)) #include