OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2010 The Android Open Source Project |
| 3 * |
| 4 * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 * you may not use this file except in compliance with the License. |
| 6 * You may obtain a copy of the License at |
| 7 * |
| 8 * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 * |
| 10 * Unless required by applicable law or agreed to in writing, software |
| 11 * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 * See the License for the specific language governing permissions and |
| 14 * limitations under the License. |
| 15 */ |
| 16 |
| 17 #ifndef ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H |
| 18 #define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H |
| 19 |
| 20 #include <stdint.h> |
| 21 #include <sys/cdefs.h> |
| 22 |
| 23 #include <hardware/gralloc.h> |
| 24 #include <hardware/hardware.h> |
| 25 #include <cutils/native_handle.h> |
| 26 |
| 27 __BEGIN_DECLS |
| 28 |
| 29 /*****************************************************************************/ |
| 30 |
| 31 #define HWC_HEADER_VERSION 1 |
| 32 |
| 33 #define HWC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1) |
| 34 |
| 35 #define HWC_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION_2(1, 0, HWC_HEAD
ER_VERSION) |
| 36 #define HWC_DEVICE_API_VERSION_1_1 HARDWARE_DEVICE_API_VERSION_2(1, 1, HWC_HEAD
ER_VERSION) |
| 37 #define HWC_DEVICE_API_VERSION_1_2 HARDWARE_DEVICE_API_VERSION_2(1, 2, HWC_HEAD
ER_VERSION) |
| 38 #define HWC_DEVICE_API_VERSION_1_3 HARDWARE_DEVICE_API_VERSION_2(1, 3, HWC_HEAD
ER_VERSION) |
| 39 |
| 40 enum { |
| 41 /* hwc_composer_device_t::set failed in EGL */ |
| 42 HWC_EGL_ERROR = -1 |
| 43 }; |
| 44 |
| 45 /* |
| 46 * hwc_layer_t::hints values |
| 47 * Hints are set by the HAL and read by SurfaceFlinger |
| 48 */ |
| 49 enum { |
| 50 /* |
| 51 * HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger |
| 52 * that it should triple buffer this layer. Typically HWC does this when |
| 53 * the layer will be unavailable for use for an extended period of time, |
| 54 * e.g. if the display will be fetching data directly from the layer and |
| 55 * the layer can not be modified until after the next set(). |
| 56 */ |
| 57 HWC_HINT_TRIPLE_BUFFER = 0x00000001, |
| 58 |
| 59 /* |
| 60 * HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear th
e |
| 61 * framebuffer with transparent pixels where this layer would be. |
| 62 * SurfaceFlinger will only honor this flag when the layer has no blending |
| 63 * |
| 64 */ |
| 65 HWC_HINT_CLEAR_FB = 0x00000002 |
| 66 }; |
| 67 |
| 68 /* |
| 69 * hwc_layer_t::flags values |
| 70 * Flags are set by SurfaceFlinger and read by the HAL |
| 71 */ |
| 72 enum { |
| 73 /* |
| 74 * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL |
| 75 * shall not consider this layer for composition as it will be handled |
| 76 * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY). |
| 77 */ |
| 78 HWC_SKIP_LAYER = 0x00000001, |
| 79 }; |
| 80 |
| 81 /* |
| 82 * hwc_layer_t::compositionType values |
| 83 */ |
| 84 enum { |
| 85 /* this layer is to be drawn into the framebuffer by SurfaceFlinger */ |
| 86 HWC_FRAMEBUFFER = 0, |
| 87 |
| 88 /* this layer will be handled in the HWC */ |
| 89 HWC_OVERLAY = 1, |
| 90 |
| 91 /* this is the background layer. it's used to set the background color. |
| 92 * there is only a single background layer */ |
| 93 HWC_BACKGROUND = 2, |
| 94 |
| 95 /* this layer holds the result of compositing the HWC_FRAMEBUFFER layers. |
| 96 * Added in HWC_DEVICE_API_VERSION_1_1. */ |
| 97 HWC_FRAMEBUFFER_TARGET = 3, |
| 98 }; |
| 99 |
| 100 /* |
| 101 * hwc_layer_t::blending values |
| 102 */ |
| 103 enum { |
| 104 /* no blending */ |
| 105 HWC_BLENDING_NONE = 0x0100, |
| 106 |
| 107 /* ONE / ONE_MINUS_SRC_ALPHA */ |
| 108 HWC_BLENDING_PREMULT = 0x0105, |
| 109 |
| 110 /* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */ |
| 111 HWC_BLENDING_COVERAGE = 0x0405 |
| 112 }; |
| 113 |
| 114 /* |
| 115 * hwc_layer_t::transform values |
| 116 */ |
| 117 enum { |
| 118 /* flip source image horizontally */ |
| 119 HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H, |
| 120 /* flip source image vertically */ |
| 121 HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V, |
| 122 /* rotate source image 90 degrees clock-wise */ |
| 123 HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90, |
| 124 /* rotate source image 180 degrees */ |
| 125 HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180, |
| 126 /* rotate source image 270 degrees clock-wise */ |
| 127 HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, |
| 128 }; |
| 129 |
| 130 /* attributes queriable with query() */ |
| 131 enum { |
| 132 /* |
| 133 * Must return 1 if the background layer is supported, 0 otherwise. |
| 134 */ |
| 135 HWC_BACKGROUND_LAYER_SUPPORTED = 0, |
| 136 |
| 137 /* |
| 138 * Returns the vsync period in nanoseconds. |
| 139 * |
| 140 * This query is not used for HWC_DEVICE_API_VERSION_1_1 and later. |
| 141 * Instead, the per-display attribute HWC_DISPLAY_VSYNC_PERIOD is used. |
| 142 */ |
| 143 HWC_VSYNC_PERIOD = 1, |
| 144 |
| 145 /* |
| 146 * Availability: HWC_DEVICE_API_VERSION_1_1 |
| 147 * Returns a mask of supported display types. |
| 148 */ |
| 149 HWC_DISPLAY_TYPES_SUPPORTED = 2, |
| 150 }; |
| 151 |
| 152 /* display attributes returned by getDisplayAttributes() */ |
| 153 enum { |
| 154 /* Indicates the end of an attribute list */ |
| 155 HWC_DISPLAY_NO_ATTRIBUTE = 0, |
| 156 |
| 157 /* The vsync period in nanoseconds */ |
| 158 HWC_DISPLAY_VSYNC_PERIOD = 1, |
| 159 |
| 160 /* The number of pixels in the horizontal and vertical directions. */ |
| 161 HWC_DISPLAY_WIDTH = 2, |
| 162 HWC_DISPLAY_HEIGHT = 3, |
| 163 |
| 164 /* The number of pixels per thousand inches of this configuration. |
| 165 * |
| 166 * Scaling DPI by 1000 allows it to be stored in an int without losing |
| 167 * too much precision. |
| 168 * |
| 169 * If the DPI for a configuration is unavailable or the HWC implementation |
| 170 * considers it unreliable, it should set these attributes to zero. |
| 171 */ |
| 172 HWC_DISPLAY_DPI_X = 4, |
| 173 HWC_DISPLAY_DPI_Y = 5, |
| 174 }; |
| 175 |
| 176 /* Allowed events for hwc_methods::eventControl() */ |
| 177 enum { |
| 178 HWC_EVENT_VSYNC = 0 |
| 179 }; |
| 180 |
| 181 /* Display types and associated mask bits. */ |
| 182 enum { |
| 183 HWC_DISPLAY_PRIMARY = 0, |
| 184 HWC_DISPLAY_EXTERNAL = 1, // HDMI, DP, etc. |
| 185 HWC_DISPLAY_VIRTUAL = 2, |
| 186 |
| 187 HWC_NUM_PHYSICAL_DISPLAY_TYPES = 2, |
| 188 HWC_NUM_DISPLAY_TYPES = 3, |
| 189 }; |
| 190 |
| 191 enum { |
| 192 HWC_DISPLAY_PRIMARY_BIT = 1 << HWC_DISPLAY_PRIMARY, |
| 193 HWC_DISPLAY_EXTERNAL_BIT = 1 << HWC_DISPLAY_EXTERNAL, |
| 194 HWC_DISPLAY_VIRTUAL_BIT = 1 << HWC_DISPLAY_VIRTUAL, |
| 195 }; |
| 196 |
| 197 /*****************************************************************************/ |
| 198 |
| 199 __END_DECLS |
| 200 |
| 201 #endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_DEFS_H */ |
OLD | NEW |