diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp index 977ab1a..a438263 100644 --- a/hwc2_device/HwcDisplay.cpp +++ b/hwc2_device/HwcDisplay.cpp @@ -863,25 +863,25 @@ HWC2::Error HwcDisplay::SetColorMode(int32_t mode) { switch (mode) { case HAL_COLOR_MODE_NATIVE: - hdr_metadata_.reset(); + hdr_metadata_ = std::make_shared(); colorspace_ = Colorspace::kDefault; break; case HAL_COLOR_MODE_STANDARD_BT601_625: case HAL_COLOR_MODE_STANDARD_BT601_625_UNADJUSTED: case HAL_COLOR_MODE_STANDARD_BT601_525: case HAL_COLOR_MODE_STANDARD_BT601_525_UNADJUSTED: - hdr_metadata_.reset(); + hdr_metadata_ = std::make_shared(); // The DP spec does not say whether this is the 525 or the 625 line version. colorspace_ = Colorspace::kBt601Ycc; break; case HAL_COLOR_MODE_STANDARD_BT709: case HAL_COLOR_MODE_SRGB: - hdr_metadata_.reset(); + hdr_metadata_ = std::make_shared(); colorspace_ = Colorspace::kBt709Ycc; break; case HAL_COLOR_MODE_DCI_P3: case HAL_COLOR_MODE_DISPLAY_P3: - hdr_metadata_.reset(); + hdr_metadata_ = std::make_shared(); colorspace_ = Colorspace::kDciP3RgbD65; break; case HAL_COLOR_MODE_DISPLAY_BT2020: { diff --git a/utils/EdidWrapper.h b/utils/EdidWrapper.h index 137e8be..651c284 100644 --- a/utils/EdidWrapper.h +++ b/utils/EdidWrapper.h @@ -41,9 +41,9 @@ class EdidWrapper { types.clear(); }; virtual void GetHdrCapabilities(std::vector &types, - const float * /*max_luminance*/, - const float * /*max_average_luminance*/, - const float * /*min_luminance*/) { + float * /*max_luminance*/, + float * /*max_average_luminance*/, + float * /*min_luminance*/) { GetSupportedHdrTypes(types); }; virtual void GetColorModes(std::vector &color_modes) { @@ -75,9 +75,9 @@ class LibdisplayEdidWrapper final : public EdidWrapper { void GetSupportedHdrTypes(std::vector &types) override; void GetHdrCapabilities(std::vector &types, - const float *max_luminance, - const float *max_average_luminance, - const float *min_luminance) override; + float *max_luminance, + float *max_average_luminance, + float *min_luminance) override; void GetColorModes(std::vector &color_modes) override; diff --git a/utils/LibdisplayEdidWrapper.cpp b/utils/LibdisplayEdidWrapper.cpp index e35b461..ad737a2 100644 --- a/utils/LibdisplayEdidWrapper.cpp +++ b/utils/LibdisplayEdidWrapper.cpp @@ -53,15 +53,15 @@ void LibdisplayEdidWrapper::GetSupportedHdrTypes(std::vector &types) { } void LibdisplayEdidWrapper::GetHdrCapabilities( - std::vector &types, const float *max_luminance, - const float *max_average_luminance, const float *min_luminance) { + std::vector &types, float *max_luminance, + float *max_average_luminance, float *min_luminance) { GetSupportedHdrTypes(types); const auto *hdr_static_meta = di_info_get_hdr_static_metadata(info_); - max_luminance = &hdr_static_meta->desired_content_max_luminance; - max_average_luminance = &hdr_static_meta + *max_luminance = hdr_static_meta->desired_content_max_luminance; + *max_average_luminance = hdr_static_meta ->desired_content_max_frame_avg_luminance; - min_luminance = &hdr_static_meta->desired_content_min_luminance; + *min_luminance = hdr_static_meta->desired_content_min_luminance; } void LibdisplayEdidWrapper::GetColorModes(std::vector &color_modes) {