]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Introduce intel_plane_min_height()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 9 Oct 2025 21:13:09 +0000 (00:13 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 28 Oct 2025 21:22:19 +0000 (23:22 +0200)
Make the skl+ plane size checks a bit more regular by
adding intel_plane_min_height() instead of using a hardcoded
1 everwhere.

v2: s/1/min_height/ one more time

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20251009211313.30234-6-ville.syrjala@linux.intel.com
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
drivers/gpu/drm/i915/display/skl_universal_plane.c

index c657565a6b91679000efaf5dcc84312f7e8560e2..1183c33ae8da1339000d6c8d0a53a73876bcd4d1 100644 (file)
@@ -1860,6 +1860,14 @@ static int intel_plane_min_width(struct intel_plane *plane,
                return 1;
 }
 
+static int intel_plane_min_height(struct intel_plane *plane,
+                                 const struct drm_framebuffer *fb,
+                                 int color_plane,
+                                 unsigned int rotation)
+{
+       return 1;
+}
+
 static int intel_plane_max_width(struct intel_plane *plane,
                                 const struct drm_framebuffer *fb,
                                 int color_plane,
@@ -1991,6 +1999,7 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
        int w = drm_rect_width(&plane_state->uapi.src) >> 16;
        int h = drm_rect_height(&plane_state->uapi.src) >> 16;
        int min_width = intel_plane_min_width(plane, fb, 0, rotation);
+       int min_height = intel_plane_min_height(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);
        unsigned int alignment = plane->min_alignment(plane, fb, 0);
@@ -1998,11 +2007,11 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
        u32 offset;
        int ret;
 
-       if (w > max_width || w < min_width || h > max_height || h < 1) {
+       if (w > max_width || w < min_width || h > max_height || h < min_height) {
                drm_dbg_kms(display->drm,
-                           "[PLANE:%d:%s] requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n",
+                           "[PLANE:%d:%s] requested Y/RGB source size %dx%d outside limits (min: %dx%d max: %dx%d)\n",
                            plane->base.base.id, plane->base.name,
-                           w, h, min_width, max_width, max_height);
+                           w, h, min_width, min_height, max_width, max_height);
                return -EINVAL;
        }
 
@@ -2063,6 +2072,7 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
        int ccs_plane = intel_fb_is_ccs_modifier(fb->modifier) ?
                        skl_main_to_aux_plane(fb, uv_plane) : 0;
        int min_width = intel_plane_min_width(plane, fb, uv_plane, rotation);
+       int min_height = intel_plane_min_height(plane, fb, uv_plane, rotation);
        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;
@@ -2072,11 +2082,11 @@ static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
        u32 offset;
 
        /* FIXME not quite sure how/if these apply to the chroma plane */
-       if (w > max_width || w < min_width || h > max_height || h < 1) {
+       if (w > max_width || w < min_width || h > max_height || h < min_height) {
                drm_dbg_kms(display->drm,
-                           "[PLANE:%d:%s] requested CbCr source size %dx%d outside limits (min: %dx1 max: %dx%d)\n",
+                           "[PLANE:%d:%s] requested CbCr source size %dx%d outside limits (min: %dx%d max: %dx%d)\n",
                            plane->base.base.id, plane->base.name,
-                           w, h, min_width, max_width, max_height);
+                           w, h, min_width, min_height, max_width, max_height);
                return -EINVAL;
        }