blob: 431b3fc479857a58ed2bf60ffca1b9d3eb564bf5 [file] [log] [blame]
Peiyong Lin2b3f8262018-07-20 16:03:46 -07001/*
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 */
16package android.hardware.configstore@1.2;
17
Kevin DuBois1ec0b522019-01-25 11:06:13 -080018import android.hardware.graphics.common@1.2::PixelFormat;
Valerie Hauec983062018-10-09 16:09:12 -070019import android.hardware.graphics.common@1.2::Dataspace;
Peiyong Lin2b3f8262018-07-20 16:03:46 -070020import @1.1::ISurfaceFlingerConfigs;
21import @1.0::OptionalBool;
22
23/**
24 * New revision of ISurfaceFlingerConfigs
25 */
26interface 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 Linbfbaf842018-08-31 14:13:36 -070035
36 /**
Peiyong Lind45f4692018-10-28 15:21:12 -070037 * 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 Linbfbaf842018-08-31 14:13:36 -070042 *
Peiyong Lind45f4692018-10-28 15:21:12 -070043 * 1. Hardware composer's capability to composite contents with the chosen
Peiyong Linbfbaf842018-08-31 14:13:36 -070044 * data space and pixel format efficiently;
45 * 2. Hardware composer's ability to composite contents when sRGB contents
Peiyong Lind45f4692018-10-28 15:21:12 -070046 * and the chosen wide color gamut data space contents coexist;
Peiyong Linbfbaf842018-08-31 14:13:36 -070047 * 3. For better blending, consider using pixel format where the alpha
48 * channel has as many bits as the RGB color channel.
Peiyong Lind45f4692018-10-28 15:21:12 -070049 * 4. Memory consumption and efficient buffer compression when considering
50 * more bits in pixel format.
Peiyong Linbfbaf842018-08-31 14:13:36 -070051 *
Peiyong Lind45f4692018-10-28 15:21:12 -070052 * @return dataspace is the default data space that SurfaceFlinger expects.
Peiyong Linbfbaf842018-08-31 14:13:36 -070053 * 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 Lind45f4692018-10-28 15:21:12 -070058 * @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 Linbfbaf842018-08-31 14:13:36 -070068 */
69 getCompositionPreference()
Peiyong Lind45f4692018-10-28 15:21:12 -070070 generates (Dataspace dataspace, PixelFormat pixelFormat,
71 Dataspace wcgDataspace, PixelFormat wcgPixelFormat);
linpeter5a12cd72018-11-22 20:41:52 +080072
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 Lin2b3f8262018-07-20 16:03:46 -070079};