AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: <amd-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org>
Cc: "Sebastian Wick" <sebastian.wick@redhat.com>,
	"Pekka Paalanen" <pekka.paalanen@collabora.com>,
	"Pekka Paalanen" <ppaalanen@gmail.com>,
	"Uma Shankar" <uma.shankar@intel.com>,
	Vitaly.Prosyak@amd.com, "Joshua Ashton" <joshua@froggi.es>,
	"Harry Wentland" <harry.wentland@amd.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: [PATCH 01/16] drm/display: Don't block HDR_OUTPUT_METADATA on unknown EOTF
Date: Mon, 12 Dec 2022 13:21:22 -0500	[thread overview]
Message-ID: <20221212182137.374625-2-harry.wentland@amd.com> (raw)
In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com>

The EDID of an HDR display defines EOTFs that are supported
by the display and can be set in the HDR metadata infoframe.
Userspace is expected to read the EDID and set an appropriate
HDR_OUTPUT_METADATA.

In drm_parse_hdr_metadata_block the kernel reads the supported
EOTFs from the EDID and stores them in the
drm_connector->hdr_sink_metadata. While doing so it also
filters the EOTFs to the EOTFs the kernel knows about.
When an HDR_OUTPUT_METADATA is set it then checks to
make sure the EOTF is a supported EOTF. In cases where
the kernel doesn't know about a new EOTF this check will
fail, even if the EDID advertises support.

Since it is expected that userspace reads the EDID to understand
what the display supports it doesn't make sense for DRM to block
an HDR_OUTPUT_METADATA if it contains an EOTF the kernel doesn't
understand.

This comes with the added benefit of future-proofing metadata
support. If the spec defines a new EOTF there is no need to
update DRM and an compositor can immediately make use of it.

Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/609

v2: Distinguish EOTFs defind in kernel and ones defined
    in EDID in the commit description (Pekka)

v3: Rebase; drm_hdmi_infoframe_set_hdr_metadata moved
    to drm_hdmi_helper.c

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Sebastian Wick <sebastian.wick@redhat.com>
Cc: Vitaly.Prosyak@amd.com
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Joshua Ashton <joshua@froggi.es>
Cc: dri-devel@lists.freedesktop.org
Cc: amd-gfx@lists.freedesktop.org
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
---
 drivers/gpu/drm/display/drm_hdmi_helper.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c
index 0264abe55278..faf5e9efa7d3 100644
--- a/drivers/gpu/drm/display/drm_hdmi_helper.c
+++ b/drivers/gpu/drm/display/drm_hdmi_helper.c
@@ -44,10 +44,8 @@ int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame,
 
 	/* Sink EOTF is Bit map while infoframe is absolute values */
 	if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf,
-	    connector->hdr_sink_metadata.hdmi_type1.eotf)) {
-		DRM_DEBUG_KMS("EOTF Not Supported\n");
-		return -EINVAL;
-	}
+	    connector->hdr_sink_metadata.hdmi_type1.eotf))
+		DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf);
 
 	err = hdmi_drm_infoframe_init(frame);
 	if (err < 0)
-- 
2.38.1


  reply	other threads:[~2022-12-12 18:22 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-12 18:21 [PATCH 00/16] Enable Colorspace connector property in amdgpu Harry Wentland
2022-12-12 18:21 ` Harry Wentland [this message]
2022-12-12 18:21 ` [PATCH 02/16] drm/connector: print max_requested_bpc in state debugfs Harry Wentland
2022-12-12 18:21 ` [PATCH 03/16] drm/connector: Drop COLORIMETRY_NO_DATA Harry Wentland
2022-12-12 18:21 ` [PATCH 04/16] drm/connector: Convert DRM_MODE_COLORIMETRY to enum Harry Wentland
2022-12-13 10:39   ` Pekka Paalanen
2022-12-13 16:41     ` Harry Wentland
2022-12-14  8:57       ` Pekka Paalanen
2022-12-12 18:21 ` [PATCH 05/16] drm/connector: Pull out common create_colorspace_property code Harry Wentland
2022-12-12 18:21 ` [PATCH 06/16] drm/connector: Allow drivers to pass list of supported colorspaces Harry Wentland
2022-12-13 10:20   ` Jani Nikula
2022-12-13 10:23   ` Pekka Paalanen
2022-12-13 16:32     ` Harry Wentland
2022-12-14  8:55       ` Pekka Paalanen
2022-12-14 19:07         ` Harry Wentland
2022-12-14 19:37         ` Alex Deucher
2022-12-13 10:34   ` Pekka Paalanen
2022-12-13 16:36     ` Harry Wentland
2022-12-12 18:21 ` [PATCH 07/16] drm/connector: Print connector colorspace in state debugfs Harry Wentland
2022-12-12 21:04   ` kernel test robot
2022-12-13  2:58   ` kernel test robot
2022-12-12 18:21 ` [PATCH 08/16] drm/amd/display: Always pass connector_state to stream validation Harry Wentland
2022-12-12 18:21 ` [PATCH 09/16] drm/amd/display: Register Colorspace property for DP and HDMI Harry Wentland
2022-12-12 18:21 ` [PATCH 10/16] drm/amd/display: Set colorspace for HDMI infoframe Harry Wentland
2022-12-12 18:21 ` [PATCH 11/16] drm/amd/display: Send correct DP colorspace infopacket Harry Wentland
2022-12-12 18:21 ` [PATCH 12/16] drm/amd/display: Always set crtcinfo from create_stream_for_sink Harry Wentland
2022-12-12 18:21 ` [PATCH 13/16] drm/amd/display: Add support for explicit BT601_YCC Harry Wentland
2022-12-12 18:21 ` [PATCH 14/16] drm/amd/display: Add debugfs for testing output colorspace Harry Wentland
2022-12-13 10:35   ` Pekka Paalanen
2022-12-12 18:21 ` [PATCH 15/16] drm/amd/display: Add default case for output_color_space switch Harry Wentland
2022-12-12 18:21 ` [PATCH 16/16] drm/amd/display: Don't restrict bpc to 8 bpc Harry Wentland
2022-12-13 10:48   ` Pekka Paalanen
2022-12-13 17:20   ` Michel Dänzer
2022-12-14  9:01     ` Pekka Paalanen
2022-12-14 15:46       ` Alex Deucher
2022-12-15  9:07         ` Michel Dänzer
2022-12-15 17:30           ` Alex Deucher
2022-12-16 11:01           ` Michel Dänzer
2022-12-15  9:17         ` Pekka Paalanen
2022-12-15 17:33           ` Alex Deucher
2022-12-15 17:42             ` Michel Dänzer
2022-12-15 17:46               ` Michel Dänzer
2022-12-23 19:10       ` Harry Wentland
2023-01-04 11:23         ` Michel Dänzer
2023-01-05 14:45         ` Sebastian Wick
2022-12-13  5:53 ` [PATCH 00/16] Enable Colorspace connector property in amdgpu Joshua Ashton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221212182137.374625-2-harry.wentland@amd.com \
    --to=harry.wentland@amd.com \
    --cc=Vitaly.Prosyak@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joshua@froggi.es \
    --cc=pekka.paalanen@collabora.com \
    --cc=ppaalanen@gmail.com \
    --cc=sebastian.wick@redhat.com \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox