From nobody Fri Nov 29 18:32:58 2024 Received: from ksmg02.maxima.ru (ksmg02.maxima.ru [81.200.124.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D56921547F2; Mon, 16 Sep 2024 10:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=81.200.124.39 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726484057; cv=none; b=mEdLCpt0UJ8hT7LJcUXUrrAKlbz8LMWTKBluDj+egC4Zdt/OI3BzH2WcQsCTHwemITCnAPYlmXqwVAOM/jC8EYq47Q+6bAWeH9PP+FNTiOJzE4I3YF2nDM4WCbaguEUDVrXCu6bR3MDmpNkJdamxxCYFmFCMwYZqw+myRpWQoTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726484057; c=relaxed/simple; bh=6c4u/w45azANOUj2mFEtuoPMCb+R4HzsadISgO8smpw=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=HmX1VF4MYaP5rVX1bFNIUHq+akiRQhHJQ455ZcmMV1t/hW5jTANEFbTmVH4W3Yvws02IA/3yJjLoRoEw3gzVPxb83NueJga2+M6rEAyODnWrBLhS7CQuYEWFOtgk9cW65Vw25T4lkMDej6VTujQN4DPpLIeuUfzChCSxX6ma9cA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=maxima.ru; spf=pass smtp.mailfrom=maxima.ru; dkim=pass (2048-bit key) header.d=maxima.ru header.i=@maxima.ru header.b=IRfxdsin; arc=none smtp.client-ip=81.200.124.39 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=maxima.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=maxima.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=maxima.ru header.i=@maxima.ru header.b="IRfxdsin" Received: from ksmg02.maxima.ru (localhost [127.0.0.1]) by ksmg02.maxima.ru (Postfix) with ESMTP id C9DCF1E0004; Mon, 16 Sep 2024 13:54:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 ksmg02.maxima.ru C9DCF1E0004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maxima.ru; s=sl; t=1726484052; bh=oZG3n3xbV5KcvOrWPpD8sTpFQFpjRfidrHM0Z4QVsic=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=IRfxdsina6UW7NgxVqvfx6G4Xr1ls4bUybzvw0M7vuhc8N+DWv2coSb8wUXMLzSM+ C4IGaEbP5YVdUREKUaFdSYzYfPaOyL2xa27yN5crkZSBA1roEQ4G0o4kurKcZztv88 P2xGdRYxMVIAn0boBq0IJwWByW0o+XNTT/nt/6WHHJoYcYHaflSFWx2vZ4HT72mQmb SVpFBkt1dQCQ8Bzb+1v1Bf9PnAuHTjNC+C1Q4E4M4EhaHbZNc8LfQUatbi7x1iZqOI S6ucslOsemIEN3uu19lnaxIJMvkqV54EexTG+NBWXfQJvrROMFQsigao6ZQpa4d1KM jJB653oUXaHgg== Received: from ksmg02.maxima.ru (unknown [81.200.124.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.maxima.ru", Issuer "GlobalSign GCC R3 DV TLS CA 2020" (verified OK)) by ksmg02.maxima.ru (Postfix) with ESMTPS; Mon, 16 Sep 2024 13:54:12 +0300 (MSK) Received: from GS-NOTE-190.mt.ru (10.0.247.10) by mmail-p-exch02.mt.ru (81.200.124.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1544.4; Mon, 16 Sep 2024 13:54:10 +0300 From: Murad Masimov To: , Greg Kroah-Hartman CC: Murad Masimov , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Alvin Lee , Chaitanya Dhere , Sasha Levin , Sohaib Nadeem , Wenjing Liu , Hersen Wu , , , , , Daniel Wheeler , Rodrigo Siqueira , Samson Tam Subject: [PATCH 6.6] drm/amd/display: Fix subvp+drr logic errors Date: Mon, 16 Sep 2024 13:53:15 +0300 Message-ID: <20240916105319.1847-1-m.masimov@maxima.ru> X-Mailer: git-send-email 2.46.0.windows.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: mt-exch-01.mt.ru (91.220.120.210) To mmail-p-exch02.mt.ru (81.200.124.62) X-KSMG-Rule-ID: 7 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 187760 [Sep 16 2024] X-KSMG-AntiSpam-Version: 6.1.1.5 X-KSMG-AntiSpam-Envelope-From: m.masimov@maxima.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dmarc=none header.from=maxima.ru;spf=none smtp.mailfrom=maxima.ru;dkim=none X-KSMG-AntiSpam-Info: LuaCore: 34 0.3.34 8a1fac695d5606478feba790382a59668a4f0039, {rep_avail}, {Tracking_from_domain_doesnt_match_to}, maxima.ru:7.1.1;81.200.124.62:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;ksmg02.maxima.ru:7.1.1;127.0.0.199:7.1.2, FromAlignment: s, ApMailHostAddress: 81.200.124.62, {DNS response errors} X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/09/16 05:22:00 #26594998 X-KSMG-AntiVirus-Status: Clean, skipped Content-Type: text/plain; charset="utf-8" From: Alvin Lee commit 8a0f02b7beed7b2b768dbdf3b79960de68f460c5 upstream. [Why] There is some logic error where the wrong variable was used to check for OTG_MASTER and DPP_PIPE. [How] Add booleans to confirm that the expected pipes were found before validating schedulability. Tested-by: Daniel Wheeler Acked-by: Rodrigo Siqueira Reviewed-by: Samson Tam Reviewed-by: Chaitanya Dhere Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher Signed-off-by: Murad Masimov --- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers= /gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c index 3d82cbef1274..7160380d5690 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c @@ -879,6 +879,8 @@ static bool subvp_drr_schedulable(struct dc *dc, struct= dc_state *context) int16_t stretched_drr_us =3D 0; int16_t drr_stretched_vblank_us =3D 0; int16_t max_vblank_mallregion =3D 0; + bool subvp_found =3D false; + bool drr_found =3D false; =20 // Find SubVP pipe for (i =3D 0; i < dc->res_pool->pipe_count; i++) { @@ -891,8 +893,10 @@ static bool subvp_drr_schedulable(struct dc *dc, struc= t dc_state *context) continue; =20 // Find the SubVP pipe - if (pipe->stream->mall_stream_config.type =3D=3D SUBVP_MAIN) + if (pipe->stream->mall_stream_config.type =3D=3D SUBVP_MAIN) { + subvp_found =3D true; break; + } } =20 // Find the DRR pipe @@ -900,15 +904,20 @@ static bool subvp_drr_schedulable(struct dc *dc, stru= ct dc_state *context) drr_pipe =3D &context->res_ctx.pipe_ctx[i]; =20 // We check for master pipe only - if (!resource_is_pipe_type(pipe, OTG_MASTER) || - !resource_is_pipe_type(pipe, DPP_PIPE)) + if (!resource_is_pipe_type(drr_pipe, OTG_MASTER) || + !resource_is_pipe_type(drr_pipe, DPP_PIPE)) continue; =20 if (drr_pipe->stream->mall_stream_config.type =3D=3D SUBVP_NONE && drr_p= ipe->stream->ignore_msa_timing_param && - (drr_pipe->stream->allow_freesync || drr_pipe->stream->vrr_active_vari= able)) + (drr_pipe->stream->allow_freesync || drr_pipe->stream->vrr_active_vari= able)) { + drr_found =3D true; break; + } } =20 + if (!subvp_found || !drr_found) + return false; + main_timing =3D &pipe->stream->timing; phantom_timing =3D &pipe->stream->mall_stream_config.paired_stream->timin= g; drr_timing =3D &drr_pipe->stream->timing; --=20 2.39.2