1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport [email protected]; 20*4d7e907cSAndroid Build Coastguard Workerimport IComposerCallback; 21*4d7e907cSAndroid Build Coastguard Worker 22*4d7e907cSAndroid Build Coastguard Workerinterface IComposerClient { 23*4d7e907cSAndroid Build Coastguard Worker /** Display attributes queryable through getDisplayAttribute. */ 24*4d7e907cSAndroid Build Coastguard Worker enum Attribute : int32_t { 25*4d7e907cSAndroid Build Coastguard Worker INVALID = 0, 26*4d7e907cSAndroid Build Coastguard Worker 27*4d7e907cSAndroid Build Coastguard Worker /** Dimensions in pixels */ 28*4d7e907cSAndroid Build Coastguard Worker WIDTH = 1, 29*4d7e907cSAndroid Build Coastguard Worker HEIGHT = 2, 30*4d7e907cSAndroid Build Coastguard Worker 31*4d7e907cSAndroid Build Coastguard Worker /** Vsync period in nanoseconds */ 32*4d7e907cSAndroid Build Coastguard Worker VSYNC_PERIOD = 3, 33*4d7e907cSAndroid Build Coastguard Worker 34*4d7e907cSAndroid Build Coastguard Worker /** 35*4d7e907cSAndroid Build Coastguard Worker * Dots per thousand inches (DPI * 1000). Scaling by 1000 allows these 36*4d7e907cSAndroid Build Coastguard Worker * numbers to be stored in an int32_t without losing too much 37*4d7e907cSAndroid Build Coastguard Worker * precision. If the DPI for a configuration is unavailable or is 38*4d7e907cSAndroid Build Coastguard Worker * considered unreliable, the device may return UNSUPPORTED instead. 39*4d7e907cSAndroid Build Coastguard Worker */ 40*4d7e907cSAndroid Build Coastguard Worker DPI_X = 4, 41*4d7e907cSAndroid Build Coastguard Worker DPI_Y = 5, 42*4d7e907cSAndroid Build Coastguard Worker }; 43*4d7e907cSAndroid Build Coastguard Worker 44*4d7e907cSAndroid Build Coastguard Worker /** Display requests returned by getDisplayRequests. */ 45*4d7e907cSAndroid Build Coastguard Worker enum DisplayRequest : uint32_t { 46*4d7e907cSAndroid Build Coastguard Worker /** 47*4d7e907cSAndroid Build Coastguard Worker * Instructs the client to provide a new client target buffer, even if 48*4d7e907cSAndroid Build Coastguard Worker * no layers are marked for client composition. 49*4d7e907cSAndroid Build Coastguard Worker */ 50*4d7e907cSAndroid Build Coastguard Worker FLIP_CLIENT_TARGET = 1 << 0, 51*4d7e907cSAndroid Build Coastguard Worker 52*4d7e907cSAndroid Build Coastguard Worker /** 53*4d7e907cSAndroid Build Coastguard Worker * Instructs the client to write the result of client composition 54*4d7e907cSAndroid Build Coastguard Worker * directly into the virtual display output buffer. If any of the 55*4d7e907cSAndroid Build Coastguard Worker * layers are not marked as Composition::CLIENT or the given display 56*4d7e907cSAndroid Build Coastguard Worker * is not a virtual display, this request has no effect. 57*4d7e907cSAndroid Build Coastguard Worker */ 58*4d7e907cSAndroid Build Coastguard Worker WRITE_CLIENT_TARGET_TO_OUTPUT = 1 << 1, 59*4d7e907cSAndroid Build Coastguard Worker }; 60*4d7e907cSAndroid Build Coastguard Worker 61*4d7e907cSAndroid Build Coastguard Worker /** Layer requests returned from getDisplayRequests. */ 62*4d7e907cSAndroid Build Coastguard Worker enum LayerRequest : uint32_t { 63*4d7e907cSAndroid Build Coastguard Worker /** 64*4d7e907cSAndroid Build Coastguard Worker * The client must clear its target with transparent pixels where 65*4d7e907cSAndroid Build Coastguard Worker * this layer would be. The client may ignore this request if the 66*4d7e907cSAndroid Build Coastguard Worker * layer must be blended. 67*4d7e907cSAndroid Build Coastguard Worker */ 68*4d7e907cSAndroid Build Coastguard Worker CLEAR_CLIENT_TARGET = 1 << 0, 69*4d7e907cSAndroid Build Coastguard Worker }; 70*4d7e907cSAndroid Build Coastguard Worker 71*4d7e907cSAndroid Build Coastguard Worker /** Power modes for use with setPowerMode. */ 72*4d7e907cSAndroid Build Coastguard Worker enum PowerMode : int32_t { 73*4d7e907cSAndroid Build Coastguard Worker /** The display is fully off (blanked). */ 74*4d7e907cSAndroid Build Coastguard Worker OFF = 0, 75*4d7e907cSAndroid Build Coastguard Worker 76*4d7e907cSAndroid Build Coastguard Worker /** 77*4d7e907cSAndroid Build Coastguard Worker * These are optional low power modes. getDozeSupport may be called to 78*4d7e907cSAndroid Build Coastguard Worker * determine whether a given display supports these modes. 79*4d7e907cSAndroid Build Coastguard Worker */ 80*4d7e907cSAndroid Build Coastguard Worker 81*4d7e907cSAndroid Build Coastguard Worker /** 82*4d7e907cSAndroid Build Coastguard Worker * The display is turned on and configured in a low power state that 83*4d7e907cSAndroid Build Coastguard Worker * is suitable for presenting ambient information to the user, 84*4d7e907cSAndroid Build Coastguard Worker * possibly with lower fidelity than ON, but with greater efficiency. 85*4d7e907cSAndroid Build Coastguard Worker */ 86*4d7e907cSAndroid Build Coastguard Worker DOZE = 1, 87*4d7e907cSAndroid Build Coastguard Worker 88*4d7e907cSAndroid Build Coastguard Worker /** 89*4d7e907cSAndroid Build Coastguard Worker * The display is configured as in DOZE but may stop applying display 90*4d7e907cSAndroid Build Coastguard Worker * updates from the client. This is effectively a hint to the device 91*4d7e907cSAndroid Build Coastguard Worker * that drawing to the display has been suspended and that the the 92*4d7e907cSAndroid Build Coastguard Worker * device must remain on in a low power state and continue 93*4d7e907cSAndroid Build Coastguard Worker * displaying its current contents indefinitely until the power mode 94*4d7e907cSAndroid Build Coastguard Worker * changes. 95*4d7e907cSAndroid Build Coastguard Worker * 96*4d7e907cSAndroid Build Coastguard Worker * This mode may also be used as a signal to enable hardware-based 97*4d7e907cSAndroid Build Coastguard Worker * doze functionality. In this case, the device is free to take over 98*4d7e907cSAndroid Build Coastguard Worker * the display and manage it autonomously to implement a low power 99*4d7e907cSAndroid Build Coastguard Worker * always-on display. 100*4d7e907cSAndroid Build Coastguard Worker */ 101*4d7e907cSAndroid Build Coastguard Worker DOZE_SUSPEND = 3, 102*4d7e907cSAndroid Build Coastguard Worker 103*4d7e907cSAndroid Build Coastguard Worker /** The display is fully on. */ 104*4d7e907cSAndroid Build Coastguard Worker ON = 2, 105*4d7e907cSAndroid Build Coastguard Worker }; 106*4d7e907cSAndroid Build Coastguard Worker 107*4d7e907cSAndroid Build Coastguard Worker /** Vsync values passed to setVsyncEnabled. */ 108*4d7e907cSAndroid Build Coastguard Worker enum Vsync : int32_t { 109*4d7e907cSAndroid Build Coastguard Worker INVALID = 0, 110*4d7e907cSAndroid Build Coastguard Worker 111*4d7e907cSAndroid Build Coastguard Worker /** Enable vsync. */ 112*4d7e907cSAndroid Build Coastguard Worker ENABLE = 1, 113*4d7e907cSAndroid Build Coastguard Worker 114*4d7e907cSAndroid Build Coastguard Worker /** Disable vsync. */ 115*4d7e907cSAndroid Build Coastguard Worker DISABLE = 2, 116*4d7e907cSAndroid Build Coastguard Worker }; 117*4d7e907cSAndroid Build Coastguard Worker 118*4d7e907cSAndroid Build Coastguard Worker /** Blend modes, settable per layer. */ 119*4d7e907cSAndroid Build Coastguard Worker enum BlendMode : int32_t { 120*4d7e907cSAndroid Build Coastguard Worker INVALID = 0, 121*4d7e907cSAndroid Build Coastguard Worker 122*4d7e907cSAndroid Build Coastguard Worker /** colorOut = colorSrc */ 123*4d7e907cSAndroid Build Coastguard Worker NONE = 1, 124*4d7e907cSAndroid Build Coastguard Worker 125*4d7e907cSAndroid Build Coastguard Worker /** colorOut = colorSrc + colorDst * (1 - alphaSrc) */ 126*4d7e907cSAndroid Build Coastguard Worker PREMULTIPLIED = 2, 127*4d7e907cSAndroid Build Coastguard Worker 128*4d7e907cSAndroid Build Coastguard Worker /** colorOut = colorSrc * alphaSrc + colorDst * (1 - alphaSrc) */ 129*4d7e907cSAndroid Build Coastguard Worker COVERAGE = 3, 130*4d7e907cSAndroid Build Coastguard Worker }; 131*4d7e907cSAndroid Build Coastguard Worker 132*4d7e907cSAndroid Build Coastguard Worker /** Possible composition types for a given layer. */ 133*4d7e907cSAndroid Build Coastguard Worker enum Composition : int32_t { 134*4d7e907cSAndroid Build Coastguard Worker INVALID = 0, 135*4d7e907cSAndroid Build Coastguard Worker 136*4d7e907cSAndroid Build Coastguard Worker /** 137*4d7e907cSAndroid Build Coastguard Worker * The client must composite this layer into the client target buffer 138*4d7e907cSAndroid Build Coastguard Worker * (provided to the device through setClientTarget). 139*4d7e907cSAndroid Build Coastguard Worker * 140*4d7e907cSAndroid Build Coastguard Worker * The device must not request any composition type changes for layers 141*4d7e907cSAndroid Build Coastguard Worker * of this type. 142*4d7e907cSAndroid Build Coastguard Worker */ 143*4d7e907cSAndroid Build Coastguard Worker CLIENT = 1, 144*4d7e907cSAndroid Build Coastguard Worker 145*4d7e907cSAndroid Build Coastguard Worker /** 146*4d7e907cSAndroid Build Coastguard Worker * The device must handle the composition of this layer through a 147*4d7e907cSAndroid Build Coastguard Worker * hardware overlay or other similar means. 148*4d7e907cSAndroid Build Coastguard Worker * 149*4d7e907cSAndroid Build Coastguard Worker * Upon validateDisplay, the device may request a change from this 150*4d7e907cSAndroid Build Coastguard Worker * type to CLIENT. 151*4d7e907cSAndroid Build Coastguard Worker */ 152*4d7e907cSAndroid Build Coastguard Worker DEVICE = 2, 153*4d7e907cSAndroid Build Coastguard Worker 154*4d7e907cSAndroid Build Coastguard Worker /** 155*4d7e907cSAndroid Build Coastguard Worker * The device must render this layer using the color set through 156*4d7e907cSAndroid Build Coastguard Worker * setLayerColor. If this functionality is not supported on a layer 157*4d7e907cSAndroid Build Coastguard Worker * that the client sets to SOLID_COLOR, the device must request that 158*4d7e907cSAndroid Build Coastguard Worker * the composition type of that layer is changed to CLIENT upon the 159*4d7e907cSAndroid Build Coastguard Worker * next call to validateDisplay. 160*4d7e907cSAndroid Build Coastguard Worker * 161*4d7e907cSAndroid Build Coastguard Worker * Upon validateDisplay, the device may request a change from this 162*4d7e907cSAndroid Build Coastguard Worker * type to CLIENT. 163*4d7e907cSAndroid Build Coastguard Worker */ 164*4d7e907cSAndroid Build Coastguard Worker SOLID_COLOR = 3, 165*4d7e907cSAndroid Build Coastguard Worker 166*4d7e907cSAndroid Build Coastguard Worker /** 167*4d7e907cSAndroid Build Coastguard Worker * Similar to DEVICE, but the position of this layer may also be set 168*4d7e907cSAndroid Build Coastguard Worker * asynchronously through setCursorPosition. If this functionality is 169*4d7e907cSAndroid Build Coastguard Worker * not supported on a layer that the client sets to CURSOR, the device 170*4d7e907cSAndroid Build Coastguard Worker * must request that the composition type of that layer is changed to 171*4d7e907cSAndroid Build Coastguard Worker * CLIENT upon the next call to validateDisplay. 172*4d7e907cSAndroid Build Coastguard Worker * 173*4d7e907cSAndroid Build Coastguard Worker * Upon validateDisplay, the device may request a change from this 174*4d7e907cSAndroid Build Coastguard Worker * type to either DEVICE or CLIENT. Changing to DEVICE will prevent 175*4d7e907cSAndroid Build Coastguard Worker * the use of setCursorPosition but still permit the device to 176*4d7e907cSAndroid Build Coastguard Worker * composite the layer. 177*4d7e907cSAndroid Build Coastguard Worker */ 178*4d7e907cSAndroid Build Coastguard Worker CURSOR = 4, 179*4d7e907cSAndroid Build Coastguard Worker 180*4d7e907cSAndroid Build Coastguard Worker /** 181*4d7e907cSAndroid Build Coastguard Worker * The device must handle the composition of this layer, as well as 182*4d7e907cSAndroid Build Coastguard Worker * its buffer updates and content synchronization. Only supported on 183*4d7e907cSAndroid Build Coastguard Worker * devices which provide Capability::SIDEBAND_STREAM. 184*4d7e907cSAndroid Build Coastguard Worker * 185*4d7e907cSAndroid Build Coastguard Worker * Upon validateDisplay, the device may request a change from this 186*4d7e907cSAndroid Build Coastguard Worker * type to either DEVICE or CLIENT, but it is unlikely that content 187*4d7e907cSAndroid Build Coastguard Worker * will display correctly in these cases. 188*4d7e907cSAndroid Build Coastguard Worker */ 189*4d7e907cSAndroid Build Coastguard Worker SIDEBAND = 5, 190*4d7e907cSAndroid Build Coastguard Worker }; 191*4d7e907cSAndroid Build Coastguard Worker 192*4d7e907cSAndroid Build Coastguard Worker /** Display types returned by getDisplayType. */ 193*4d7e907cSAndroid Build Coastguard Worker enum DisplayType : int32_t { 194*4d7e907cSAndroid Build Coastguard Worker INVALID = 0, 195*4d7e907cSAndroid Build Coastguard Worker 196*4d7e907cSAndroid Build Coastguard Worker /** 197*4d7e907cSAndroid Build Coastguard Worker * All physical displays, including both internal displays and 198*4d7e907cSAndroid Build Coastguard Worker * hotpluggable external displays. 199*4d7e907cSAndroid Build Coastguard Worker */ 200*4d7e907cSAndroid Build Coastguard Worker PHYSICAL = 1, 201*4d7e907cSAndroid Build Coastguard Worker 202*4d7e907cSAndroid Build Coastguard Worker /** Virtual displays created by createVirtualDisplay. */ 203*4d7e907cSAndroid Build Coastguard Worker VIRTUAL = 2, 204*4d7e907cSAndroid Build Coastguard Worker }; 205*4d7e907cSAndroid Build Coastguard Worker 206*4d7e907cSAndroid Build Coastguard Worker /** Special index values (always negative) for command queue commands. */ 207*4d7e907cSAndroid Build Coastguard Worker enum HandleIndex : int32_t { 208*4d7e907cSAndroid Build Coastguard Worker /** No handle */ 209*4d7e907cSAndroid Build Coastguard Worker EMPTY = -1, 210*4d7e907cSAndroid Build Coastguard Worker 211*4d7e907cSAndroid Build Coastguard Worker /** Use cached handle */ 212*4d7e907cSAndroid Build Coastguard Worker CACHED = -2, 213*4d7e907cSAndroid Build Coastguard Worker }; 214*4d7e907cSAndroid Build Coastguard Worker 215*4d7e907cSAndroid Build Coastguard Worker struct Rect { 216*4d7e907cSAndroid Build Coastguard Worker int32_t left; 217*4d7e907cSAndroid Build Coastguard Worker int32_t top; 218*4d7e907cSAndroid Build Coastguard Worker int32_t right; 219*4d7e907cSAndroid Build Coastguard Worker int32_t bottom; 220*4d7e907cSAndroid Build Coastguard Worker }; 221*4d7e907cSAndroid Build Coastguard Worker 222*4d7e907cSAndroid Build Coastguard Worker struct FRect { 223*4d7e907cSAndroid Build Coastguard Worker float left; 224*4d7e907cSAndroid Build Coastguard Worker float top; 225*4d7e907cSAndroid Build Coastguard Worker float right; 226*4d7e907cSAndroid Build Coastguard Worker float bottom; 227*4d7e907cSAndroid Build Coastguard Worker }; 228*4d7e907cSAndroid Build Coastguard Worker 229*4d7e907cSAndroid Build Coastguard Worker struct Color { 230*4d7e907cSAndroid Build Coastguard Worker uint8_t r; 231*4d7e907cSAndroid Build Coastguard Worker uint8_t g; 232*4d7e907cSAndroid Build Coastguard Worker uint8_t b; 233*4d7e907cSAndroid Build Coastguard Worker uint8_t a; 234*4d7e907cSAndroid Build Coastguard Worker }; 235*4d7e907cSAndroid Build Coastguard Worker 236*4d7e907cSAndroid Build Coastguard Worker /** 237*4d7e907cSAndroid Build Coastguard Worker * Provides a IComposerCallback object for the device to call. 238*4d7e907cSAndroid Build Coastguard Worker * 239*4d7e907cSAndroid Build Coastguard Worker * This function must be called only once. 240*4d7e907cSAndroid Build Coastguard Worker * 241*4d7e907cSAndroid Build Coastguard Worker * @param callback is the IComposerCallback object. 242*4d7e907cSAndroid Build Coastguard Worker */ 243*4d7e907cSAndroid Build Coastguard Worker @entry 244*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 245*4d7e907cSAndroid Build Coastguard Worker registerCallback(IComposerCallback callback); 246*4d7e907cSAndroid Build Coastguard Worker 247*4d7e907cSAndroid Build Coastguard Worker /** 248*4d7e907cSAndroid Build Coastguard Worker * Returns the maximum number of virtual displays supported by this device 249*4d7e907cSAndroid Build Coastguard Worker * (which may be 0). The client must not attempt to create more than this 250*4d7e907cSAndroid Build Coastguard Worker * many virtual displays on this device. This number must not change for 251*4d7e907cSAndroid Build Coastguard Worker * the lifetime of the device. 252*4d7e907cSAndroid Build Coastguard Worker * 253*4d7e907cSAndroid Build Coastguard Worker * @return count is the maximum number of virtual displays supported. 254*4d7e907cSAndroid Build Coastguard Worker */ 255*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 256*4d7e907cSAndroid Build Coastguard Worker getMaxVirtualDisplayCount() generates (uint32_t count); 257*4d7e907cSAndroid Build Coastguard Worker 258*4d7e907cSAndroid Build Coastguard Worker /** 259*4d7e907cSAndroid Build Coastguard Worker * Creates a new virtual display with the given width and height. The 260*4d7e907cSAndroid Build Coastguard Worker * format passed into this function is the default format requested by the 261*4d7e907cSAndroid Build Coastguard Worker * consumer of the virtual display output buffers. 262*4d7e907cSAndroid Build Coastguard Worker * 263*4d7e907cSAndroid Build Coastguard Worker * The display must be assumed to be on from the time the first frame is 264*4d7e907cSAndroid Build Coastguard Worker * presented until the display is destroyed. 265*4d7e907cSAndroid Build Coastguard Worker * 266*4d7e907cSAndroid Build Coastguard Worker * @param width is the width in pixels. 267*4d7e907cSAndroid Build Coastguard Worker * @param height is the height in pixels. 268*4d7e907cSAndroid Build Coastguard Worker * @param formatHint is the default output buffer format selected by 269*4d7e907cSAndroid Build Coastguard Worker * the consumer. 270*4d7e907cSAndroid Build Coastguard Worker * @param outputBufferSlotCount is the number of output buffer slots to be 271*4d7e907cSAndroid Build Coastguard Worker * reserved. 272*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 273*4d7e907cSAndroid Build Coastguard Worker * UNSUPPORTED when the width or height is too large for the 274*4d7e907cSAndroid Build Coastguard Worker * device to be able to create a virtual display. 275*4d7e907cSAndroid Build Coastguard Worker * NO_RESOURCES when the device is unable to create a new virtual 276*4d7e907cSAndroid Build Coastguard Worker * display at this time. 277*4d7e907cSAndroid Build Coastguard Worker * @return display is the newly-created virtual display. 278*4d7e907cSAndroid Build Coastguard Worker * @return format is the format of the buffer the device will produce. 279*4d7e907cSAndroid Build Coastguard Worker */ 280*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 281*4d7e907cSAndroid Build Coastguard Worker createVirtualDisplay(uint32_t width, 282*4d7e907cSAndroid Build Coastguard Worker uint32_t height, 283*4d7e907cSAndroid Build Coastguard Worker PixelFormat formatHint, 284*4d7e907cSAndroid Build Coastguard Worker uint32_t outputBufferSlotCount) 285*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 286*4d7e907cSAndroid Build Coastguard Worker Display display, 287*4d7e907cSAndroid Build Coastguard Worker PixelFormat format); 288*4d7e907cSAndroid Build Coastguard Worker 289*4d7e907cSAndroid Build Coastguard Worker /** 290*4d7e907cSAndroid Build Coastguard Worker * Destroys a virtual display. After this call all resources consumed by 291*4d7e907cSAndroid Build Coastguard Worker * this display may be freed by the device and any operations performed on 292*4d7e907cSAndroid Build Coastguard Worker * this display must fail. 293*4d7e907cSAndroid Build Coastguard Worker * 294*4d7e907cSAndroid Build Coastguard Worker * @param display is the virtual display to destroy. 295*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 296*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 297*4d7e907cSAndroid Build Coastguard Worker * BAD_PARAMETER when the display handle which was passed in does 298*4d7e907cSAndroid Build Coastguard Worker * not refer to a virtual display. 299*4d7e907cSAndroid Build Coastguard Worker */ 300*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 301*4d7e907cSAndroid Build Coastguard Worker destroyVirtualDisplay(Display display) generates (Error error); 302*4d7e907cSAndroid Build Coastguard Worker 303*4d7e907cSAndroid Build Coastguard Worker /** 304*4d7e907cSAndroid Build Coastguard Worker * Creates a new layer on the given display. 305*4d7e907cSAndroid Build Coastguard Worker * 306*4d7e907cSAndroid Build Coastguard Worker * @param display is the display on which to create the layer. 307*4d7e907cSAndroid Build Coastguard Worker * @param bufferSlotCount is the number of buffer slot to be reserved. 308*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 309*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 310*4d7e907cSAndroid Build Coastguard Worker * NO_RESOURCES when the device was unable to create a layer this 311*4d7e907cSAndroid Build Coastguard Worker * time. 312*4d7e907cSAndroid Build Coastguard Worker * @return layer is the handle of the new layer. 313*4d7e907cSAndroid Build Coastguard Worker */ 314*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 315*4d7e907cSAndroid Build Coastguard Worker createLayer(Display display, 316*4d7e907cSAndroid Build Coastguard Worker uint32_t bufferSlotCount) 317*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 318*4d7e907cSAndroid Build Coastguard Worker Layer layer); 319*4d7e907cSAndroid Build Coastguard Worker 320*4d7e907cSAndroid Build Coastguard Worker /** 321*4d7e907cSAndroid Build Coastguard Worker * Destroys the given layer. 322*4d7e907cSAndroid Build Coastguard Worker * 323*4d7e907cSAndroid Build Coastguard Worker * @param display is the display on which the layer was created. 324*4d7e907cSAndroid Build Coastguard Worker * @param layer is the layer to destroy. 325*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 326*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 327*4d7e907cSAndroid Build Coastguard Worker * BAD_LAYER when an invalid layer handle was passed in. 328*4d7e907cSAndroid Build Coastguard Worker */ 329*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 330*4d7e907cSAndroid Build Coastguard Worker destroyLayer(Display display, Layer layer) generates (Error error); 331*4d7e907cSAndroid Build Coastguard Worker 332*4d7e907cSAndroid Build Coastguard Worker /** 333*4d7e907cSAndroid Build Coastguard Worker * Retrieves which display configuration is currently active. 334*4d7e907cSAndroid Build Coastguard Worker * 335*4d7e907cSAndroid Build Coastguard Worker * If no display configuration is currently active, this function must 336*4d7e907cSAndroid Build Coastguard Worker * return BAD_CONFIG. It is the responsibility of the client to call 337*4d7e907cSAndroid Build Coastguard Worker * setActiveConfig with a valid configuration before attempting to present 338*4d7e907cSAndroid Build Coastguard Worker * anything on the display. 339*4d7e907cSAndroid Build Coastguard Worker * 340*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to which the active config is queried. 341*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 342*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 343*4d7e907cSAndroid Build Coastguard Worker * BAD_CONFIG when no configuration is currently active. 344*4d7e907cSAndroid Build Coastguard Worker * @return config is the currently active display configuration. 345*4d7e907cSAndroid Build Coastguard Worker */ 346*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 347*4d7e907cSAndroid Build Coastguard Worker getActiveConfig(Display display) generates (Error error, Config config); 348*4d7e907cSAndroid Build Coastguard Worker 349*4d7e907cSAndroid Build Coastguard Worker /** 350*4d7e907cSAndroid Build Coastguard Worker * Returns whether a client target with the given properties can be 351*4d7e907cSAndroid Build Coastguard Worker * handled by the device. 352*4d7e907cSAndroid Build Coastguard Worker * 353*4d7e907cSAndroid Build Coastguard Worker * This function must return true for a client target with width and 354*4d7e907cSAndroid Build Coastguard Worker * height equal to the active display configuration dimensions, 355*4d7e907cSAndroid Build Coastguard Worker * PixelFormat::RGBA_8888, and Dataspace::UNKNOWN. It is not required to 356*4d7e907cSAndroid Build Coastguard Worker * return true for any other configuration. 357*4d7e907cSAndroid Build Coastguard Worker * 358*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to query. 359*4d7e907cSAndroid Build Coastguard Worker * @param width is the client target width in pixels. 360*4d7e907cSAndroid Build Coastguard Worker * @param height is the client target height in pixels. 361*4d7e907cSAndroid Build Coastguard Worker * @param format is the client target format. 362*4d7e907cSAndroid Build Coastguard Worker * @param dataspace is the client target dataspace, as described in 363*4d7e907cSAndroid Build Coastguard Worker * setLayerDataspace. 364*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 365*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 366*4d7e907cSAndroid Build Coastguard Worker * UNSUPPORTED when the given configuration is not supported. 367*4d7e907cSAndroid Build Coastguard Worker */ 368*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 369*4d7e907cSAndroid Build Coastguard Worker getClientTargetSupport(Display display, 370*4d7e907cSAndroid Build Coastguard Worker uint32_t width, 371*4d7e907cSAndroid Build Coastguard Worker uint32_t height, 372*4d7e907cSAndroid Build Coastguard Worker PixelFormat format, 373*4d7e907cSAndroid Build Coastguard Worker Dataspace dataspace) 374*4d7e907cSAndroid Build Coastguard Worker generates (Error error); 375*4d7e907cSAndroid Build Coastguard Worker 376*4d7e907cSAndroid Build Coastguard Worker /** 377*4d7e907cSAndroid Build Coastguard Worker * Returns the color modes supported on this display. 378*4d7e907cSAndroid Build Coastguard Worker * 379*4d7e907cSAndroid Build Coastguard Worker * All devices must support at least ColorMode::NATIVE. 380*4d7e907cSAndroid Build Coastguard Worker * 381*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to query. 382*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 383*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 384*4d7e907cSAndroid Build Coastguard Worker * @return modes is an array of color modes. 385*4d7e907cSAndroid Build Coastguard Worker */ 386*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 387*4d7e907cSAndroid Build Coastguard Worker getColorModes(Display display) 388*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 389*4d7e907cSAndroid Build Coastguard Worker vec<ColorMode> modes); 390*4d7e907cSAndroid Build Coastguard Worker 391*4d7e907cSAndroid Build Coastguard Worker /** 392*4d7e907cSAndroid Build Coastguard Worker * Returns a display attribute value for a particular display 393*4d7e907cSAndroid Build Coastguard Worker * configuration. 394*4d7e907cSAndroid Build Coastguard Worker * 395*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to query. 396*4d7e907cSAndroid Build Coastguard Worker * @param config is the display configuration for which to return 397*4d7e907cSAndroid Build Coastguard Worker * attribute values. 398*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 399*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 400*4d7e907cSAndroid Build Coastguard Worker * BAD_CONFIG when config does not name a valid configuration for 401*4d7e907cSAndroid Build Coastguard Worker * this display. 402*4d7e907cSAndroid Build Coastguard Worker * BAD_PARAMETER when attribute is unrecognized. 403*4d7e907cSAndroid Build Coastguard Worker * UNSUPPORTED when attribute cannot be queried for the config. 404*4d7e907cSAndroid Build Coastguard Worker * @return value is the value of the attribute. 405*4d7e907cSAndroid Build Coastguard Worker */ 406*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 407*4d7e907cSAndroid Build Coastguard Worker getDisplayAttribute(Display display, 408*4d7e907cSAndroid Build Coastguard Worker Config config, 409*4d7e907cSAndroid Build Coastguard Worker Attribute attribute) 410*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 411*4d7e907cSAndroid Build Coastguard Worker int32_t value); 412*4d7e907cSAndroid Build Coastguard Worker 413*4d7e907cSAndroid Build Coastguard Worker /** 414*4d7e907cSAndroid Build Coastguard Worker * Returns handles for all of the valid display configurations on this 415*4d7e907cSAndroid Build Coastguard Worker * display. 416*4d7e907cSAndroid Build Coastguard Worker * 417*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to query. 418*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 419*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 420*4d7e907cSAndroid Build Coastguard Worker * @return configs is an array of configuration handles. 421*4d7e907cSAndroid Build Coastguard Worker */ 422*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 423*4d7e907cSAndroid Build Coastguard Worker getDisplayConfigs(Display display) 424*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 425*4d7e907cSAndroid Build Coastguard Worker vec<Config> configs); 426*4d7e907cSAndroid Build Coastguard Worker 427*4d7e907cSAndroid Build Coastguard Worker /** 428*4d7e907cSAndroid Build Coastguard Worker * Returns a human-readable version of the display's name. 429*4d7e907cSAndroid Build Coastguard Worker * 430*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 431*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 432*4d7e907cSAndroid Build Coastguard Worker * @return name is the name of the display. 433*4d7e907cSAndroid Build Coastguard Worker */ 434*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 435*4d7e907cSAndroid Build Coastguard Worker getDisplayName(Display display) generates (Error error, string name); 436*4d7e907cSAndroid Build Coastguard Worker 437*4d7e907cSAndroid Build Coastguard Worker /** 438*4d7e907cSAndroid Build Coastguard Worker * Returns whether the given display is a physical or virtual display. 439*4d7e907cSAndroid Build Coastguard Worker * 440*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to query. 441*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 442*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 443*4d7e907cSAndroid Build Coastguard Worker * @return type is the type of the display. 444*4d7e907cSAndroid Build Coastguard Worker */ 445*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 446*4d7e907cSAndroid Build Coastguard Worker getDisplayType(Display display) generates (Error error, DisplayType type); 447*4d7e907cSAndroid Build Coastguard Worker 448*4d7e907cSAndroid Build Coastguard Worker /** 449*4d7e907cSAndroid Build Coastguard Worker * Returns whether the given display supports PowerMode::DOZE and 450*4d7e907cSAndroid Build Coastguard Worker * PowerMode::DOZE_SUSPEND. DOZE_SUSPEND may not provide any benefit over 451*4d7e907cSAndroid Build Coastguard Worker * DOZE (see the definition of PowerMode for more information), but if 452*4d7e907cSAndroid Build Coastguard Worker * both DOZE and DOZE_SUSPEND are no different from PowerMode::ON, the 453*4d7e907cSAndroid Build Coastguard Worker * device must not claim support. 454*4d7e907cSAndroid Build Coastguard Worker * 455*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to query. 456*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 457*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 458*4d7e907cSAndroid Build Coastguard Worker * @return support is true only when the display supports doze modes. 459*4d7e907cSAndroid Build Coastguard Worker */ 460*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 461*4d7e907cSAndroid Build Coastguard Worker getDozeSupport(Display display) generates (Error error, bool support); 462*4d7e907cSAndroid Build Coastguard Worker 463*4d7e907cSAndroid Build Coastguard Worker /** 464*4d7e907cSAndroid Build Coastguard Worker * Returns the high dynamic range (HDR) capabilities of the given display, 465*4d7e907cSAndroid Build Coastguard Worker * which are invariant with regard to the active configuration. 466*4d7e907cSAndroid Build Coastguard Worker * 467*4d7e907cSAndroid Build Coastguard Worker * Displays which are not HDR-capable must return no types. 468*4d7e907cSAndroid Build Coastguard Worker * 469*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to query. 470*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 471*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 472*4d7e907cSAndroid Build Coastguard Worker * @return types is an array of HDR types, may have 0 elements if the 473*4d7e907cSAndroid Build Coastguard Worker * display is not HDR-capable. 474*4d7e907cSAndroid Build Coastguard Worker * @return maxLuminance is the desired content maximum luminance for this 475*4d7e907cSAndroid Build Coastguard Worker * display in cd/m^2. 476*4d7e907cSAndroid Build Coastguard Worker * @return maxAverageLuminance - the desired content maximum frame-average 477*4d7e907cSAndroid Build Coastguard Worker * luminance for this display in cd/m^2. 478*4d7e907cSAndroid Build Coastguard Worker * @return minLuminance is the desired content minimum luminance for this 479*4d7e907cSAndroid Build Coastguard Worker * display in cd/m^2. 480*4d7e907cSAndroid Build Coastguard Worker */ 481*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 482*4d7e907cSAndroid Build Coastguard Worker getHdrCapabilities(Display display) 483*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 484*4d7e907cSAndroid Build Coastguard Worker vec<Hdr> types, 485*4d7e907cSAndroid Build Coastguard Worker float maxLuminance, 486*4d7e907cSAndroid Build Coastguard Worker float maxAverageLuminance, 487*4d7e907cSAndroid Build Coastguard Worker float minLuminance); 488*4d7e907cSAndroid Build Coastguard Worker 489*4d7e907cSAndroid Build Coastguard Worker /** 490*4d7e907cSAndroid Build Coastguard Worker * Set the number of client target slots to be reserved. 491*4d7e907cSAndroid Build Coastguard Worker * 492*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to which the slots are reserved. 493*4d7e907cSAndroid Build Coastguard Worker * @param clientTargetSlotCount is the slot count for client targets. 494*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 495*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 496*4d7e907cSAndroid Build Coastguard Worker * NO_RESOURCES when unable to reserve the slots. 497*4d7e907cSAndroid Build Coastguard Worker */ 498*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 499*4d7e907cSAndroid Build Coastguard Worker setClientTargetSlotCount(Display display, 500*4d7e907cSAndroid Build Coastguard Worker uint32_t clientTargetSlotCount) 501*4d7e907cSAndroid Build Coastguard Worker generates (Error error); 502*4d7e907cSAndroid Build Coastguard Worker 503*4d7e907cSAndroid Build Coastguard Worker /** 504*4d7e907cSAndroid Build Coastguard Worker * Sets the active configuration for this display. Upon returning, the 505*4d7e907cSAndroid Build Coastguard Worker * given display configuration must be active and remain so until either 506*4d7e907cSAndroid Build Coastguard Worker * this function is called again or the display is disconnected. 507*4d7e907cSAndroid Build Coastguard Worker * 508*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to which the active config is set. 509*4d7e907cSAndroid Build Coastguard Worker * @param config is the new display configuration. 510*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 511*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 512*4d7e907cSAndroid Build Coastguard Worker * BAD_CONFIG when the configuration handle passed in is not valid 513*4d7e907cSAndroid Build Coastguard Worker * for this display. 514*4d7e907cSAndroid Build Coastguard Worker */ 515*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 516*4d7e907cSAndroid Build Coastguard Worker setActiveConfig(Display display, Config config) generates (Error error); 517*4d7e907cSAndroid Build Coastguard Worker 518*4d7e907cSAndroid Build Coastguard Worker /** 519*4d7e907cSAndroid Build Coastguard Worker * Sets the color mode of the given display. 520*4d7e907cSAndroid Build Coastguard Worker * 521*4d7e907cSAndroid Build Coastguard Worker * Upon returning from this function, the color mode change must have 522*4d7e907cSAndroid Build Coastguard Worker * fully taken effect. 523*4d7e907cSAndroid Build Coastguard Worker * 524*4d7e907cSAndroid Build Coastguard Worker * All devices must support at least ColorMode::NATIVE, and displays are 525*4d7e907cSAndroid Build Coastguard Worker * assumed to be in this mode upon hotplug. 526*4d7e907cSAndroid Build Coastguard Worker * 527*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to which the color mode is set. 528*4d7e907cSAndroid Build Coastguard Worker * @param mode is the mode to set to. 529*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 530*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 531*4d7e907cSAndroid Build Coastguard Worker * BAD_PARAMETER when mode is not a valid color mode. 532*4d7e907cSAndroid Build Coastguard Worker * UNSUPPORTED when mode is not supported on this display. 533*4d7e907cSAndroid Build Coastguard Worker */ 534*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 535*4d7e907cSAndroid Build Coastguard Worker setColorMode(Display display, ColorMode mode) generates (Error error); 536*4d7e907cSAndroid Build Coastguard Worker 537*4d7e907cSAndroid Build Coastguard Worker /** 538*4d7e907cSAndroid Build Coastguard Worker * Sets the power mode of the given display. The transition must be 539*4d7e907cSAndroid Build Coastguard Worker * complete when this function returns. It is valid to call this function 540*4d7e907cSAndroid Build Coastguard Worker * multiple times with the same power mode. 541*4d7e907cSAndroid Build Coastguard Worker * 542*4d7e907cSAndroid Build Coastguard Worker * All displays must support PowerMode::ON and PowerMode::OFF. Whether a 543*4d7e907cSAndroid Build Coastguard Worker * display supports PowerMode::DOZE or PowerMode::DOZE_SUSPEND may be 544*4d7e907cSAndroid Build Coastguard Worker * queried using getDozeSupport. 545*4d7e907cSAndroid Build Coastguard Worker * 546*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to which the power mode is set. 547*4d7e907cSAndroid Build Coastguard Worker * @param mode is the new power mode. 548*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 549*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 550*4d7e907cSAndroid Build Coastguard Worker * BAD_PARAMETER when mode was not a valid power mode. 551*4d7e907cSAndroid Build Coastguard Worker * UNSUPPORTED when mode is not supported on this display. 552*4d7e907cSAndroid Build Coastguard Worker */ 553*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 554*4d7e907cSAndroid Build Coastguard Worker setPowerMode(Display display, PowerMode mode) generates (Error error); 555*4d7e907cSAndroid Build Coastguard Worker 556*4d7e907cSAndroid Build Coastguard Worker /** 557*4d7e907cSAndroid Build Coastguard Worker * Enables or disables the vsync signal for the given display. Virtual 558*4d7e907cSAndroid Build Coastguard Worker * displays never generate vsync callbacks, and any attempt to enable 559*4d7e907cSAndroid Build Coastguard Worker * vsync for a virtual display though this function must succeed and have 560*4d7e907cSAndroid Build Coastguard Worker * no other effect. 561*4d7e907cSAndroid Build Coastguard Worker * 562*4d7e907cSAndroid Build Coastguard Worker * @param display is the display to which the vsync mode is set. 563*4d7e907cSAndroid Build Coastguard Worker * @param enabled indicates whether to enable or disable vsync 564*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 565*4d7e907cSAndroid Build Coastguard Worker * BAD_DISPLAY when an invalid display handle was passed in. 566*4d7e907cSAndroid Build Coastguard Worker * BAD_PARAMETER when enabled was an invalid value. 567*4d7e907cSAndroid Build Coastguard Worker */ 568*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 569*4d7e907cSAndroid Build Coastguard Worker setVsyncEnabled(Display display, Vsync enabled) generates (Error error); 570*4d7e907cSAndroid Build Coastguard Worker 571*4d7e907cSAndroid Build Coastguard Worker /** 572*4d7e907cSAndroid Build Coastguard Worker * Sets the input command message queue. 573*4d7e907cSAndroid Build Coastguard Worker * 574*4d7e907cSAndroid Build Coastguard Worker * @param descriptor is the descriptor of the input command message queue. 575*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 576*4d7e907cSAndroid Build Coastguard Worker * NO_RESOURCES when failed to set the queue temporarily. 577*4d7e907cSAndroid Build Coastguard Worker */ 578*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 579*4d7e907cSAndroid Build Coastguard Worker setInputCommandQueue(fmq_sync<uint32_t> descriptor) 580*4d7e907cSAndroid Build Coastguard Worker generates (Error error); 581*4d7e907cSAndroid Build Coastguard Worker 582*4d7e907cSAndroid Build Coastguard Worker /** 583*4d7e907cSAndroid Build Coastguard Worker * Gets the output command message queue. 584*4d7e907cSAndroid Build Coastguard Worker * 585*4d7e907cSAndroid Build Coastguard Worker * This function must only be called inside executeCommands closure. 586*4d7e907cSAndroid Build Coastguard Worker * 587*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 588*4d7e907cSAndroid Build Coastguard Worker * NO_RESOURCES when failed to get the queue temporarily. 589*4d7e907cSAndroid Build Coastguard Worker * @return descriptor is the descriptor of the output command queue. 590*4d7e907cSAndroid Build Coastguard Worker */ 591*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 592*4d7e907cSAndroid Build Coastguard Worker getOutputCommandQueue() 593*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 594*4d7e907cSAndroid Build Coastguard Worker fmq_sync<uint32_t> descriptor); 595*4d7e907cSAndroid Build Coastguard Worker 596*4d7e907cSAndroid Build Coastguard Worker /** 597*4d7e907cSAndroid Build Coastguard Worker * Executes commands from the input command message queue. Return values 598*4d7e907cSAndroid Build Coastguard Worker * generated by the input commands are written to the output command 599*4d7e907cSAndroid Build Coastguard Worker * message queue in the form of value commands. 600*4d7e907cSAndroid Build Coastguard Worker * 601*4d7e907cSAndroid Build Coastguard Worker * @param inLength is the length of input commands. 602*4d7e907cSAndroid Build Coastguard Worker * @param inHandles is an array of handles referenced by the input 603*4d7e907cSAndroid Build Coastguard Worker * commands. 604*4d7e907cSAndroid Build Coastguard Worker * @return error is NONE upon success. Otherwise, 605*4d7e907cSAndroid Build Coastguard Worker * BAD_PARAMETER when inLength is not equal to the length of 606*4d7e907cSAndroid Build Coastguard Worker * commands in the input command message queue. 607*4d7e907cSAndroid Build Coastguard Worker * NO_RESOURCES when the output command message queue was not 608*4d7e907cSAndroid Build Coastguard Worker * properly drained. 609*4d7e907cSAndroid Build Coastguard Worker * @param outQueueChanged indicates whether the output command message 610*4d7e907cSAndroid Build Coastguard Worker * queue has changed. 611*4d7e907cSAndroid Build Coastguard Worker * @param outLength is the length of output commands. 612*4d7e907cSAndroid Build Coastguard Worker * @param outHandles is an array of handles referenced by the output 613*4d7e907cSAndroid Build Coastguard Worker * commands. 614*4d7e907cSAndroid Build Coastguard Worker */ 615*4d7e907cSAndroid Build Coastguard Worker @callflow(next="*") 616*4d7e907cSAndroid Build Coastguard Worker executeCommands(uint32_t inLength, 617*4d7e907cSAndroid Build Coastguard Worker vec<handle> inHandles) 618*4d7e907cSAndroid Build Coastguard Worker generates (Error error, 619*4d7e907cSAndroid Build Coastguard Worker bool outQueueChanged, 620*4d7e907cSAndroid Build Coastguard Worker uint32_t outLength, 621*4d7e907cSAndroid Build Coastguard Worker vec<handle> outHandles); 622*4d7e907cSAndroid Build Coastguard Worker 623*4d7e907cSAndroid Build Coastguard Worker /** 624*4d7e907cSAndroid Build Coastguard Worker * SELECT_DISPLAY has this pseudo prototype 625*4d7e907cSAndroid Build Coastguard Worker * 626*4d7e907cSAndroid Build Coastguard Worker * selectDisplay(Display display); 627*4d7e907cSAndroid Build Coastguard Worker * 628*4d7e907cSAndroid Build Coastguard Worker * Selects the current display implied by all other commands. 629*4d7e907cSAndroid Build Coastguard Worker * 630*4d7e907cSAndroid Build Coastguard Worker * @param display is the newly selected display. 631*4d7e907cSAndroid Build Coastguard Worker * 632*4d7e907cSAndroid Build Coastguard Worker * 633*4d7e907cSAndroid Build Coastguard Worker * SELECT_LAYER has this pseudo prototype 634*4d7e907cSAndroid Build Coastguard Worker * 635*4d7e907cSAndroid Build Coastguard Worker * selectLayer(Layer layer); 636*4d7e907cSAndroid Build Coastguard Worker * 637*4d7e907cSAndroid Build Coastguard Worker * Selects the current layer implied by all implicit layer commands. 638*4d7e907cSAndroid Build Coastguard Worker * 639*4d7e907cSAndroid Build Coastguard Worker * @param layer is the newly selected layer. 640*4d7e907cSAndroid Build Coastguard Worker * 641*4d7e907cSAndroid Build Coastguard Worker * 642*4d7e907cSAndroid Build Coastguard Worker * SET_ERROR has this pseudo prototype 643*4d7e907cSAndroid Build Coastguard Worker * 644*4d7e907cSAndroid Build Coastguard Worker * setError(uint32_t location, Error error); 645*4d7e907cSAndroid Build Coastguard Worker * 646*4d7e907cSAndroid Build Coastguard Worker * Indicates an error generated by a command. 647*4d7e907cSAndroid Build Coastguard Worker * 648*4d7e907cSAndroid Build Coastguard Worker * @param location is the offset of the command in the input command 649*4d7e907cSAndroid Build Coastguard Worker * message queue. 650*4d7e907cSAndroid Build Coastguard Worker * @param error is the error generated by the command. 651*4d7e907cSAndroid Build Coastguard Worker * 652*4d7e907cSAndroid Build Coastguard Worker * 653*4d7e907cSAndroid Build Coastguard Worker * SET_CHANGED_COMPOSITION_TYPES has this pseudo prototype 654*4d7e907cSAndroid Build Coastguard Worker * 655*4d7e907cSAndroid Build Coastguard Worker * setChangedCompositionTypes(vec<Layer> layers, 656*4d7e907cSAndroid Build Coastguard Worker * vec<Composition> types); 657*4d7e907cSAndroid Build Coastguard Worker * 658*4d7e907cSAndroid Build Coastguard Worker * Sets the layers for which the device requires a different composition 659*4d7e907cSAndroid Build Coastguard Worker * type than had been set prior to the last call to VALIDATE_DISPLAY. The 660*4d7e907cSAndroid Build Coastguard Worker * client must either update its state with these types and call 661*4d7e907cSAndroid Build Coastguard Worker * ACCEPT_DISPLAY_CHANGES, or must set new types and attempt to validate 662*4d7e907cSAndroid Build Coastguard Worker * the display again. 663*4d7e907cSAndroid Build Coastguard Worker * 664*4d7e907cSAndroid Build Coastguard Worker * @param layers is an array of layer handles. 665*4d7e907cSAndroid Build Coastguard Worker * @param types is an array of composition types, each corresponding to 666*4d7e907cSAndroid Build Coastguard Worker * an element of layers. 667*4d7e907cSAndroid Build Coastguard Worker * 668*4d7e907cSAndroid Build Coastguard Worker * 669*4d7e907cSAndroid Build Coastguard Worker * SET_DISPLAY_REQUESTS has this pseudo prototype 670*4d7e907cSAndroid Build Coastguard Worker * 671*4d7e907cSAndroid Build Coastguard Worker * setDisplayRequests(uint32_t displayRequestMask, 672*4d7e907cSAndroid Build Coastguard Worker * vec<Layer> layers, 673*4d7e907cSAndroid Build Coastguard Worker * vec<uint32_t> layerRequestMasks); 674*4d7e907cSAndroid Build Coastguard Worker * 675*4d7e907cSAndroid Build Coastguard Worker * Sets the display requests and the layer requests required for the last 676*4d7e907cSAndroid Build Coastguard Worker * validated configuration. 677*4d7e907cSAndroid Build Coastguard Worker * 678*4d7e907cSAndroid Build Coastguard Worker * Display requests provide information about how the client must handle 679*4d7e907cSAndroid Build Coastguard Worker * the client target. Layer requests provide information about how the 680*4d7e907cSAndroid Build Coastguard Worker * client must handle an individual layer. 681*4d7e907cSAndroid Build Coastguard Worker * 682*4d7e907cSAndroid Build Coastguard Worker * @param displayRequestMask is the display requests for the current 683*4d7e907cSAndroid Build Coastguard Worker * validated state. 684*4d7e907cSAndroid Build Coastguard Worker * @param layers is an array of layers which all have at least one 685*4d7e907cSAndroid Build Coastguard Worker * request. 686*4d7e907cSAndroid Build Coastguard Worker * @param layerRequestMasks is the requests corresponding to each element 687*4d7e907cSAndroid Build Coastguard Worker * of layers. 688*4d7e907cSAndroid Build Coastguard Worker * 689*4d7e907cSAndroid Build Coastguard Worker * 690*4d7e907cSAndroid Build Coastguard Worker * SET_PRESENT_FENCE has this pseudo prototype 691*4d7e907cSAndroid Build Coastguard Worker * 692*4d7e907cSAndroid Build Coastguard Worker * setPresentFence(int32_t presentFenceIndex); 693*4d7e907cSAndroid Build Coastguard Worker * 694*4d7e907cSAndroid Build Coastguard Worker * Sets the present fence as a result of PRESENT_DISPLAY. For physical 695*4d7e907cSAndroid Build Coastguard Worker * displays, this fence must be signaled at the vsync when the result 696*4d7e907cSAndroid Build Coastguard Worker * of composition of this frame starts to appear (for video-mode panels) 697*4d7e907cSAndroid Build Coastguard Worker * or starts to transfer to panel memory (for command-mode panels). For 698*4d7e907cSAndroid Build Coastguard Worker * virtual displays, this fence must be signaled when writes to the output 699*4d7e907cSAndroid Build Coastguard Worker * buffer have completed and it is safe to read from it. 700*4d7e907cSAndroid Build Coastguard Worker * 701*4d7e907cSAndroid Build Coastguard Worker * @param presentFenceIndex is an index into outHandles array. 702*4d7e907cSAndroid Build Coastguard Worker * 703*4d7e907cSAndroid Build Coastguard Worker * 704*4d7e907cSAndroid Build Coastguard Worker * SET_RELEASE_FENCES has this pseudo prototype 705*4d7e907cSAndroid Build Coastguard Worker * 706*4d7e907cSAndroid Build Coastguard Worker * setReleaseFences(vec<Layer> layers, 707*4d7e907cSAndroid Build Coastguard Worker * vec<int32_t> releaseFenceIndices); 708*4d7e907cSAndroid Build Coastguard Worker * 709*4d7e907cSAndroid Build Coastguard Worker * Sets the release fences for device layers on this display which will 710*4d7e907cSAndroid Build Coastguard Worker * receive new buffer contents this frame. 711*4d7e907cSAndroid Build Coastguard Worker * 712*4d7e907cSAndroid Build Coastguard Worker * A release fence is a file descriptor referring to a sync fence object 713*4d7e907cSAndroid Build Coastguard Worker * which must be signaled after the device has finished reading from the 714*4d7e907cSAndroid Build Coastguard Worker * buffer presented in the prior frame. This indicates that it is safe to 715*4d7e907cSAndroid Build Coastguard Worker * start writing to the buffer again. If a given layer's fence is not 716*4d7e907cSAndroid Build Coastguard Worker * returned from this function, it must be assumed that the buffer 717*4d7e907cSAndroid Build Coastguard Worker * presented on the previous frame is ready to be written. 718*4d7e907cSAndroid Build Coastguard Worker * 719*4d7e907cSAndroid Build Coastguard Worker * The fences returned by this function must be unique for each layer 720*4d7e907cSAndroid Build Coastguard Worker * (even if they point to the same underlying sync object). 721*4d7e907cSAndroid Build Coastguard Worker * 722*4d7e907cSAndroid Build Coastguard Worker * @param layers is an array of layer handles. 723*4d7e907cSAndroid Build Coastguard Worker * @param releaseFenceIndices are indices into outHandles array, each 724*4d7e907cSAndroid Build Coastguard Worker * corresponding to an element of layers. 725*4d7e907cSAndroid Build Coastguard Worker * 726*4d7e907cSAndroid Build Coastguard Worker * 727*4d7e907cSAndroid Build Coastguard Worker * SET_COLOR_TRANSFORM has this pseudo prototype 728*4d7e907cSAndroid Build Coastguard Worker * 729*4d7e907cSAndroid Build Coastguard Worker * setColorTransform(float[16] matrix, 730*4d7e907cSAndroid Build Coastguard Worker * ColorTransform hint); 731*4d7e907cSAndroid Build Coastguard Worker * 732*4d7e907cSAndroid Build Coastguard Worker * Sets a color transform which will be applied after composition. 733*4d7e907cSAndroid Build Coastguard Worker * 734*4d7e907cSAndroid Build Coastguard Worker * If hint is not ColorTransform::ARBITRARY, then the device may use the 735*4d7e907cSAndroid Build Coastguard Worker * hint to apply the desired color transform instead of using the color 736*4d7e907cSAndroid Build Coastguard Worker * matrix directly. 737*4d7e907cSAndroid Build Coastguard Worker * 738*4d7e907cSAndroid Build Coastguard Worker * If the device is not capable of either using the hint or the matrix to 739*4d7e907cSAndroid Build Coastguard Worker * apply the desired color transform, it must force all layers to client 740*4d7e907cSAndroid Build Coastguard Worker * composition during VALIDATE_DISPLAY. 741*4d7e907cSAndroid Build Coastguard Worker * 742*4d7e907cSAndroid Build Coastguard Worker * If IComposer::Capability::SKIP_CLIENT_COLOR_TRANSFORM is present, then 743*4d7e907cSAndroid Build Coastguard Worker * the client must never apply the color transform during client 744*4d7e907cSAndroid Build Coastguard Worker * composition, even if all layers are being composed by the client. 745*4d7e907cSAndroid Build Coastguard Worker * 746*4d7e907cSAndroid Build Coastguard Worker * The matrix provided is an affine color transformation of the following 747*4d7e907cSAndroid Build Coastguard Worker * form: 748*4d7e907cSAndroid Build Coastguard Worker * 749*4d7e907cSAndroid Build Coastguard Worker * |r.r r.g r.b 0| 750*4d7e907cSAndroid Build Coastguard Worker * |g.r g.g g.b 0| 751*4d7e907cSAndroid Build Coastguard Worker * |b.r b.g b.b 0| 752*4d7e907cSAndroid Build Coastguard Worker * |Tr Tg Tb 1| 753*4d7e907cSAndroid Build Coastguard Worker * 754*4d7e907cSAndroid Build Coastguard Worker * This matrix must be provided in row-major form: 755*4d7e907cSAndroid Build Coastguard Worker * 756*4d7e907cSAndroid Build Coastguard Worker * {r.r, r.g, r.b, 0, g.r, ...}. 757*4d7e907cSAndroid Build Coastguard Worker * 758*4d7e907cSAndroid Build Coastguard Worker * Given a matrix of this form and an input color [R_in, G_in, B_in], the 759*4d7e907cSAndroid Build Coastguard Worker * output color [R_out, G_out, B_out] will be: 760*4d7e907cSAndroid Build Coastguard Worker * 761*4d7e907cSAndroid Build Coastguard Worker * R_out = R_in * r.r + G_in * g.r + B_in * b.r + Tr 762*4d7e907cSAndroid Build Coastguard Worker * G_out = R_in * r.g + G_in * g.g + B_in * b.g + Tg 763*4d7e907cSAndroid Build Coastguard Worker * B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb 764*4d7e907cSAndroid Build Coastguard Worker * 765*4d7e907cSAndroid Build Coastguard Worker * @param matrix is a 4x4 transform matrix (16 floats) as described above. 766*4d7e907cSAndroid Build Coastguard Worker * @param hint is a hint value which may be used instead of the given 767*4d7e907cSAndroid Build Coastguard Worker * matrix unless it is ColorTransform::ARBITRARY. 768*4d7e907cSAndroid Build Coastguard Worker * 769*4d7e907cSAndroid Build Coastguard Worker * 770*4d7e907cSAndroid Build Coastguard Worker * SET_CLIENT_TARGET has this pseudo prototype 771*4d7e907cSAndroid Build Coastguard Worker * 772*4d7e907cSAndroid Build Coastguard Worker * setClientTarget(uint32_t targetSlot, 773*4d7e907cSAndroid Build Coastguard Worker * int32_t targetIndex, 774*4d7e907cSAndroid Build Coastguard Worker * int32_t acquireFenceIndex, 775*4d7e907cSAndroid Build Coastguard Worker * Dataspace dataspace, 776*4d7e907cSAndroid Build Coastguard Worker * vec<Rect> damage); 777*4d7e907cSAndroid Build Coastguard Worker * 778*4d7e907cSAndroid Build Coastguard Worker * Sets the buffer handle which will receive the output of client 779*4d7e907cSAndroid Build Coastguard Worker * composition. Layers marked as Composition::CLIENT must be composited 780*4d7e907cSAndroid Build Coastguard Worker * into this buffer prior to the call to PRESENT_DISPLAY, and layers not 781*4d7e907cSAndroid Build Coastguard Worker * marked as Composition::CLIENT must be composited with this buffer by 782*4d7e907cSAndroid Build Coastguard Worker * the device. 783*4d7e907cSAndroid Build Coastguard Worker * 784*4d7e907cSAndroid Build Coastguard Worker * The buffer handle provided may be empty if no layers are being 785*4d7e907cSAndroid Build Coastguard Worker * composited by the client. This must not result in an error (unless an 786*4d7e907cSAndroid Build Coastguard Worker * invalid display handle is also provided). 787*4d7e907cSAndroid Build Coastguard Worker * 788*4d7e907cSAndroid Build Coastguard Worker * Also provides a file descriptor referring to an acquire sync fence 789*4d7e907cSAndroid Build Coastguard Worker * object, which must be signaled when it is safe to read from the client 790*4d7e907cSAndroid Build Coastguard Worker * target buffer. If it is already safe to read from this buffer, an 791*4d7e907cSAndroid Build Coastguard Worker * empty handle may be passed instead. 792*4d7e907cSAndroid Build Coastguard Worker * 793*4d7e907cSAndroid Build Coastguard Worker * For more about dataspaces, see SET_LAYER_DATASPACE. 794*4d7e907cSAndroid Build Coastguard Worker * 795*4d7e907cSAndroid Build Coastguard Worker * The damage parameter describes a surface damage region as defined in 796*4d7e907cSAndroid Build Coastguard Worker * the description of SET_LAYER_SURFACE_DAMAGE. 797*4d7e907cSAndroid Build Coastguard Worker * 798*4d7e907cSAndroid Build Coastguard Worker * Will be called before PRESENT_DISPLAY if any of the layers are marked 799*4d7e907cSAndroid Build Coastguard Worker * as Composition::CLIENT. If no layers are so marked, then it is not 800*4d7e907cSAndroid Build Coastguard Worker * necessary to call this function. It is not necessary to call 801*4d7e907cSAndroid Build Coastguard Worker * validateDisplay after changing the target through this function. 802*4d7e907cSAndroid Build Coastguard Worker * 803*4d7e907cSAndroid Build Coastguard Worker * @param targetSlot is the client target buffer slot to use. 804*4d7e907cSAndroid Build Coastguard Worker * @param targetIndex is an index into inHandles for the new target 805*4d7e907cSAndroid Build Coastguard Worker * buffer. 806*4d7e907cSAndroid Build Coastguard Worker * @param acquireFenceIndex is an index into inHandles for a sync fence 807*4d7e907cSAndroid Build Coastguard Worker * file descriptor as described above. 808*4d7e907cSAndroid Build Coastguard Worker * @param dataspace is the dataspace of the buffer, as described in 809*4d7e907cSAndroid Build Coastguard Worker * setLayerDataspace. 810*4d7e907cSAndroid Build Coastguard Worker * @param damage is the surface damage region. 811*4d7e907cSAndroid Build Coastguard Worker * 812*4d7e907cSAndroid Build Coastguard Worker * 813*4d7e907cSAndroid Build Coastguard Worker * SET_OUTPUT_BUFFER has this pseudo prototype 814*4d7e907cSAndroid Build Coastguard Worker * 815*4d7e907cSAndroid Build Coastguard Worker * setOutputBuffer(uint32_t bufferSlot, 816*4d7e907cSAndroid Build Coastguard Worker * int32_t bufferIndex, 817*4d7e907cSAndroid Build Coastguard Worker * int32_t releaseFenceIndex); 818*4d7e907cSAndroid Build Coastguard Worker * 819*4d7e907cSAndroid Build Coastguard Worker * Sets the output buffer for a virtual display. That is, the buffer to 820*4d7e907cSAndroid Build Coastguard Worker * which the composition result will be written. 821*4d7e907cSAndroid Build Coastguard Worker * 822*4d7e907cSAndroid Build Coastguard Worker * Also provides a file descriptor referring to a release sync fence 823*4d7e907cSAndroid Build Coastguard Worker * object, which must be signaled when it is safe to write to the output 824*4d7e907cSAndroid Build Coastguard Worker * buffer. If it is already safe to write to the output buffer, an empty 825*4d7e907cSAndroid Build Coastguard Worker * handle may be passed instead. 826*4d7e907cSAndroid Build Coastguard Worker * 827*4d7e907cSAndroid Build Coastguard Worker * Must be called at least once before PRESENT_DISPLAY, but does not have 828*4d7e907cSAndroid Build Coastguard Worker * any interaction with layer state or display validation. 829*4d7e907cSAndroid Build Coastguard Worker * 830*4d7e907cSAndroid Build Coastguard Worker * @param bufferSlot is the new output buffer. 831*4d7e907cSAndroid Build Coastguard Worker * @param bufferIndex is the new output buffer. 832*4d7e907cSAndroid Build Coastguard Worker * @param releaseFenceIndex is a sync fence file descriptor as described 833*4d7e907cSAndroid Build Coastguard Worker * above. 834*4d7e907cSAndroid Build Coastguard Worker * 835*4d7e907cSAndroid Build Coastguard Worker * 836*4d7e907cSAndroid Build Coastguard Worker * VALIDATE_DISPLAY has this pseudo prototype 837*4d7e907cSAndroid Build Coastguard Worker * 838*4d7e907cSAndroid Build Coastguard Worker * validateDisplay(); 839*4d7e907cSAndroid Build Coastguard Worker * 840*4d7e907cSAndroid Build Coastguard Worker * Instructs the device to inspect all of the layer state and determine if 841*4d7e907cSAndroid Build Coastguard Worker * there are any composition type changes necessary before presenting the 842*4d7e907cSAndroid Build Coastguard Worker * display. Permitted changes are described in the definition of 843*4d7e907cSAndroid Build Coastguard Worker * Composition above. 844*4d7e907cSAndroid Build Coastguard Worker * 845*4d7e907cSAndroid Build Coastguard Worker * 846*4d7e907cSAndroid Build Coastguard Worker * ACCEPT_DISPLAY_CHANGES has this pseudo prototype 847*4d7e907cSAndroid Build Coastguard Worker * 848*4d7e907cSAndroid Build Coastguard Worker * acceptDisplayChanges(); 849*4d7e907cSAndroid Build Coastguard Worker * 850*4d7e907cSAndroid Build Coastguard Worker * Accepts the changes required by the device from the previous 851*4d7e907cSAndroid Build Coastguard Worker * validateDisplay call (which may be queried using 852*4d7e907cSAndroid Build Coastguard Worker * getChangedCompositionTypes) and revalidates the display. This function 853*4d7e907cSAndroid Build Coastguard Worker * is equivalent to requesting the changed types from 854*4d7e907cSAndroid Build Coastguard Worker * getChangedCompositionTypes, setting those types on the corresponding 855*4d7e907cSAndroid Build Coastguard Worker * layers, and then calling validateDisplay again. 856*4d7e907cSAndroid Build Coastguard Worker * 857*4d7e907cSAndroid Build Coastguard Worker * After this call it must be valid to present this display. Calling this 858*4d7e907cSAndroid Build Coastguard Worker * after validateDisplay returns 0 changes must succeed with NONE, but 859*4d7e907cSAndroid Build Coastguard Worker * must have no other effect. 860*4d7e907cSAndroid Build Coastguard Worker * 861*4d7e907cSAndroid Build Coastguard Worker * 862*4d7e907cSAndroid Build Coastguard Worker * PRESENT_DISPLAY has this pseudo prototype 863*4d7e907cSAndroid Build Coastguard Worker * 864*4d7e907cSAndroid Build Coastguard Worker * presentDisplay(); 865*4d7e907cSAndroid Build Coastguard Worker * 866*4d7e907cSAndroid Build Coastguard Worker * Presents the current display contents on the screen (or in the case of 867*4d7e907cSAndroid Build Coastguard Worker * virtual displays, into the output buffer). 868*4d7e907cSAndroid Build Coastguard Worker * 869*4d7e907cSAndroid Build Coastguard Worker * Prior to calling this function, the display must be successfully 870*4d7e907cSAndroid Build Coastguard Worker * validated with validateDisplay. Note that setLayerBuffer and 871*4d7e907cSAndroid Build Coastguard Worker * setLayerSurfaceDamage specifically do not count as layer state, so if 872*4d7e907cSAndroid Build Coastguard Worker * there are no other changes to the layer state (or to the buffer's 873*4d7e907cSAndroid Build Coastguard Worker * properties as described in setLayerBuffer), then it is safe to call 874*4d7e907cSAndroid Build Coastguard Worker * this function without first validating the display. 875*4d7e907cSAndroid Build Coastguard Worker * 876*4d7e907cSAndroid Build Coastguard Worker * 877*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_CURSOR_POSITION has this pseudo prototype 878*4d7e907cSAndroid Build Coastguard Worker * 879*4d7e907cSAndroid Build Coastguard Worker * setLayerCursorPosition(int32_t x, int32_t y); 880*4d7e907cSAndroid Build Coastguard Worker * 881*4d7e907cSAndroid Build Coastguard Worker * Asynchronously sets the position of a cursor layer. 882*4d7e907cSAndroid Build Coastguard Worker * 883*4d7e907cSAndroid Build Coastguard Worker * Prior to validateDisplay, a layer may be marked as Composition::CURSOR. 884*4d7e907cSAndroid Build Coastguard Worker * If validation succeeds (i.e., the device does not request a composition 885*4d7e907cSAndroid Build Coastguard Worker * change for that layer), then once a buffer has been set for the layer 886*4d7e907cSAndroid Build Coastguard Worker * and it has been presented, its position may be set by this function at 887*4d7e907cSAndroid Build Coastguard Worker * any time between presentDisplay and any subsequent validateDisplay 888*4d7e907cSAndroid Build Coastguard Worker * calls for this display. 889*4d7e907cSAndroid Build Coastguard Worker * 890*4d7e907cSAndroid Build Coastguard Worker * Once validateDisplay is called, this function must not be called again 891*4d7e907cSAndroid Build Coastguard Worker * until the validate/present sequence is completed. 892*4d7e907cSAndroid Build Coastguard Worker * 893*4d7e907cSAndroid Build Coastguard Worker * May be called from any thread so long as it is not interleaved with the 894*4d7e907cSAndroid Build Coastguard Worker * validate/present sequence as described above. 895*4d7e907cSAndroid Build Coastguard Worker * 896*4d7e907cSAndroid Build Coastguard Worker * @param layer is the layer to which the position is set. 897*4d7e907cSAndroid Build Coastguard Worker * @param x is the new x coordinate (in pixels from the left of the 898*4d7e907cSAndroid Build Coastguard Worker * screen). 899*4d7e907cSAndroid Build Coastguard Worker * @param y is the new y coordinate (in pixels from the top of the 900*4d7e907cSAndroid Build Coastguard Worker * screen). 901*4d7e907cSAndroid Build Coastguard Worker * 902*4d7e907cSAndroid Build Coastguard Worker * 903*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_BUFFER has this pseudo prototype 904*4d7e907cSAndroid Build Coastguard Worker * 905*4d7e907cSAndroid Build Coastguard Worker * setLayerBuffer(uint32_t bufferSlot, 906*4d7e907cSAndroid Build Coastguard Worker * int32_t bufferIndex, 907*4d7e907cSAndroid Build Coastguard Worker * int32_t acquireFenceIndex); 908*4d7e907cSAndroid Build Coastguard Worker * 909*4d7e907cSAndroid Build Coastguard Worker * Sets the buffer handle to be displayed for this layer. If the buffer 910*4d7e907cSAndroid Build Coastguard Worker * properties set at allocation time (width, height, format, and usage) 911*4d7e907cSAndroid Build Coastguard Worker * have not changed since the previous frame, it is not necessary to call 912*4d7e907cSAndroid Build Coastguard Worker * validateDisplay before calling presentDisplay unless new state needs to 913*4d7e907cSAndroid Build Coastguard Worker * be validated in the interim. 914*4d7e907cSAndroid Build Coastguard Worker * 915*4d7e907cSAndroid Build Coastguard Worker * Also provides a file descriptor referring to an acquire sync fence 916*4d7e907cSAndroid Build Coastguard Worker * object, which must be signaled when it is safe to read from the given 917*4d7e907cSAndroid Build Coastguard Worker * buffer. If it is already safe to read from the buffer, an empty handle 918*4d7e907cSAndroid Build Coastguard Worker * may be passed instead. 919*4d7e907cSAndroid Build Coastguard Worker * 920*4d7e907cSAndroid Build Coastguard Worker * This function must return NONE and have no other effect if called for a 921*4d7e907cSAndroid Build Coastguard Worker * layer with a composition type of Composition::SOLID_COLOR (because it 922*4d7e907cSAndroid Build Coastguard Worker * has no buffer) or Composition::SIDEBAND or Composition::CLIENT (because 923*4d7e907cSAndroid Build Coastguard Worker * synchronization and buffer updates for these layers are handled 924*4d7e907cSAndroid Build Coastguard Worker * elsewhere). 925*4d7e907cSAndroid Build Coastguard Worker * 926*4d7e907cSAndroid Build Coastguard Worker * @param layer is the layer to which the buffer is set. 927*4d7e907cSAndroid Build Coastguard Worker * @param bufferSlot is the buffer slot to use. 928*4d7e907cSAndroid Build Coastguard Worker * @param bufferIndex is the buffer handle to set. 929*4d7e907cSAndroid Build Coastguard Worker * @param acquireFenceIndex is a sync fence file descriptor as described above. 930*4d7e907cSAndroid Build Coastguard Worker * 931*4d7e907cSAndroid Build Coastguard Worker * 932*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_SURFACE_DAMAGE has this pseudo prototype 933*4d7e907cSAndroid Build Coastguard Worker * 934*4d7e907cSAndroid Build Coastguard Worker * setLayerSurfaceDamage(vec<Rect> damage); 935*4d7e907cSAndroid Build Coastguard Worker * 936*4d7e907cSAndroid Build Coastguard Worker * Provides the region of the source buffer which has been modified since 937*4d7e907cSAndroid Build Coastguard Worker * the last frame. This region does not need to be validated before 938*4d7e907cSAndroid Build Coastguard Worker * calling presentDisplay. 939*4d7e907cSAndroid Build Coastguard Worker * 940*4d7e907cSAndroid Build Coastguard Worker * Once set through this function, the damage region remains the same 941*4d7e907cSAndroid Build Coastguard Worker * until a subsequent call to this function. 942*4d7e907cSAndroid Build Coastguard Worker * 943*4d7e907cSAndroid Build Coastguard Worker * If damage is non-empty, then it may be assumed that any portion of the 944*4d7e907cSAndroid Build Coastguard Worker * source buffer not covered by one of the rects has not been modified 945*4d7e907cSAndroid Build Coastguard Worker * this frame. If damage is empty, then the whole source buffer must be 946*4d7e907cSAndroid Build Coastguard Worker * treated as if it has been modified. 947*4d7e907cSAndroid Build Coastguard Worker * 948*4d7e907cSAndroid Build Coastguard Worker * If the layer's contents are not modified relative to the prior frame, 949*4d7e907cSAndroid Build Coastguard Worker * damage must contain exactly one empty rect([0, 0, 0, 0]). 950*4d7e907cSAndroid Build Coastguard Worker * 951*4d7e907cSAndroid Build Coastguard Worker * The damage rects are relative to the pre-transformed buffer, and their 952*4d7e907cSAndroid Build Coastguard Worker * origin is the top-left corner. They must not exceed the dimensions of 953*4d7e907cSAndroid Build Coastguard Worker * the latched buffer. 954*4d7e907cSAndroid Build Coastguard Worker * 955*4d7e907cSAndroid Build Coastguard Worker * @param layer is the layer to which the damage region is set. 956*4d7e907cSAndroid Build Coastguard Worker * @param damage is the new surface damage region. 957*4d7e907cSAndroid Build Coastguard Worker * 958*4d7e907cSAndroid Build Coastguard Worker * 959*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_BLEND_MODE has this pseudo prototype 960*4d7e907cSAndroid Build Coastguard Worker * 961*4d7e907cSAndroid Build Coastguard Worker * setLayerBlendMode(BlendMode mode) 962*4d7e907cSAndroid Build Coastguard Worker * 963*4d7e907cSAndroid Build Coastguard Worker * Sets the blend mode of the given layer. 964*4d7e907cSAndroid Build Coastguard Worker * 965*4d7e907cSAndroid Build Coastguard Worker * @param mode is the new blend mode. 966*4d7e907cSAndroid Build Coastguard Worker * 967*4d7e907cSAndroid Build Coastguard Worker * 968*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_COLOR has this pseudo prototype 969*4d7e907cSAndroid Build Coastguard Worker * 970*4d7e907cSAndroid Build Coastguard Worker * setLayerColor(Color color); 971*4d7e907cSAndroid Build Coastguard Worker * 972*4d7e907cSAndroid Build Coastguard Worker * Sets the color of the given layer. If the composition type of the layer 973*4d7e907cSAndroid Build Coastguard Worker * is not Composition::SOLID_COLOR, this call must succeed and have no 974*4d7e907cSAndroid Build Coastguard Worker * other effect. 975*4d7e907cSAndroid Build Coastguard Worker * 976*4d7e907cSAndroid Build Coastguard Worker * @param color is the new color. 977*4d7e907cSAndroid Build Coastguard Worker * 978*4d7e907cSAndroid Build Coastguard Worker * 979*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_COMPOSITION_TYPE has this pseudo prototype 980*4d7e907cSAndroid Build Coastguard Worker * 981*4d7e907cSAndroid Build Coastguard Worker * setLayerCompositionType(Composition type); 982*4d7e907cSAndroid Build Coastguard Worker * 983*4d7e907cSAndroid Build Coastguard Worker * Sets the desired composition type of the given layer. During 984*4d7e907cSAndroid Build Coastguard Worker * validateDisplay, the device may request changes to the composition 985*4d7e907cSAndroid Build Coastguard Worker * types of any of the layers as described in the definition of 986*4d7e907cSAndroid Build Coastguard Worker * Composition above. 987*4d7e907cSAndroid Build Coastguard Worker * 988*4d7e907cSAndroid Build Coastguard Worker * @param type is the new composition type. 989*4d7e907cSAndroid Build Coastguard Worker * 990*4d7e907cSAndroid Build Coastguard Worker * 991*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_DATASPACE has this pseudo prototype 992*4d7e907cSAndroid Build Coastguard Worker * 993*4d7e907cSAndroid Build Coastguard Worker * setLayerDataspace(Dataspace dataspace); 994*4d7e907cSAndroid Build Coastguard Worker * 995*4d7e907cSAndroid Build Coastguard Worker * Sets the dataspace of the layer. 996*4d7e907cSAndroid Build Coastguard Worker * 997*4d7e907cSAndroid Build Coastguard Worker * The dataspace provides more information about how to interpret the buffer 998*4d7e907cSAndroid Build Coastguard Worker * or solid color, such as the encoding standard and color transform. 999*4d7e907cSAndroid Build Coastguard Worker * 1000*4d7e907cSAndroid Build Coastguard Worker * See the values of Dataspace for more information. 1001*4d7e907cSAndroid Build Coastguard Worker * 1002*4d7e907cSAndroid Build Coastguard Worker * @param dataspace is the new dataspace. 1003*4d7e907cSAndroid Build Coastguard Worker * 1004*4d7e907cSAndroid Build Coastguard Worker * 1005*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_DISPLAY_FRAME has this pseudo prototype 1006*4d7e907cSAndroid Build Coastguard Worker * 1007*4d7e907cSAndroid Build Coastguard Worker * setLayerDisplayFrame(Rect frame); 1008*4d7e907cSAndroid Build Coastguard Worker * 1009*4d7e907cSAndroid Build Coastguard Worker * Sets the display frame (the portion of the display covered by a layer) 1010*4d7e907cSAndroid Build Coastguard Worker * of the given layer. This frame must not exceed the display dimensions. 1011*4d7e907cSAndroid Build Coastguard Worker * 1012*4d7e907cSAndroid Build Coastguard Worker * @param frame is the new display frame. 1013*4d7e907cSAndroid Build Coastguard Worker * 1014*4d7e907cSAndroid Build Coastguard Worker * 1015*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_PLANE_ALPHA has this pseudo prototype 1016*4d7e907cSAndroid Build Coastguard Worker * 1017*4d7e907cSAndroid Build Coastguard Worker * setLayerPlaneAlpha(float alpha); 1018*4d7e907cSAndroid Build Coastguard Worker * 1019*4d7e907cSAndroid Build Coastguard Worker * Sets an alpha value (a floating point value in the range [0.0, 1.0]) 1020*4d7e907cSAndroid Build Coastguard Worker * which will be applied to the whole layer. It can be conceptualized as a 1021*4d7e907cSAndroid Build Coastguard Worker * preprocessing step which applies the following function: 1022*4d7e907cSAndroid Build Coastguard Worker * if (blendMode == BlendMode::PREMULTIPLIED) 1023*4d7e907cSAndroid Build Coastguard Worker * out.rgb = in.rgb * planeAlpha 1024*4d7e907cSAndroid Build Coastguard Worker * out.a = in.a * planeAlpha 1025*4d7e907cSAndroid Build Coastguard Worker * 1026*4d7e907cSAndroid Build Coastguard Worker * If the device does not support this operation on a layer which is 1027*4d7e907cSAndroid Build Coastguard Worker * marked Composition::DEVICE, it must request a composition type change 1028*4d7e907cSAndroid Build Coastguard Worker * to Composition::CLIENT upon the next validateDisplay call. 1029*4d7e907cSAndroid Build Coastguard Worker * 1030*4d7e907cSAndroid Build Coastguard Worker * @param alpha is the plane alpha value to apply. 1031*4d7e907cSAndroid Build Coastguard Worker * 1032*4d7e907cSAndroid Build Coastguard Worker * 1033*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_SIDEBAND_STREAM has this pseudo prototype 1034*4d7e907cSAndroid Build Coastguard Worker * 1035*4d7e907cSAndroid Build Coastguard Worker * setLayerSidebandStream(int32_t streamIndex) 1036*4d7e907cSAndroid Build Coastguard Worker * 1037*4d7e907cSAndroid Build Coastguard Worker * Sets the sideband stream for this layer. If the composition type of the 1038*4d7e907cSAndroid Build Coastguard Worker * given layer is not Composition::SIDEBAND, this call must succeed and 1039*4d7e907cSAndroid Build Coastguard Worker * have no other effect. 1040*4d7e907cSAndroid Build Coastguard Worker * 1041*4d7e907cSAndroid Build Coastguard Worker * @param streamIndex is the new sideband stream. 1042*4d7e907cSAndroid Build Coastguard Worker * 1043*4d7e907cSAndroid Build Coastguard Worker * 1044*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_SOURCE_CROP has this pseudo prototype 1045*4d7e907cSAndroid Build Coastguard Worker * 1046*4d7e907cSAndroid Build Coastguard Worker * setLayerSourceCrop(FRect crop); 1047*4d7e907cSAndroid Build Coastguard Worker * 1048*4d7e907cSAndroid Build Coastguard Worker * Sets the source crop (the portion of the source buffer which will fill 1049*4d7e907cSAndroid Build Coastguard Worker * the display frame) of the given layer. This crop rectangle must not 1050*4d7e907cSAndroid Build Coastguard Worker * exceed the dimensions of the latched buffer. 1051*4d7e907cSAndroid Build Coastguard Worker * 1052*4d7e907cSAndroid Build Coastguard Worker * If the device is not capable of supporting a true float source crop 1053*4d7e907cSAndroid Build Coastguard Worker * (i.e., it will truncate or round the floats to integers), it must set 1054*4d7e907cSAndroid Build Coastguard Worker * this layer to Composition::CLIENT when crop is non-integral for the 1055*4d7e907cSAndroid Build Coastguard Worker * most accurate rendering. 1056*4d7e907cSAndroid Build Coastguard Worker * 1057*4d7e907cSAndroid Build Coastguard Worker * If the device cannot support float source crops, but still wants to 1058*4d7e907cSAndroid Build Coastguard Worker * handle the layer, it must use the following code (or similar) to 1059*4d7e907cSAndroid Build Coastguard Worker * convert to an integer crop: 1060*4d7e907cSAndroid Build Coastguard Worker * intCrop.left = (int) ceilf(crop.left); 1061*4d7e907cSAndroid Build Coastguard Worker * intCrop.top = (int) ceilf(crop.top); 1062*4d7e907cSAndroid Build Coastguard Worker * intCrop.right = (int) floorf(crop.right); 1063*4d7e907cSAndroid Build Coastguard Worker * intCrop.bottom = (int) floorf(crop.bottom); 1064*4d7e907cSAndroid Build Coastguard Worker * 1065*4d7e907cSAndroid Build Coastguard Worker * @param crop is the new source crop. 1066*4d7e907cSAndroid Build Coastguard Worker * 1067*4d7e907cSAndroid Build Coastguard Worker * 1068*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_TRANSFORM has this pseudo prototype 1069*4d7e907cSAndroid Build Coastguard Worker * 1070*4d7e907cSAndroid Build Coastguard Worker * Sets the transform (rotation/flip) of the given layer. 1071*4d7e907cSAndroid Build Coastguard Worker * 1072*4d7e907cSAndroid Build Coastguard Worker * setLayerTransform(Transform transform); 1073*4d7e907cSAndroid Build Coastguard Worker * 1074*4d7e907cSAndroid Build Coastguard Worker * @param transform is the new transform. 1075*4d7e907cSAndroid Build Coastguard Worker * 1076*4d7e907cSAndroid Build Coastguard Worker * 1077*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_VISIBLE_REGION has this pseudo prototype 1078*4d7e907cSAndroid Build Coastguard Worker * 1079*4d7e907cSAndroid Build Coastguard Worker * setLayerVisibleRegion(vec<Rect> visible); 1080*4d7e907cSAndroid Build Coastguard Worker * 1081*4d7e907cSAndroid Build Coastguard Worker * Specifies the portion of the layer that is visible, including portions 1082*4d7e907cSAndroid Build Coastguard Worker * under translucent areas of other layers. The region is in screen space, 1083*4d7e907cSAndroid Build Coastguard Worker * and must not exceed the dimensions of the screen. 1084*4d7e907cSAndroid Build Coastguard Worker * 1085*4d7e907cSAndroid Build Coastguard Worker * @param visible is the new visible region, in screen space. 1086*4d7e907cSAndroid Build Coastguard Worker * 1087*4d7e907cSAndroid Build Coastguard Worker * 1088*4d7e907cSAndroid Build Coastguard Worker * SET_LAYER_Z_ORDER has this pseudo prototype 1089*4d7e907cSAndroid Build Coastguard Worker * 1090*4d7e907cSAndroid Build Coastguard Worker * setLayerZOrder(uint32_t z); 1091*4d7e907cSAndroid Build Coastguard Worker * 1092*4d7e907cSAndroid Build Coastguard Worker * Sets the desired Z order (height) of the given layer. A layer with a 1093*4d7e907cSAndroid Build Coastguard Worker * greater Z value occludes a layer with a lesser Z value. 1094*4d7e907cSAndroid Build Coastguard Worker * 1095*4d7e907cSAndroid Build Coastguard Worker * @param z is the new Z order. 1096*4d7e907cSAndroid Build Coastguard Worker */ 1097*4d7e907cSAndroid Build Coastguard Worker enum Command : int32_t { 1098*4d7e907cSAndroid Build Coastguard Worker LENGTH_MASK = 0xffff, 1099*4d7e907cSAndroid Build Coastguard Worker OPCODE_SHIFT = 16, 1100*4d7e907cSAndroid Build Coastguard Worker OPCODE_MASK = 0xffff << OPCODE_SHIFT, 1101*4d7e907cSAndroid Build Coastguard Worker 1102*4d7e907cSAndroid Build Coastguard Worker /** special commands */ 1103*4d7e907cSAndroid Build Coastguard Worker SELECT_DISPLAY = 0x000 << OPCODE_SHIFT, 1104*4d7e907cSAndroid Build Coastguard Worker SELECT_LAYER = 0x001 << OPCODE_SHIFT, 1105*4d7e907cSAndroid Build Coastguard Worker 1106*4d7e907cSAndroid Build Coastguard Worker /** value commands (for return values) */ 1107*4d7e907cSAndroid Build Coastguard Worker SET_ERROR = 0x100 << OPCODE_SHIFT, 1108*4d7e907cSAndroid Build Coastguard Worker SET_CHANGED_COMPOSITION_TYPES = 0x101 << OPCODE_SHIFT, 1109*4d7e907cSAndroid Build Coastguard Worker SET_DISPLAY_REQUESTS = 0x102 << OPCODE_SHIFT, 1110*4d7e907cSAndroid Build Coastguard Worker SET_PRESENT_FENCE = 0x103 << OPCODE_SHIFT, 1111*4d7e907cSAndroid Build Coastguard Worker SET_RELEASE_FENCES = 0x104 << OPCODE_SHIFT, 1112*4d7e907cSAndroid Build Coastguard Worker 1113*4d7e907cSAndroid Build Coastguard Worker /** display commands */ 1114*4d7e907cSAndroid Build Coastguard Worker SET_COLOR_TRANSFORM = 0x200 << OPCODE_SHIFT, 1115*4d7e907cSAndroid Build Coastguard Worker SET_CLIENT_TARGET = 0x201 << OPCODE_SHIFT, 1116*4d7e907cSAndroid Build Coastguard Worker SET_OUTPUT_BUFFER = 0x202 << OPCODE_SHIFT, 1117*4d7e907cSAndroid Build Coastguard Worker VALIDATE_DISPLAY = 0x203 << OPCODE_SHIFT, 1118*4d7e907cSAndroid Build Coastguard Worker ACCEPT_DISPLAY_CHANGES = 0x204 << OPCODE_SHIFT, 1119*4d7e907cSAndroid Build Coastguard Worker PRESENT_DISPLAY = 0x205 << OPCODE_SHIFT, 1120*4d7e907cSAndroid Build Coastguard Worker PRESENT_OR_VALIDATE_DISPLAY = 0x206 << OPCODE_SHIFT, 1121*4d7e907cSAndroid Build Coastguard Worker 1122*4d7e907cSAndroid Build Coastguard Worker /** layer commands (VALIDATE_DISPLAY not required) */ 1123*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_CURSOR_POSITION = 0x300 << OPCODE_SHIFT, 1124*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_BUFFER = 0x301 << OPCODE_SHIFT, 1125*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_SURFACE_DAMAGE = 0x302 << OPCODE_SHIFT, 1126*4d7e907cSAndroid Build Coastguard Worker 1127*4d7e907cSAndroid Build Coastguard Worker /** layer state commands (VALIDATE_DISPLAY required) */ 1128*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_BLEND_MODE = 0x400 << OPCODE_SHIFT, 1129*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_COLOR = 0x401 << OPCODE_SHIFT, 1130*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_COMPOSITION_TYPE = 0x402 << OPCODE_SHIFT, 1131*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_DATASPACE = 0x403 << OPCODE_SHIFT, 1132*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_DISPLAY_FRAME = 0x404 << OPCODE_SHIFT, 1133*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_PLANE_ALPHA = 0x405 << OPCODE_SHIFT, 1134*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_SIDEBAND_STREAM = 0x406 << OPCODE_SHIFT, 1135*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_SOURCE_CROP = 0x407 << OPCODE_SHIFT, 1136*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_TRANSFORM = 0x408 << OPCODE_SHIFT, 1137*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_VISIBLE_REGION = 0x409 << OPCODE_SHIFT, 1138*4d7e907cSAndroid Build Coastguard Worker SET_LAYER_Z_ORDER = 0x40a << OPCODE_SHIFT, 1139*4d7e907cSAndroid Build Coastguard Worker SET_PRESENT_OR_VALIDATE_DISPLAY_RESULT = 0x40b << OPCODE_SHIFT, 1140*4d7e907cSAndroid Build Coastguard Worker 1141*4d7e907cSAndroid Build Coastguard Worker /* 0x800 - 0xfff are reserved for vendor extensions */ 1142*4d7e907cSAndroid Build Coastguard Worker /* 0x1000 - 0xffff are reserved */ 1143*4d7e907cSAndroid Build Coastguard Worker }; 1144*4d7e907cSAndroid Build Coastguard Worker}; 1145