From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH 6/8] drm/i915/fbc: Align FBC segments to 512B on glk+
Date: Fri, 2 Jul 2021 23:46:01 +0300 [thread overview]
Message-ID: <20210702204603.596-7-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20210702204603.596-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Apply the same 512 byte FBC segment alignment to glk+ as we use
on skl+. The only real difference is that we now have a dedicated
register for the FBC override stride. Not 100% sure which
platforms really need the 512B alignment, but it's easieest
to just do it on everything.
Also the hardware no longer seems to misclaculate the CFB stride
for linear, so we can omit the use of the override stride for
linear unless the stride is misaligned.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_fbc.c | 14 +++++++++++---
drivers/gpu/drm/i915/i915_reg.h | 4 ++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 2baf58af016c..2da5295092e7 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -93,7 +93,7 @@ static unsigned int intel_fbc_cfb_stride(struct drm_i915_private *i915,
* be 512 byte aligned. Aligning each line to 512 bytes guarantees
* that regardless of the compression limit we choose later.
*/
- if (DISPLAY_VER(i915) == 9)
+ if (DISPLAY_VER(i915) >= 9)
return ALIGN(stride, 512);
else
return stride;
@@ -334,10 +334,18 @@ static void gen7_fbc_activate(struct drm_i915_private *dev_priv)
const struct intel_fbc_reg_params *params = &fbc->params;
u32 dpfc_ctl;
- /* Display WA #0529: skl, kbl, bxt. */
- if (DISPLAY_VER(dev_priv) == 9) {
+ if (DISPLAY_VER(dev_priv) >= 10) {
u32 val = 0;
+ if (params->override_cfb_stride)
+ val |= FBC_STRIDE_OVERRIDE |
+ FBC_STRIDE(params->override_cfb_stride / fbc->limit);
+
+ intel_de_write(dev_priv, GLK_FBC_STRIDE, val);
+ } else if (DISPLAY_VER(dev_priv) == 9) {
+ u32 val = 0;
+
+ /* Display WA #0529: skl, kbl, bxt. */
if (params->override_cfb_stride)
val |= CHICKEN_FBC_STRIDE_OVERRIDE |
CHICKEN_FBC_STRIDE(params->override_cfb_stride / fbc->limit);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index ab2bd4837efd..7cf318d84d81 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3334,6 +3334,10 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
#define ILK_DPFC_DISABLE_DUMMY0 (1 << 8)
#define ILK_DPFC_CHICKEN_COMP_DUMMY_PIXEL (1 << 14)
#define ILK_DPFC_NUKE_ON_ANY_MODIFICATION (1 << 23)
+#define GLK_FBC_STRIDE _MMIO(0x43228)
+#define FBC_STRIDE_OVERRIDE REG_BIT(15)
+#define FBC_STRIDE_MASK REG_GENMASK(14, 0)
+#define FBC_STRIDE(x) REG_FIELD_PREP(FBC_STRIDE_MASK, (x))
#define ILK_FBC_RT_BASE _MMIO(0x2128)
#define ILK_FBC_RT_VALID (1 << 0)
#define SNB_FBC_FRONT_BUFFER (1 << 1)
--
2.31.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-07-02 20:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 20:45 [Intel-gfx] [PATCH 0/8] drm/i915/fbc: Rework CFB stride/size calculations Ville Syrjala
2021-07-02 20:45 ` [Intel-gfx] [PATCH 1/8] drm/i915/fbc: Rewrite the FBC tiling check a bit Ville Syrjala
2021-07-02 20:45 ` [Intel-gfx] [PATCH 2/8] drm/i915/fbc: Extract intel_fbc_update() Ville Syrjala
2021-07-02 20:45 ` [Intel-gfx] [PATCH 3/8] drm/i915/fbc: Move the "recompress on activate" to a central place Ville Syrjala
2021-07-02 20:45 ` [Intel-gfx] [PATCH 4/8] drm/i915/fbc: Polish the skl+ FBC stride override handling Ville Syrjala
2021-07-05 8:02 ` Jani Nikula
2021-07-02 20:46 ` [Intel-gfx] [PATCH 5/8] drm/i915/fbc: Rework cfb stride/size calculations Ville Syrjala
2021-09-06 5:23 ` Shankar, Uma
2021-09-21 14:56 ` Ville Syrjälä
2021-09-22 18:09 ` Shankar, Uma
2021-07-02 20:46 ` Ville Syrjala [this message]
2021-08-19 10:50 ` [Intel-gfx] [PATCH 6/8] drm/i915/fbc: Align FBC segments to 512B on glk+ Juha-Pekka Heikkila
2021-07-02 20:46 ` [Intel-gfx] [PATCH 7/8] drm/i915/fbc: Implement Wa_16011863758 for icl+ Ville Syrjala
2021-08-19 10:52 ` Juha-Pekka Heikkila
2021-07-02 20:46 ` [Intel-gfx] [PATCH 8/8] drm/i915/fbc: Allow higher compression limits on FBC1 Ville Syrjala
2021-08-23 17:52 ` Juha-Pekka Heikkilä
2021-07-02 22:02 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/fbc: Rework CFB stride/size calculations Patchwork
2021-07-02 22:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-03 1:37 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-07-07 15:31 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/fbc: Rework CFB stride/size calculations (rev2) Patchwork
2021-07-07 15:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-07-07 20:05 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
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=20210702204603.596-7-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.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.