1
0
Fork 0

drm_hwcomposer: Add property to disable HDR

* It has been reported that HDR is not working properly on Raspberry Pi
  with HDMI displays that support it.

Change-Id: I31f9d7bb5a3f81eeca1f98a72c26786d97edc28d
This commit is contained in:
Konsta 2025-08-29 23:50:46 +03:00
parent e2e9c8cff7
commit adcc927bd4
3 changed files with 11 additions and 0 deletions

View file

@ -202,6 +202,12 @@ const HwcDisplayConfig *HwcDisplay::GetNextConfig() const {
}
void HwcDisplay::SetOutputType(OutputType hdr_output_type) {
if (Properties::DisableHdr()) {
hdr_metadata_.reset();
min_bpc_ = 6;
colorspace_ = Colorspace::kDefault;
return;
}
switch (hdr_output_type) {
case OutputType::kHdr10: {
SetHdrOutputMetadata(ui::Hdr::HDR10);

View file

@ -150,4 +150,8 @@ auto Properties::GetForceMode() -> std::string {
return {force_mode};
}
auto Properties::DisableHdr() -> bool {
return (property_get_bool("vendor.hwc.drm.disable_hdr", 0) != 0);
}
} // namespace android::drm_hwcomposer

View file

@ -37,6 +37,7 @@ class Properties {
static auto GetBackendOverride() -> std::string;
static auto GetDevicePath() -> std::string;
static auto GetForceMode() -> std::string;
static auto DisableHdr() -> bool;
};
} // namespace android::drm_hwcomposer