Dominik Laskowski | cd2e9f5 | 2018-03-12 19:41:03 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 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 | package android.hardware.graphics.composer@2.3; |
| 18 | |
Peiyong Lin | 830137f | 2018-09-13 17:19:38 -0700 | [diff] [blame] | 19 | import android.hardware.graphics.composer@2.1::IComposerClient.Command; |
Dominik Laskowski | cd2e9f5 | 2018-03-12 19:41:03 -0700 | [diff] [blame] | 20 | import @2.2::IComposerClient; |
| 21 | import @2.1::Display; |
| 22 | import @2.1::Error; |
| 23 | |
| 24 | interface IComposerClient extends @2.2::IComposerClient { |
| 25 | |
Peiyong Lin | 830137f | 2018-09-13 17:19:38 -0700 | [diff] [blame] | 26 | enum Command : @2.2::IComposerClient.Command { |
| 27 | /** |
| 28 | * SET_LAYER_COLOR_TRANSFORM has this pseudo prototype |
| 29 | * |
| 30 | * setLayerColorTransform(float[16] matrix); |
| 31 | * |
| 32 | * This command has the following binary layout in bytes: |
| 33 | * |
| 34 | * 0 - 16 * 4: matrix |
| 35 | * |
| 36 | * Sets a matrix for color transform which will be applied on this layer |
| 37 | * before composition. |
| 38 | * |
| 39 | * If the device is not capable of apply the matrix on this layer, it must force |
| 40 | * this layer to client composition during VALIDATE_DISPLAY. |
| 41 | * |
| 42 | * The matrix provided is an affine color transformation of the following |
| 43 | * form: |
| 44 | * |
| 45 | * |r.r r.g r.b 0| |
| 46 | * |g.r g.g g.b 0| |
| 47 | * |b.r b.g b.b 0| |
| 48 | * |Tr Tg Tb 1| |
| 49 | * |
| 50 | * This matrix must be provided in row-major form: |
| 51 | * |
| 52 | * {r.r, r.g, r.b, 0, g.r, ...}. |
| 53 | * |
| 54 | * Given a matrix of this form and an input color [R_in, G_in, B_in], |
| 55 | * the input color must first be converted to linear space |
| 56 | * [R_linear, G_linear, B_linear], then the output linear color |
| 57 | * [R_out_linear, G_out_linear, B_out_linear] will be: |
| 58 | * |
| 59 | * R_out_linear = R_linear * r.r + G_linear * g.r + B_linear * b.r + Tr |
| 60 | * G_out_linear = R_linear * r.g + G_linear * g.g + B_linear * b.g + Tg |
| 61 | * B_out_linear = R_linear * r.b + G_linear * g.b + B_linear * b.b + Tb |
| 62 | * |
| 63 | * [R_out_linear, G_out_linear, B_out_linear] must then be converted to |
| 64 | * gamma space: [R_out, G_out, B_out] before blending. |
| 65 | * |
| 66 | * @param matrix is a 4x4 transform matrix (16 floats) as described above. |
| 67 | */ |
| 68 | SET_LAYER_COLOR_TRANSFORM = 0x40d << @2.1::IComposerClient.Command:OPCODE_SHIFT, |
| 69 | }; |
| 70 | |
Dominik Laskowski | cd2e9f5 | 2018-03-12 19:41:03 -0700 | [diff] [blame] | 71 | /** |
| 72 | * Returns the port and data that describe a physical display. The port is |
| 73 | * a unique number that identifies a physical connector (e.g. eDP, HDMI) |
| 74 | * for display output. The data blob is parsed to determine its format, |
| 75 | * typically EDID 1.3 as specified in VESA E-EDID Standard Release A |
| 76 | * Revision 1. |
| 77 | * |
| 78 | * @param display is the display to query. |
| 79 | * @return error is NONE upon success. Otherwise, |
| 80 | * BAD_DISPLAY when an invalid display handle was passed in. |
| 81 | * UNSUPPORTED when identification data is unavailable. |
| 82 | * @return port is the connector to which the display is connected. |
| 83 | * @return data is the EDID 1.3 blob identifying the display. |
| 84 | */ |
| 85 | @callflow(next="*") |
| 86 | getDisplayIdentificationData(Display display) |
| 87 | generates (Error error, |
| 88 | uint8_t port, |
| 89 | vec<uint8_t> data); |
| 90 | |
Peiyong Lin | 830137f | 2018-09-13 17:19:38 -0700 | [diff] [blame] | 91 | /** |
| 92 | * Executes commands from the input command message queue. Return values |
| 93 | * generated by the input commands are written to the output command |
| 94 | * message queue in the form of value commands. |
| 95 | * |
| 96 | * @param inLength is the length of input commands. |
| 97 | * @param inHandles is an array of handles referenced by the input |
| 98 | * commands. |
| 99 | * @return error is NONE upon success. Otherwise, |
| 100 | * BAD_PARAMETER when inLength is not equal to the length of |
| 101 | * commands in the input command message queue. |
| 102 | * NO_RESOURCES when the output command message queue was not |
| 103 | * properly drained. |
| 104 | * @param outQueueChanged indicates whether the output command message |
| 105 | * queue has changed. |
| 106 | * @param outLength is the length of output commands. |
| 107 | * @param outHandles is an array of handles referenced by the output |
| 108 | * commands. |
| 109 | */ |
| 110 | executeCommands_2_3(uint32_t inLength, |
| 111 | vec<handle> inHandles) |
| 112 | generates (Error error, |
| 113 | bool outQueueChanged, |
| 114 | uint32_t outLength, |
| 115 | vec<handle> outHandles); |
Dominik Laskowski | cd2e9f5 | 2018-03-12 19:41:03 -0700 | [diff] [blame] | 116 | }; |