Peiyong Lin | 2b3f826 | 2018-07-20 16:03:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.1 (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.1 |
| 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 | package android.hardware.configstore@1.2; |
| 17 | |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 18 | import android.hardware.graphics.common@1.1::PixelFormat; |
Valerie Hau | ec98306 | 2018-10-09 16:09:12 -0700 | [diff] [blame] | 19 | import android.hardware.graphics.common@1.2::Dataspace; |
Peiyong Lin | 2b3f826 | 2018-07-20 16:03:46 -0700 | [diff] [blame] | 20 | import @1.1::ISurfaceFlingerConfigs; |
| 21 | import @1.0::OptionalBool; |
| 22 | |
| 23 | /** |
| 24 | * New revision of ISurfaceFlingerConfigs |
| 25 | */ |
| 26 | interface ISurfaceFlingerConfigs extends @1.1::ISurfaceFlingerConfigs { |
| 27 | /** |
| 28 | * useColorManagement indicates whether SurfaceFlinger should manage color |
| 29 | * by switching to appropriate color mode automatically depending on the |
| 30 | * Dataspace of the surfaces on screen. |
| 31 | * This function must return true when hasWideColorDisplay or hasHDRDisplay |
| 32 | * return true. |
| 33 | */ |
| 34 | useColorManagement() generates (OptionalBool value); |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 35 | |
| 36 | /** |
Peiyong Lin | d45f469 | 2018-10-28 15:21:12 -0700 | [diff] [blame] | 37 | * Returns the default data space and pixel format that SurfaceFlinger |
| 38 | * expects to receive and output as well as the wide color gamut data space |
| 39 | * and pixel format for wide color gamut surfaces. |
| 40 | * To determine the data space and pixel format, there are a few things |
| 41 | * we recommend to consider: |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 42 | * |
Peiyong Lin | d45f469 | 2018-10-28 15:21:12 -0700 | [diff] [blame] | 43 | * 1. Hardware composer's capability to composite contents with the chosen |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 44 | * data space and pixel format efficiently; |
| 45 | * 2. Hardware composer's ability to composite contents when sRGB contents |
Peiyong Lin | d45f469 | 2018-10-28 15:21:12 -0700 | [diff] [blame] | 46 | * and the chosen wide color gamut data space contents coexist; |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 47 | * 3. For better blending, consider using pixel format where the alpha |
| 48 | * channel has as many bits as the RGB color channel. |
Peiyong Lin | d45f469 | 2018-10-28 15:21:12 -0700 | [diff] [blame] | 49 | * 4. Memory consumption and efficient buffer compression when considering |
| 50 | * more bits in pixel format. |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 51 | * |
Peiyong Lin | d45f469 | 2018-10-28 15:21:12 -0700 | [diff] [blame] | 52 | * @return dataspace is the default data space that SurfaceFlinger expects. |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 53 | * The data space must not be Dataspace::UNKNOWN, if unspecified, |
| 54 | * the default data space is Dataspace::V0_SRGB; |
| 55 | * @return pixelFormat is the default pixel format that SurfaceFlinger |
| 56 | * expects. If unspecified, the default pixel format is |
| 57 | * PixelFormat::RGBA_8888. |
Peiyong Lin | d45f469 | 2018-10-28 15:21:12 -0700 | [diff] [blame] | 58 | * @return wcgDataspace is the data space that SurfaceFlinger expects for |
| 59 | * wide color gamut surfaces. |
| 60 | * When hasWideColorDisplay returns true, this API must return a |
| 61 | * valid wide color gamut data space. |
| 62 | * The data space must not be UNKNOWN, if unspecified, the data space |
| 63 | * is V0_SRGB by default, which essentially indicates there's no wide |
| 64 | * color gamut, meaning hasWideColorDisplay returns false. |
| 65 | * @return wcgPixelFormat is the pixel format that SurfaceFlinger expects for |
| 66 | * wide color gamut surfaces. If unspecified, the pixel format is |
| 67 | * PixelFormat::RGBA_8888 by default. |
Peiyong Lin | bfbaf84 | 2018-08-31 14:13:36 -0700 | [diff] [blame] | 68 | */ |
| 69 | getCompositionPreference() |
Peiyong Lin | d45f469 | 2018-10-28 15:21:12 -0700 | [diff] [blame] | 70 | generates (Dataspace dataspace, PixelFormat pixelFormat, |
| 71 | Dataspace wcgDataspace, PixelFormat wcgPixelFormat); |
linpeter | 5a12cd7 | 2018-11-22 20:41:52 +0800 | [diff] [blame^] | 72 | |
| 73 | /** |
| 74 | * Returns the native panel primary data. The data includes red, green, |
| 75 | * blue and white. The primary format is CIE 1931 XYZ color space. If |
| 76 | * unspecified, the primaries is sRGB gamut by default. |
| 77 | */ |
| 78 | getDisplayNativePrimaries() generates (DisplayPrimaries primaries); |
Peiyong Lin | 2b3f826 | 2018-07-20 16:03:46 -0700 | [diff] [blame] | 79 | }; |