From patchwork Mon Jan 20 12:54:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mitul Golani X-Patchwork-Id: 13945054 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 EAC47C02182 for ; Mon, 20 Jan 2025 12:58:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 925A410E3FE; Mon, 20 Jan 2025 12:58:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="a93GXy8t"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 45C1410E3FC; Mon, 20 Jan 2025 12:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737377881; x=1768913881; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+d7dAQzrB4HDCmoEdbrdxR6mOUtHN0NaEFVkKYTnD84=; b=a93GXy8t8A5a6/sOsXrGq3Yp/6oRU+C8bR5hJ9Ysb1fAc4d5VSUM7x9a uZJ0uT5c5Qpmi0i97UgW0VXj6TXf1kittT/DReuFFzBvxUkp4N85xV2fn hAehPLgomT7mU589pX86XR/d5FBLTWNcI0g6r2IVJwJD1h0q9fqPaaD9B aH+9vWDtUIdHgE6pdnQLQLGqs7WD8sfV5B9zFOYGA4ofyJ4DJGPeLWnpd jP7+n7VXS3vRYJMFlcui5kTvGfmpZHk1Gt8ZuVmD2gXM19LnSclMGlEy3 KCk7kvaoLdTa/yC1Sj5UDFPauhGT3NrFy56oMW6ArlfS1rEIKzDSSJo1c w==; X-CSE-ConnectionGUID: j7HqCUJYSX+3Ess7HY3Vxw== X-CSE-MsgGUID: fZRag69TSvWJTn4tWKWr/g== X-IronPort-AV: E=McAfee;i="6700,10204,11321"; a="37930645" X-IronPort-AV: E=Sophos;i="6.13,219,1732608000"; d="scan'208";a="37930645" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2025 04:58:01 -0800 X-CSE-ConnectionGUID: Ouq3b4eNT/aMnM88UEK2Mw== X-CSE-MsgGUID: w0MTstMETo691yWV+3Qlmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,219,1732608000"; d="scan'208";a="106326443" Received: from mgolanimitul-x299-ud4-pro.iind.intel.com ([10.190.239.114]) by fmviesa006.fm.intel.com with ESMTP; 20 Jan 2025 04:57:59 -0800 From: Mitul Golani To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: ankit.k.nautiyal@intel.com, jani.nikula@intel.com, ville.syrjala@intel.com Subject: [PATCH v8 5/7] drm/i915/scaler: Limit pipe scaler downscaling factors for YUV420 Date: Mon, 20 Jan 2025 18:24:37 +0530 Message-ID: <20250120125439.4188626-6-mitulkumar.ajitkumar.golani@intel.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250120125439.4188626-1-mitulkumar.ajitkumar.golani@intel.com> References: <20250120125439.4188626-1-mitulkumar.ajitkumar.golani@intel.com> MIME-Version: 1.0 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Limit downscaling to less than 1.5 (source/destination) in the horizontal direction and 1.0 in the vertical direction, When configured for Pipe YUV 420 encoding for port output. Bspec: 50441, 7490, 69901 Signed-off-by: Mitul Golani Reviewed-by: Ankit Nautiyal --- drivers/gpu/drm/i915/display/skl_scaler.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index 72344044d9d3..c9d7966b37ff 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -456,6 +456,16 @@ static int intel_atomic_setup_scaler(struct intel_crtc_state *crtc_state, calculate_max_scale(crtc, 0, *scaler_id, &max_hscale, &max_vscale); + /* + * When configured for Pipe YUV 420 encoding for port output, + * limit downscaling to less than 1.5 (source/destination) in + * the horizontal direction and 1.0 in the vertical direction. + */ + if (crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) { + max_hscale = 0x18000 - 1; + max_vscale = 0x10000; + } + hscale = drm_rect_calc_hscale(&src, &crtc_state->pch_pfit.dst, 0, max_hscale); vscale = drm_rect_calc_vscale(&src, &crtc_state->pch_pfit.dst,