All of lore.kernel.org
 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>,
	Eric Anholt <eric@anholt.net>
Cc: Maxime Ripard <maxime@cerno.tech>,
	Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Dave Stevenson <dave.stevenson@raspberrypi.com>
Subject: [PATCH 14/15] drm/vc4: hdmi: Correct interlaced timings again
Date: Wed, 07 Dec 2022 12:53:25 +0100	[thread overview]
Message-ID: <20221207-rpi-hvs-crtc-misc-v1-14-1f8e0770798b@cerno.tech> (raw)
In-Reply-To: <20221207-rpi-hvs-crtc-misc-v1-0-1f8e0770798b@cerno.tech>

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

The back porch timings were correct, only the sync offset was wrong.
Correct timing is now reported for 1080i and 576i, but the h offset is
incorrect for 480i for non-obvious reasons.

Fixes: c0ba150ce468 ("drm/vc4: Correct HDMI timing registers for interlaced modes")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 12a00d644b61..e027381b7331 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -1298,11 +1298,12 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
 		     VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL));
 	u32 vertb = (VC4_SET_FIELD(mode->htotal >> (2 - pixel_rep),
 				   VC5_HDMI_VERTB_VSPO) |
-		     VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end,
+		     VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end +
+				   interlaced,
 				   VC4_HDMI_VERTB_VBP));
 	u32 vertb_even = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) |
 			  VC4_SET_FIELD(mode->crtc_vtotal -
-					mode->crtc_vsync_end - interlaced,
+					mode->crtc_vsync_end,
 					VC4_HDMI_VERTB_VBP));
 	unsigned long flags;
 	unsigned char gcp;

-- 
2.38.1

WARNING: multiple messages have this Message-ID (diff)
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>,
	Eric Anholt <eric@anholt.net>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>,
	Maxime Ripard <maxime@cerno.tech>
Subject: [PATCH 14/15] drm/vc4: hdmi: Correct interlaced timings again
Date: Wed, 07 Dec 2022 12:53:25 +0100	[thread overview]
Message-ID: <20221207-rpi-hvs-crtc-misc-v1-14-1f8e0770798b@cerno.tech> (raw)
In-Reply-To: <20221207-rpi-hvs-crtc-misc-v1-0-1f8e0770798b@cerno.tech>

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

The back porch timings were correct, only the sync offset was wrong.
Correct timing is now reported for 1080i and 576i, but the h offset is
incorrect for 480i for non-obvious reasons.

Fixes: c0ba150ce468 ("drm/vc4: Correct HDMI timing registers for interlaced modes")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 12a00d644b61..e027381b7331 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -1298,11 +1298,12 @@ static void vc5_hdmi_set_timings(struct vc4_hdmi *vc4_hdmi,
 		     VC4_SET_FIELD(mode->crtc_vdisplay, VC5_HDMI_VERTA_VAL));
 	u32 vertb = (VC4_SET_FIELD(mode->htotal >> (2 - pixel_rep),
 				   VC5_HDMI_VERTB_VSPO) |
-		     VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end,
+		     VC4_SET_FIELD(mode->crtc_vtotal - mode->crtc_vsync_end +
+				   interlaced,
 				   VC4_HDMI_VERTB_VBP));
 	u32 vertb_even = (VC4_SET_FIELD(0, VC5_HDMI_VERTB_VSPO) |
 			  VC4_SET_FIELD(mode->crtc_vtotal -
-					mode->crtc_vsync_end - interlaced,
+					mode->crtc_vsync_end,
 					VC4_HDMI_VERTB_VBP));
 	unsigned long flags;
 	unsigned char gcp;

-- 
2.38.1

  parent reply	other threads:[~2022-12-07 11:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 11:53 [PATCH 00/15] drm/vc4: Misc fixes and improvements for the HVS and CRTCs Maxime Ripard
2022-12-07 11:53 ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 01/15] drm/vc4: hvs: Configure the HVS COB allocations Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 02/15] drm/vc4: hvs: Set AXI panic modes Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 03/15] drm/vc4: hvs: SCALER_DISPBKGND_AUTOHS is only valid on HVS4 Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 04/15] drm/vc4: hvs: Correct interrupt masking bit assignment for HVS5 Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 05/15] drm/vc4: hvs: Support zpos on all planes Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 06/15] drm/vc4: hvs: Fix colour order for xRGB1555 on HVS5 Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 07/15] drm/vc4: hvs: Add DRM 210101010 RGB formats Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 08/15] drm/vc4: hvs: Ignore atomic_flush if we're disabled Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2023-01-09 10:32   ` Dave Stevenson
2023-01-09 10:32     ` Dave Stevenson
2022-12-07 11:53 ` [PATCH 09/15] drm/vc4: plane: Allow using 0 as a pixel order value Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 10/15] drm/vc4: plane: Omit pixel_order from the hvs_format for hvs5 only formats Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 11/15] drm/vc4: plane: Add 3:3:2 and 4:4:4:4 RGB/RGBX/RGBA formats Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 12/15] drm/vc4: Add comments for which HVS_PIXEL_ORDER_xxx defines apply Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` [PATCH 13/15] drm/vc4: crtc: Fix timings for VEC modes Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2022-12-07 11:53 ` Maxime Ripard [this message]
2022-12-07 11:53   ` [PATCH 14/15] drm/vc4: hdmi: Correct interlaced timings again Maxime Ripard
2022-12-07 11:53 ` [PATCH 15/15] drm/vc4: vec: Support progressive modes Maxime Ripard
2022-12-07 11:53   ` Maxime Ripard
2023-01-09 14:53 ` [PATCH 00/15] drm/vc4: Misc fixes and improvements for the HVS and CRTCs Maxime Ripard
2023-01-09 14:53   ` Maxime Ripard

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-hvs-crtc-misc-v1-14-1f8e0770798b@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=eric@anholt.net \
    --cc=kfyatek+publicgit@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.