* [PATCH] drm/i915/display: send null DRM infoframe when ending HDR transmission
@ 2026-09-01 13:04 Xiao Lu
2026-09-01 13:25 ` sashiko-bot
0 siblings, 1 reply; 4+ messages in thread
From: Xiao Lu @ 2026-09-01 13:04 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula, ville.syrjala, imre.deak, xiaolu
From: xiaolu <xiaolu@intel.com>
CTA-861-H requires that when a source ends Dynamic Range and Mastering
InfoFrame transmission, it shall send a DRM infoframe with EOTF=0 and
all metadata fields set to 0 for at least 2 seconds before stopping.
Currently, when transitioning from HDR to SDR, the driver abruptly
stops sending the DRM metadata SDP/infoframe. This causes DP-to-HDMI
converters to latch the previous HDR metadata and continue forwarding
it to the HDMI sink, resulting in color errors (e.g. oversaturated or
washed-out colors) on SDR content. Windows correctly implements the
null infoframe transition.
Fix both the DP and native HDMI paths to send a zeroed DRM infoframe
(EOTF=Traditional_SDR=0, all luminance and primaries fields zero) when
transitioning from HDR to SDR. The null packet is only sent when the
previous connector state had HDR metadata active, avoiding unnecessary
DRM infoframe transmission during normal SDR operation.
Signed-off-by: xiaolu <xiaolu@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 23 ++++++++++++++++++++---
drivers/gpu/drm/i915/display/intel_hdmi.c | 19 ++++++++++++++++++-
2 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 61ae83857cd6..8ff4aa2e6c0b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3219,14 +3219,29 @@ intel_dp_in_hdr_mode(const struct drm_connector_state *conn_state)
static void
intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
struct intel_crtc_state *crtc_state,
- const struct drm_connector_state *conn_state)
+ const struct drm_connector_state *conn_state,
+ const struct drm_connector_state *old_conn_state)
{
struct intel_display *display = to_intel_display(intel_dp);
int ret;
struct hdmi_drm_infoframe *drm_infoframe = &crtc_state->infoframes.drm.drm;
- if (!conn_state->hdr_output_metadata)
+ if (!conn_state->hdr_output_metadata) {
+ /*
+ * CTA-861-H requires ending HDR metadata transmission by
+ * sending a DRM infoframe with EOTF=0 and all fields zero
+ * for at least 2 seconds, rather than abruptly stopping.
+ * Abruptly stopping causes DP-to-HDMI converters to latch
+ * the previous HDR metadata and forward it to the HDMI sink,
+ * resulting in color errors on SDR content.
+ */
+ if (old_conn_state && old_conn_state->hdr_output_metadata) {
+ hdmi_drm_infoframe_init(drm_infoframe);
+ crtc_state->infoframes.enable |=
+ intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
+ }
return;
+ }
ret = drm_hdmi_infoframe_set_hdr_metadata(drm_infoframe, conn_state);
@@ -3632,7 +3647,9 @@ intel_dp_compute_config(struct intel_atomic_state *state,
intel_alpm_lobf_compute_config(intel_dp, pipe_config, conn_state);
intel_dp_drrs_compute_config(connector, pipe_config, link_bpp_x16);
intel_dp_compute_vsc_sdp(intel_dp, pipe_config, conn_state);
- intel_dp_compute_hdr_metadata_infoframe_sdp(intel_dp, pipe_config, conn_state);
+ intel_dp_compute_hdr_metadata_infoframe_sdp(intel_dp, pipe_config, conn_state,
+ drm_atomic_get_old_connector_state(&state->base,
+ conn_state->connector));
return intel_dp_tunnel_atomic_compute_stream_bw(state, intel_dp, connector,
pipe_config);
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 8a019d3574df..9fb9be302d35 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -856,8 +856,25 @@ intel_hdmi_compute_drm_infoframe(struct intel_encoder *encoder,
if (!crtc_state->has_infoframe)
return true;
- if (!conn_state->hdr_output_metadata)
+ if (!conn_state->hdr_output_metadata) {
+ const struct drm_connector_state *old_conn_state =
+ drm_atomic_get_old_connector_state(conn_state->state,
+ conn_state->connector);
+ /*
+ * CTA-861-H requires ending HDR metadata transmission by
+ * sending a DRM infoframe with EOTF=0 and all fields zero
+ * for at least 2 seconds, rather than abruptly stopping.
+ * Abruptly stopping causes DP-to-HDMI converters to latch
+ * the previous HDR metadata and forward it to the HDMI sink,
+ * resulting in color errors on SDR content.
+ */
+ if (old_conn_state && old_conn_state->hdr_output_metadata) {
+ hdmi_drm_infoframe_init(frame);
+ crtc_state->infoframes.enable |=
+ intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
+ }
return true;
+ }
crtc_state->infoframes.enable |=
intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] drm/i915/display: send null DRM infoframe when ending HDR transmission
@ 2026-09-01 13:06 Xiao Lu
2026-09-01 13:26 ` sashiko-bot
0 siblings, 1 reply; 4+ messages in thread
From: Xiao Lu @ 2026-09-01 13:06 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula, ville.syrjala, imre.deak, Xiao Lu
CTA-861-H requires that when a source ends Dynamic Range and Mastering
InfoFrame transmission, it shall send a DRM infoframe with EOTF=0 and
all metadata fields set to 0 for at least 2 seconds before stopping.
Currently, when transitioning from HDR to SDR, the driver abruptly
stops sending the DRM metadata SDP/infoframe. This causes DP-to-HDMI
converters to latch the previous HDR metadata and continue forwarding
it to the HDMI sink, resulting in color errors (e.g. oversaturated or
washed-out colors) on SDR content. Windows correctly implements the
null infoframe transition.
Fix both the DP and native HDMI paths to send a zeroed DRM infoframe
(EOTF=Traditional_SDR=0, all luminance and primaries fields zero) when
transitioning from HDR to SDR. The null packet is only sent when the
previous connector state had HDR metadata active, avoiding unnecessary
DRM infoframe transmission during normal SDR operation.
Signed-off-by: Xiao Lu <xiaolu.xie@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 23 ++++++++++++++++++++---
drivers/gpu/drm/i915/display/intel_hdmi.c | 19 ++++++++++++++++++-
2 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 61ae83857cd6..8ff4aa2e6c0b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3219,14 +3219,29 @@ intel_dp_in_hdr_mode(const struct drm_connector_state *conn_state)
static void
intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
struct intel_crtc_state *crtc_state,
- const struct drm_connector_state *conn_state)
+ const struct drm_connector_state *conn_state,
+ const struct drm_connector_state *old_conn_state)
{
struct intel_display *display = to_intel_display(intel_dp);
int ret;
struct hdmi_drm_infoframe *drm_infoframe = &crtc_state->infoframes.drm.drm;
- if (!conn_state->hdr_output_metadata)
+ if (!conn_state->hdr_output_metadata) {
+ /*
+ * CTA-861-H requires ending HDR metadata transmission by
+ * sending a DRM infoframe with EOTF=0 and all fields zero
+ * for at least 2 seconds, rather than abruptly stopping.
+ * Abruptly stopping causes DP-to-HDMI converters to latch
+ * the previous HDR metadata and forward it to the HDMI sink,
+ * resulting in color errors on SDR content.
+ */
+ if (old_conn_state && old_conn_state->hdr_output_metadata) {
+ hdmi_drm_infoframe_init(drm_infoframe);
+ crtc_state->infoframes.enable |=
+ intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
+ }
return;
+ }
ret = drm_hdmi_infoframe_set_hdr_metadata(drm_infoframe, conn_state);
@@ -3632,7 +3647,9 @@ intel_dp_compute_config(struct intel_atomic_state *state,
intel_alpm_lobf_compute_config(intel_dp, pipe_config, conn_state);
intel_dp_drrs_compute_config(connector, pipe_config, link_bpp_x16);
intel_dp_compute_vsc_sdp(intel_dp, pipe_config, conn_state);
- intel_dp_compute_hdr_metadata_infoframe_sdp(intel_dp, pipe_config, conn_state);
+ intel_dp_compute_hdr_metadata_infoframe_sdp(intel_dp, pipe_config, conn_state,
+ drm_atomic_get_old_connector_state(&state->base,
+ conn_state->connector));
return intel_dp_tunnel_atomic_compute_stream_bw(state, intel_dp, connector,
pipe_config);
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index 8a019d3574df..9fb9be302d35 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -856,8 +856,25 @@ intel_hdmi_compute_drm_infoframe(struct intel_encoder *encoder,
if (!crtc_state->has_infoframe)
return true;
- if (!conn_state->hdr_output_metadata)
+ if (!conn_state->hdr_output_metadata) {
+ const struct drm_connector_state *old_conn_state =
+ drm_atomic_get_old_connector_state(conn_state->state,
+ conn_state->connector);
+ /*
+ * CTA-861-H requires ending HDR metadata transmission by
+ * sending a DRM infoframe with EOTF=0 and all fields zero
+ * for at least 2 seconds, rather than abruptly stopping.
+ * Abruptly stopping causes DP-to-HDMI converters to latch
+ * the previous HDR metadata and forward it to the HDMI sink,
+ * resulting in color errors on SDR content.
+ */
+ if (old_conn_state && old_conn_state->hdr_output_metadata) {
+ hdmi_drm_infoframe_init(frame);
+ crtc_state->infoframes.enable |=
+ intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
+ }
return true;
+ }
crtc_state->infoframes.enable |=
intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915/display: send null DRM infoframe when ending HDR transmission
2026-09-01 13:04 [PATCH] drm/i915/display: send null DRM infoframe when ending HDR transmission Xiao Lu
@ 2026-09-01 13:25 ` sashiko-bot
0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-01 13:25 UTC (permalink / raw)
To: Xiao Lu; +Cc: intel-gfx
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Stateless implementation of the CTA-861-H 2-second requirement causes indefinite transmission, premature termination, and spurious state mismatches.
--
commit 78df3126b776d1f0e5455dd977f44bfe09013697
Author: xiaolu <xiaolu@intel.com>
drm/i915/display: send null DRM infoframe when ending HDR transmission
This commit aims to fix color errors on SDR content when transitioning from
HDR to SDR by sending a null DRM infoframe for at least 2 seconds as required
by CTA-861-H.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 6b60e0a1c8eef..7680594ae6702 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
[ ... ]
> @@ -3231,14 +3231,29 @@ intel_dp_in_hdr_mode(const struct drm_connector_state *conn_state)
> static void
> intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
> struct intel_crtc_state *crtc_state,
> - const struct drm_connector_state *conn_state)
> + const struct drm_connector_state *conn_state,
> + const struct drm_connector_state *old_conn_state)
> {
> struct intel_display *display = to_intel_display(intel_dp);
> int ret;
> struct hdmi_drm_infoframe *drm_infoframe = &crtc_state->infoframes.drm.drm;
>
> - if (!conn_state->hdr_output_metadata)
> + if (!conn_state->hdr_output_metadata) {
> + /*
> + * CTA-861-H requires ending HDR metadata transmission by
> + * sending a DRM infoframe with EOTF=0 and all fields zero
> + * for at least 2 seconds, rather than abruptly stopping.
> + * Abruptly stopping causes DP-to-HDMI converters to latch
> + * the previous HDR metadata and forward it to the HDMI sink,
> + * resulting in color errors on SDR content.
> + */
> + if (old_conn_state && old_conn_state->hdr_output_metadata) {
> + hdmi_drm_infoframe_init(drm_infoframe);
> + crtc_state->infoframes.enable |=
> + intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
> + }
[Severity: Medium]
Could this introduce a regression where the zeroed DRM infoframe is either
transmitted indefinitely or terminated prematurely depending on subsequent
commits?
This logic in intel_dp_compute_hdr_metadata_infoframe_sdp() enables the
zeroed infoframe during the HDR to SDR modeset, but does not provide a
mechanism to disable it after 2 seconds. If the compositor does not perform
another commit, the infoframe transmission appears to continue indefinitely.
Conversely, if the compositor performs an unrelated atomic commit (for
example, updating a cursor plane) within 2 seconds of the HDR transition,
won't this immediately disable the infoframe? The recalculation of the state
would see no HDR metadata in the old state and skip setting the enable bit,
terminating the infoframe prematurely and violating the CTA-861-H requirement.
> return;
> + }
>
> ret = drm_hdmi_infoframe_set_hdr_metadata(drm_infoframe, conn_state);
[ ... ]
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 9b637e38a1a51..bdacad8ea30a3 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
[ ... ]
> @@ -856,8 +856,25 @@ intel_hdmi_compute_drm_infoframe(struct intel_encoder *encoder,
> if (!crtc_state->has_infoframe)
> return true;
>
> - if (!conn_state->hdr_output_metadata)
> + if (!conn_state->hdr_output_metadata) {
> + const struct drm_connector_state *old_conn_state =
> + drm_atomic_get_old_connector_state(conn_state->state,
> + conn_state->connector);
> + /*
> + * CTA-861-H requires ending HDR metadata transmission by
> + * sending a DRM infoframe with EOTF=0 and all fields zero
> + * for at least 2 seconds, rather than abruptly stopping.
> + * Abruptly stopping causes DP-to-HDMI converters to latch
> + * the previous HDR metadata and forward it to the HDMI sink,
> + * resulting in color errors on SDR content.
> + */
> + if (old_conn_state && old_conn_state->hdr_output_metadata) {
> + hdmi_drm_infoframe_init(frame);
> + crtc_state->infoframes.enable |=
> + intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
> + }
[Severity: Medium]
Does this face the same stateless implementation regression as the DP path?
Like in intel_dp_compute_hdr_metadata_infoframe_sdp(), this logic in
intel_hdmi_compute_drm_infoframe() indefinitely prolongs the transmission if
there are no further commits, or truncates it if rapid modesets occur within
the 2-second window.
> return true;
> + }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260901130415.236800-1-xiaolu.xie@intel.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/i915/display: send null DRM infoframe when ending HDR transmission
2026-09-01 13:06 Xiao Lu
@ 2026-09-01 13:26 ` sashiko-bot
0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-01 13:26 UTC (permalink / raw)
To: Xiao Lu; +Cc: intel-gfx
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The implementation fails to enforce the CTA-861-H 2-second minimum duration for zero-filled DRM infoframes and leaves them enabled indefinitely during normal SDR operation.
--
commit 36a317ecec2b669b256a0c4c50d72b83f1882ac8
Author: Xiao Lu <xiaolu.xie@intel.com>
Subject: drm/i915/display: send null DRM infoframe when ending HDR transmission
This commit aims to fix color errors on DP-to-HDMI converters during the
HDR-to-SDR transition. It implements the CTA-861-H requirement to send a
null DRM infoframe for at least 2 seconds before stopping the transmission
entirely.
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 6b60e0a1c8eef..7680594ae6702 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3231,14 +3231,29 @@ intel_dp_in_hdr_mode(const struct drm_connector_state *conn_state)
> static void
> intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
> struct intel_crtc_state *crtc_state,
> - const struct drm_connector_state *conn_state)
> + const struct drm_connector_state *conn_state,
> + const struct drm_connector_state *old_conn_state)
> {
> struct intel_display *display = to_intel_display(intel_dp);
> int ret;
> struct hdmi_drm_infoframe *drm_infoframe = &crtc_state->infoframes.drm.drm;
>
> - if (!conn_state->hdr_output_metadata)
> + if (!conn_state->hdr_output_metadata) {
> + /*
> + * CTA-861-H requires ending HDR metadata transmission by
> + * sending a DRM infoframe with EOTF=0 and all fields zero
> + * for at least 2 seconds, rather than abruptly stopping.
> + * Abruptly stopping causes DP-to-HDMI converters to latch
> + * the previous HDR metadata and forward it to the HDMI sink,
> + * resulting in color errors on SDR content.
> + */
> + if (old_conn_state && old_conn_state->hdr_output_metadata) {
> + hdmi_drm_infoframe_init(drm_infoframe);
> + crtc_state->infoframes.enable |=
> + intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
> + }
[Severity: Medium]
How is the 2-second minimum duration enforced here?
The infoframe transmission is tied to the transient atomic state transition
where old_conn_state->hdr_output_metadata is true. Since the crtc_state
persists until the next commit, wouldn't the null infoframe transmit
indefinitely during normal SDR operation, rather than stopping after 2 seconds?
Additionally, if a subsequent userspace commit (like a page flip or resolution
change) occurs within 2 seconds, old_conn_state->hdr_output_metadata will be
false for that new commit. Doesn't this mean the infoframe will abruptly stop,
violating the 2-second minimum requirement?
> return;
> + }
>
> ret = drm_hdmi_infoframe_set_hdr_metadata(drm_infoframe, conn_state);
[ ... ]
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 9b637e38a1a51..bdacad8ea30a3 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -856,8 +856,25 @@ intel_hdmi_compute_drm_infoframe(struct intel_encoder *encoder,
> if (!crtc_state->has_infoframe)
> return true;
>
> - if (!conn_state->hdr_output_metadata)
> + if (!conn_state->hdr_output_metadata) {
> + const struct drm_connector_state *old_conn_state =
> + drm_atomic_get_old_connector_state(conn_state->state,
> + conn_state->connector);
> + /*
> + * CTA-861-H requires ending HDR metadata transmission by
> + * sending a DRM infoframe with EOTF=0 and all fields zero
> + * for at least 2 seconds, rather than abruptly stopping.
> + * Abruptly stopping causes DP-to-HDMI converters to latch
> + * the previous HDR metadata and forward it to the HDMI sink,
> + * resulting in color errors on SDR content.
> + */
> + if (old_conn_state && old_conn_state->hdr_output_metadata) {
> + hdmi_drm_infoframe_init(frame);
> + crtc_state->infoframes.enable |=
> + intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
> + }
[Severity: Medium]
This appears to have the same issue for the native HDMI path. Tying the
transmission requirement to an event-based atomic commit means the 2-second
minimum duration isn't guaranteed by a timer or delayed worker.
Could this result in the null infoframe either being disabled too early (if
another commit happens quickly) or remaining enabled forever?
> return true;
> + }
>
> crtc_state->infoframes.enable |=
> intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260901130649.237080-1-xiaolu.xie@intel.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-01 13:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-01 13:04 [PATCH] drm/i915/display: send null DRM infoframe when ending HDR transmission Xiao Lu
2026-09-01 13:25 ` sashiko-bot
-- strict thread matches above, loose matches on Subject: below --
2026-09-01 13:06 Xiao Lu
2026-09-01 13:26 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox