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 C8A17D1CDC6 for ; Tue, 9 Dec 2025 08:51:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 001AC10E1C0; Tue, 9 Dec 2025 08:51:27 +0000 (UTC) Received: from coelho.fi (coelho.fi [88.99.146.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 384BA10E1C0; Tue, 9 Dec 2025 08:51:27 +0000 (UTC) Received: from mobile-access-5d6aa7-235.dhcp.inet.fi ([93.106.167.235] helo=[192.168.8.139]) by coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vStRI-00000000gTX-1onv; Tue, 09 Dec 2025 10:51:24 +0200 Message-ID: From: Luca Coelho To: Imre Deak , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Date: Tue, 09 Dec 2025 10:51:10 +0200 In-Reply-To: <20251127175023.1522538-4-imre.deak@intel.com> References: <20251127175023.1522538-1-imre.deak@intel.com> <20251127175023.1522538-4-imre.deak@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-7 MIME-Version: 1.0 Subject: Re: [PATCH 03/50] drm/i915/dp: Fix DSC sink's slice count capability check X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, 2025-11-27 at 19:49 +0200, Imre Deak wrote: > A DSC sink supporting DSC slice count N, not necessarily supports slice > counts less than N. Hence the driver should check the sink's support for > a particular slice count before using that slice count, fix > intel_dp_dsc_get_slice_count() accordingly. >=20 > Cc: dri-devel@lists.freedesktop.org > Signed-off-by: Imre Deak > --- > drivers/gpu/drm/i915/display/intel_dp.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i9= 15/display/intel_dp.c > index 0ec82fcbcf48e..6d232c15a0b5a 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp.c > +++ b/drivers/gpu/drm/i915/display/intel_dp.c > @@ -1013,6 +1013,8 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_= connector *connector, > int num_joined_pipes) > { > struct intel_display *display =3D to_intel_display(connector); > + u32 sink_slice_count_mask =3D > + drm_dp_dsc_sink_slice_count_mask(connector->dp.dsc_dpcd, false); > u8 min_slice_count, i; > int max_slice_width; > int tp_rgb_yuv444; > @@ -1084,9 +1086,9 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_= connector *connector, > (!HAS_DSC_3ENGINES(display) || num_joined_pipes !=3D 4)) > continue; > =20 > - if (test_slice_count > > - drm_dp_dsc_sink_max_slice_count(connector->dp.dsc_dpcd, false)) > - break; > + if (!(drm_dp_dsc_slice_count_to_mask(test_slice_count) & > + sink_slice_count_mask)) > + continue; > =20 > /* > * Bigjoiner needs small joiner to be enabled. > @@ -1103,8 +1105,14 @@ u8 intel_dp_dsc_get_slice_count(const struct intel= _connector *connector, > return test_slice_count; > } > =20 > - drm_dbg_kms(display->drm, "Unsupported Slice Count %d\n", > - min_slice_count); > + /* Print slice count 1,2,4,..24 if bit#0,1,3,..23 is set in the mask. *= / > + sink_slice_count_mask <<=3D 1; > + drm_dbg_kms(display->drm, > + "[CONNECTOR:%d:%s] Unsupported slice count (min: %d, sink supporte= d: %*pbl)\n", > + connector->base.base.id, connector->base.name, > + min_slice_count, > + (int)BITS_PER_TYPE(sink_slice_count_mask), &sink_slice_count_mask)= ; > + > return 0; > } >=20 I think this patch could be squashed into the previous one. IMHO it makes it a bit easier to see how those functions defined in the previous patch would be used. But nevertheless: Reviewed-by: Luca Coelho -- Cheers, Luca.