AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <superm1@kernel.org>
To: roman.li@amd.com, amd-gfx@lists.freedesktop.org
Cc: Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 3/4] drm/amd/display: Correct some suspect code indentation
Date: Tue, 21 Jan 2025 07:57:18 -0600	[thread overview]
Message-ID: <20250121135719.2883833-4-superm1@kernel.org> (raw)
In-Reply-To: <20250121135719.2883833-1-superm1@kernel.org>

From: Mario Limonciello <mario.limonciello@amd.com>

The indentation for some lines in DML2 code is off and checkpatch
reported it while fixing another issue.

```
WARNING: suspect code indent for conditional statements (24, 40)
46: FILE: drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c:6416:
+                       for (k = 0; k <= mode_lib->ms.num_active_planes; k++) {
                                        CalculateUrgentBurstFactor(

WARNING: suspect code indent for conditional statements (8, 24)
118: FILE: drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c:6784:
+       for (k = 0; k <= mode_lib->ms.num_active_planes; k++) {
                        if (mode_lib->ms.cache_display_cfg.surface.SurfaceTiling[k] == dml_sw_linear && (!(!dml_is_vertical_rotation(mode_lib->ms.cache_display_cfg.plane.SourceScan[k])) || mode_lib->ms.cache_display_cfg.surface.DCCEnable[k] == true)) {
```

Correct indentation for those two cases.

Fixes: 7966f319c66d9 ("drm/amd/display: Introduce DML2")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 .../amd/display/dc/dml2/display_mode_core.c   | 55 +++++++++----------
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
index 45147b812d7d9..e2c7afa958456 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c
@@ -6414,32 +6414,32 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib)
 			}
 
 			for (k = 0; k <= mode_lib->ms.num_active_planes - 1; k++) {
-					CalculateUrgentBurstFactor(
-							mode_lib->ms.cache_display_cfg.plane.UseMALLForPStateChange[k],
-							mode_lib->ms.swath_width_luma_ub_this_state[k],
-							mode_lib->ms.swath_width_chroma_ub_this_state[k],
-							mode_lib->ms.SwathHeightYThisState[k],
-							mode_lib->ms.SwathHeightCThisState[k],
-							mode_lib->ms.cache_display_cfg.timing.HTotal[k] / mode_lib->ms.cache_display_cfg.timing.PixelClock[k],
-							mode_lib->ms.UrgLatency,
-							mode_lib->ms.ip.cursor_buffer_size,
-							mode_lib->ms.cache_display_cfg.plane.CursorWidth[k],
-							mode_lib->ms.cache_display_cfg.plane.CursorBPP[k],
-							mode_lib->ms.VRatioPreY[j][k],
-							mode_lib->ms.VRatioPreC[j][k],
-							mode_lib->ms.BytePerPixelInDETY[k],
-							mode_lib->ms.BytePerPixelInDETC[k],
-							mode_lib->ms.DETBufferSizeYThisState[k],
-							mode_lib->ms.DETBufferSizeCThisState[k],
-							/* Output */
-							&mode_lib->ms.UrgentBurstFactorCursorPre[k],
-							&mode_lib->ms.UrgentBurstFactorLumaPre[k],
-							&mode_lib->ms.UrgentBurstFactorChroma[k],
-							&mode_lib->ms.NotUrgentLatencyHidingPre[k]);
-
-					mode_lib->ms.cursor_bw_pre[k] = mode_lib->ms.cache_display_cfg.plane.NumberOfCursors[k] * mode_lib->ms.cache_display_cfg.plane.CursorWidth[k] *
-													mode_lib->ms.cache_display_cfg.plane.CursorBPP[k] / 8.0 / (mode_lib->ms.cache_display_cfg.timing.HTotal[k] /
-													mode_lib->ms.cache_display_cfg.timing.PixelClock[k]) * mode_lib->ms.VRatioPreY[j][k];
+				CalculateUrgentBurstFactor(
+						mode_lib->ms.cache_display_cfg.plane.UseMALLForPStateChange[k],
+						mode_lib->ms.swath_width_luma_ub_this_state[k],
+						mode_lib->ms.swath_width_chroma_ub_this_state[k],
+						mode_lib->ms.SwathHeightYThisState[k],
+						mode_lib->ms.SwathHeightCThisState[k],
+						mode_lib->ms.cache_display_cfg.timing.HTotal[k] / mode_lib->ms.cache_display_cfg.timing.PixelClock[k],
+						mode_lib->ms.UrgLatency,
+						mode_lib->ms.ip.cursor_buffer_size,
+						mode_lib->ms.cache_display_cfg.plane.CursorWidth[k],
+						mode_lib->ms.cache_display_cfg.plane.CursorBPP[k],
+						mode_lib->ms.VRatioPreY[j][k],
+						mode_lib->ms.VRatioPreC[j][k],
+						mode_lib->ms.BytePerPixelInDETY[k],
+						mode_lib->ms.BytePerPixelInDETC[k],
+						mode_lib->ms.DETBufferSizeYThisState[k],
+						mode_lib->ms.DETBufferSizeCThisState[k],
+						/* Output */
+						&mode_lib->ms.UrgentBurstFactorCursorPre[k],
+						&mode_lib->ms.UrgentBurstFactorLumaPre[k],
+						&mode_lib->ms.UrgentBurstFactorChroma[k],
+						&mode_lib->ms.NotUrgentLatencyHidingPre[k]);
+
+				mode_lib->ms.cursor_bw_pre[k] = mode_lib->ms.cache_display_cfg.plane.NumberOfCursors[k] * mode_lib->ms.cache_display_cfg.plane.CursorWidth[k] *
+												mode_lib->ms.cache_display_cfg.plane.CursorBPP[k] / 8.0 / (mode_lib->ms.cache_display_cfg.timing.HTotal[k] /
+												mode_lib->ms.cache_display_cfg.timing.PixelClock[k]) * mode_lib->ms.VRatioPreY[j][k];
 			}
 
 			{
@@ -6782,9 +6782,8 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib)
 	/*Source Format, Pixel Format and Scan Support Check*/
 	mode_lib->ms.support.SourceFormatPixelAndScanSupport = true;
 	for (k = 0; k <= mode_lib->ms.num_active_planes - 1; k++) {
-			if (mode_lib->ms.cache_display_cfg.surface.SurfaceTiling[k] == dml_sw_linear && (!(!dml_is_vertical_rotation(mode_lib->ms.cache_display_cfg.plane.SourceScan[k])) || mode_lib->ms.cache_display_cfg.surface.DCCEnable[k] == true)) {
+		if (mode_lib->ms.cache_display_cfg.surface.SurfaceTiling[k] == dml_sw_linear && (!(!dml_is_vertical_rotation(mode_lib->ms.cache_display_cfg.plane.SourceScan[k])) || mode_lib->ms.cache_display_cfg.surface.DCCEnable[k] == true))
 			mode_lib->ms.support.SourceFormatPixelAndScanSupport = false;
-		}
 	}
 
 	for (k = 0; k <= mode_lib->ms.num_active_planes; k++) {
-- 
2.43.0


  parent reply	other threads:[~2025-01-21 13:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 13:57 [PATCH 0/4] Correct a series of off by 1 errors in DML and DML2 Mario Limonciello
2025-01-21 13:57 ` [PATCH 1/4] drm/amd/display: Adjust plane init for off by one error Mario Limonciello
2025-01-21 16:32   ` Harry Wentland
2025-01-21 16:52     ` Mario Limonciello
2025-01-21 13:57 ` [PATCH 2/4] drm/amd/display: Correct off by one errors in DML Mario Limonciello
2025-01-21 13:57 ` Mario Limonciello [this message]
2025-01-21 13:57 ` [PATCH 4/4] drm/amd/display: Correct off by one errors in DML2 Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250121135719.2883833-4-superm1@kernel.org \
    --to=superm1@kernel.org \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=mario.limonciello@amd.com \
    --cc=roman.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox