linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Emma Anholt <emma@anholt.net>, Maxime Ripard <mripard@kernel.org>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Maxime Ripard <maxime@cerno.tech>
Subject: [PATCH 4/9] drm/vc4: hdmi: Rename full range helper
Date: Wed, 07 Dec 2022 17:07:48 +0100	[thread overview]
Message-ID: <20221207-rpi-hdmi-improvements-v1-4-6b15f774c13a@cerno.tech> (raw)
In-Reply-To: <20221207-rpi-hdmi-improvements-v1-0-6b15f774c13a@cerno.tech>

From: Dave Stevenson <dave.stevenson@raspberrypi.com>

The VC4 HDMI driver has a helper function to figure out whether full
range or limited range RGB is being used called
vc4_hdmi_is_full_range_rgb().

We'll need it to support other colorspaces, so let's rename it to
vc4_hdmi_is_full_range().

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 488a4012d422..51469939a8b4 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -149,8 +149,8 @@ static bool vc4_hdmi_mode_needs_scrambling(const struct drm_display_mode *mode,
 	return clock > HDMI_14_MAX_TMDS_CLK;
 }
 
-static bool vc4_hdmi_is_full_range_rgb(struct vc4_hdmi *vc4_hdmi,
-				       const struct drm_display_mode *mode)
+static bool vc4_hdmi_is_full_range(struct vc4_hdmi *vc4_hdmi,
+				   const struct drm_display_mode *mode)
 {
 	struct drm_display_info *display = &vc4_hdmi->connector.display_info;
 
@@ -892,7 +892,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder)
 
 	drm_hdmi_avi_infoframe_quant_range(&frame.avi,
 					   connector, mode,
-					   vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode) ?
+					   vc4_hdmi_is_full_range(vc4_hdmi, mode) ?
 					   HDMI_QUANTIZATION_RANGE_FULL :
 					   HDMI_QUANTIZATION_RANGE_LIMITED);
 	drm_hdmi_avi_infoframe_colorimetry(&frame.avi, cstate);
@@ -1145,7 +1145,7 @@ static void vc4_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
 	csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR,
 				VC4_HD_CSC_CTL_ORDER);
 
-	if (!vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode)) {
+	if (!vc4_hdmi_is_full_range(vc4_hdmi, mode)) {
 		/* CEA VICs other than #1 requre limited range RGB
 		 * output unless overridden by an AVI infoframe.
 		 * Apply a colorspace conversion to squash 0-255 down
@@ -1298,7 +1298,7 @@ static void vc5_hdmi_csc_setup(struct vc4_hdmi *vc4_hdmi,
 	case VC4_HDMI_OUTPUT_RGB:
 		if_xbar = 0x354021;
 
-		if (!vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode))
+		if (!vc4_hdmi_is_full_range(vc4_hdmi, mode))
 			vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_to_limited_rgb);
 		else
 			vc5_hdmi_set_csc_coeffs(vc4_hdmi, vc5_hdmi_csc_full_rgb_unity);

-- 
2.38.1

  parent reply	other threads:[~2022-12-07 16:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 16:07 [PATCH 0/9] drm/vc4: hdmi: Broadcast RGB, BT601, BT2020 Maxime Ripard
2022-12-07 16:07 ` [PATCH 1/9] drm/vc4: hdmi: Update all the planes if the TV margins are changed Maxime Ripard
2023-01-11 13:56   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 2/9] drm/vc4: hdmi: Constify container_of wrappers Maxime Ripard
2023-01-11 14:02   ` Thomas Zimmermann
2023-01-11 14:17     ` Jani Nikula
2022-12-07 16:07 ` [PATCH 3/9] drm/vc4: hdmi: Add Broadcast RGB property to allow override of RGB range Maxime Ripard
2023-01-11 14:11   ` Thomas Zimmermann
2023-01-26  9:38     ` Maxime Ripard
2022-12-07 16:07 ` Maxime Ripard [this message]
2023-01-11 14:13   ` [PATCH 4/9] drm/vc4: hdmi: Rename full range helper Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 5/9] drm/vc4: hdmi: Rework the CSC matrices organization Maxime Ripard
2023-01-11 15:03   ` Thomas Zimmermann
2023-01-11 17:00     ` Dave Stevenson
2023-01-26 13:40       ` Maxime Ripard
2022-12-07 16:07 ` [PATCH 6/9] drm/vc4: hdmi: Swap CSC matrix channels for YUV444 Maxime Ripard
2023-01-11 15:05   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 7/9] drm/vc4: hdmi: Add a function to retrieve the CSC matrix Maxime Ripard
2023-01-11 15:14   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 8/9] drm/vc4: hdmi: Add BT.601 Support Maxime Ripard
2023-01-11 15:16   ` Thomas Zimmermann
2022-12-07 16:07 ` [PATCH 9/9] drm/vc4: hdmi: Add BT.2020 Support Maxime Ripard
2023-01-11 15:18   ` Thomas Zimmermann

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=20221207-rpi-hdmi-improvements-v1-4-6b15f774c13a@cerno.tech \
    --to=maxime@cerno.tech \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mripard@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).