PLANE_CUS_CTL has a restriction of 4096 width even though
PLANE_SIZE and scaler size registers supports max 5120.
Take care of this restriction in max_width.

Without this patch, when 5k content is sent on HDR plane
with NV12 content, FIFO underrun is seen and screen blanks
out.

Signed-off-by: Vidya Srinivas <vidya.srini...@intel.com>
Signed-off-by: Yashashvi Shantam <shantam.yashas...@intel.com>
Change-Id: If629c478ba044c8bde633de9f0fc638aa6c44233
---
 .../gpu/drm/i915/display/intel_display_types.h  |  3 ++-
 .../gpu/drm/i915/display/skl_universal_plane.c  | 17 +++++++++++++----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h 
b/drivers/gpu/drm/i915/display/intel_display_types.h
index ea1e8a6e10b0..0455ea340329 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1358,7 +1358,8 @@ struct intel_plane {
        int (*min_width)(const struct drm_framebuffer *fb,
                         int color_plane,
                         unsigned int rotation);
-       int (*max_width)(const struct drm_framebuffer *fb,
+       int (*max_width)(struct intel_plane *plane,
+                        const struct drm_framebuffer *fb,
                         int color_plane,
                         unsigned int rotation);
        int (*max_height)(const struct drm_framebuffer *fb,
diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c 
b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index 28890876bdeb..a49829c5a863 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -313,7 +313,8 @@ 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,
+static int skl_plane_max_width(struct intel_plane *plane,
+                               const struct drm_framebuffer *fb,
                               int color_plane,
                               unsigned int rotation)
 {
@@ -352,7 +353,8 @@ static int skl_plane_max_width(const struct drm_framebuffer 
*fb,
        }
 }
 
-static int glk_plane_max_width(const struct drm_framebuffer *fb,
+static int glk_plane_max_width(struct intel_plane *plane,
+                               const struct drm_framebuffer *fb,
                               int color_plane,
                               unsigned int rotation)
 {
@@ -420,10 +422,17 @@ static int icl_plane_min_width(const struct 
drm_framebuffer *fb,
        }
 }
 
-static int icl_plane_max_width(const struct drm_framebuffer *fb,
+static int icl_plane_max_width(struct intel_plane *plane,
+                               const struct drm_framebuffer *fb,
                               int color_plane,
                               unsigned int rotation)
 {
+       struct drm_i915_private *dev_priv = to_i915(plane->base.dev);
+
+       if (icl_is_hdr_plane(dev_priv, plane->id) &&
+           intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
+               return 4096;
+
        return 5120;
 }
 
@@ -1377,7 +1386,7 @@ static int intel_plane_max_width(struct intel_plane 
*plane,
                                 unsigned int rotation)
 {
        if (plane->max_width)
-               return plane->max_width(fb, color_plane, rotation);
+               return plane->max_width(plane, fb, color_plane, rotation);
        else
                return INT_MAX;
 }
-- 
2.33.0

Reply via email to