* [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
@ 2020-09-24 18:51 Ville Syrjala
2020-09-24 23:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ville Syrjala @ 2020-09-24 18:51 UTC (permalink / raw)
To: intel-gfx
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reduce this maintenance nightmare a bit by converting the plane
min/max width/height stuff into vfuncs.
Now, if I could just think of a nice way to also use this for
intel_mode_valid_max_plane_size()...
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_display.c | 194 +++++-------------
.../drm/i915/display/intel_display_types.h | 9 +
drivers/gpu/drm/i915/display/intel_sprite.c | 140 +++++++++++++
3 files changed, 196 insertions(+), 147 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 5a9d933e425a..a823d406f0ee 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -3696,127 +3696,6 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
&to_intel_frontbuffer(fb)->bits);
}
-static int skl_max_plane_width(const struct drm_framebuffer *fb,
- int color_plane,
- unsigned int rotation)
-{
- int cpp = fb->format->cpp[color_plane];
-
- switch (fb->modifier) {
- case DRM_FORMAT_MOD_LINEAR:
- case I915_FORMAT_MOD_X_TILED:
- /*
- * Validated limit is 4k, but has 5k should
- * work apart from the following features:
- * - Ytile (already limited to 4k)
- * - FP16 (already limited to 4k)
- * - render compression (already limited to 4k)
- * - KVMR sprite and cursor (don't care)
- * - horizontal panning (TODO verify this)
- * - pipe and plane scaling (TODO verify this)
- */
- if (cpp == 8)
- return 4096;
- else
- return 5120;
- case I915_FORMAT_MOD_Y_TILED_CCS:
- case I915_FORMAT_MOD_Yf_TILED_CCS:
- case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
- /* FIXME AUX plane? */
- case I915_FORMAT_MOD_Y_TILED:
- case I915_FORMAT_MOD_Yf_TILED:
- if (cpp == 8)
- return 2048;
- else
- return 4096;
- default:
- MISSING_CASE(fb->modifier);
- return 2048;
- }
-}
-
-static int glk_max_plane_width(const struct drm_framebuffer *fb,
- int color_plane,
- unsigned int rotation)
-{
- int cpp = fb->format->cpp[color_plane];
-
- switch (fb->modifier) {
- case DRM_FORMAT_MOD_LINEAR:
- case I915_FORMAT_MOD_X_TILED:
- if (cpp == 8)
- return 4096;
- else
- return 5120;
- case I915_FORMAT_MOD_Y_TILED_CCS:
- case I915_FORMAT_MOD_Yf_TILED_CCS:
- /* FIXME AUX plane? */
- case I915_FORMAT_MOD_Y_TILED:
- case I915_FORMAT_MOD_Yf_TILED:
- if (cpp == 8)
- return 2048;
- else
- return 5120;
- default:
- MISSING_CASE(fb->modifier);
- return 2048;
- }
-}
-
-static int icl_min_plane_width(const struct drm_framebuffer *fb)
-{
- /* Wa_14011264657, Wa_14011050563: gen11+ */
- switch (fb->format->format) {
- case DRM_FORMAT_C8:
- return 18;
- case DRM_FORMAT_RGB565:
- return 10;
- case DRM_FORMAT_XRGB8888:
- case DRM_FORMAT_XBGR8888:
- case DRM_FORMAT_ARGB8888:
- case DRM_FORMAT_ABGR8888:
- case DRM_FORMAT_XRGB2101010:
- case DRM_FORMAT_XBGR2101010:
- case DRM_FORMAT_ARGB2101010:
- case DRM_FORMAT_ABGR2101010:
- case DRM_FORMAT_XVYU2101010:
- case DRM_FORMAT_Y212:
- case DRM_FORMAT_Y216:
- return 6;
- case DRM_FORMAT_NV12:
- return 20;
- case DRM_FORMAT_P010:
- case DRM_FORMAT_P012:
- case DRM_FORMAT_P016:
- return 12;
- case DRM_FORMAT_XRGB16161616F:
- case DRM_FORMAT_XBGR16161616F:
- case DRM_FORMAT_ARGB16161616F:
- case DRM_FORMAT_ABGR16161616F:
- case DRM_FORMAT_XVYU12_16161616:
- case DRM_FORMAT_XVYU16161616:
- return 4;
- default:
- return 1;
- }
-}
-
-static int icl_max_plane_width(const struct drm_framebuffer *fb,
- int color_plane,
- unsigned int rotation)
-{
- return 5120;
-}
-
-static int skl_max_plane_height(void)
-{
- return 4096;
-}
-
-static int icl_max_plane_height(void)
-{
- return 4320;
-}
static bool
skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
@@ -3874,35 +3753,55 @@ intel_plane_fence_y_offset(const struct intel_plane_state *plane_state)
return y;
}
+static int intel_plane_min_width(struct intel_plane *plane,
+ const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ if (plane->min_width)
+ return plane->min_width(fb, color_plane, rotation);
+ else
+ return 1;
+}
+
+static int intel_plane_max_width(struct intel_plane *plane,
+ const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ if (plane->max_width)
+ return plane->max_width(fb, color_plane, rotation);
+ else
+ return INT_MAX;
+}
+
+static int intel_plane_max_height(struct intel_plane *plane,
+ const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ if (plane->max_height)
+ return plane->max_height(fb, color_plane, rotation);
+ else
+ return INT_MAX;
+}
+
static int skl_check_main_surface(struct intel_plane_state *plane_state)
{
- struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev);
+ struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
+ struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
const struct drm_framebuffer *fb = plane_state->hw.fb;
unsigned int rotation = plane_state->hw.rotation;
int x = plane_state->uapi.src.x1 >> 16;
int y = plane_state->uapi.src.y1 >> 16;
int w = drm_rect_width(&plane_state->uapi.src) >> 16;
int h = drm_rect_height(&plane_state->uapi.src) >> 16;
- int max_width, min_width, max_height;
- u32 alignment, offset;
+ int min_width = intel_plane_min_width(plane, fb, 0, rotation);
+ int max_width = intel_plane_max_width(plane, fb, 0, rotation);
+ int max_height = intel_plane_max_height(plane, fb, 0, rotation);
int aux_plane = intel_main_to_aux_plane(fb, 0);
u32 aux_offset = plane_state->color_plane[aux_plane].offset;
-
- if (INTEL_GEN(dev_priv) >= 11) {
- max_width = icl_max_plane_width(fb, 0, rotation);
- min_width = icl_min_plane_width(fb);
- } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
- max_width = glk_max_plane_width(fb, 0, rotation);
- min_width = 1;
- } else {
- max_width = skl_max_plane_width(fb, 0, rotation);
- min_width = 1;
- }
-
- if (INTEL_GEN(dev_priv) >= 11)
- max_height = icl_max_plane_height();
- else
- max_height = skl_max_plane_height();
+ u32 alignment, offset;
if (w > max_width || w < min_width || h > max_height) {
drm_dbg_kms(&dev_priv->drm,
@@ -3985,22 +3884,19 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
{
- struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
+ struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
+ struct drm_i915_private *i915 = to_i915(plane->base.dev);
const struct drm_framebuffer *fb = plane_state->hw.fb;
unsigned int rotation = plane_state->hw.rotation;
int uv_plane = 1;
- int max_width = skl_max_plane_width(fb, uv_plane, rotation);
- int max_height = 4096;
+ int max_width = intel_plane_max_width(plane, fb, uv_plane, rotation);
+ int max_height = intel_plane_max_height(plane, fb, uv_plane, rotation);
int x = plane_state->uapi.src.x1 >> 17;
int y = plane_state->uapi.src.y1 >> 17;
int w = drm_rect_width(&plane_state->uapi.src) >> 17;
int h = drm_rect_height(&plane_state->uapi.src) >> 17;
u32 offset;
- intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
- offset = intel_plane_compute_aligned_offset(&x, &y,
- plane_state, uv_plane);
-
/* FIXME not quite sure how/if these apply to the chroma plane */
if (w > max_width || h > max_height) {
drm_dbg_kms(&i915->drm,
@@ -4009,6 +3905,10 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
return -EINVAL;
}
+ intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
+ offset = intel_plane_compute_aligned_offset(&x, &y,
+ plane_state, uv_plane);
+
if (is_ccs_modifier(fb->modifier)) {
int ccs_plane = main_to_ccs_plane(fb, uv_plane);
int aux_offset = plane_state->color_plane[ccs_plane].offset;
diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 3d4bf9b6a0a2..a16120508318 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1170,6 +1170,15 @@ struct intel_plane {
* the intel_plane_state structure and accessed via plane_state.
*/
+ int (*min_width)(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation);
+ int (*max_width)(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation);
+ int (*max_height)(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation);
unsigned int (*max_stride)(struct intel_plane *plane,
u32 pixel_format, u64 modifier,
unsigned int rotation);
diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
index 63040cb0d4e1..d682ab1c0f70 100644
--- a/drivers/gpu/drm/i915/display/intel_sprite.c
+++ b/drivers/gpu/drm/i915/display/intel_sprite.c
@@ -393,6 +393,134 @@ static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
return DIV_ROUND_UP(pixel_rate * num, den);
}
+static int skl_plane_max_width(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ int cpp = fb->format->cpp[color_plane];
+
+ switch (fb->modifier) {
+ case DRM_FORMAT_MOD_LINEAR:
+ case I915_FORMAT_MOD_X_TILED:
+ /*
+ * Validated limit is 4k, but has 5k should
+ * work apart from the following features:
+ * - Ytile (already limited to 4k)
+ * - FP16 (already limited to 4k)
+ * - render compression (already limited to 4k)
+ * - KVMR sprite and cursor (don't care)
+ * - horizontal panning (TODO verify this)
+ * - pipe and plane scaling (TODO verify this)
+ */
+ if (cpp == 8)
+ return 4096;
+ else
+ return 5120;
+ case I915_FORMAT_MOD_Y_TILED_CCS:
+ case I915_FORMAT_MOD_Yf_TILED_CCS:
+ case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
+ /* FIXME AUX plane? */
+ case I915_FORMAT_MOD_Y_TILED:
+ case I915_FORMAT_MOD_Yf_TILED:
+ if (cpp == 8)
+ return 2048;
+ else
+ return 4096;
+ default:
+ MISSING_CASE(fb->modifier);
+ return 2048;
+ }
+}
+
+static int glk_plane_max_width(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ int cpp = fb->format->cpp[color_plane];
+
+ switch (fb->modifier) {
+ case DRM_FORMAT_MOD_LINEAR:
+ case I915_FORMAT_MOD_X_TILED:
+ if (cpp == 8)
+ return 4096;
+ else
+ return 5120;
+ case I915_FORMAT_MOD_Y_TILED_CCS:
+ case I915_FORMAT_MOD_Yf_TILED_CCS:
+ /* FIXME AUX plane? */
+ case I915_FORMAT_MOD_Y_TILED:
+ case I915_FORMAT_MOD_Yf_TILED:
+ if (cpp == 8)
+ return 2048;
+ else
+ return 5120;
+ default:
+ MISSING_CASE(fb->modifier);
+ return 2048;
+ }
+}
+
+static int icl_plane_min_width(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ /* Wa_14011264657, Wa_14011050563: gen11+ */
+ switch (fb->format->format) {
+ case DRM_FORMAT_C8:
+ return 18;
+ case DRM_FORMAT_RGB565:
+ return 10;
+ case DRM_FORMAT_XRGB8888:
+ case DRM_FORMAT_XBGR8888:
+ case DRM_FORMAT_ARGB8888:
+ case DRM_FORMAT_ABGR8888:
+ case DRM_FORMAT_XRGB2101010:
+ case DRM_FORMAT_XBGR2101010:
+ case DRM_FORMAT_ARGB2101010:
+ case DRM_FORMAT_ABGR2101010:
+ case DRM_FORMAT_XVYU2101010:
+ case DRM_FORMAT_Y212:
+ case DRM_FORMAT_Y216:
+ return 6;
+ case DRM_FORMAT_NV12:
+ return 20;
+ case DRM_FORMAT_P010:
+ case DRM_FORMAT_P012:
+ case DRM_FORMAT_P016:
+ return 12;
+ case DRM_FORMAT_XRGB16161616F:
+ case DRM_FORMAT_XBGR16161616F:
+ case DRM_FORMAT_ARGB16161616F:
+ case DRM_FORMAT_ABGR16161616F:
+ case DRM_FORMAT_XVYU12_16161616:
+ case DRM_FORMAT_XVYU16161616:
+ return 4;
+ default:
+ return 1;
+ }
+}
+
+static int icl_plane_max_width(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ return 5120;
+}
+
+static int skl_plane_max_height(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ return 4096;
+}
+
+static int icl_plane_max_height(const struct drm_framebuffer *fb,
+ int color_plane,
+ unsigned int rotation)
+{
+ return 4320;
+}
+
static unsigned int
skl_plane_max_stride(struct intel_plane *plane,
u32 pixel_format, u64 modifier,
@@ -3083,6 +3211,18 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
}
+ if (INTEL_GEN(dev_priv) >= 11) {
+ plane->min_width = icl_plane_min_width;
+ plane->max_width = icl_plane_max_width;
+ plane->max_height = icl_plane_max_height;
+ } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
+ plane->max_width = glk_plane_max_width;
+ plane->max_height = skl_plane_max_height;
+ } else {
+ plane->max_width = skl_plane_max_width;
+ plane->max_height = skl_plane_max_height;
+ }
+
plane->max_stride = skl_plane_max_stride;
plane->update_plane = skl_update_plane;
plane->disable_plane = skl_disable_plane;
--
2.26.2
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
2020-09-24 18:51 [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs Ville Syrjala
@ 2020-09-24 23:00 ` Patchwork
2020-09-25 4:02 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-10-16 23:40 ` [Intel-gfx] [PATCH] " Aditya Swarup
2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2020-09-24 23:00 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 7901 bytes --]
== Series Details ==
Series: drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
URL : https://patchwork.freedesktop.org/series/82071/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9053 -> Patchwork_18568
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/index.html
Known issues
------------
Here are the changes found in Patchwork_18568 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: [PASS][1] -> [DMESG-WARN][2] ([i915#1982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-bsw-kefka/igt@i915_pm_rpm@basic-pci-d3-state.html
* igt@i915_selftest@live@execlists:
- fi-tgl-y: [PASS][3] -> [INCOMPLETE][4] ([i915#2089] / [i915#2268])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-tgl-y/igt@i915_selftest@live@execlists.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-tgl-y/igt@i915_selftest@live@execlists.html
* igt@kms_busy@basic@flip:
- fi-kbl-x1275: [PASS][5] -> [DMESG-WARN][6] ([i915#62] / [i915#92] / [i915#95])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-kbl-x1275/igt@kms_busy@basic@flip.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-kbl-x1275/igt@kms_busy@basic@flip.html
* igt@kms_frontbuffer_tracking@basic:
- fi-tgl-y: [PASS][7] -> [DMESG-WARN][8] ([i915#1982])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-tgl-y/igt@kms_frontbuffer_tracking@basic.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-tgl-y/igt@kms_frontbuffer_tracking@basic.html
* igt@vgem_basic@setversion:
- fi-tgl-y: [PASS][9] -> [DMESG-WARN][10] ([i915#402])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-tgl-y/igt@vgem_basic@setversion.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-tgl-y/igt@vgem_basic@setversion.html
* igt@vgem_basic@unload:
- fi-skl-guc: [PASS][11] -> [DMESG-WARN][12] ([i915#2203])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-skl-guc/igt@vgem_basic@unload.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-skl-guc/igt@vgem_basic@unload.html
#### Possible fixes ####
* igt@i915_module_load@reload:
- {fi-ehl-1}: [DMESG-WARN][13] ([i915#1982]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-ehl-1/igt@i915_module_load@reload.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-ehl-1/igt@i915_module_load@reload.html
- fi-tgl-y: [DMESG-WARN][15] ([i915#1982] / [k.org#205379]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-tgl-y/igt@i915_module_load@reload.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-tgl-y/igt@i915_module_load@reload.html
* igt@kms_busy@basic@flip:
- {fi-tgl-dsi}: [DMESG-WARN][17] ([i915#1982]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-tgl-dsi/igt@kms_busy@basic@flip.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-tgl-dsi/igt@kms_busy@basic@flip.html
- fi-tgl-y: [DMESG-WARN][19] ([i915#1982]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-tgl-y/igt@kms_busy@basic@flip.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-tgl-y/igt@kms_busy@basic@flip.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy:
- fi-icl-u2: [DMESG-WARN][21] ([i915#1982]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-icl-u2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-icl-u2/igt@kms_cursor_legacy@basic-busy-flip-before-cursor-legacy.html
* igt@prime_self_import@basic-with_two_bos:
- fi-tgl-y: [DMESG-WARN][23] ([i915#402]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-tgl-y/igt@prime_self_import@basic-with_two_bos.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-tgl-y/igt@prime_self_import@basic-with_two_bos.html
#### Warnings ####
* igt@gem_exec_suspend@basic-s3:
- fi-kbl-x1275: [DMESG-WARN][25] ([i915#62] / [i915#92]) -> [DMESG-WARN][26] ([i915#1982] / [i915#62] / [i915#92] / [i915#95])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-kbl-x1275/igt@gem_exec_suspend@basic-s3.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-kbl-x1275/igt@gem_exec_suspend@basic-s3.html
* igt@i915_pm_rpm@module-reload:
- fi-kbl-guc: [SKIP][27] ([fdo#109271]) -> [DMESG-WARN][28] ([i915#2203])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-kbl-guc/igt@i915_pm_rpm@module-reload.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-kbl-guc/igt@i915_pm_rpm@module-reload.html
* igt@kms_force_connector_basic@prune-stale-modes:
- fi-kbl-x1275: [DMESG-WARN][29] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][30] ([i915#62] / [i915#92]) +3 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-kbl-x1275/igt@kms_force_connector_basic@prune-stale-modes.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-kbl-x1275/igt@kms_force_connector_basic@prune-stale-modes.html
* igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c:
- fi-kbl-x1275: [DMESG-WARN][31] ([i915#62] / [i915#92]) -> [DMESG-WARN][32] ([i915#62] / [i915#92] / [i915#95]) +2 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/fi-kbl-x1275/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/fi-kbl-x1275/igt@kms_pipe_crc_basic@compare-crc-sanitycheck-pipe-c.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2089]: https://gitlab.freedesktop.org/drm/intel/issues/2089
[i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
[i915#2268]: https://gitlab.freedesktop.org/drm/intel/issues/2268
[i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
[k.org#205379]: https://bugzilla.kernel.org/show_bug.cgi?id=205379
Participating hosts (46 -> 40)
------------------------------
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_9053 -> Patchwork_18568
CI-20190529: 20190529
CI_DRM_9053: 1cf86dfa098540e161420c4e6814d5629c8eceb4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5787: 0ec962017c8131de14e0cb038f7f76b1f17ed637 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18568: 8027f06f88a3c2ebd341ee82e9cbb34ccd6a9863 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
8027f06f88a3 drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/index.html
[-- Attachment #1.2: Type: text/html, Size: 10383 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
2020-09-24 18:51 [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs Ville Syrjala
2020-09-24 23:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
@ 2020-09-25 4:02 ` Patchwork
2020-10-16 23:40 ` [Intel-gfx] [PATCH] " Aditya Swarup
2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2020-09-25 4:02 UTC (permalink / raw)
To: Ville Syrjala; +Cc: intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 13228 bytes --]
== Series Details ==
Series: drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
URL : https://patchwork.freedesktop.org/series/82071/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_9053_full -> Patchwork_18568_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_18568_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@feature_discovery@psr2:
- shard-iclb: [PASS][1] -> [SKIP][2] ([i915#658])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-iclb2/igt@feature_discovery@psr2.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-iclb3/igt@feature_discovery@psr2.html
* igt@gem_ctx_isolation@preservation-s3@vcs0:
- shard-skl: [PASS][3] -> [INCOMPLETE][4] ([i915#198])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl7/igt@gem_ctx_isolation@preservation-s3@vcs0.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl9/igt@gem_ctx_isolation@preservation-s3@vcs0.html
* igt@gem_huc_copy@huc-copy:
- shard-tglb: [PASS][5] -> [SKIP][6] ([i915#2190])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-tglb3/igt@gem_huc_copy@huc-copy.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-tglb6/igt@gem_huc_copy@huc-copy.html
* igt@i915_module_load@reload:
- shard-skl: [PASS][7] -> [DMESG-WARN][8] ([i915#1982]) +6 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl4/igt@i915_module_load@reload.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl5/igt@i915_module_load@reload.html
* igt@i915_selftest@mock@contexts:
- shard-apl: [PASS][9] -> [INCOMPLETE][10] ([i915#1635] / [i915#2278])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-apl8/igt@i915_selftest@mock@contexts.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-apl6/igt@i915_selftest@mock@contexts.html
* igt@kms_flip@flip-vs-expired-vblank@b-edp1:
- shard-skl: [PASS][11] -> [FAIL][12] ([i915#79])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl4/igt@kms_flip@flip-vs-expired-vblank@b-edp1.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl5/igt@kms_flip@flip-vs-expired-vblank@b-edp1.html
* igt@kms_flip@flip-vs-suspend-interruptible@a-dp1:
- shard-kbl: [PASS][13] -> [DMESG-WARN][14] ([i915#180]) +3 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-kbl6/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-kbl6/igt@kms_flip@flip-vs-suspend-interruptible@a-dp1.html
* igt@kms_flip@plain-flip-fb-recreate-interruptible@a-edp1:
- shard-skl: [PASS][15] -> [FAIL][16] ([i915#2122])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl7/igt@kms_flip@plain-flip-fb-recreate-interruptible@a-edp1.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl1/igt@kms_flip@plain-flip-fb-recreate-interruptible@a-edp1.html
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [PASS][17] -> [FAIL][18] ([fdo#108145] / [i915#265])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl9/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
* igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping:
- shard-iclb: [PASS][19] -> [DMESG-WARN][20] ([i915#1982])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-iclb5/igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-iclb3/igt@kms_plane_scaling@pipe-b-scaler-with-clipping-clamping.html
* igt@kms_psr@psr2_suspend:
- shard-iclb: [PASS][21] -> [SKIP][22] ([fdo#109441]) +2 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-iclb2/igt@kms_psr@psr2_suspend.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-iclb4/igt@kms_psr@psr2_suspend.html
* igt@kms_setmode@basic:
- shard-skl: [PASS][23] -> [FAIL][24] ([i915#31])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl8/igt@kms_setmode@basic.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl10/igt@kms_setmode@basic.html
* igt@kms_vblank@pipe-d-wait-idle:
- shard-tglb: [PASS][25] -> [DMESG-WARN][26] ([i915#1982]) +1 similar issue
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-tglb3/igt@kms_vblank@pipe-d-wait-idle.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-tglb6/igt@kms_vblank@pipe-d-wait-idle.html
* igt@prime_vgem@sync@bcs0:
- shard-tglb: [PASS][27] -> [INCOMPLETE][28] ([i915#409])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-tglb8/igt@prime_vgem@sync@bcs0.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-tglb2/igt@prime_vgem@sync@bcs0.html
#### Possible fixes ####
* igt@gem_ctx_persistence@engines-mixed-process@rcs0:
- shard-glk: [FAIL][29] ([i915#2374]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-glk7/igt@gem_ctx_persistence@engines-mixed-process@rcs0.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-glk6/igt@gem_ctx_persistence@engines-mixed-process@rcs0.html
* igt@gem_exec_reloc@basic-many-active@rcs0:
- shard-glk: [FAIL][31] ([i915#2389]) -> [PASS][32] +3 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-glk6/igt@gem_exec_reloc@basic-many-active@rcs0.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-glk7/igt@gem_exec_reloc@basic-many-active@rcs0.html
* igt@gem_exec_whisper@basic-fds-forked-all:
- shard-glk: [DMESG-WARN][33] ([i915#118] / [i915#95]) -> [PASS][34] +1 similar issue
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-glk7/igt@gem_exec_whisper@basic-fds-forked-all.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-glk1/igt@gem_exec_whisper@basic-fds-forked-all.html
* igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy:
- shard-glk: [FAIL][35] ([i915#72]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-glk2/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-glk3/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-legacy.html
* igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled:
- shard-skl: [FAIL][37] ([i915#177] / [i915#52] / [i915#54]) -> [PASS][38]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl7/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl1/igt@kms_draw_crc@draw-method-rgb565-pwrite-untiled.html
* igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1:
- shard-skl: [FAIL][39] ([i915#79]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl5/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl3/igt@kms_flip@flip-vs-expired-vblank-interruptible@b-edp1.html
* igt@kms_frontbuffer_tracking@fbcpsr-1p-rte:
- shard-tglb: [DMESG-WARN][41] ([i915#1982]) -> [PASS][42] +2 similar issues
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-tglb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-rte.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-tglb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-rte.html
* igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu:
- shard-skl: [FAIL][43] ([i915#49]) -> [PASS][44]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl10/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl1/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-indfb-draw-mmap-cpu.html
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-shrfb-msflip-blt:
- shard-skl: [DMESG-WARN][45] ([i915#1982]) -> [PASS][46] +1 similar issue
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl10/igt@kms_frontbuffer_tracking@psr-1p-primscrn-shrfb-msflip-blt.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl1/igt@kms_frontbuffer_tracking@psr-1p-primscrn-shrfb-msflip-blt.html
* igt@kms_hdr@bpc-switch:
- shard-skl: [FAIL][47] ([i915#1188]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl8/igt@kms_hdr@bpc-switch.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl4/igt@kms_hdr@bpc-switch.html
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: [FAIL][49] ([fdo#108145] / [i915#265]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl10/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl1/igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min.html
* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [SKIP][51] ([fdo#109441]) -> [PASS][52] +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-iclb7/igt@kms_psr@psr2_primary_page_flip.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
#### Warnings ####
* igt@i915_pm_dc@dc3co-vpb-simulation:
- shard-iclb: [SKIP][53] ([i915#588]) -> [SKIP][54] ([i915#658])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-iclb2/igt@i915_pm_dc@dc3co-vpb-simulation.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-iclb5/igt@i915_pm_dc@dc3co-vpb-simulation.html
* igt@kms_fbcon_fbt@psr-suspend:
- shard-skl: [INCOMPLETE][55] ([i915#198]) -> [DMESG-WARN][56] ([i915#1982])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_9053/shard-skl1/igt@kms_fbcon_fbt@psr-suspend.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/shard-skl3/igt@kms_fbcon_fbt@psr-suspend.html
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
[i915#177]: https://gitlab.freedesktop.org/drm/intel/issues/177
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#198]: https://gitlab.freedesktop.org/drm/intel/issues/198
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2122]: https://gitlab.freedesktop.org/drm/intel/issues/2122
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2278]: https://gitlab.freedesktop.org/drm/intel/issues/2278
[i915#2374]: https://gitlab.freedesktop.org/drm/intel/issues/2374
[i915#2389]: https://gitlab.freedesktop.org/drm/intel/issues/2389
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#409]: https://gitlab.freedesktop.org/drm/intel/issues/409
[i915#49]: https://gitlab.freedesktop.org/drm/intel/issues/49
[i915#52]: https://gitlab.freedesktop.org/drm/intel/issues/52
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#588]: https://gitlab.freedesktop.org/drm/intel/issues/588
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (10 -> 10)
------------------------------
No changes in participating hosts
Build changes
-------------
* Linux: CI_DRM_9053 -> Patchwork_18568
CI-20190529: 20190529
CI_DRM_9053: 1cf86dfa098540e161420c4e6814d5629c8eceb4 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5787: 0ec962017c8131de14e0cb038f7f76b1f17ed637 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_18568: 8027f06f88a3c2ebd341ee82e9cbb34ccd6a9863 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18568/index.html
[-- Attachment #1.2: Type: text/html, Size: 15254 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
2020-09-24 18:51 [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs Ville Syrjala
2020-09-24 23:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-09-25 4:02 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
@ 2020-10-16 23:40 ` Aditya Swarup
2020-10-23 0:17 ` Aditya Swarup
2 siblings, 1 reply; 7+ messages in thread
From: Aditya Swarup @ 2020-10-16 23:40 UTC (permalink / raw)
To: Ville Syrjala, intel-gfx
On 9/24/20 11:51 AM, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Reduce this maintenance nightmare a bit by converting the plane
> min/max width/height stuff into vfuncs.
>
> Now, if I could just think of a nice way to also use this for
> intel_mode_valid_max_plane_size()...
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
LGTM..
Reviewed-by: Aditya Swarup <aditya.swarup@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 194 +++++-------------
> .../drm/i915/display/intel_display_types.h | 9 +
> drivers/gpu/drm/i915/display/intel_sprite.c | 140 +++++++++++++
> 3 files changed, 196 insertions(+), 147 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 5a9d933e425a..a823d406f0ee 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -3696,127 +3696,6 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> &to_intel_frontbuffer(fb)->bits);
> }
>
> -static int skl_max_plane_width(const struct drm_framebuffer *fb,
> - int color_plane,
> - unsigned int rotation)
> -{
> - int cpp = fb->format->cpp[color_plane];
> -
> - switch (fb->modifier) {
> - case DRM_FORMAT_MOD_LINEAR:
> - case I915_FORMAT_MOD_X_TILED:
> - /*
> - * Validated limit is 4k, but has 5k should
> - * work apart from the following features:
> - * - Ytile (already limited to 4k)
> - * - FP16 (already limited to 4k)
> - * - render compression (already limited to 4k)
> - * - KVMR sprite and cursor (don't care)
> - * - horizontal panning (TODO verify this)
> - * - pipe and plane scaling (TODO verify this)
> - */
> - if (cpp == 8)
> - return 4096;
> - else
> - return 5120;
> - case I915_FORMAT_MOD_Y_TILED_CCS:
> - case I915_FORMAT_MOD_Yf_TILED_CCS:
> - case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
> - /* FIXME AUX plane? */
> - case I915_FORMAT_MOD_Y_TILED:
> - case I915_FORMAT_MOD_Yf_TILED:
> - if (cpp == 8)
> - return 2048;
> - else
> - return 4096;
> - default:
> - MISSING_CASE(fb->modifier);
> - return 2048;
> - }
> -}
> -
> -static int glk_max_plane_width(const struct drm_framebuffer *fb,
> - int color_plane,
> - unsigned int rotation)
> -{
> - int cpp = fb->format->cpp[color_plane];
> -
> - switch (fb->modifier) {
> - case DRM_FORMAT_MOD_LINEAR:
> - case I915_FORMAT_MOD_X_TILED:
> - if (cpp == 8)
> - return 4096;
> - else
> - return 5120;
> - case I915_FORMAT_MOD_Y_TILED_CCS:
> - case I915_FORMAT_MOD_Yf_TILED_CCS:
> - /* FIXME AUX plane? */
> - case I915_FORMAT_MOD_Y_TILED:
> - case I915_FORMAT_MOD_Yf_TILED:
> - if (cpp == 8)
> - return 2048;
> - else
> - return 5120;
> - default:
> - MISSING_CASE(fb->modifier);
> - return 2048;
> - }
> -}
> -
> -static int icl_min_plane_width(const struct drm_framebuffer *fb)
> -{
> - /* Wa_14011264657, Wa_14011050563: gen11+ */
> - switch (fb->format->format) {
> - case DRM_FORMAT_C8:
> - return 18;
> - case DRM_FORMAT_RGB565:
> - return 10;
> - case DRM_FORMAT_XRGB8888:
> - case DRM_FORMAT_XBGR8888:
> - case DRM_FORMAT_ARGB8888:
> - case DRM_FORMAT_ABGR8888:
> - case DRM_FORMAT_XRGB2101010:
> - case DRM_FORMAT_XBGR2101010:
> - case DRM_FORMAT_ARGB2101010:
> - case DRM_FORMAT_ABGR2101010:
> - case DRM_FORMAT_XVYU2101010:
> - case DRM_FORMAT_Y212:
> - case DRM_FORMAT_Y216:
> - return 6;
> - case DRM_FORMAT_NV12:
> - return 20;
> - case DRM_FORMAT_P010:
> - case DRM_FORMAT_P012:
> - case DRM_FORMAT_P016:
> - return 12;
> - case DRM_FORMAT_XRGB16161616F:
> - case DRM_FORMAT_XBGR16161616F:
> - case DRM_FORMAT_ARGB16161616F:
> - case DRM_FORMAT_ABGR16161616F:
> - case DRM_FORMAT_XVYU12_16161616:
> - case DRM_FORMAT_XVYU16161616:
> - return 4;
> - default:
> - return 1;
> - }
> -}
> -
> -static int icl_max_plane_width(const struct drm_framebuffer *fb,
> - int color_plane,
> - unsigned int rotation)
> -{
> - return 5120;
> -}
> -
> -static int skl_max_plane_height(void)
> -{
> - return 4096;
> -}
> -
> -static int icl_max_plane_height(void)
> -{
> - return 4320;
> -}
>
> static bool
> skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
> @@ -3874,35 +3753,55 @@ intel_plane_fence_y_offset(const struct intel_plane_state *plane_state)
> return y;
> }
>
> +static int intel_plane_min_width(struct intel_plane *plane,
> + const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + if (plane->min_width)
> + return plane->min_width(fb, color_plane, rotation);
> + else
> + return 1;
> +}
> +
> +static int intel_plane_max_width(struct intel_plane *plane,
> + const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + if (plane->max_width)
> + return plane->max_width(fb, color_plane, rotation);
> + else
> + return INT_MAX;
> +}
> +
> +static int intel_plane_max_height(struct intel_plane *plane,
> + const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + if (plane->max_height)
> + return plane->max_height(fb, color_plane, rotation);
> + else
> + return INT_MAX;
> +}
> +
> static int skl_check_main_surface(struct intel_plane_state *plane_state)
> {
> - struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev);
> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> + struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> const struct drm_framebuffer *fb = plane_state->hw.fb;
> unsigned int rotation = plane_state->hw.rotation;
> int x = plane_state->uapi.src.x1 >> 16;
> int y = plane_state->uapi.src.y1 >> 16;
> int w = drm_rect_width(&plane_state->uapi.src) >> 16;
> int h = drm_rect_height(&plane_state->uapi.src) >> 16;
> - int max_width, min_width, max_height;
> - u32 alignment, offset;
> + int min_width = intel_plane_min_width(plane, fb, 0, rotation);
> + int max_width = intel_plane_max_width(plane, fb, 0, rotation);
> + int max_height = intel_plane_max_height(plane, fb, 0, rotation);
> int aux_plane = intel_main_to_aux_plane(fb, 0);
> u32 aux_offset = plane_state->color_plane[aux_plane].offset;
> -
> - if (INTEL_GEN(dev_priv) >= 11) {
> - max_width = icl_max_plane_width(fb, 0, rotation);
> - min_width = icl_min_plane_width(fb);
> - } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
> - max_width = glk_max_plane_width(fb, 0, rotation);
> - min_width = 1;
> - } else {
> - max_width = skl_max_plane_width(fb, 0, rotation);
> - min_width = 1;
> - }
> -
> - if (INTEL_GEN(dev_priv) >= 11)
> - max_height = icl_max_plane_height();
> - else
> - max_height = skl_max_plane_height();
> + u32 alignment, offset;
>
> if (w > max_width || w < min_width || h > max_height) {
> drm_dbg_kms(&dev_priv->drm,
> @@ -3985,22 +3884,19 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
>
> static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
> {
> - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> + struct drm_i915_private *i915 = to_i915(plane->base.dev);
> const struct drm_framebuffer *fb = plane_state->hw.fb;
> unsigned int rotation = plane_state->hw.rotation;
> int uv_plane = 1;
> - int max_width = skl_max_plane_width(fb, uv_plane, rotation);
> - int max_height = 4096;
> + int max_width = intel_plane_max_width(plane, fb, uv_plane, rotation);
> + int max_height = intel_plane_max_height(plane, fb, uv_plane, rotation);
> int x = plane_state->uapi.src.x1 >> 17;
> int y = plane_state->uapi.src.y1 >> 17;
> int w = drm_rect_width(&plane_state->uapi.src) >> 17;
> int h = drm_rect_height(&plane_state->uapi.src) >> 17;
> u32 offset;
>
> - intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
> - offset = intel_plane_compute_aligned_offset(&x, &y,
> - plane_state, uv_plane);
> -
> /* FIXME not quite sure how/if these apply to the chroma plane */
> if (w > max_width || h > max_height) {
> drm_dbg_kms(&i915->drm,
> @@ -4009,6 +3905,10 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
> return -EINVAL;
> }
>
> + intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
> + offset = intel_plane_compute_aligned_offset(&x, &y,
> + plane_state, uv_plane);
> +
> if (is_ccs_modifier(fb->modifier)) {
> int ccs_plane = main_to_ccs_plane(fb, uv_plane);
> int aux_offset = plane_state->color_plane[ccs_plane].offset;
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 3d4bf9b6a0a2..a16120508318 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1170,6 +1170,15 @@ struct intel_plane {
> * the intel_plane_state structure and accessed via plane_state.
> */
>
> + int (*min_width)(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation);
> + int (*max_width)(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation);
> + int (*max_height)(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation);
> unsigned int (*max_stride)(struct intel_plane *plane,
> u32 pixel_format, u64 modifier,
> unsigned int rotation);
> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> index 63040cb0d4e1..d682ab1c0f70 100644
> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> @@ -393,6 +393,134 @@ static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
> return DIV_ROUND_UP(pixel_rate * num, den);
> }
>
> +static int skl_plane_max_width(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + int cpp = fb->format->cpp[color_plane];
> +
> + switch (fb->modifier) {
> + case DRM_FORMAT_MOD_LINEAR:
> + case I915_FORMAT_MOD_X_TILED:
> + /*
> + * Validated limit is 4k, but has 5k should
> + * work apart from the following features:
> + * - Ytile (already limited to 4k)
> + * - FP16 (already limited to 4k)
> + * - render compression (already limited to 4k)
> + * - KVMR sprite and cursor (don't care)
> + * - horizontal panning (TODO verify this)
> + * - pipe and plane scaling (TODO verify this)
> + */
> + if (cpp == 8)
> + return 4096;
> + else
> + return 5120;
> + case I915_FORMAT_MOD_Y_TILED_CCS:
> + case I915_FORMAT_MOD_Yf_TILED_CCS:
> + case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
> + /* FIXME AUX plane? */
> + case I915_FORMAT_MOD_Y_TILED:
> + case I915_FORMAT_MOD_Yf_TILED:
> + if (cpp == 8)
> + return 2048;
> + else
> + return 4096;
> + default:
> + MISSING_CASE(fb->modifier);
> + return 2048;
> + }
> +}
> +
> +static int glk_plane_max_width(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + int cpp = fb->format->cpp[color_plane];
> +
> + switch (fb->modifier) {
> + case DRM_FORMAT_MOD_LINEAR:
> + case I915_FORMAT_MOD_X_TILED:
> + if (cpp == 8)
> + return 4096;
> + else
> + return 5120;
> + case I915_FORMAT_MOD_Y_TILED_CCS:
> + case I915_FORMAT_MOD_Yf_TILED_CCS:
> + /* FIXME AUX plane? */
> + case I915_FORMAT_MOD_Y_TILED:
> + case I915_FORMAT_MOD_Yf_TILED:
> + if (cpp == 8)
> + return 2048;
> + else
> + return 5120;
> + default:
> + MISSING_CASE(fb->modifier);
> + return 2048;
> + }
> +}
> +
> +static int icl_plane_min_width(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + /* Wa_14011264657, Wa_14011050563: gen11+ */
> + switch (fb->format->format) {
> + case DRM_FORMAT_C8:
> + return 18;
> + case DRM_FORMAT_RGB565:
> + return 10;
> + case DRM_FORMAT_XRGB8888:
> + case DRM_FORMAT_XBGR8888:
> + case DRM_FORMAT_ARGB8888:
> + case DRM_FORMAT_ABGR8888:
> + case DRM_FORMAT_XRGB2101010:
> + case DRM_FORMAT_XBGR2101010:
> + case DRM_FORMAT_ARGB2101010:
> + case DRM_FORMAT_ABGR2101010:
> + case DRM_FORMAT_XVYU2101010:
> + case DRM_FORMAT_Y212:
> + case DRM_FORMAT_Y216:
> + return 6;
> + case DRM_FORMAT_NV12:
> + return 20;
> + case DRM_FORMAT_P010:
> + case DRM_FORMAT_P012:
> + case DRM_FORMAT_P016:
> + return 12;
> + case DRM_FORMAT_XRGB16161616F:
> + case DRM_FORMAT_XBGR16161616F:
> + case DRM_FORMAT_ARGB16161616F:
> + case DRM_FORMAT_ABGR16161616F:
> + case DRM_FORMAT_XVYU12_16161616:
> + case DRM_FORMAT_XVYU16161616:
> + return 4;
> + default:
> + return 1;
> + }
> +}
> +
> +static int icl_plane_max_width(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + return 5120;
> +}
> +
> +static int skl_plane_max_height(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + return 4096;
> +}
> +
> +static int icl_plane_max_height(const struct drm_framebuffer *fb,
> + int color_plane,
> + unsigned int rotation)
> +{
> + return 4320;
> +}
> +
> static unsigned int
> skl_plane_max_stride(struct intel_plane *plane,
> u32 pixel_format, u64 modifier,
> @@ -3083,6 +3211,18 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
> }
>
> + if (INTEL_GEN(dev_priv) >= 11) {
> + plane->min_width = icl_plane_min_width;
> + plane->max_width = icl_plane_max_width;
> + plane->max_height = icl_plane_max_height;
> + } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
> + plane->max_width = glk_plane_max_width;
> + plane->max_height = skl_plane_max_height;
> + } else {
> + plane->max_width = skl_plane_max_width;
> + plane->max_height = skl_plane_max_height;
> + }
> +
> plane->max_stride = skl_plane_max_stride;
> plane->update_plane = skl_update_plane;
> plane->disable_plane = skl_disable_plane;
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
2020-10-16 23:40 ` [Intel-gfx] [PATCH] " Aditya Swarup
@ 2020-10-23 0:17 ` Aditya Swarup
2020-10-30 12:37 ` Ville Syrjälä
0 siblings, 1 reply; 7+ messages in thread
From: Aditya Swarup @ 2020-10-23 0:17 UTC (permalink / raw)
To: Ville Syrjala, intel-gfx
On 10/16/20 4:40 PM, Aditya Swarup wrote:
> On 9/24/20 11:51 AM, Ville Syrjala wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> Reduce this maintenance nightmare a bit by converting the plane
>> min/max width/height stuff into vfuncs.
>>
>> Now, if I could just think of a nice way to also use this for
>> intel_mode_valid_max_plane_size()...
>>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> LGTM..
> Reviewed-by: Aditya Swarup <aditya.swarup@intel.com>
Hi Ville
Are you going to push this patch to drm-tip or are you planning to rework this patch?
This patch simplifies the max/min plane width plane assignment and fixes the NV12 aux surface bug
and is good enough to push.
Regards,
Aditya Swarup
>> ---
>> drivers/gpu/drm/i915/display/intel_display.c | 194 +++++-------------
>> .../drm/i915/display/intel_display_types.h | 9 +
>> drivers/gpu/drm/i915/display/intel_sprite.c | 140 +++++++++++++
>> 3 files changed, 196 insertions(+), 147 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
>> index 5a9d933e425a..a823d406f0ee 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display.c
>> @@ -3696,127 +3696,6 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>> &to_intel_frontbuffer(fb)->bits);
>> }
>>
>> -static int skl_max_plane_width(const struct drm_framebuffer *fb,
>> - int color_plane,
>> - unsigned int rotation)
>> -{
>> - int cpp = fb->format->cpp[color_plane];
>> -
>> - switch (fb->modifier) {
>> - case DRM_FORMAT_MOD_LINEAR:
>> - case I915_FORMAT_MOD_X_TILED:
>> - /*
>> - * Validated limit is 4k, but has 5k should
>> - * work apart from the following features:
>> - * - Ytile (already limited to 4k)
>> - * - FP16 (already limited to 4k)
>> - * - render compression (already limited to 4k)
>> - * - KVMR sprite and cursor (don't care)
>> - * - horizontal panning (TODO verify this)
>> - * - pipe and plane scaling (TODO verify this)
>> - */
>> - if (cpp == 8)
>> - return 4096;
>> - else
>> - return 5120;
>> - case I915_FORMAT_MOD_Y_TILED_CCS:
>> - case I915_FORMAT_MOD_Yf_TILED_CCS:
>> - case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
>> - /* FIXME AUX plane? */
>> - case I915_FORMAT_MOD_Y_TILED:
>> - case I915_FORMAT_MOD_Yf_TILED:
>> - if (cpp == 8)
>> - return 2048;
>> - else
>> - return 4096;
>> - default:
>> - MISSING_CASE(fb->modifier);
>> - return 2048;
>> - }
>> -}
>> -
>> -static int glk_max_plane_width(const struct drm_framebuffer *fb,
>> - int color_plane,
>> - unsigned int rotation)
>> -{
>> - int cpp = fb->format->cpp[color_plane];
>> -
>> - switch (fb->modifier) {
>> - case DRM_FORMAT_MOD_LINEAR:
>> - case I915_FORMAT_MOD_X_TILED:
>> - if (cpp == 8)
>> - return 4096;
>> - else
>> - return 5120;
>> - case I915_FORMAT_MOD_Y_TILED_CCS:
>> - case I915_FORMAT_MOD_Yf_TILED_CCS:
>> - /* FIXME AUX plane? */
>> - case I915_FORMAT_MOD_Y_TILED:
>> - case I915_FORMAT_MOD_Yf_TILED:
>> - if (cpp == 8)
>> - return 2048;
>> - else
>> - return 5120;
>> - default:
>> - MISSING_CASE(fb->modifier);
>> - return 2048;
>> - }
>> -}
>> -
>> -static int icl_min_plane_width(const struct drm_framebuffer *fb)
>> -{
>> - /* Wa_14011264657, Wa_14011050563: gen11+ */
>> - switch (fb->format->format) {
>> - case DRM_FORMAT_C8:
>> - return 18;
>> - case DRM_FORMAT_RGB565:
>> - return 10;
>> - case DRM_FORMAT_XRGB8888:
>> - case DRM_FORMAT_XBGR8888:
>> - case DRM_FORMAT_ARGB8888:
>> - case DRM_FORMAT_ABGR8888:
>> - case DRM_FORMAT_XRGB2101010:
>> - case DRM_FORMAT_XBGR2101010:
>> - case DRM_FORMAT_ARGB2101010:
>> - case DRM_FORMAT_ABGR2101010:
>> - case DRM_FORMAT_XVYU2101010:
>> - case DRM_FORMAT_Y212:
>> - case DRM_FORMAT_Y216:
>> - return 6;
>> - case DRM_FORMAT_NV12:
>> - return 20;
>> - case DRM_FORMAT_P010:
>> - case DRM_FORMAT_P012:
>> - case DRM_FORMAT_P016:
>> - return 12;
>> - case DRM_FORMAT_XRGB16161616F:
>> - case DRM_FORMAT_XBGR16161616F:
>> - case DRM_FORMAT_ARGB16161616F:
>> - case DRM_FORMAT_ABGR16161616F:
>> - case DRM_FORMAT_XVYU12_16161616:
>> - case DRM_FORMAT_XVYU16161616:
>> - return 4;
>> - default:
>> - return 1;
>> - }
>> -}
>> -
>> -static int icl_max_plane_width(const struct drm_framebuffer *fb,
>> - int color_plane,
>> - unsigned int rotation)
>> -{
>> - return 5120;
>> -}
>> -
>> -static int skl_max_plane_height(void)
>> -{
>> - return 4096;
>> -}
>> -
>> -static int icl_max_plane_height(void)
>> -{
>> - return 4320;
>> -}
>>
>> static bool
>> skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
>> @@ -3874,35 +3753,55 @@ intel_plane_fence_y_offset(const struct intel_plane_state *plane_state)
>> return y;
>> }
>>
>> +static int intel_plane_min_width(struct intel_plane *plane,
>> + const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + if (plane->min_width)
>> + return plane->min_width(fb, color_plane, rotation);
>> + else
>> + return 1;
>> +}
>> +
>> +static int intel_plane_max_width(struct intel_plane *plane,
>> + const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + if (plane->max_width)
>> + return plane->max_width(fb, color_plane, rotation);
>> + else
>> + return INT_MAX;
>> +}
>> +
>> +static int intel_plane_max_height(struct intel_plane *plane,
>> + const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + if (plane->max_height)
>> + return plane->max_height(fb, color_plane, rotation);
>> + else
>> + return INT_MAX;
>> +}
>> +
>> static int skl_check_main_surface(struct intel_plane_state *plane_state)
>> {
>> - struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev);
>> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
>> + struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
>> const struct drm_framebuffer *fb = plane_state->hw.fb;
>> unsigned int rotation = plane_state->hw.rotation;
>> int x = plane_state->uapi.src.x1 >> 16;
>> int y = plane_state->uapi.src.y1 >> 16;
>> int w = drm_rect_width(&plane_state->uapi.src) >> 16;
>> int h = drm_rect_height(&plane_state->uapi.src) >> 16;
>> - int max_width, min_width, max_height;
>> - u32 alignment, offset;
>> + int min_width = intel_plane_min_width(plane, fb, 0, rotation);
>> + int max_width = intel_plane_max_width(plane, fb, 0, rotation);
>> + int max_height = intel_plane_max_height(plane, fb, 0, rotation);
>> int aux_plane = intel_main_to_aux_plane(fb, 0);
>> u32 aux_offset = plane_state->color_plane[aux_plane].offset;
>> -
>> - if (INTEL_GEN(dev_priv) >= 11) {
>> - max_width = icl_max_plane_width(fb, 0, rotation);
>> - min_width = icl_min_plane_width(fb);
>> - } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
>> - max_width = glk_max_plane_width(fb, 0, rotation);
>> - min_width = 1;
>> - } else {
>> - max_width = skl_max_plane_width(fb, 0, rotation);
>> - min_width = 1;
>> - }
>> -
>> - if (INTEL_GEN(dev_priv) >= 11)
>> - max_height = icl_max_plane_height();
>> - else
>> - max_height = skl_max_plane_height();
>> + u32 alignment, offset;
>>
>> if (w > max_width || w < min_width || h > max_height) {
>> drm_dbg_kms(&dev_priv->drm,
>> @@ -3985,22 +3884,19 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
>>
>> static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
>> {
>> - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
>> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
>> + struct drm_i915_private *i915 = to_i915(plane->base.dev);
>> const struct drm_framebuffer *fb = plane_state->hw.fb;
>> unsigned int rotation = plane_state->hw.rotation;
>> int uv_plane = 1;
>> - int max_width = skl_max_plane_width(fb, uv_plane, rotation);
>> - int max_height = 4096;
>> + int max_width = intel_plane_max_width(plane, fb, uv_plane, rotation);
>> + int max_height = intel_plane_max_height(plane, fb, uv_plane, rotation);
>> int x = plane_state->uapi.src.x1 >> 17;
>> int y = plane_state->uapi.src.y1 >> 17;
>> int w = drm_rect_width(&plane_state->uapi.src) >> 17;
>> int h = drm_rect_height(&plane_state->uapi.src) >> 17;
>> u32 offset;
>>
>> - intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
>> - offset = intel_plane_compute_aligned_offset(&x, &y,
>> - plane_state, uv_plane);
>> -
>> /* FIXME not quite sure how/if these apply to the chroma plane */
>> if (w > max_width || h > max_height) {
>> drm_dbg_kms(&i915->drm,
>> @@ -4009,6 +3905,10 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
>> return -EINVAL;
>> }
>>
>> + intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
>> + offset = intel_plane_compute_aligned_offset(&x, &y,
>> + plane_state, uv_plane);
>> +
>> if (is_ccs_modifier(fb->modifier)) {
>> int ccs_plane = main_to_ccs_plane(fb, uv_plane);
>> int aux_offset = plane_state->color_plane[ccs_plane].offset;
>> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
>> index 3d4bf9b6a0a2..a16120508318 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
>> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
>> @@ -1170,6 +1170,15 @@ struct intel_plane {
>> * the intel_plane_state structure and accessed via plane_state.
>> */
>>
>> + int (*min_width)(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation);
>> + int (*max_width)(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation);
>> + int (*max_height)(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation);
>> unsigned int (*max_stride)(struct intel_plane *plane,
>> u32 pixel_format, u64 modifier,
>> unsigned int rotation);
>> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
>> index 63040cb0d4e1..d682ab1c0f70 100644
>> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
>> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
>> @@ -393,6 +393,134 @@ static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
>> return DIV_ROUND_UP(pixel_rate * num, den);
>> }
>>
>> +static int skl_plane_max_width(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + int cpp = fb->format->cpp[color_plane];
>> +
>> + switch (fb->modifier) {
>> + case DRM_FORMAT_MOD_LINEAR:
>> + case I915_FORMAT_MOD_X_TILED:
>> + /*
>> + * Validated limit is 4k, but has 5k should
>> + * work apart from the following features:
>> + * - Ytile (already limited to 4k)
>> + * - FP16 (already limited to 4k)
>> + * - render compression (already limited to 4k)
>> + * - KVMR sprite and cursor (don't care)
>> + * - horizontal panning (TODO verify this)
>> + * - pipe and plane scaling (TODO verify this)
>> + */
>> + if (cpp == 8)
>> + return 4096;
>> + else
>> + return 5120;
>> + case I915_FORMAT_MOD_Y_TILED_CCS:
>> + case I915_FORMAT_MOD_Yf_TILED_CCS:
>> + case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
>> + /* FIXME AUX plane? */
>> + case I915_FORMAT_MOD_Y_TILED:
>> + case I915_FORMAT_MOD_Yf_TILED:
>> + if (cpp == 8)
>> + return 2048;
>> + else
>> + return 4096;
>> + default:
>> + MISSING_CASE(fb->modifier);
>> + return 2048;
>> + }
>> +}
>> +
>> +static int glk_plane_max_width(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + int cpp = fb->format->cpp[color_plane];
>> +
>> + switch (fb->modifier) {
>> + case DRM_FORMAT_MOD_LINEAR:
>> + case I915_FORMAT_MOD_X_TILED:
>> + if (cpp == 8)
>> + return 4096;
>> + else
>> + return 5120;
>> + case I915_FORMAT_MOD_Y_TILED_CCS:
>> + case I915_FORMAT_MOD_Yf_TILED_CCS:
>> + /* FIXME AUX plane? */
>> + case I915_FORMAT_MOD_Y_TILED:
>> + case I915_FORMAT_MOD_Yf_TILED:
>> + if (cpp == 8)
>> + return 2048;
>> + else
>> + return 5120;
>> + default:
>> + MISSING_CASE(fb->modifier);
>> + return 2048;
>> + }
>> +}
>> +
>> +static int icl_plane_min_width(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + /* Wa_14011264657, Wa_14011050563: gen11+ */
>> + switch (fb->format->format) {
>> + case DRM_FORMAT_C8:
>> + return 18;
>> + case DRM_FORMAT_RGB565:
>> + return 10;
>> + case DRM_FORMAT_XRGB8888:
>> + case DRM_FORMAT_XBGR8888:
>> + case DRM_FORMAT_ARGB8888:
>> + case DRM_FORMAT_ABGR8888:
>> + case DRM_FORMAT_XRGB2101010:
>> + case DRM_FORMAT_XBGR2101010:
>> + case DRM_FORMAT_ARGB2101010:
>> + case DRM_FORMAT_ABGR2101010:
>> + case DRM_FORMAT_XVYU2101010:
>> + case DRM_FORMAT_Y212:
>> + case DRM_FORMAT_Y216:
>> + return 6;
>> + case DRM_FORMAT_NV12:
>> + return 20;
>> + case DRM_FORMAT_P010:
>> + case DRM_FORMAT_P012:
>> + case DRM_FORMAT_P016:
>> + return 12;
>> + case DRM_FORMAT_XRGB16161616F:
>> + case DRM_FORMAT_XBGR16161616F:
>> + case DRM_FORMAT_ARGB16161616F:
>> + case DRM_FORMAT_ABGR16161616F:
>> + case DRM_FORMAT_XVYU12_16161616:
>> + case DRM_FORMAT_XVYU16161616:
>> + return 4;
>> + default:
>> + return 1;
>> + }
>> +}
>> +
>> +static int icl_plane_max_width(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + return 5120;
>> +}
>> +
>> +static int skl_plane_max_height(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + return 4096;
>> +}
>> +
>> +static int icl_plane_max_height(const struct drm_framebuffer *fb,
>> + int color_plane,
>> + unsigned int rotation)
>> +{
>> + return 4320;
>> +}
>> +
>> static unsigned int
>> skl_plane_max_stride(struct intel_plane *plane,
>> u32 pixel_format, u64 modifier,
>> @@ -3083,6 +3211,18 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>> fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
>> }
>>
>> + if (INTEL_GEN(dev_priv) >= 11) {
>> + plane->min_width = icl_plane_min_width;
>> + plane->max_width = icl_plane_max_width;
>> + plane->max_height = icl_plane_max_height;
>> + } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
>> + plane->max_width = glk_plane_max_width;
>> + plane->max_height = skl_plane_max_height;
>> + } else {
>> + plane->max_width = skl_plane_max_width;
>> + plane->max_height = skl_plane_max_height;
>> + }
>> +
>> plane->max_stride = skl_plane_max_stride;
>> plane->update_plane = skl_update_plane;
>> plane->disable_plane = skl_disable_plane;
>>
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
2020-10-23 0:17 ` Aditya Swarup
@ 2020-10-30 12:37 ` Ville Syrjälä
2020-11-13 16:05 ` Aditya Swarup
0 siblings, 1 reply; 7+ messages in thread
From: Ville Syrjälä @ 2020-10-30 12:37 UTC (permalink / raw)
To: Aditya Swarup; +Cc: intel-gfx
On Thu, Oct 22, 2020 at 05:17:00PM -0700, Aditya Swarup wrote:
> On 10/16/20 4:40 PM, Aditya Swarup wrote:
> > On 9/24/20 11:51 AM, Ville Syrjala wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>
> >> Reduce this maintenance nightmare a bit by converting the plane
> >> min/max width/height stuff into vfuncs.
> >>
> >> Now, if I could just think of a nice way to also use this for
> >> intel_mode_valid_max_plane_size()...
> >>
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > LGTM..
> > Reviewed-by: Aditya Swarup <aditya.swarup@intel.com>
> Hi Ville
>
> Are you going to push this patch to drm-tip or are you planning to rework this patch?
> This patch simplifies the max/min plane width plane assignment and fixes the NV12 aux surface bug
> and is good enough to push.
Didn't you have a related fix you wanted to get in first?
>
> Regards,
> Aditya Swarup
> >> ---
> >> drivers/gpu/drm/i915/display/intel_display.c | 194 +++++-------------
> >> .../drm/i915/display/intel_display_types.h | 9 +
> >> drivers/gpu/drm/i915/display/intel_sprite.c | 140 +++++++++++++
> >> 3 files changed, 196 insertions(+), 147 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> >> index 5a9d933e425a..a823d406f0ee 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_display.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> >> @@ -3696,127 +3696,6 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >> &to_intel_frontbuffer(fb)->bits);
> >> }
> >>
> >> -static int skl_max_plane_width(const struct drm_framebuffer *fb,
> >> - int color_plane,
> >> - unsigned int rotation)
> >> -{
> >> - int cpp = fb->format->cpp[color_plane];
> >> -
> >> - switch (fb->modifier) {
> >> - case DRM_FORMAT_MOD_LINEAR:
> >> - case I915_FORMAT_MOD_X_TILED:
> >> - /*
> >> - * Validated limit is 4k, but has 5k should
> >> - * work apart from the following features:
> >> - * - Ytile (already limited to 4k)
> >> - * - FP16 (already limited to 4k)
> >> - * - render compression (already limited to 4k)
> >> - * - KVMR sprite and cursor (don't care)
> >> - * - horizontal panning (TODO verify this)
> >> - * - pipe and plane scaling (TODO verify this)
> >> - */
> >> - if (cpp == 8)
> >> - return 4096;
> >> - else
> >> - return 5120;
> >> - case I915_FORMAT_MOD_Y_TILED_CCS:
> >> - case I915_FORMAT_MOD_Yf_TILED_CCS:
> >> - case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
> >> - /* FIXME AUX plane? */
> >> - case I915_FORMAT_MOD_Y_TILED:
> >> - case I915_FORMAT_MOD_Yf_TILED:
> >> - if (cpp == 8)
> >> - return 2048;
> >> - else
> >> - return 4096;
> >> - default:
> >> - MISSING_CASE(fb->modifier);
> >> - return 2048;
> >> - }
> >> -}
> >> -
> >> -static int glk_max_plane_width(const struct drm_framebuffer *fb,
> >> - int color_plane,
> >> - unsigned int rotation)
> >> -{
> >> - int cpp = fb->format->cpp[color_plane];
> >> -
> >> - switch (fb->modifier) {
> >> - case DRM_FORMAT_MOD_LINEAR:
> >> - case I915_FORMAT_MOD_X_TILED:
> >> - if (cpp == 8)
> >> - return 4096;
> >> - else
> >> - return 5120;
> >> - case I915_FORMAT_MOD_Y_TILED_CCS:
> >> - case I915_FORMAT_MOD_Yf_TILED_CCS:
> >> - /* FIXME AUX plane? */
> >> - case I915_FORMAT_MOD_Y_TILED:
> >> - case I915_FORMAT_MOD_Yf_TILED:
> >> - if (cpp == 8)
> >> - return 2048;
> >> - else
> >> - return 5120;
> >> - default:
> >> - MISSING_CASE(fb->modifier);
> >> - return 2048;
> >> - }
> >> -}
> >> -
> >> -static int icl_min_plane_width(const struct drm_framebuffer *fb)
> >> -{
> >> - /* Wa_14011264657, Wa_14011050563: gen11+ */
> >> - switch (fb->format->format) {
> >> - case DRM_FORMAT_C8:
> >> - return 18;
> >> - case DRM_FORMAT_RGB565:
> >> - return 10;
> >> - case DRM_FORMAT_XRGB8888:
> >> - case DRM_FORMAT_XBGR8888:
> >> - case DRM_FORMAT_ARGB8888:
> >> - case DRM_FORMAT_ABGR8888:
> >> - case DRM_FORMAT_XRGB2101010:
> >> - case DRM_FORMAT_XBGR2101010:
> >> - case DRM_FORMAT_ARGB2101010:
> >> - case DRM_FORMAT_ABGR2101010:
> >> - case DRM_FORMAT_XVYU2101010:
> >> - case DRM_FORMAT_Y212:
> >> - case DRM_FORMAT_Y216:
> >> - return 6;
> >> - case DRM_FORMAT_NV12:
> >> - return 20;
> >> - case DRM_FORMAT_P010:
> >> - case DRM_FORMAT_P012:
> >> - case DRM_FORMAT_P016:
> >> - return 12;
> >> - case DRM_FORMAT_XRGB16161616F:
> >> - case DRM_FORMAT_XBGR16161616F:
> >> - case DRM_FORMAT_ARGB16161616F:
> >> - case DRM_FORMAT_ABGR16161616F:
> >> - case DRM_FORMAT_XVYU12_16161616:
> >> - case DRM_FORMAT_XVYU16161616:
> >> - return 4;
> >> - default:
> >> - return 1;
> >> - }
> >> -}
> >> -
> >> -static int icl_max_plane_width(const struct drm_framebuffer *fb,
> >> - int color_plane,
> >> - unsigned int rotation)
> >> -{
> >> - return 5120;
> >> -}
> >> -
> >> -static int skl_max_plane_height(void)
> >> -{
> >> - return 4096;
> >> -}
> >> -
> >> -static int icl_max_plane_height(void)
> >> -{
> >> - return 4320;
> >> -}
> >>
> >> static bool
> >> skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
> >> @@ -3874,35 +3753,55 @@ intel_plane_fence_y_offset(const struct intel_plane_state *plane_state)
> >> return y;
> >> }
> >>
> >> +static int intel_plane_min_width(struct intel_plane *plane,
> >> + const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + if (plane->min_width)
> >> + return plane->min_width(fb, color_plane, rotation);
> >> + else
> >> + return 1;
> >> +}
> >> +
> >> +static int intel_plane_max_width(struct intel_plane *plane,
> >> + const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + if (plane->max_width)
> >> + return plane->max_width(fb, color_plane, rotation);
> >> + else
> >> + return INT_MAX;
> >> +}
> >> +
> >> +static int intel_plane_max_height(struct intel_plane *plane,
> >> + const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + if (plane->max_height)
> >> + return plane->max_height(fb, color_plane, rotation);
> >> + else
> >> + return INT_MAX;
> >> +}
> >> +
> >> static int skl_check_main_surface(struct intel_plane_state *plane_state)
> >> {
> >> - struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev);
> >> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> >> + struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
> >> const struct drm_framebuffer *fb = plane_state->hw.fb;
> >> unsigned int rotation = plane_state->hw.rotation;
> >> int x = plane_state->uapi.src.x1 >> 16;
> >> int y = plane_state->uapi.src.y1 >> 16;
> >> int w = drm_rect_width(&plane_state->uapi.src) >> 16;
> >> int h = drm_rect_height(&plane_state->uapi.src) >> 16;
> >> - int max_width, min_width, max_height;
> >> - u32 alignment, offset;
> >> + int min_width = intel_plane_min_width(plane, fb, 0, rotation);
> >> + int max_width = intel_plane_max_width(plane, fb, 0, rotation);
> >> + int max_height = intel_plane_max_height(plane, fb, 0, rotation);
> >> int aux_plane = intel_main_to_aux_plane(fb, 0);
> >> u32 aux_offset = plane_state->color_plane[aux_plane].offset;
> >> -
> >> - if (INTEL_GEN(dev_priv) >= 11) {
> >> - max_width = icl_max_plane_width(fb, 0, rotation);
> >> - min_width = icl_min_plane_width(fb);
> >> - } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
> >> - max_width = glk_max_plane_width(fb, 0, rotation);
> >> - min_width = 1;
> >> - } else {
> >> - max_width = skl_max_plane_width(fb, 0, rotation);
> >> - min_width = 1;
> >> - }
> >> -
> >> - if (INTEL_GEN(dev_priv) >= 11)
> >> - max_height = icl_max_plane_height();
> >> - else
> >> - max_height = skl_max_plane_height();
> >> + u32 alignment, offset;
> >>
> >> if (w > max_width || w < min_width || h > max_height) {
> >> drm_dbg_kms(&dev_priv->drm,
> >> @@ -3985,22 +3884,19 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
> >>
> >> static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
> >> {
> >> - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
> >> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
> >> + struct drm_i915_private *i915 = to_i915(plane->base.dev);
> >> const struct drm_framebuffer *fb = plane_state->hw.fb;
> >> unsigned int rotation = plane_state->hw.rotation;
> >> int uv_plane = 1;
> >> - int max_width = skl_max_plane_width(fb, uv_plane, rotation);
> >> - int max_height = 4096;
> >> + int max_width = intel_plane_max_width(plane, fb, uv_plane, rotation);
> >> + int max_height = intel_plane_max_height(plane, fb, uv_plane, rotation);
> >> int x = plane_state->uapi.src.x1 >> 17;
> >> int y = plane_state->uapi.src.y1 >> 17;
> >> int w = drm_rect_width(&plane_state->uapi.src) >> 17;
> >> int h = drm_rect_height(&plane_state->uapi.src) >> 17;
> >> u32 offset;
> >>
> >> - intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
> >> - offset = intel_plane_compute_aligned_offset(&x, &y,
> >> - plane_state, uv_plane);
> >> -
> >> /* FIXME not quite sure how/if these apply to the chroma plane */
> >> if (w > max_width || h > max_height) {
> >> drm_dbg_kms(&i915->drm,
> >> @@ -4009,6 +3905,10 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
> >> return -EINVAL;
> >> }
> >>
> >> + intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
> >> + offset = intel_plane_compute_aligned_offset(&x, &y,
> >> + plane_state, uv_plane);
> >> +
> >> if (is_ccs_modifier(fb->modifier)) {
> >> int ccs_plane = main_to_ccs_plane(fb, uv_plane);
> >> int aux_offset = plane_state->color_plane[ccs_plane].offset;
> >> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> >> index 3d4bf9b6a0a2..a16120508318 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> >> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> >> @@ -1170,6 +1170,15 @@ struct intel_plane {
> >> * the intel_plane_state structure and accessed via plane_state.
> >> */
> >>
> >> + int (*min_width)(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation);
> >> + int (*max_width)(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation);
> >> + int (*max_height)(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation);
> >> unsigned int (*max_stride)(struct intel_plane *plane,
> >> u32 pixel_format, u64 modifier,
> >> unsigned int rotation);
> >> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
> >> index 63040cb0d4e1..d682ab1c0f70 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
> >> @@ -393,6 +393,134 @@ static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
> >> return DIV_ROUND_UP(pixel_rate * num, den);
> >> }
> >>
> >> +static int skl_plane_max_width(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + int cpp = fb->format->cpp[color_plane];
> >> +
> >> + switch (fb->modifier) {
> >> + case DRM_FORMAT_MOD_LINEAR:
> >> + case I915_FORMAT_MOD_X_TILED:
> >> + /*
> >> + * Validated limit is 4k, but has 5k should
> >> + * work apart from the following features:
> >> + * - Ytile (already limited to 4k)
> >> + * - FP16 (already limited to 4k)
> >> + * - render compression (already limited to 4k)
> >> + * - KVMR sprite and cursor (don't care)
> >> + * - horizontal panning (TODO verify this)
> >> + * - pipe and plane scaling (TODO verify this)
> >> + */
> >> + if (cpp == 8)
> >> + return 4096;
> >> + else
> >> + return 5120;
> >> + case I915_FORMAT_MOD_Y_TILED_CCS:
> >> + case I915_FORMAT_MOD_Yf_TILED_CCS:
> >> + case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
> >> + /* FIXME AUX plane? */
> >> + case I915_FORMAT_MOD_Y_TILED:
> >> + case I915_FORMAT_MOD_Yf_TILED:
> >> + if (cpp == 8)
> >> + return 2048;
> >> + else
> >> + return 4096;
> >> + default:
> >> + MISSING_CASE(fb->modifier);
> >> + return 2048;
> >> + }
> >> +}
> >> +
> >> +static int glk_plane_max_width(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + int cpp = fb->format->cpp[color_plane];
> >> +
> >> + switch (fb->modifier) {
> >> + case DRM_FORMAT_MOD_LINEAR:
> >> + case I915_FORMAT_MOD_X_TILED:
> >> + if (cpp == 8)
> >> + return 4096;
> >> + else
> >> + return 5120;
> >> + case I915_FORMAT_MOD_Y_TILED_CCS:
> >> + case I915_FORMAT_MOD_Yf_TILED_CCS:
> >> + /* FIXME AUX plane? */
> >> + case I915_FORMAT_MOD_Y_TILED:
> >> + case I915_FORMAT_MOD_Yf_TILED:
> >> + if (cpp == 8)
> >> + return 2048;
> >> + else
> >> + return 5120;
> >> + default:
> >> + MISSING_CASE(fb->modifier);
> >> + return 2048;
> >> + }
> >> +}
> >> +
> >> +static int icl_plane_min_width(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + /* Wa_14011264657, Wa_14011050563: gen11+ */
> >> + switch (fb->format->format) {
> >> + case DRM_FORMAT_C8:
> >> + return 18;
> >> + case DRM_FORMAT_RGB565:
> >> + return 10;
> >> + case DRM_FORMAT_XRGB8888:
> >> + case DRM_FORMAT_XBGR8888:
> >> + case DRM_FORMAT_ARGB8888:
> >> + case DRM_FORMAT_ABGR8888:
> >> + case DRM_FORMAT_XRGB2101010:
> >> + case DRM_FORMAT_XBGR2101010:
> >> + case DRM_FORMAT_ARGB2101010:
> >> + case DRM_FORMAT_ABGR2101010:
> >> + case DRM_FORMAT_XVYU2101010:
> >> + case DRM_FORMAT_Y212:
> >> + case DRM_FORMAT_Y216:
> >> + return 6;
> >> + case DRM_FORMAT_NV12:
> >> + return 20;
> >> + case DRM_FORMAT_P010:
> >> + case DRM_FORMAT_P012:
> >> + case DRM_FORMAT_P016:
> >> + return 12;
> >> + case DRM_FORMAT_XRGB16161616F:
> >> + case DRM_FORMAT_XBGR16161616F:
> >> + case DRM_FORMAT_ARGB16161616F:
> >> + case DRM_FORMAT_ABGR16161616F:
> >> + case DRM_FORMAT_XVYU12_16161616:
> >> + case DRM_FORMAT_XVYU16161616:
> >> + return 4;
> >> + default:
> >> + return 1;
> >> + }
> >> +}
> >> +
> >> +static int icl_plane_max_width(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + return 5120;
> >> +}
> >> +
> >> +static int skl_plane_max_height(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + return 4096;
> >> +}
> >> +
> >> +static int icl_plane_max_height(const struct drm_framebuffer *fb,
> >> + int color_plane,
> >> + unsigned int rotation)
> >> +{
> >> + return 4320;
> >> +}
> >> +
> >> static unsigned int
> >> skl_plane_max_stride(struct intel_plane *plane,
> >> u32 pixel_format, u64 modifier,
> >> @@ -3083,6 +3211,18 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
> >> fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
> >> }
> >>
> >> + if (INTEL_GEN(dev_priv) >= 11) {
> >> + plane->min_width = icl_plane_min_width;
> >> + plane->max_width = icl_plane_max_width;
> >> + plane->max_height = icl_plane_max_height;
> >> + } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
> >> + plane->max_width = glk_plane_max_width;
> >> + plane->max_height = skl_plane_max_height;
> >> + } else {
> >> + plane->max_width = skl_plane_max_width;
> >> + plane->max_height = skl_plane_max_height;
> >> + }
> >> +
> >> plane->max_stride = skl_plane_max_stride;
> >> plane->update_plane = skl_update_plane;
> >> plane->disable_plane = skl_disable_plane;
> >>
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs
2020-10-30 12:37 ` Ville Syrjälä
@ 2020-11-13 16:05 ` Aditya Swarup
0 siblings, 0 replies; 7+ messages in thread
From: Aditya Swarup @ 2020-11-13 16:05 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: intel-gfx
On 10/30/20 5:37 AM, Ville Syrjälä wrote:
> On Thu, Oct 22, 2020 at 05:17:00PM -0700, Aditya Swarup wrote:
>> On 10/16/20 4:40 PM, Aditya Swarup wrote:
>>> On 9/24/20 11:51 AM, Ville Syrjala wrote:
>>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>
>>>> Reduce this maintenance nightmare a bit by converting the plane
>>>> min/max width/height stuff into vfuncs.
>>>>
>>>> Now, if I could just think of a nice way to also use this for
>>>> intel_mode_valid_max_plane_size()...
>>>>
>>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>> LGTM..
>>> Reviewed-by: Aditya Swarup <aditya.swarup@intel.com>
>> Hi Ville
>>
>> Are you going to push this patch to drm-tip or are you planning to rework this patch?
>> This patch simplifies the max/min plane width plane assignment and fixes the NV12 aux surface bug
>> and is good enough to push.
>
> Didn't you have a related fix you wanted to get in first?
My patch is still unreviewed - https://patchwork.freedesktop.org/patch/394819/ and your patch fixes that
issue as well in a cleaner way.
So, I don't think it is worth the effort to push my patch and then rebase your patch. This patch should
be sufficient.
Aditya Swarup
>
>>
>> Regards,
>> Aditya Swarup
>>>> ---
>>>> drivers/gpu/drm/i915/display/intel_display.c | 194 +++++-------------
>>>> .../drm/i915/display/intel_display_types.h | 9 +
>>>> drivers/gpu/drm/i915/display/intel_sprite.c | 140 +++++++++++++
>>>> 3 files changed, 196 insertions(+), 147 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
>>>> index 5a9d933e425a..a823d406f0ee 100644
>>>> --- a/drivers/gpu/drm/i915/display/intel_display.c
>>>> +++ b/drivers/gpu/drm/i915/display/intel_display.c
>>>> @@ -3696,127 +3696,6 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>>>> &to_intel_frontbuffer(fb)->bits);
>>>> }
>>>>
>>>> -static int skl_max_plane_width(const struct drm_framebuffer *fb,
>>>> - int color_plane,
>>>> - unsigned int rotation)
>>>> -{
>>>> - int cpp = fb->format->cpp[color_plane];
>>>> -
>>>> - switch (fb->modifier) {
>>>> - case DRM_FORMAT_MOD_LINEAR:
>>>> - case I915_FORMAT_MOD_X_TILED:
>>>> - /*
>>>> - * Validated limit is 4k, but has 5k should
>>>> - * work apart from the following features:
>>>> - * - Ytile (already limited to 4k)
>>>> - * - FP16 (already limited to 4k)
>>>> - * - render compression (already limited to 4k)
>>>> - * - KVMR sprite and cursor (don't care)
>>>> - * - horizontal panning (TODO verify this)
>>>> - * - pipe and plane scaling (TODO verify this)
>>>> - */
>>>> - if (cpp == 8)
>>>> - return 4096;
>>>> - else
>>>> - return 5120;
>>>> - case I915_FORMAT_MOD_Y_TILED_CCS:
>>>> - case I915_FORMAT_MOD_Yf_TILED_CCS:
>>>> - case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
>>>> - /* FIXME AUX plane? */
>>>> - case I915_FORMAT_MOD_Y_TILED:
>>>> - case I915_FORMAT_MOD_Yf_TILED:
>>>> - if (cpp == 8)
>>>> - return 2048;
>>>> - else
>>>> - return 4096;
>>>> - default:
>>>> - MISSING_CASE(fb->modifier);
>>>> - return 2048;
>>>> - }
>>>> -}
>>>> -
>>>> -static int glk_max_plane_width(const struct drm_framebuffer *fb,
>>>> - int color_plane,
>>>> - unsigned int rotation)
>>>> -{
>>>> - int cpp = fb->format->cpp[color_plane];
>>>> -
>>>> - switch (fb->modifier) {
>>>> - case DRM_FORMAT_MOD_LINEAR:
>>>> - case I915_FORMAT_MOD_X_TILED:
>>>> - if (cpp == 8)
>>>> - return 4096;
>>>> - else
>>>> - return 5120;
>>>> - case I915_FORMAT_MOD_Y_TILED_CCS:
>>>> - case I915_FORMAT_MOD_Yf_TILED_CCS:
>>>> - /* FIXME AUX plane? */
>>>> - case I915_FORMAT_MOD_Y_TILED:
>>>> - case I915_FORMAT_MOD_Yf_TILED:
>>>> - if (cpp == 8)
>>>> - return 2048;
>>>> - else
>>>> - return 5120;
>>>> - default:
>>>> - MISSING_CASE(fb->modifier);
>>>> - return 2048;
>>>> - }
>>>> -}
>>>> -
>>>> -static int icl_min_plane_width(const struct drm_framebuffer *fb)
>>>> -{
>>>> - /* Wa_14011264657, Wa_14011050563: gen11+ */
>>>> - switch (fb->format->format) {
>>>> - case DRM_FORMAT_C8:
>>>> - return 18;
>>>> - case DRM_FORMAT_RGB565:
>>>> - return 10;
>>>> - case DRM_FORMAT_XRGB8888:
>>>> - case DRM_FORMAT_XBGR8888:
>>>> - case DRM_FORMAT_ARGB8888:
>>>> - case DRM_FORMAT_ABGR8888:
>>>> - case DRM_FORMAT_XRGB2101010:
>>>> - case DRM_FORMAT_XBGR2101010:
>>>> - case DRM_FORMAT_ARGB2101010:
>>>> - case DRM_FORMAT_ABGR2101010:
>>>> - case DRM_FORMAT_XVYU2101010:
>>>> - case DRM_FORMAT_Y212:
>>>> - case DRM_FORMAT_Y216:
>>>> - return 6;
>>>> - case DRM_FORMAT_NV12:
>>>> - return 20;
>>>> - case DRM_FORMAT_P010:
>>>> - case DRM_FORMAT_P012:
>>>> - case DRM_FORMAT_P016:
>>>> - return 12;
>>>> - case DRM_FORMAT_XRGB16161616F:
>>>> - case DRM_FORMAT_XBGR16161616F:
>>>> - case DRM_FORMAT_ARGB16161616F:
>>>> - case DRM_FORMAT_ABGR16161616F:
>>>> - case DRM_FORMAT_XVYU12_16161616:
>>>> - case DRM_FORMAT_XVYU16161616:
>>>> - return 4;
>>>> - default:
>>>> - return 1;
>>>> - }
>>>> -}
>>>> -
>>>> -static int icl_max_plane_width(const struct drm_framebuffer *fb,
>>>> - int color_plane,
>>>> - unsigned int rotation)
>>>> -{
>>>> - return 5120;
>>>> -}
>>>> -
>>>> -static int skl_max_plane_height(void)
>>>> -{
>>>> - return 4096;
>>>> -}
>>>> -
>>>> -static int icl_max_plane_height(void)
>>>> -{
>>>> - return 4320;
>>>> -}
>>>>
>>>> static bool
>>>> skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
>>>> @@ -3874,35 +3753,55 @@ intel_plane_fence_y_offset(const struct intel_plane_state *plane_state)
>>>> return y;
>>>> }
>>>>
>>>> +static int intel_plane_min_width(struct intel_plane *plane,
>>>> + const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + if (plane->min_width)
>>>> + return plane->min_width(fb, color_plane, rotation);
>>>> + else
>>>> + return 1;
>>>> +}
>>>> +
>>>> +static int intel_plane_max_width(struct intel_plane *plane,
>>>> + const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + if (plane->max_width)
>>>> + return plane->max_width(fb, color_plane, rotation);
>>>> + else
>>>> + return INT_MAX;
>>>> +}
>>>> +
>>>> +static int intel_plane_max_height(struct intel_plane *plane,
>>>> + const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + if (plane->max_height)
>>>> + return plane->max_height(fb, color_plane, rotation);
>>>> + else
>>>> + return INT_MAX;
>>>> +}
>>>> +
>>>> static int skl_check_main_surface(struct intel_plane_state *plane_state)
>>>> {
>>>> - struct drm_i915_private *dev_priv = to_i915(plane_state->uapi.plane->dev);
>>>> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
>>>> + struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
>>>> const struct drm_framebuffer *fb = plane_state->hw.fb;
>>>> unsigned int rotation = plane_state->hw.rotation;
>>>> int x = plane_state->uapi.src.x1 >> 16;
>>>> int y = plane_state->uapi.src.y1 >> 16;
>>>> int w = drm_rect_width(&plane_state->uapi.src) >> 16;
>>>> int h = drm_rect_height(&plane_state->uapi.src) >> 16;
>>>> - int max_width, min_width, max_height;
>>>> - u32 alignment, offset;
>>>> + int min_width = intel_plane_min_width(plane, fb, 0, rotation);
>>>> + int max_width = intel_plane_max_width(plane, fb, 0, rotation);
>>>> + int max_height = intel_plane_max_height(plane, fb, 0, rotation);
>>>> int aux_plane = intel_main_to_aux_plane(fb, 0);
>>>> u32 aux_offset = plane_state->color_plane[aux_plane].offset;
>>>> -
>>>> - if (INTEL_GEN(dev_priv) >= 11) {
>>>> - max_width = icl_max_plane_width(fb, 0, rotation);
>>>> - min_width = icl_min_plane_width(fb);
>>>> - } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
>>>> - max_width = glk_max_plane_width(fb, 0, rotation);
>>>> - min_width = 1;
>>>> - } else {
>>>> - max_width = skl_max_plane_width(fb, 0, rotation);
>>>> - min_width = 1;
>>>> - }
>>>> -
>>>> - if (INTEL_GEN(dev_priv) >= 11)
>>>> - max_height = icl_max_plane_height();
>>>> - else
>>>> - max_height = skl_max_plane_height();
>>>> + u32 alignment, offset;
>>>>
>>>> if (w > max_width || w < min_width || h > max_height) {
>>>> drm_dbg_kms(&dev_priv->drm,
>>>> @@ -3985,22 +3884,19 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
>>>>
>>>> static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
>>>> {
>>>> - struct drm_i915_private *i915 = to_i915(plane_state->uapi.plane->dev);
>>>> + struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
>>>> + struct drm_i915_private *i915 = to_i915(plane->base.dev);
>>>> const struct drm_framebuffer *fb = plane_state->hw.fb;
>>>> unsigned int rotation = plane_state->hw.rotation;
>>>> int uv_plane = 1;
>>>> - int max_width = skl_max_plane_width(fb, uv_plane, rotation);
>>>> - int max_height = 4096;
>>>> + int max_width = intel_plane_max_width(plane, fb, uv_plane, rotation);
>>>> + int max_height = intel_plane_max_height(plane, fb, uv_plane, rotation);
>>>> int x = plane_state->uapi.src.x1 >> 17;
>>>> int y = plane_state->uapi.src.y1 >> 17;
>>>> int w = drm_rect_width(&plane_state->uapi.src) >> 17;
>>>> int h = drm_rect_height(&plane_state->uapi.src) >> 17;
>>>> u32 offset;
>>>>
>>>> - intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
>>>> - offset = intel_plane_compute_aligned_offset(&x, &y,
>>>> - plane_state, uv_plane);
>>>> -
>>>> /* FIXME not quite sure how/if these apply to the chroma plane */
>>>> if (w > max_width || h > max_height) {
>>>> drm_dbg_kms(&i915->drm,
>>>> @@ -4009,6 +3905,10 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
>>>> return -EINVAL;
>>>> }
>>>>
>>>> + intel_add_fb_offsets(&x, &y, plane_state, uv_plane);
>>>> + offset = intel_plane_compute_aligned_offset(&x, &y,
>>>> + plane_state, uv_plane);
>>>> +
>>>> if (is_ccs_modifier(fb->modifier)) {
>>>> int ccs_plane = main_to_ccs_plane(fb, uv_plane);
>>>> int aux_offset = plane_state->color_plane[ccs_plane].offset;
>>>> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
>>>> index 3d4bf9b6a0a2..a16120508318 100644
>>>> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
>>>> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
>>>> @@ -1170,6 +1170,15 @@ struct intel_plane {
>>>> * the intel_plane_state structure and accessed via plane_state.
>>>> */
>>>>
>>>> + int (*min_width)(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation);
>>>> + int (*max_width)(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation);
>>>> + int (*max_height)(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation);
>>>> unsigned int (*max_stride)(struct intel_plane *plane,
>>>> u32 pixel_format, u64 modifier,
>>>> unsigned int rotation);
>>>> diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c b/drivers/gpu/drm/i915/display/intel_sprite.c
>>>> index 63040cb0d4e1..d682ab1c0f70 100644
>>>> --- a/drivers/gpu/drm/i915/display/intel_sprite.c
>>>> +++ b/drivers/gpu/drm/i915/display/intel_sprite.c
>>>> @@ -393,6 +393,134 @@ static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
>>>> return DIV_ROUND_UP(pixel_rate * num, den);
>>>> }
>>>>
>>>> +static int skl_plane_max_width(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + int cpp = fb->format->cpp[color_plane];
>>>> +
>>>> + switch (fb->modifier) {
>>>> + case DRM_FORMAT_MOD_LINEAR:
>>>> + case I915_FORMAT_MOD_X_TILED:
>>>> + /*
>>>> + * Validated limit is 4k, but has 5k should
>>>> + * work apart from the following features:
>>>> + * - Ytile (already limited to 4k)
>>>> + * - FP16 (already limited to 4k)
>>>> + * - render compression (already limited to 4k)
>>>> + * - KVMR sprite and cursor (don't care)
>>>> + * - horizontal panning (TODO verify this)
>>>> + * - pipe and plane scaling (TODO verify this)
>>>> + */
>>>> + if (cpp == 8)
>>>> + return 4096;
>>>> + else
>>>> + return 5120;
>>>> + case I915_FORMAT_MOD_Y_TILED_CCS:
>>>> + case I915_FORMAT_MOD_Yf_TILED_CCS:
>>>> + case I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS:
>>>> + /* FIXME AUX plane? */
>>>> + case I915_FORMAT_MOD_Y_TILED:
>>>> + case I915_FORMAT_MOD_Yf_TILED:
>>>> + if (cpp == 8)
>>>> + return 2048;
>>>> + else
>>>> + return 4096;
>>>> + default:
>>>> + MISSING_CASE(fb->modifier);
>>>> + return 2048;
>>>> + }
>>>> +}
>>>> +
>>>> +static int glk_plane_max_width(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + int cpp = fb->format->cpp[color_plane];
>>>> +
>>>> + switch (fb->modifier) {
>>>> + case DRM_FORMAT_MOD_LINEAR:
>>>> + case I915_FORMAT_MOD_X_TILED:
>>>> + if (cpp == 8)
>>>> + return 4096;
>>>> + else
>>>> + return 5120;
>>>> + case I915_FORMAT_MOD_Y_TILED_CCS:
>>>> + case I915_FORMAT_MOD_Yf_TILED_CCS:
>>>> + /* FIXME AUX plane? */
>>>> + case I915_FORMAT_MOD_Y_TILED:
>>>> + case I915_FORMAT_MOD_Yf_TILED:
>>>> + if (cpp == 8)
>>>> + return 2048;
>>>> + else
>>>> + return 5120;
>>>> + default:
>>>> + MISSING_CASE(fb->modifier);
>>>> + return 2048;
>>>> + }
>>>> +}
>>>> +
>>>> +static int icl_plane_min_width(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + /* Wa_14011264657, Wa_14011050563: gen11+ */
>>>> + switch (fb->format->format) {
>>>> + case DRM_FORMAT_C8:
>>>> + return 18;
>>>> + case DRM_FORMAT_RGB565:
>>>> + return 10;
>>>> + case DRM_FORMAT_XRGB8888:
>>>> + case DRM_FORMAT_XBGR8888:
>>>> + case DRM_FORMAT_ARGB8888:
>>>> + case DRM_FORMAT_ABGR8888:
>>>> + case DRM_FORMAT_XRGB2101010:
>>>> + case DRM_FORMAT_XBGR2101010:
>>>> + case DRM_FORMAT_ARGB2101010:
>>>> + case DRM_FORMAT_ABGR2101010:
>>>> + case DRM_FORMAT_XVYU2101010:
>>>> + case DRM_FORMAT_Y212:
>>>> + case DRM_FORMAT_Y216:
>>>> + return 6;
>>>> + case DRM_FORMAT_NV12:
>>>> + return 20;
>>>> + case DRM_FORMAT_P010:
>>>> + case DRM_FORMAT_P012:
>>>> + case DRM_FORMAT_P016:
>>>> + return 12;
>>>> + case DRM_FORMAT_XRGB16161616F:
>>>> + case DRM_FORMAT_XBGR16161616F:
>>>> + case DRM_FORMAT_ARGB16161616F:
>>>> + case DRM_FORMAT_ABGR16161616F:
>>>> + case DRM_FORMAT_XVYU12_16161616:
>>>> + case DRM_FORMAT_XVYU16161616:
>>>> + return 4;
>>>> + default:
>>>> + return 1;
>>>> + }
>>>> +}
>>>> +
>>>> +static int icl_plane_max_width(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + return 5120;
>>>> +}
>>>> +
>>>> +static int skl_plane_max_height(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + return 4096;
>>>> +}
>>>> +
>>>> +static int icl_plane_max_height(const struct drm_framebuffer *fb,
>>>> + int color_plane,
>>>> + unsigned int rotation)
>>>> +{
>>>> + return 4320;
>>>> +}
>>>> +
>>>> static unsigned int
>>>> skl_plane_max_stride(struct intel_plane *plane,
>>>> u32 pixel_format, u64 modifier,
>>>> @@ -3083,6 +3211,18 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>>>> fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
>>>> }
>>>>
>>>> + if (INTEL_GEN(dev_priv) >= 11) {
>>>> + plane->min_width = icl_plane_min_width;
>>>> + plane->max_width = icl_plane_max_width;
>>>> + plane->max_height = icl_plane_max_height;
>>>> + } else if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
>>>> + plane->max_width = glk_plane_max_width;
>>>> + plane->max_height = skl_plane_max_height;
>>>> + } else {
>>>> + plane->max_width = skl_plane_max_width;
>>>> + plane->max_height = skl_plane_max_height;
>>>> + }
>>>> +
>>>> plane->max_stride = skl_plane_max_stride;
>>>> plane->update_plane = skl_update_plane;
>>>> plane->disable_plane = skl_disable_plane;
>>>>
>>>
>>> _______________________________________________
>>> Intel-gfx mailing list
>>> Intel-gfx@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
>>>
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-11-13 16:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-24 18:51 [Intel-gfx] [PATCH] drm/i915: Add plane .{min, max}_width() and .max_height() vfuncs Ville Syrjala
2020-09-24 23:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-09-25 4:02 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-10-16 23:40 ` [Intel-gfx] [PATCH] " Aditya Swarup
2020-10-23 0:17 ` Aditya Swarup
2020-10-30 12:37 ` Ville Syrjälä
2020-11-13 16:05 ` Aditya Swarup
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox