From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: "Lucas De Marchi" <lucas.demarchi@intel.com>,
"Juha-Pekka Heikkilä" <juha-pekka.heikkila@intel.com>
Subject: [Intel-gfx] [PATCH 07/11] drm/i915/xelpd: Support 128k plane stride
Date: Wed, 14 Apr 2021 18:52:04 +0300 [thread overview]
Message-ID: <20210414155208.3161335-8-imre.deak@intel.com> (raw)
In-Reply-To: <20210414155208.3161335-1-imre.deak@intel.com>
From: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
XE_LPD supports plane strides up to 128KB.
Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
Signed-off-by: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
.../drm/i915/display/skl_universal_plane.c | 46 +++++++++++++++----
drivers/gpu/drm/i915/i915_reg.h | 2 +
2 files changed, 39 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 349a53cef0a94..c5b9669d2aacf 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -481,17 +481,35 @@ skl_plane_max_stride(struct intel_plane *plane,
u32 pixel_format, u64 modifier,
unsigned int rotation)
{
+ struct drm_i915_private *i915 = to_i915(plane->base.dev);
const struct drm_format_info *info = drm_format_info(pixel_format);
int cpp = info->cpp[0];
+ int max_horizontal_pixels = 8192;
+ int max_stride_bytes;
+
+ if (DISPLAY_VER(i915) >= 13) {
+ /*
+ * The stride in bytes must not exceed of the size
+ * of 128K bytes. For pixel formats of 64bpp will allow
+ * for a 16K pixel surface.
+ */
+ max_stride_bytes = 131072;
+ if (cpp == 8)
+ max_horizontal_pixels = 16384;
+ else
+ max_horizontal_pixels = 65536;
+ } else {
+ /*
+ * "The stride in bytes must not exceed the
+ * of the size of 8K pixels and 32K bytes."
+ */
+ max_stride_bytes = 32768;
+ }
- /*
- * "The stride in bytes must not exceed the
- * of the size of 8K pixels and 32K bytes."
- */
if (drm_rotation_90_or_270(rotation))
- return min(8192, 32768 / cpp);
+ return min(max_horizontal_pixels, max_stride_bytes / cpp);
else
- return min(8192 * cpp, 32768);
+ return min(max_horizontal_pixels * cpp, max_stride_bytes);
}
@@ -1451,7 +1469,10 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
}
}
- drm_WARN_ON(&dev_priv->drm, x > 8191 || y > 8191);
+ if (DISPLAY_VER(dev_priv) >= 13)
+ drm_WARN_ON(&dev_priv->drm, x > 65535 || y > 65535);
+ else
+ drm_WARN_ON(&dev_priv->drm, x > 8191 || y > 8191);
plane_state->view.color_plane[0].offset = offset;
plane_state->view.color_plane[0].x = x;
@@ -1525,7 +1546,10 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
}
}
- drm_WARN_ON(&i915->drm, x > 8191 || y > 8191);
+ if (DISPLAY_VER(i915) >= 13)
+ drm_WARN_ON(&i915->drm, x > 65535 || y > 65535);
+ else
+ drm_WARN_ON(&i915->drm, x > 8191 || y > 8191);
plane_state->view.color_plane[uv_plane].offset = offset;
plane_state->view.color_plane[uv_plane].x = x;
@@ -2238,7 +2262,11 @@ skl_get_initial_plane_config(struct intel_crtc *crtc,
val = intel_de_read(dev_priv, PLANE_STRIDE(pipe, plane_id));
stride_mult = skl_plane_stride_mult(fb, 0, DRM_MODE_ROTATE_0);
- fb->pitches[0] = (val & 0x3ff) * stride_mult;
+
+ if (DISPLAY_VER(dev_priv) >= 13)
+ fb->pitches[0] = (val & PLANE_STRIDE_MASK_XELPD) * stride_mult;
+ else
+ fb->pitches[0] = (val & PLANE_STRIDE_MASK) * stride_mult;
aligned_height = intel_fb_align_height(fb, 0, fb->height);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index f80d656331f42..cdcb60b3fa063 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -7210,6 +7210,8 @@ enum {
_PIPE(pipe, _PLANE_STRIDE_3_A, _PLANE_STRIDE_3_B)
#define PLANE_STRIDE(pipe, plane) \
_MMIO_PLANE(plane, _PLANE_STRIDE_1(pipe), _PLANE_STRIDE_2(pipe))
+#define PLANE_STRIDE_MASK REG_GENMASK(10, 0)
+#define PLANE_STRIDE_MASK_XELPD REG_GENMASK(11, 0)
#define _PLANE_POS_1_B 0x7118c
#define _PLANE_POS_2_B 0x7128c
--
2.27.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2021-04-14 15:52 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 15:51 [Intel-gfx] [PATCH 00/11] drm/i915/adl_p: Add support for Display Page Tables Imre Deak
2021-04-14 15:51 ` [Intel-gfx] [PATCH 01/11] drm/i915: Pass intel_framebuffer instad of drm_framebuffer to intel_fill_fb_info() Imre Deak
2021-04-14 15:51 ` [Intel-gfx] [PATCH 02/11] drm/i915/xelpd: add XE_LPD display characteristics Imre Deak
2021-05-05 23:55 ` Souza, Jose
2021-04-14 15:52 ` [Intel-gfx] [PATCH 03/11] drm/i915/adl_p: Add PCI Devices IDs Imre Deak
2021-04-14 15:52 ` [Intel-gfx] [PATCH 04/11] drm/i915/adl_p: ADL_P device info enabling Imre Deak
2021-05-05 23:54 ` Souza, Jose
2021-04-14 15:52 ` [Intel-gfx] [PATCH 05/11] drm/i915/xelpd: First stab at DPT support Imre Deak
2021-04-14 15:52 ` [Intel-gfx] [PATCH 06/11] drm/i915/xelpd: Fallback to plane stride limitations when using DPT Imre Deak
2021-04-14 15:52 ` Imre Deak [this message]
2021-04-14 15:52 ` [Intel-gfx] [PATCH 08/11] drm/i915/adl_p: Add stride restriction " Imre Deak
2021-04-14 15:52 ` [Intel-gfx] [PATCH 09/11] drm/i915/adl_p: Disable support for 90/270 FB rotation Imre Deak
2021-04-14 15:52 ` [Intel-gfx] [PATCH 10/11] drm/i915/adl_p: Require a minimum of 8 tiles stride for DPT FBs Imre Deak
2021-04-15 22:12 ` Imre Deak
2021-05-06 11:11 ` Kahola, Mika
2021-04-14 15:52 ` [Intel-gfx] [PATCH 11/11] drm/i915/adl_p: Enable remapping to pad DPT FB strides to POT Imre Deak
2021-04-14 17:22 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/adl_p: Add support for Display Page Tables Patchwork
2021-04-14 17:50 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-04-14 20:32 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-04-15 11:29 ` [Intel-gfx] [PATCH 00/11] " Jani Nikula
2021-04-21 11:03 ` Jani Nikula
2021-04-21 11:24 ` Imre Deak
2021-04-21 12:12 ` Jani Nikula
2021-04-21 19:21 ` Imre Deak
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=20210414155208.3161335-8-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=juha-pekka.heikkila@intel.com \
--cc=lucas.demarchi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox