Loading services/surfaceflinger/SurfaceFlinger.cpp +1 −37 Original line number Diff line number Diff line Loading @@ -203,19 +203,6 @@ const String16 sAccessSurfaceFlinger("android.permission.ACCESS_SURFACE_FLINGER" const String16 sReadFramebuffer("android.permission.READ_FRAME_BUFFER"); const String16 sDump("android.permission.DUMP"); constexpr float kSrgbRedX = 0.4123f; constexpr float kSrgbRedY = 0.2126f; constexpr float kSrgbRedZ = 0.0193f; constexpr float kSrgbGreenX = 0.3576f; constexpr float kSrgbGreenY = 0.7152f; constexpr float kSrgbGreenZ = 0.1192f; constexpr float kSrgbBlueX = 0.1805f; constexpr float kSrgbBlueY = 0.0722f; constexpr float kSrgbBlueZ = 0.9506f; constexpr float kSrgbWhiteX = 0.9505f; constexpr float kSrgbWhiteY = 1.0000f; constexpr float kSrgbWhiteZ = 1.0891f; constexpr float kDefaultRefreshRate = 60.f; constexpr float kPerformanceRefreshRate = 90.f; Loading Loading @@ -353,15 +340,7 @@ SurfaceFlinger::SurfaceFlinger(surfaceflinger::Factory& factory) } ALOGV("Primary Display Orientation is set to %2d.", SurfaceFlinger::primaryDisplayOrientation); auto surfaceFlingerConfigsServiceV1_2 = V1_2::ISurfaceFlingerConfigs::getService(); if (surfaceFlingerConfigsServiceV1_2) { surfaceFlingerConfigsServiceV1_2->getDisplayNativePrimaries( [&](auto tmpPrimaries) { memcpy(&mInternalDisplayPrimaries, &tmpPrimaries, sizeof(ui::DisplayPrimaries)); }); } else { initDefaultDisplayNativePrimaries(); } mInternalDisplayPrimaries = sysprop::getDisplayNativePrimaries(); // debugging stuff... char value[PROPERTY_VALUE_MAX]; Loading Loading @@ -3214,21 +3193,6 @@ void SurfaceFlinger::invalidateLayerStack(const sp<const Layer>& layer, const Re } } void SurfaceFlinger::initDefaultDisplayNativePrimaries() { mInternalDisplayPrimaries.red.X = kSrgbRedX; mInternalDisplayPrimaries.red.Y = kSrgbRedY; mInternalDisplayPrimaries.red.Z = kSrgbRedZ; mInternalDisplayPrimaries.green.X = kSrgbGreenX; mInternalDisplayPrimaries.green.Y = kSrgbGreenY; mInternalDisplayPrimaries.green.Z = kSrgbGreenZ; mInternalDisplayPrimaries.blue.X = kSrgbBlueX; mInternalDisplayPrimaries.blue.Y = kSrgbBlueY; mInternalDisplayPrimaries.blue.Z = kSrgbBlueZ; mInternalDisplayPrimaries.white.X = kSrgbWhiteX; mInternalDisplayPrimaries.white.Y = kSrgbWhiteY; mInternalDisplayPrimaries.white.Z = kSrgbWhiteZ; } bool SurfaceFlinger::handlePageFlip() { ALOGV("handlePageFlip"); Loading services/surfaceflinger/SurfaceFlinger.h +0 −4 Original line number Diff line number Diff line Loading @@ -700,10 +700,6 @@ private: // region of all screens presenting this layer stack. void invalidateLayerStack(const sp<const Layer>& layer, const Region& dirty); // Initialize structures containing information about the internal // display's native color coordinates using default data void initDefaultDisplayNativePrimaries(); /* ------------------------------------------------------------------------ * H/W composer */ Loading services/surfaceflinger/SurfaceFlingerProperties.cpp +44 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ #include <android/hardware/configstore/1.2/ISurfaceFlingerConfigs.h> #include <configstore/Utils.h> #include <cstdlib> #include <tuple> #include "SurfaceFlingerProperties.h" Loading @@ -15,6 +16,7 @@ namespace android { namespace sysprop { using namespace android::hardware::configstore; using namespace android::hardware::configstore::V1_0; using ::android::hardware::configstore::V1_2::DisplayPrimaries; using ::android::hardware::graphics::common::V1_2::Dataspace; using ::android::hardware::graphics::common::V1_2::PixelFormat; Loading Loading @@ -242,5 +244,47 @@ int32_t wcg_composition_pixel_format(PixelFormat defaultValue) { return static_cast<int32_t>(defaultValue); } #define DISPLAY_PRIMARY_SIZE 3 constexpr float kSrgbRedX = 0.4123f; constexpr float kSrgbRedY = 0.2126f; constexpr float kSrgbRedZ = 0.0193f; constexpr float kSrgbGreenX = 0.3576f; constexpr float kSrgbGreenY = 0.7152f; constexpr float kSrgbGreenZ = 0.1192f; constexpr float kSrgbBlueX = 0.1805f; constexpr float kSrgbBlueY = 0.0722f; constexpr float kSrgbBlueZ = 0.9506f; constexpr float kSrgbWhiteX = 0.9505f; constexpr float kSrgbWhiteY = 1.0000f; constexpr float kSrgbWhiteZ = 1.0891f; DisplayPrimaries getDisplayNativePrimaries() { auto mDisplay_primary_red = SurfaceFlingerProperties::display_primary_red(); auto mDisplay_primary_green = SurfaceFlingerProperties::display_primary_green(); auto mDisplay_primary_blue = SurfaceFlingerProperties::display_primary_blue(); auto mDisplay_primary_white = SurfaceFlingerProperties::display_primary_white(); // To avoid null point exception. mDisplay_primary_red.resize(DISPLAY_PRIMARY_SIZE); mDisplay_primary_green.resize(DISPLAY_PRIMARY_SIZE); mDisplay_primary_blue.resize(DISPLAY_PRIMARY_SIZE); mDisplay_primary_white.resize(DISPLAY_PRIMARY_SIZE); DisplayPrimaries primaries = {{static_cast<float>(mDisplay_primary_red[0].value_or(kSrgbRedX)), static_cast<float>(mDisplay_primary_red[1].value_or(kSrgbRedY)), static_cast<float>(mDisplay_primary_red[2].value_or(kSrgbRedZ))}, {static_cast<float>(mDisplay_primary_green[0].value_or(kSrgbGreenX)), static_cast<float>(mDisplay_primary_green[1].value_or(kSrgbGreenY)), static_cast<float>(mDisplay_primary_green[2].value_or(kSrgbGreenZ))}, {static_cast<float>(mDisplay_primary_blue[0].value_or(kSrgbBlueX)), static_cast<float>(mDisplay_primary_blue[1].value_or(kSrgbBlueY)), static_cast<float>(mDisplay_primary_blue[2].value_or(kSrgbBlueZ))}, {static_cast<float>(mDisplay_primary_white[0].value_or(kSrgbWhiteX)), static_cast<float>(mDisplay_primary_white[1].value_or(kSrgbWhiteY)), static_cast<float>(mDisplay_primary_white[2].value_or(kSrgbWhiteZ))}}; return primaries; } } // namespace sysprop } // namespace android services/surfaceflinger/SurfaceFlingerProperties.h +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ int64_t wcg_composition_dataspace( int32_t wcg_composition_pixel_format( android::hardware::graphics::common::V1_2::PixelFormat defaultValue); android::hardware::configstore::V1_2::DisplayPrimaries getDisplayNativePrimaries(); } // namespace sysprop } // namespace android #endif // SURFACEFLINGERPROPERTIES_H_ services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop +36 −0 Original line number Diff line number Diff line Loading @@ -250,3 +250,39 @@ prop { access: Readonly prop_name: "ro.surface_flinger.wcg_composition_pixel_format" } # Return the native panel primary data. The data includes red, green, # blue and white. The primary format is CIE 1931 XYZ color space. # If unspecified, the primaries is sRGB gamut by default. prop { api_name: "display_primary_red" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_red" } prop { api_name: "display_primary_green" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_green" } prop { api_name: "display_primary_blue" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_blue" } prop { api_name: "display_primary_white" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_white" } Loading
services/surfaceflinger/SurfaceFlinger.cpp +1 −37 Original line number Diff line number Diff line Loading @@ -203,19 +203,6 @@ const String16 sAccessSurfaceFlinger("android.permission.ACCESS_SURFACE_FLINGER" const String16 sReadFramebuffer("android.permission.READ_FRAME_BUFFER"); const String16 sDump("android.permission.DUMP"); constexpr float kSrgbRedX = 0.4123f; constexpr float kSrgbRedY = 0.2126f; constexpr float kSrgbRedZ = 0.0193f; constexpr float kSrgbGreenX = 0.3576f; constexpr float kSrgbGreenY = 0.7152f; constexpr float kSrgbGreenZ = 0.1192f; constexpr float kSrgbBlueX = 0.1805f; constexpr float kSrgbBlueY = 0.0722f; constexpr float kSrgbBlueZ = 0.9506f; constexpr float kSrgbWhiteX = 0.9505f; constexpr float kSrgbWhiteY = 1.0000f; constexpr float kSrgbWhiteZ = 1.0891f; constexpr float kDefaultRefreshRate = 60.f; constexpr float kPerformanceRefreshRate = 90.f; Loading Loading @@ -353,15 +340,7 @@ SurfaceFlinger::SurfaceFlinger(surfaceflinger::Factory& factory) } ALOGV("Primary Display Orientation is set to %2d.", SurfaceFlinger::primaryDisplayOrientation); auto surfaceFlingerConfigsServiceV1_2 = V1_2::ISurfaceFlingerConfigs::getService(); if (surfaceFlingerConfigsServiceV1_2) { surfaceFlingerConfigsServiceV1_2->getDisplayNativePrimaries( [&](auto tmpPrimaries) { memcpy(&mInternalDisplayPrimaries, &tmpPrimaries, sizeof(ui::DisplayPrimaries)); }); } else { initDefaultDisplayNativePrimaries(); } mInternalDisplayPrimaries = sysprop::getDisplayNativePrimaries(); // debugging stuff... char value[PROPERTY_VALUE_MAX]; Loading Loading @@ -3214,21 +3193,6 @@ void SurfaceFlinger::invalidateLayerStack(const sp<const Layer>& layer, const Re } } void SurfaceFlinger::initDefaultDisplayNativePrimaries() { mInternalDisplayPrimaries.red.X = kSrgbRedX; mInternalDisplayPrimaries.red.Y = kSrgbRedY; mInternalDisplayPrimaries.red.Z = kSrgbRedZ; mInternalDisplayPrimaries.green.X = kSrgbGreenX; mInternalDisplayPrimaries.green.Y = kSrgbGreenY; mInternalDisplayPrimaries.green.Z = kSrgbGreenZ; mInternalDisplayPrimaries.blue.X = kSrgbBlueX; mInternalDisplayPrimaries.blue.Y = kSrgbBlueY; mInternalDisplayPrimaries.blue.Z = kSrgbBlueZ; mInternalDisplayPrimaries.white.X = kSrgbWhiteX; mInternalDisplayPrimaries.white.Y = kSrgbWhiteY; mInternalDisplayPrimaries.white.Z = kSrgbWhiteZ; } bool SurfaceFlinger::handlePageFlip() { ALOGV("handlePageFlip"); Loading
services/surfaceflinger/SurfaceFlinger.h +0 −4 Original line number Diff line number Diff line Loading @@ -700,10 +700,6 @@ private: // region of all screens presenting this layer stack. void invalidateLayerStack(const sp<const Layer>& layer, const Region& dirty); // Initialize structures containing information about the internal // display's native color coordinates using default data void initDefaultDisplayNativePrimaries(); /* ------------------------------------------------------------------------ * H/W composer */ Loading
services/surfaceflinger/SurfaceFlingerProperties.cpp +44 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ #include <android/hardware/configstore/1.2/ISurfaceFlingerConfigs.h> #include <configstore/Utils.h> #include <cstdlib> #include <tuple> #include "SurfaceFlingerProperties.h" Loading @@ -15,6 +16,7 @@ namespace android { namespace sysprop { using namespace android::hardware::configstore; using namespace android::hardware::configstore::V1_0; using ::android::hardware::configstore::V1_2::DisplayPrimaries; using ::android::hardware::graphics::common::V1_2::Dataspace; using ::android::hardware::graphics::common::V1_2::PixelFormat; Loading Loading @@ -242,5 +244,47 @@ int32_t wcg_composition_pixel_format(PixelFormat defaultValue) { return static_cast<int32_t>(defaultValue); } #define DISPLAY_PRIMARY_SIZE 3 constexpr float kSrgbRedX = 0.4123f; constexpr float kSrgbRedY = 0.2126f; constexpr float kSrgbRedZ = 0.0193f; constexpr float kSrgbGreenX = 0.3576f; constexpr float kSrgbGreenY = 0.7152f; constexpr float kSrgbGreenZ = 0.1192f; constexpr float kSrgbBlueX = 0.1805f; constexpr float kSrgbBlueY = 0.0722f; constexpr float kSrgbBlueZ = 0.9506f; constexpr float kSrgbWhiteX = 0.9505f; constexpr float kSrgbWhiteY = 1.0000f; constexpr float kSrgbWhiteZ = 1.0891f; DisplayPrimaries getDisplayNativePrimaries() { auto mDisplay_primary_red = SurfaceFlingerProperties::display_primary_red(); auto mDisplay_primary_green = SurfaceFlingerProperties::display_primary_green(); auto mDisplay_primary_blue = SurfaceFlingerProperties::display_primary_blue(); auto mDisplay_primary_white = SurfaceFlingerProperties::display_primary_white(); // To avoid null point exception. mDisplay_primary_red.resize(DISPLAY_PRIMARY_SIZE); mDisplay_primary_green.resize(DISPLAY_PRIMARY_SIZE); mDisplay_primary_blue.resize(DISPLAY_PRIMARY_SIZE); mDisplay_primary_white.resize(DISPLAY_PRIMARY_SIZE); DisplayPrimaries primaries = {{static_cast<float>(mDisplay_primary_red[0].value_or(kSrgbRedX)), static_cast<float>(mDisplay_primary_red[1].value_or(kSrgbRedY)), static_cast<float>(mDisplay_primary_red[2].value_or(kSrgbRedZ))}, {static_cast<float>(mDisplay_primary_green[0].value_or(kSrgbGreenX)), static_cast<float>(mDisplay_primary_green[1].value_or(kSrgbGreenY)), static_cast<float>(mDisplay_primary_green[2].value_or(kSrgbGreenZ))}, {static_cast<float>(mDisplay_primary_blue[0].value_or(kSrgbBlueX)), static_cast<float>(mDisplay_primary_blue[1].value_or(kSrgbBlueY)), static_cast<float>(mDisplay_primary_blue[2].value_or(kSrgbBlueZ))}, {static_cast<float>(mDisplay_primary_white[0].value_or(kSrgbWhiteX)), static_cast<float>(mDisplay_primary_white[1].value_or(kSrgbWhiteY)), static_cast<float>(mDisplay_primary_white[2].value_or(kSrgbWhiteZ))}}; return primaries; } } // namespace sysprop } // namespace android
services/surfaceflinger/SurfaceFlingerProperties.h +2 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,8 @@ int64_t wcg_composition_dataspace( int32_t wcg_composition_pixel_format( android::hardware::graphics::common::V1_2::PixelFormat defaultValue); android::hardware::configstore::V1_2::DisplayPrimaries getDisplayNativePrimaries(); } // namespace sysprop } // namespace android #endif // SURFACEFLINGERPROPERTIES_H_
services/surfaceflinger/sysprop/SurfaceFlingerProperties.sysprop +36 −0 Original line number Diff line number Diff line Loading @@ -250,3 +250,39 @@ prop { access: Readonly prop_name: "ro.surface_flinger.wcg_composition_pixel_format" } # Return the native panel primary data. The data includes red, green, # blue and white. The primary format is CIE 1931 XYZ color space. # If unspecified, the primaries is sRGB gamut by default. prop { api_name: "display_primary_red" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_red" } prop { api_name: "display_primary_green" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_green" } prop { api_name: "display_primary_blue" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_blue" } prop { api_name: "display_primary_white" type: DoubleList scope: Internal access: Readonly prop_name: "ro.surface_flinger.display_primary_white" }