From patchwork Thu Sep 26 05:14:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kandpal, Suraj" X-Patchwork-Id: 13812801 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 A71C5CCFA17 for ; Thu, 26 Sep 2024 05:17:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0739510E87A; Thu, 26 Sep 2024 05:17:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="FAoG9F34"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B13A10E87E for ; Thu, 26 Sep 2024 05:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1727327808; x=1758863808; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1ut8S1Pnby4ZzIVcHCy5y+x+Hs6LsAy0WZtL5zu0UDM=; b=FAoG9F34UNzd2BBA+uFgojOmKwwutxsd9jUFLvCt+1gti+/uyhlL5b5Z oKRiO+0U8qHj/3ymqrE31UNRbSseU+9P01DTq3ujqDetazvFogkhUyB7I KpBreN7+G5V/GZgQkjEQv6A3H1fRmGHFPCzPHRxnMqHIduLzVcdSKD4GE U3TJ9Dh4/JuabwTQ6E2aP1tz1lKHqAwR21Xd480WruvgWloG7ar7uWV6O mgXT3Q3t0WBmPrBSLf8zssxjICVE4YqMOCy13VyoDXyu5lKaJqsBYWXR8 FQ+gLq+vVHxOX5zWi+Nycb36KQW4vV5L2wRvhVnNo7YdHPdMs04B/r8/H g==; X-CSE-ConnectionGUID: mlhJNG31TnuHnazvSc3xPg== X-CSE-MsgGUID: RbeFuRigR/+1uUhjqGtL7w== X-IronPort-AV: E=McAfee;i="6700,10204,11206"; a="26500530" X-IronPort-AV: E=Sophos;i="6.10,259,1719903600"; d="scan'208";a="26500530" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2024 22:16:46 -0700 X-CSE-ConnectionGUID: fgL0ar4HSGKwA5nOFhaG1g== X-CSE-MsgGUID: JsjiKkwXQqi9w9cG9H8X+A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,259,1719903600"; d="scan'208";a="71891135" Received: from kandpal-x299-ud4-pro.iind.intel.com ([10.190.239.32]) by orviesa010.jf.intel.com with ESMTP; 25 Sep 2024 22:16:45 -0700 From: Suraj Kandpal To: intel-gfx@lists.freedesktop.org Cc: mitulkumar.ajitkumar.golani@intel.com, chaitanya.kumar.borah@intel.com, Suraj Kandpal Subject: [PATCH] drm/i915/vdsc: Add bpc check in intel_dsc_compute_params Date: Thu, 26 Sep 2024 10:44:10 +0530 Message-ID: <20240926051410.1285547-1-suraj.kandpal@intel.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240926043332.1284692-2-suraj.kandpal@intel.com> References: <20240926043332.1284692-2-suraj.kandpal@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" DSC does not support bpc under 8 according to DSC 1.2a Section 2 Requirements. Return an error if that happens to be the case. --v2 -should be bit_per_component [Mitul/Chaitanya] -Add reference to this restriction [Chaitanya] Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_vdsc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c index 8158e3702ed5..57401ce71970 100644 --- a/drivers/gpu/drm/i915/display/intel_vdsc.c +++ b/drivers/gpu/drm/i915/display/intel_vdsc.c @@ -306,6 +306,11 @@ int intel_dsc_compute_params(struct intel_crtc_state *pipe_config) vdsc_cfg->bits_per_component = pipe_config->pipe_bpp / 3; + if (vdsc_cfg->bites_per_component < 8) { + drm_dbg_kms(&dev_priv->drm, "DSC bpc requirements not met\n"); + return -EINVAL; + } + drm_dsc_set_rc_buf_thresh(vdsc_cfg); /*