Re: [PATCH 07/18] drm/vc4: hdmi: Add full range RGB helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Am 17.03.21 um 16:43 schrieb Maxime Ripard:
We're going to need to tell whether we want to run with a full or
limited range RGB output in multiple places in the code, so let's create
a helper that will return whether we need with full range or not.

Signed-off-by: Maxime Ripard <maxime@xxxxxxxxxx>

Acked-by: Thomas Zimmermann <tzimmermann@xxxxxxx>

although with a comments

---
  drivers/gpu/drm/vc4/vc4_hdmi.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index eee9751009c2..fc545072b173 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -95,6 +95,15 @@
#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000) +static bool vc4_hdmi_is_full_range_rgb(struct vc4_hdmi *vc4_hdmi,
+				       const struct drm_display_mode *mode)
+{
+	struct vc4_hdmi_encoder *vc4_encoder = &vc4_hdmi->encoder;
+
+	return !vc4_encoder->hdmi_monitor ||

Is this ever being called from non-HDMI code? If not, I'd put an drm_WARN_ONCE around this check.

+		drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_FULL;
+}
+
  static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
  {
  	struct drm_info_node *node = (struct drm_info_node *)m->private;
@@ -833,8 +842,7 @@ static void vc4_hdmi_encoder_pre_crtc_enable(struct
drm_encoder *encoder,
  	struct vc4_hdmi_encoder *vc4_encoder = to_vc4_hdmi_encoder(encoder);
  	struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
- if (vc4_encoder->hdmi_monitor &&
-	    drm_default_rgb_quant_range(mode) == HDMI_QUANTIZATION_RANGE_LIMITED) {
+	if (vc4_hdmi_is_full_range_rgb(vc4_hdmi, mode) {
  		if (vc4_hdmi->variant->csc_setup)
  			vc4_hdmi->variant->csc_setup(vc4_hdmi, true);

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux