From patchwork Mon Nov 21 11:50:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 13050786 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 DB6AEC433FE for ; Mon, 21 Nov 2022 11:50:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2188610E2B0; Mon, 21 Nov 2022 11:50:59 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26B5F10E2B0 for ; Mon, 21 Nov 2022 11:50:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669031457; x=1700567457; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qmZ+++1KritZhheeU5ngstYkxUnJ1tl+52PQhaiZHMo=; b=Xtyvd4ATAzxmEvH1pAj/O0KkyKGDiitCtXppTazUCjCDOOVnhndGUTaK GcaBUV5Wpe8GLVgMx/pUjMeT1QC/uoBwfE4PGFZqUDDgw4VAFAesz0tz4 Kt89+uerH8chGoEKikrbFiWoC04VEFr8/ss9rt/N46+RC9wMyvZTB8rvA Z04IYuw4cfyzpiPg1IjHIYfI7nctv2DOakyS812gZXOO7A8oZCg+etw7r AOmPhmfrcwuKI55v3jiH30T0YKKd63ON+xDTiWMjgIJ/HTMfsQlrg2kp1 T116DmB+BC7BG1aRXC65bYVUCh3y/2C3v+Cbh+dG5olOhBofMVPfjg0Xe A==; X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="312241098" X-IronPort-AV: E=Sophos;i="5.96,181,1665471600"; d="scan'208";a="312241098" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 03:50:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10537"; a="704535523" X-IronPort-AV: E=Sophos;i="5.96,181,1665471600"; d="scan'208";a="704535523" Received: from nsnead-mobl1.amr.corp.intel.com (HELO kveik.ger.corp.intel.com) ([10.251.208.113]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 03:50:55 -0800 From: Luca Coelho To: intel-gfx@lists.freedesktop.org Date: Mon, 21 Nov 2022 13:50:43 +0200 Message-Id: <20221121115043.763658-2-luciano.coelho@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221121115043.763658-1-luciano.coelho@intel.com> References: <20221121115043.763658-1-luciano.coelho@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 2/2] drm/i915/mtl: Limit scaler input to 4k in plane scaling 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: ville.syrjala@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" From: Animesh Manna As part of die area reduction max input source modified to 4096 for MTL so modified range check logic of scaler. Signed-off-by: José Roberto de Souza Signed-off-by: Animesh Manna Reviewed-by: Manasi Navare --- No changes in v2. drivers/gpu/drm/i915/display/skl_scaler.c | 31 +++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index d7390067b7d4..6baa07142b03 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -103,6 +103,8 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; + int min_src_w, min_src_h, min_dst_w, min_dst_h; + int max_src_w, max_src_h, max_dst_w, max_dst_h; /* * Src coordinates are already rotated by 270 degrees for @@ -157,15 +159,28 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, return -EINVAL; } + min_src_w = SKL_MIN_SRC_W; + min_src_h = SKL_MIN_SRC_H; + min_dst_w = SKL_MIN_DST_W; + min_dst_h = SKL_MIN_DST_H; + + if (DISPLAY_VER(dev_priv) >= 11 && DISPLAY_VER(dev_priv) < 14) { + max_src_w = ICL_MAX_SRC_W; + max_src_h = ICL_MAX_SRC_H; + max_dst_w = ICL_MAX_DST_W; + max_dst_h = ICL_MAX_DST_H; + } else { + max_src_w = SKL_MAX_SRC_W; + max_src_h = SKL_MAX_SRC_H; + max_dst_w = SKL_MAX_DST_W; + max_dst_h = SKL_MAX_DST_H; + } + /* range checks */ - if (src_w < SKL_MIN_SRC_W || src_h < SKL_MIN_SRC_H || - dst_w < SKL_MIN_DST_W || dst_h < SKL_MIN_DST_H || - (DISPLAY_VER(dev_priv) >= 11 && - (src_w > ICL_MAX_SRC_W || src_h > ICL_MAX_SRC_H || - dst_w > ICL_MAX_DST_W || dst_h > ICL_MAX_DST_H)) || - (DISPLAY_VER(dev_priv) < 11 && - (src_w > SKL_MAX_SRC_W || src_h > SKL_MAX_SRC_H || - dst_w > SKL_MAX_DST_W || dst_h > SKL_MAX_DST_H))) { + if (src_w < min_src_w || src_h < min_src_h || + dst_w < min_dst_w || dst_h < min_dst_h || + src_w > max_src_w || src_h > max_src_h || + dst_w > max_dst_w || dst_h > max_dst_h) { drm_dbg_kms(&dev_priv->drm, "scaler_user index %u.%u: src %ux%u dst %ux%u " "size is out of scaler range\n",