All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915/fbc: Move DPFC_CHICKEN programming into intel_fbc_program_workarounds()
Date: Fri, 26 Jan 2024 12:26:52 +0200	[thread overview]
Message-ID: <ZbOI7Na4nd6KRwor@intel.com> (raw)
In-Reply-To: <170601736631.12457.15576941633628295050@gjsousa-mobl2>

On Tue, Jan 23, 2024 at 10:42:46AM -0300, Gustavo Sousa wrote:
> Quoting Ville Syrjala (2024-01-23 06:00:51-03:00)
> >From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> >Move all DPFC_CHICKEN programming into intel_fbc_program_workarounds().
> >We already have one thing programmed there, whereas the rest is strewn
> >about in intel_display_wa_apply() and init_clock_gating(). Since we have
> >a single place doing all the programming (and it's serialized by the
> >crtc commits) there should be no danger of rmw races.
> >
> >Other FBC related workarounds also exist, but those require fiddling
> >with other registers that may also get programmed from other places,
> >so we'll need to think harder what to do with those.
> >
> >Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >---
> > .../gpu/drm/i915/display/intel_display_wa.c   |  8 -----
> > drivers/gpu/drm/i915/display/intel_fbc.c      | 32 ++++++++++++++++--
> > drivers/gpu/drm/i915/intel_clock_gating.c     | 33 -------------------
> > 3 files changed, 29 insertions(+), 44 deletions(-)
> >
> >diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.c b/drivers/gpu/drm/i915/display/intel_display_wa.c
> >index ac136fd992ba..e5a8022db664 100644
> >--- a/drivers/gpu/drm/i915/display/intel_display_wa.c
> >+++ b/drivers/gpu/drm/i915/display/intel_display_wa.c
> >@@ -10,20 +10,12 @@
> > 
> > static void gen11_display_wa_apply(struct drm_i915_private *i915)
> > {
> >-        /* Wa_1409120013 */
> >-        intel_de_write(i915, ILK_DPFC_CHICKEN(INTEL_FBC_A),
> >-                       DPFC_CHICKEN_COMP_DUMMY_PIXEL);
> >-
> >         /* Wa_14010594013 */
> >         intel_de_rmw(i915, GEN8_CHICKEN_DCPR_1, 0, ICL_DELAY_PMRSP);
> > }
> > 
> > static void xe_d_display_wa_apply(struct drm_i915_private *i915)
> > {
> >-        /* Wa_1409120013 */
> >-        intel_de_write(i915, ILK_DPFC_CHICKEN(INTEL_FBC_A),
> >-                       DPFC_CHICKEN_COMP_DUMMY_PIXEL);
> >-
> >         /* Wa_14013723622 */
> >         intel_de_rmw(i915, CLKREQ_POLICY, CLKREQ_POLICY_MEM_UP_OVRD, 0);
> > }
> >diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> >index f17a1afb4929..1a2d4d91a85f 100644
> >--- a/drivers/gpu/drm/i915/display/intel_fbc.c
> >+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> >@@ -826,10 +826,36 @@ static void intel_fbc_program_cfb(struct intel_fbc *fbc)
> > 
> > static void intel_fbc_program_workarounds(struct intel_fbc *fbc)
> > {
> >+        struct drm_i915_private *i915 = fbc->i915;
> >+
> >+        if (IS_SKYLAKE(i915) || IS_BROXTON(i915)) {
> >+                /*
> >+                 * WaFbcHighMemBwCorruptionAvoidance:skl,bxt
> >+                 * Display WA #0883: skl,bxt
> >+                 */
> >+                intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
> >+                             0, DPFC_DISABLE_DUMMY0);
> >+        }
> >+
> >+        if (IS_SKYLAKE(i915) || IS_KABYLAKE(i915) ||
> >+            IS_COFFEELAKE(i915) || IS_COMETLAKE(i915)) {
> >+                /*
> >+                 * WaFbcNukeOnHostModify:skl,kbl,cfl
> >+                 * Display WA #0873: skl,kbl,cfl
> >+                 */
> >+                intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
> >+                             0, DPFC_NUKE_ON_ANY_MODIFICATION);
> >+        }
> >+
> >+        /* Wa_1409120013:icl,jsl,tgl,dg1 */
> >+        if (IS_DISPLAY_VER(i915, 11, 12))
> >+                intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
> >+                             0, DPFC_CHICKEN_COMP_DUMMY_PIXEL);
> >+
> >         /* Wa_22014263786:icl,jsl,tgl,dg1,rkl,adls,adlp,mtl */
> >-        if (DISPLAY_VER(fbc->i915) >= 11 && !IS_DG2(fbc->i915))
> >-                intel_de_rmw(fbc->i915, ILK_DPFC_CHICKEN(fbc->id), 0,
> >-                             DPFC_CHICKEN_FORCE_SLB_INVALIDATION);
> >+        if (DISPLAY_VER(i915) >= 11 && !IS_DG2(i915))
> >+                intel_de_rmw(i915, ILK_DPFC_CHICKEN(fbc->id),
> >+                             0, DPFC_CHICKEN_FORCE_SLB_INVALIDATION);
> 
> Since we are writing to the same register, maybe we could have a single read,
> modify and write instead of multiple rmw calls?

Perhaps. Although we do at most do two rmws here on any given system.
So it's not particularly expensive to keep it simple like this.

I was also pondering about splitting this into vfuncs, which would
need multiple rmws anyway. But the whole thing is a bit of a mess
in terms of which platforms need what, so not sure it's make it
look any nicer.

> 
> --
> Gustavo Sousa
> 
> > }
> > 
> > static void __intel_fbc_cleanup_cfb(struct intel_fbc *fbc)
> >diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
> >index 9c21ce69bd98..39f23288e8a8 100644
> >--- a/drivers/gpu/drm/i915/intel_clock_gating.c
> >+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
> >@@ -105,12 +105,6 @@ static void bxt_init_clock_gating(struct drm_i915_private *i915)
> >          * Display WA #0562: bxt
> >          */
> >         intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
> >-
> >-        /*
> >-         * WaFbcHighMemBwCorruptionAvoidance:bxt
> >-         * Display WA #0883: bxt
> >-         */
> >-        intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A), 0, DPFC_DISABLE_DUMMY0);
> > }
> > 
> > static void glk_init_clock_gating(struct drm_i915_private *i915)
> >@@ -396,13 +390,6 @@ static void cfl_init_clock_gating(struct drm_i915_private *i915)
> >          * Display WA #0562: cfl
> >          */
> >         intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
> >-
> >-        /*
> >-         * WaFbcNukeOnHostModify:cfl
> >-         * Display WA #0873: cfl
> >-         */
> >-        intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A),
> >-                         0, DPFC_NUKE_ON_ANY_MODIFICATION);
> > }
> > 
> > static void kbl_init_clock_gating(struct drm_i915_private *i915)
> >@@ -427,13 +414,6 @@ static void kbl_init_clock_gating(struct drm_i915_private *i915)
> >          * Display WA #0562: kbl
> >          */
> >         intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
> >-
> >-        /*
> >-         * WaFbcNukeOnHostModify:kbl
> >-         * Display WA #0873: kbl
> >-         */
> >-        intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A),
> >-                         0, DPFC_NUKE_ON_ANY_MODIFICATION);
> > }
> > 
> > static void skl_init_clock_gating(struct drm_i915_private *i915)
> >@@ -452,19 +432,6 @@ static void skl_init_clock_gating(struct drm_i915_private *i915)
> >          * Display WA #0562: skl
> >          */
> >         intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
> >-
> >-        /*
> >-         * WaFbcNukeOnHostModify:skl
> >-         * Display WA #0873: skl
> >-         */
> >-        intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A),
> >-                         0, DPFC_NUKE_ON_ANY_MODIFICATION);
> >-
> >-        /*
> >-         * WaFbcHighMemBwCorruptionAvoidance:skl
> >-         * Display WA #0883: skl
> >-         */
> >-        intel_uncore_rmw(&i915->uncore, ILK_DPFC_CHICKEN(INTEL_FBC_A), 0, DPFC_DISABLE_DUMMY0);
> > }
> > 
> > static void bdw_init_clock_gating(struct drm_i915_private *i915)
> >-- 
> >2.43.0
> >

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-01-26 10:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23  9:00 [PATCH 1/2] drm/i915/fbc: Don't use a fence for a plane if FBC is not possible Ville Syrjala
2024-01-23  9:00 ` [PATCH 2/2] drm/i915/fbc: Move DPFC_CHICKEN programming into intel_fbc_program_workarounds() Ville Syrjala
2024-01-23 13:42   ` Gustavo Sousa
2024-01-26 10:26     ` Ville Syrjälä [this message]
2024-01-30 19:31       ` Gustavo Sousa
2024-01-23 13:27 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915/fbc: Don't use a fence for a plane if FBC is not possible Patchwork
2024-01-23 13:39 ` ✓ Fi.CI.BAT: success " Patchwork
2024-01-23 17:42 ` ✓ Fi.CI.IGT: " Patchwork
2024-02-13 17:32 ` [PATCH 1/2] " Govindapillai, Vinod

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=ZbOI7Na4nd6KRwor@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.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.