dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jan Claußen" <jan.claussen10@web.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v5 6/8] drm/rockchip: vop2: Select the CSC matrix from the DRM colorimetry
Date: Sat, 21 Nov 2026 13:22:53 +0000	[thread overview]
Message-ID: <sashiko-outbox-227067@kernel.org> (raw)
In-Reply-To: <20261121131126.3358-7-jan.claussen10@web.de>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] drm/rockchip: vop2: dropped BT.601 mappings in
  vop2_convert_csc_mode()
--

commit 2d1b69aeefd3a8b09e750140ac04acf448f1e9ea
Author: Jan Claußen <jan.claussen10@web.de>

drm/rockchip: vop2: Select the CSC matrix from the DRM colorimetry

This commit replaces the V4L2 colorspace field in struct
rockchip_crtc_state with enum drm_colorspace and selects the VOP2 CSC
format directly from DRM_MODE_COLORIMETRY_* values.

> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> index bfb3841425687..41035bf27491d 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

[ ... ]

> @@ -647,20 +645,13 @@ static void vop2_setup_scale(struct vop2 *vop2, const struct vop2_win *win,
>  	}
>  }
>  
> -static int vop2_convert_csc_mode(int csc_mode)
> +static enum vop_csc_format
> +vop2_convert_csc_mode(enum drm_colorspace colorspace)
>  {
> -	switch (csc_mode) {
> -	case V4L2_COLORSPACE_SMPTE170M:
> -	case V4L2_COLORSPACE_470_SYSTEM_M:
> -	case V4L2_COLORSPACE_470_SYSTEM_BG:
> -		return CSC_BT601L;
> -	case V4L2_COLORSPACE_REC709:
> -	case V4L2_COLORSPACE_SMPTE240M:
> -	case V4L2_COLORSPACE_DEFAULT:
> -		return CSC_BT709L;
> -	case V4L2_COLORSPACE_JPEG:
> -		return CSC_BT601F;
> -	case V4L2_COLORSPACE_BT2020:
> +	switch (colorspace) {
> +	case DRM_MODE_COLORIMETRY_BT2020_RGB:
> +	case DRM_MODE_COLORIMETRY_BT2020_YCC:
> +	case DRM_MODE_COLORIMETRY_BT2020_CYCC:
>  		return CSC_BT2020L;
>  	default:
>  		return CSC_BT709L;

[Severity: Low]
Should vop2_convert_csc_mode() keep mappings for BT.601 colorimetries (such
as DRM_MODE_COLORIMETRY_SMPTE_170M_YCC and DRM_MODE_COLORIMETRY_BT601_YCC),
or should the unused BT.601 matrix tables be dropped if BT.601 is not
needed?

Dropping CSC_BT601L and CSC_BT601F here causes any BT.601 colorspace to
fall back to CSC_BT709L and leaves the CSC_BT601L and CSC_BT601F cases (and
rgb2yuv_bt601l / rgb2yuv_bt601f) in vop2_rgb2yuv_get_matrix() unreachable.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261121131126.3358-1-jan.claussen10@web.de?part=6

  reply	other threads:[~2026-11-21 13:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 13:10 [PATCH v5 0/8] drm: Add colorspace property support to the HDMI helpers Jan Claußen
2026-11-21 13:10 ` [PATCH v5 1/8] drm/connector: Fix typo in colorspace error messages Jan Claußen
2026-11-21 13:10 ` [PATCH v5 2/8] drm/display: hdmi-state-helper: Force modeset on colorspace change Jan Claußen
2026-11-21 13:10 ` [PATCH v5 3/8] drm/connector: hdmi: Create the colorspace property Jan Claußen
2026-11-21 13:10 ` [PATCH v5 4/8] drm/bridge-connector: Pass supported colorspaces to the HDMI helpers Jan Claußen
2026-11-21 13:10 ` [PATCH v5 5/8] drm/bridge: dw-hdmi-qp: Forward supported colorspaces from platform data Jan Claußen
2026-11-21 13:11 ` [PATCH v5 6/8] drm/rockchip: vop2: Select the CSC matrix from the DRM colorimetry Jan Claußen
2026-11-21 13:22   ` sashiko-bot [this message]
2026-11-21 13:11 ` [PATCH v5 7/8] drm/rockchip: dw_hdmi_qp: Set the VOP2 color space from the connector Jan Claußen
2026-11-21 13:11 ` [PATCH v5 8/8] drm/rockchip: dw_hdmi_qp: Advertise BT.709 and BT.2020 colorimetries Jan Claußen

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=sashiko-outbox-227067@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jan.claussen10@web.de \
    --cc=sashiko-reviews@lists.linux.dev \
    /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