From: Pekka Paalanen <ppaalanen@gmail.com>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "Sebastian Wick" <sebastian.wick@redhat.com>,
dri-devel@lists.freedesktop.org,
"Uma Shankar" <uma.shankar@intel.com>,
amd-gfx@lists.freedesktop.org, "Joshua Ashton" <joshua@froggi.es>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
Vitaly.Prosyak@amd.com
Subject: Re: [PATCH 14/16] drm/amd/display: Add debugfs for testing output colorspace
Date: Tue, 13 Dec 2022 12:35:59 +0200 [thread overview]
Message-ID: <20221213123559.33425bf1@eldfell> (raw)
In-Reply-To: <20221212182137.374625-15-harry.wentland@amd.com>
[-- Attachment #1: Type: text/plain, Size: 3625 bytes --]
On Mon, 12 Dec 2022 13:21:35 -0500
Harry Wentland <harry.wentland@amd.com> wrote:
> In order to IGT test colorspace we'll want to print
> the currently enabled colorspace on a stream. We add
> a new debugfs to do so, using the same scheme as
> current bpc reporting.
>
> This might also come in handy when debugging display
> issues.
>
> 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
> ---
> .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 57 +++++++++++++++++++
> 1 file changed, 57 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 461037a3dd75..d95d1c9f4805 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -935,6 +935,61 @@ static int amdgpu_current_bpc_show(struct seq_file *m, void *data)
> }
> DEFINE_SHOW_ATTRIBUTE(amdgpu_current_bpc);
>
> +/*
> + * Returns the current bpc for the crtc.
> + * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/amdgpu_current_colorspace
> + */
> +static int amdgpu_current_colorspace_show(struct seq_file *m, void *data)
> +{
> + struct drm_crtc *crtc = m->private;
> + struct drm_device *dev = crtc->dev;
> + struct dm_crtc_state *dm_crtc_state = NULL;
> + int res = -ENODEV;
> +
> + mutex_lock(&dev->mode_config.mutex);
> + drm_modeset_lock(&crtc->mutex, NULL);
> + if (crtc->state == NULL)
> + goto unlock;
> +
> + dm_crtc_state = to_dm_crtc_state(crtc->state);
> + if (dm_crtc_state->stream == NULL)
> + goto unlock;
> +
> + switch (dm_crtc_state->stream->output_color_space) {
> + case COLOR_SPACE_SRGB:
> + seq_printf(m, "RGB");
What does COLOR_SPACE_SRGB mean? Printing it as "RGB" seems suspicious.
Should this be "sRGB" or "BT709_RGB" instead?
> + break;
> + case COLOR_SPACE_YCBCR601:
> + case COLOR_SPACE_YCBCR601_LIMITED:
> + seq_printf(m, "BT601_YCC");
> + break;
> + case COLOR_SPACE_YCBCR709:
> + case COLOR_SPACE_YCBCR709_LIMITED:
> + seq_printf(m, "BT709_YCC");
> + break;
> + case COLOR_SPACE_ADOBERGB:
> + seq_printf(m, "opRGB");
> + break;
> + case COLOR_SPACE_2020_RGB_FULLRANGE:
> + seq_printf(m, "BT2020_RGB");
> + break;
> + case COLOR_SPACE_2020_YCBCR:
> + seq_printf(m, "BT2020_YCC");
> + break;
What do these actually mean?
Are these a combination of colorimetry and color representation
(YCbCr/ICtCp - RGB conversion)?
Should these match enum drm_colorspace entries?
Thanks,
pq
> + default:
> + goto unlock;
> + }
> + res = 0;
> +
> +unlock:
> + drm_modeset_unlock(&crtc->mutex);
> + mutex_unlock(&dev->mode_config.mutex);
> +
> + return res;
> +}
> +DEFINE_SHOW_ATTRIBUTE(amdgpu_current_colorspace);
> +
> +
> /*
> * Example usage:
> * Disable dsc passthrough, i.e.,: have dsc decoding at converver, not external RX
> @@ -3326,6 +3381,8 @@ void crtc_debugfs_init(struct drm_crtc *crtc)
> #endif
> debugfs_create_file("amdgpu_current_bpc", 0644, crtc->debugfs_entry,
> crtc, &amdgpu_current_bpc_fops);
> + debugfs_create_file("amdgpu_current_colorspace", 0644, crtc->debugfs_entry,
> + crtc, &amdgpu_current_colorspace_fops);
> }
>
> /*
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-12-13 10:36 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 ` [PATCH 01/16] drm/display: Don't block HDR_OUTPUT_METADATA on unknown EOTF Harry Wentland
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 [this message]
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=20221213123559.33425bf1@eldfell \
--to=ppaalanen@gmail.com \
--cc=Vitaly.Prosyak@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=joshua@froggi.es \
--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