All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: "Mika Kahola" <mika.kahola@intel.com>,
	"Jouni Högander" <jouni.hogander@intel.com>
Subject: [PATCH 1/5] drm/i915/psr: Calculate PIPE_SRCSZ_ERLY_TPT value
Date: Tue, 19 Mar 2024 14:33:23 +0200	[thread overview]
Message-ID: <20240319123327.1661097-2-jouni.hogander@intel.com> (raw)
In-Reply-To: <20240319123327.1661097-1-jouni.hogander@intel.com>

When early transport is enabled we need to write PIPE_SRCSZ_ERLY_TPT on
every flip doing selective update. This patch calculates
PIPE_SRCSZ_ERLY_TPT same way as is done for PSR2_MAN_TRK_CTL value and
stores i in intel_crtc_state->pipe_srcsz_early_tpt to be written later
during flip.

Bspec: 68927

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 .../gpu/drm/i915/display/intel_display_types.h   |  2 ++
 drivers/gpu/drm/i915/display/intel_psr.c         | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 8b9860cefaae..ba573490fd87 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1423,6 +1423,8 @@ struct intel_crtc_state {
 
 	u32 psr2_man_track_ctl;
 
+	u32 pipe_srcsz_early_tpt;
+
 	struct drm_rect psr2_su_area;
 
 	/* Variable Refresh Rate state */
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 747761efa4be..cbf9495c7072 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2075,6 +2075,20 @@ static void psr2_man_trk_ctl_calc(struct intel_crtc_state *crtc_state,
 	crtc_state->psr2_man_track_ctl = val;
 }
 
+static u32 psr2_pipe_srcsz_early_tpt_calc(struct intel_crtc_state *crtc_state,
+					  bool full_update)
+{
+	int width, height;
+
+	if (!crtc_state->enable_psr2_su_region_et || full_update)
+		return 0;
+
+	width = drm_rect_width(&crtc_state->psr2_su_area);
+	height = drm_rect_height(&crtc_state->psr2_su_area);
+
+	return PIPESRC_WIDTH(width - 1) | PIPESRC_HEIGHT(height - 1);
+}
+
 static void clip_area_update(struct drm_rect *overlap_damage_area,
 			     struct drm_rect *damage_area,
 			     struct drm_rect *pipe_src)
@@ -2362,6 +2376,8 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
 
 skip_sel_fetch_set_loop:
 	psr2_man_trk_ctl_calc(crtc_state, full_update);
+	crtc_state->pipe_srcsz_early_tpt =
+		psr2_pipe_srcsz_early_tpt_calc(crtc_state, full_update);
 	return 0;
 }
 
-- 
2.34.1


  reply	other threads:[~2024-03-19 12:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19 12:33 [PATCH 0/5] Wa_16021440873 and early transport fixes Jouni Högander
2024-03-19 12:33 ` Jouni Högander [this message]
2024-03-27 13:05   ` [PATCH 1/5] drm/i915/psr: Calculate PIPE_SRCSZ_ERLY_TPT value Kahola, Mika
2024-03-19 12:33 ` [PATCH 2/5] drm/i915/psr: Move writing early transport pipe src Jouni Högander
2024-03-27 13:06   ` Kahola, Mika
2024-03-19 12:33 ` [PATCH 3/5] drm/i915/display/intel_psr: Fix intel_psr2_sel_fetch_et_alignment usage Jouni Högander
2024-03-28  9:25   ` Kahola, Mika
2024-03-19 12:33 ` [PATCH 4/5] drm/i915/display: Add definition for MCURSOR_MODE_64_2B Jouni Högander
2024-03-28  9:29   ` Kahola, Mika
2024-03-19 12:33 ` [PATCH 5/5] drm/i915/display: Implement Wa_16021440873 Jouni Högander
2024-03-28 12:57   ` Kahola, Mika
2024-03-28 13:19     ` Hogander, Jouni
2024-03-19 21:40 ` ✗ Fi.CI.SPARSE: warning for Wa_16021440873 and early transport fixes Patchwork
2024-03-19 21:58 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-03-20  8:03 ` ✗ Fi.CI.SPARSE: warning for Wa_16021440873 and early transport fixes (rev2) Patchwork
2024-03-20  8:16 ` ✓ Fi.CI.BAT: success " Patchwork
2024-03-20 18:39 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-28 13:01   ` Hogander, Jouni

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=20240319123327.1661097-2-jouni.hogander@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kahola@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 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.