mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-06-13 14:32:57 -04:00
drm: capture EDID HDR metadata when only EOTFs are advertised
Some displays populate the desired-content luminance bytes in the HDR Static Metadata Data Block without setting the Type 1 descriptor flag. Fall through to capture the values whenever any luminance field is non-zero, and log what was parsed at WLR_DEBUG level to aid HDR debugging. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
78830ab696
commit
51b9350e69
1 changed files with 21 additions and 1 deletions
|
|
@ -105,7 +105,14 @@ void parse_edid(struct wlr_drm_connector *conn, size_t len, const uint8_t *data)
|
|||
output->supported_transfer_functions |= WLR_COLOR_TRANSFER_FUNCTION_ST2084_PQ;
|
||||
}
|
||||
|
||||
if (hdr_static_metadata->type1) {
|
||||
// Capture HDR static metadata whenever the EDID provides any value, even if
|
||||
// the Type 1 descriptor flag is unset: some displays only advertise EOTFs
|
||||
// without explicitly flagging Type 1 support, but still expose useful
|
||||
// desired-content luminance values.
|
||||
if (hdr_static_metadata->type1 ||
|
||||
hdr_static_metadata->desired_content_max_luminance > 0 ||
|
||||
hdr_static_metadata->desired_content_max_frame_avg_luminance > 0 ||
|
||||
hdr_static_metadata->desired_content_min_luminance > 0) {
|
||||
output->hdr_metadata_value = (struct wlr_output_hdr_metadata){
|
||||
.desired_content_min_luminance = hdr_static_metadata->desired_content_min_luminance,
|
||||
};
|
||||
|
|
@ -120,6 +127,19 @@ void parse_edid(struct wlr_drm_connector *conn, size_t len, const uint8_t *data)
|
|||
hdr_static_metadata->desired_content_max_frame_avg_luminance;
|
||||
}
|
||||
output->hdr_metadata = &output->hdr_metadata_value;
|
||||
wlr_log(WLR_DEBUG,
|
||||
"EDID HDR static metadata: type1=%d pq=%d hlg=%d hdr_gamma=%d sdr=%d, "
|
||||
"min_lum=%.4f cd/m^2, max_lum=%.1f cd/m^2, max_fall=%.1f cd/m^2",
|
||||
hdr_static_metadata->type1, hdr_static_metadata->pq,
|
||||
hdr_static_metadata->hlg, hdr_static_metadata->traditional_hdr,
|
||||
hdr_static_metadata->traditional_sdr,
|
||||
hdr_static_metadata->desired_content_min_luminance,
|
||||
hdr_static_metadata->desired_content_max_luminance,
|
||||
hdr_static_metadata->desired_content_max_frame_avg_luminance);
|
||||
} else {
|
||||
wlr_log(WLR_DEBUG,
|
||||
"EDID has no HDR static metadata (sdr_only=%d)",
|
||||
hdr_static_metadata->traditional_sdr);
|
||||
}
|
||||
|
||||
di_info_destroy(info);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue