From patchwork Mon Nov 11 12:08:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhavin Sharma X-Patchwork-Id: 13871561 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 98963D41D41 for ; Tue, 12 Nov 2024 00:28:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9181710E058; Tue, 12 Nov 2024 00:28:19 +0000 (UTC) Received: from IND01-MAX-obe.outbound.protection.outlook.com (mail-maxind01on2129.outbound.protection.outlook.com [40.107.222.129]) by gabe.freedesktop.org (Postfix) with ESMTPS id C4AFA10E1E8; Mon, 11 Nov 2024 12:10:04 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qx3u41FEHmOAMFVSUJEhto3K8CsNqUus0crZlRi2IukrHu43ogUTFclz9AoSwBpUtMxiAtyAa4gvwdxrs2mv1Y6+ner5JwXRPxUrNmuGJVXuVn38zyGyOd9BMuiEgXTpo9S+2/DUk/ufi4dqShJ/BvXwjS+rAOOPeZh+kaXdFgW7Ts04rmsankjBxEYVy7R0oOIE2Zc0Tan1MmlwuMaZZpNHfPTp+v3zkQep1pmzDq74MqDUkt6sF0b6hmvZSRM58a78Fu7qqUmvEGXgDn+A/wpTobz/zfQ4AFbiWugvpOnf2n/b+Q2rb6ExAyEs9dRP/a6X5Oi0NyNXEA6P4F3kcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zso/yW8wtF76QU2td8fVa8ZbR7jk9zNX6Oj9Teb2xY8=; b=rTCygOpinUIdvlNcHL8lNXj1RTtPd+yEtUqM7pp6vlubK/6vS+/cDjb7ENNeIIus1jOlTC3LQhinbxU25CIuRII96ABIUkjqZhnXyIBXUD6EmIjhseuXnEeH+OVPbir63d6XQYLDE8HYxdb5NhCi7L2CJIeJKiu5pPGIKXCrmhzK22AzYlhlptGCKsRa+eNaJllFRU2FYfCcGjUphh4LRvwEs+BlqhTAMDaHiPRyfXlTnsUMLra8ZUt675IPwIi3I3vOe1UTzi99MFd9uCXAQXjiS/PpjCm5Ra6RV2zqMJ7VN73BRB/Uit23VsRGw157JkuLME5S0xjKem/kwNEUPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siliconsignals.io; dmarc=pass action=none header.from=siliconsignals.io; dkim=pass header.d=siliconsignals.io; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=siliconsignals.io; Received: from PN3P287MB1171.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:1a1::5) by PN2P287MB0675.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:15d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Mon, 11 Nov 2024 12:09:57 +0000 Received: from PN3P287MB1171.INDP287.PROD.OUTLOOK.COM ([fe80::12a8:c951:3e4b:5a8a]) by PN3P287MB1171.INDP287.PROD.OUTLOOK.COM ([fe80::12a8:c951:3e4b:5a8a%4]) with mapi id 15.20.8137.027; Mon, 11 Nov 2024 12:09:57 +0000 From: Bhavin Sharma To: alexander.deucher@amd.com Cc: tarang.raval@siliconsignals.io, Bhavin Sharma , Chaitanya Dhere , Jun Lei , Harry Wentland , Leo Li , Rodrigo Siqueira , =?utf-8?q?Christian_K=C3=B6nig?= , Xinhui Pan , David Airlie , Simona Vetter , Kenneth Feng , Wenjing Liu , Roman Li , Alex Hung , Leo Ma , Jose Fernandez , Aurabindo Pillai , Ilya Bakoulin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drm/amd/display: Remove redundant check Date: Mon, 11 Nov 2024 17:38:28 +0530 Message-ID: <20241111120900.63869-2-bhavin.sharma@siliconsignals.io> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241111120900.63869-1-bhavin.sharma@siliconsignals.io> References: <20241111120900.63869-1-bhavin.sharma@siliconsignals.io> X-ClientProxiedBy: PN3PR01CA0096.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:9b::13) To PN3P287MB1171.INDP287.PROD.OUTLOOK.COM (2603:1096:c01:1a1::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PN3P287MB1171:EE_|PN2P287MB0675:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a0c3c7e-ca7d-4245-b36b-08dd0249c276 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|52116014|7416014|366016|38350700014; X-Microsoft-Antispam-Message-Info: 1W8bv3qQpsB8flFlOdAPeX+AiHGto7A1stiCkg8IaEAuXz3iHvLncQ3uPKw3kpm1dNvTO4gUvROXCNKbTrWzWV+Zlob7gDyKuilp7duyrfpea93gJJXzkv0grqCIatAYFSKZDELKuHUVhEDdDaaohxzOZ2pjqiTzeCtpFKFN1UM9ZRzZ0mHTiePSE/qkRC0RsoNDh/gx0i5h6qu3PH4AYOVVrdL829kc4tqOKLu8VJNDifulEE5gCc9hjc9Fjp36OVJZY5QyjkxEdkSCEw76jB/l/C1P4Edo/i889s5LakA96/60hUo7ZG/LyJR9F4yp++NWDa2rrSHJvCB4TygNBqp09wEhz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.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PN3P287MB1171.INDP287.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(52116014)(7416014)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xf/QOrOIj5ENeYzT31zQhRGun4B52PRQQqi4YWidcuLIKAD2RNHs9S/TUq/yrptLv/apS+vLGe/0wfZ0aUzN4Itlp+QoDGoZf4YdboUTbYBVVe50jONoqYs1qM6jHOkRXmBQXmDB4AlgI25KobVaw7KalcII7+JJUfjAQI7p/85ptkmdbJlyskdhXFyHWBw/o47gWmELm7+OBWvjq7ja1LZ5mEDmED9wtAxyAEqVdrFfpoTmctzdPMl++dX+D/SJd+KT4rD9XzJo+SSTftUVjFZsJwO6p3/rHa7wQ8uoL4QR0P4REWiH3jGWDhERoUpiACpP9B2LEth3uBiLJcim+StQmWrFSnV+icA2V8E/60fSGMNaiYo4W++fIyfM3LXvqXY95lXFaCgQIkpYhZGVi9hym2o+o0pW4TTuEa1p98xFAzqb89BP14hNc49+Rt9Bz5s5k0NIqwat1o96hgEoGC70bbM8zr9mr67SzW8/AxQ0qdJXOAJKsSlKw67FEgxnN0MGLYyY5CGkyiUElxXHi1cp5ra1BRgmXfRyTG1NIc1wyOQ1JLjdZ+ev/H/0iCkfjI4kYvpgyV1ODvnKewDKLMqaeObZlvj4tXEaFGcnJmvsdXsj6AzceViCNew/5tOFuMraVtBzopxzIO4lKI+zlCIcg5FTf7X4hVEfpmBO2RLeZsYEYa7DXs1kydm7wfaTzimhSKh7GtxXC+mIFjplCZm0fLA78c0vPoHW/yLFgxW1Qh0VbJcp+oGsSMJLs/17xpvBK0xfKlwPQK/5b5t5r+X/zyfKp+P859MR/lBaK2WOvjshH8YWNGe/QinS8KzSTDXGZ/EXTOSn/mI41hvlMShRD6m7ViUR1gcWEPgvAXr2ekkgpK5eNSwgbkUnR/RVYR5LetmTplEEtifLSszPyuJFghM/p3lxJMnJlh1eVJ3oLm2t2nBeBYMRpa31itpsTkRBGilLSSJP3+bk+00+f9t0mWieeZeGxxxxoi1rqByItghxV5vNAzRdprU5NshVtAHEKKoqqP0n2KUpeuVjN2Hx3Avu2utGxd/2K3DBw7UuNVzxVVcp7MdxTeflFIM4ZXByZ/n6tzXGhmeBq4NoNdRLgKbvW8tVn2aM7anJbFSDosTbRPk/u6vFX9xcdbHT3vQq11o+nfUyj7VsPVdQ1wH9Ev1E3qDOtTb5hqfPh4fSDn0S4nF382uxCN02coHrco0ZkeDvHgQfB0NXbzruYfhB41Mrkv6MFgu3rjZArexpXdqAn6Zuk9GX2DtcA2iSnk6Em2Obi3CsW8IpYiNhKlauom0iGu0EAQZJkgccRMBzgaWkEN0l11acDXlKI16RcF1py1VYZ7OhRVVactR/CYZSSZYxsh3QR03wE6eDVw91nYXXB4eHnVDAmw0yycHz6kFfqscg4OGqSoHoH+rkxYTlfBrn/FNYaonTbR4SOQIDpHdPCudI5++2i2NWgm/JpPp2wom0k4QZ2pNkvy0nau2UJaR5TGrsUCAjiqZuw0BeKNQPguw4h1BjJTZkV42EVrWU2FJ9scKQ2zI8GjHYN/VaMZPPIRYQWobQ1laOLJHeGW3T3Ve3bYcvBk/DXVYlSYyQuoFuiO3ot1n4DVyD21P64RioLdBE4AJYqLGPBDU= X-OriginatorOrg: siliconsignals.io X-MS-Exchange-CrossTenant-Network-Message-Id: 0a0c3c7e-ca7d-4245-b36b-08dd0249c276 X-MS-Exchange-CrossTenant-AuthSource: PN3P287MB1171.INDP287.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 12:09:57.5956 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 7ec5089e-a433-4bd1-a638-82ee62e21d37 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bzr+DBbgm3ZjscTc1++6thrgUFDXvqx/UqKxbFCkQG9mItoCgH/ULP6kEUHGMHqFANCI4hQYkHVl0lkR94IQ7GZfnm7iQ5tM3iMdDGbdE+I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN2P287MB0675 X-Mailman-Approved-At: Tue, 12 Nov 2024 00:28:18 +0000 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" The mode_422 variable is initialized to zero, making mode_422 ? 2 : 1 always false. Since is_dsc_possible is already checked just above, there's no need to check it again before filling out the DSC settings. Removing this redundant check simplifies the code without affecting functionality. Signed-off-by: Bhavin Sharma --- .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c index d8bfc85e5dcd..705ddabb5024 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c @@ -564,7 +564,7 @@ static void get_surf_rq_param( unsigned int vp_height = 0; unsigned int data_pitch = 0; unsigned int meta_pitch = 0; - unsigned int ppe = mode_422 ? 2 : 1; + unsigned int ppe = 1; bool surf_linear; bool surf_vert; unsigned int bytes_per_element; diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c index ebd5df1a36e8..85f6f8e43947 100644 --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c @@ -1093,14 +1093,11 @@ static bool setup_dsc_config( if (!is_dsc_possible) goto done; - // Final decission: can we do DSC or not? - if (is_dsc_possible) { - // Fill out the rest of DSC settings - dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported; - dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth; - dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4; - dsc_cfg->is_dp = dsc_sink_caps->is_dp; - } + // Fill out the rest of DSC settings + dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported; + dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth; + dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4; + dsc_cfg->is_dp = dsc_sink_caps->is_dp; done: if (!is_dsc_possible)