From patchwork Tue Nov 30 17:12:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 12647951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC155C433FE for ; Tue, 30 Nov 2021 18:01:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 194856E0B9; Tue, 30 Nov 2021 18:01:17 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A5516E0A2 for ; Tue, 30 Nov 2021 18:01:16 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10184"; a="223505711" X-IronPort-AV: E=Sophos;i="5.87,276,1631602800"; d="scan'208";a="223505711" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2021 09:21:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,276,1631602800"; d="scan'208";a="511617129" Received: from vsrini4-xps-8920.iind.intel.com (HELO localhost.localdomain) ([10.223.163.28]) by fmsmga007.fm.intel.com with ESMTP; 30 Nov 2021 09:21:21 -0800 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org Date: Tue, 30 Nov 2021 22:42:20 +0530 Message-Id: <20211130171220.8622-1-vidya.srinivas@intel.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211130160534.7983-1-vidya.srinivas@intel.com> References: <20211130160534.7983-1-vidya.srinivas@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in max_width X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yashashvi Shantam Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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. v2: Addressed review comments from Ville. Added separate functions for max_width - for HDR and SDR Signed-off-by: Vidya Srinivas Signed-off-by: Yashashvi Shantam Reviewed-by: Ville Syrjälä --- .../gpu/drm/i915/display/skl_universal_plane.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c index 28890876bdeb..d320a3ba1ade 100644 --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c @@ -420,7 +420,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_hdr(const struct drm_framebuffer *fb, + int color_plane, + unsigned int rotation) +{ + if (intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier)) + return 4096; + else + return 5120; +} + +static int icl_plane_max_width_sdr(const struct drm_framebuffer *fb, int color_plane, unsigned int rotation) { @@ -2108,7 +2118,10 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv, if (DISPLAY_VER(dev_priv) >= 11) { plane->min_width = icl_plane_min_width; - plane->max_width = icl_plane_max_width; + if (icl_is_hdr_plane(dev_priv, plane_id)) + plane->max_width = icl_plane_max_width_hdr; + else + plane->max_width = icl_plane_max_width_sdr; plane->max_height = icl_plane_max_height; plane->min_cdclk = icl_plane_min_cdclk; } else if (DISPLAY_VER(dev_priv) >= 10) {