public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: clean up reversed type specifiers in dml2_core
@ 2026-04-29 21:02 Adriano Vero
  2026-04-30  0:53 ` Claude review: " Claude Code Review Bot
  2026-04-30  0:53 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: Adriano Vero @ 2026-04-29 21:02 UTC (permalink / raw)
  To: austin.zheng, jun.lei, harry.wentland, sunpeng.li
  Cc: siqueira, alexander.deucher, christian.koenig, airlied, simona,
	amd-gfx, dri-devel, linux-kernel, Adriano Vero

Replace non-standard reversed type specifiers with canonical C ordering:
- 'int unsigned' -> 'unsigned int'
- 'long int unsigned' cast -> 'unsigned long'

Affected sites:
- dml2_core_utils.c: function return type, parameter type, local
  variable, and two viewport height casts
- dml2_core_utils.h: matching declarations for the above functions
- dml2_core_dcn4.c: two viewport height casts and one local variable

No functional change.

Signed-off-by: Adriano Vero <adri.vero.dev@gmail.com>
---
 .../dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4.c   |  6 +++---
 .../dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.c  | 12 +++++++-----
 .../dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.h  |  6 ++++--
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4.c
index 858e7bbc511f..ad03e66f963d 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_dcn4.c
@@ -287,10 +287,10 @@ static void create_phantom_plane_from_main_plane(struct dml2_plane_parameters *p
 	phantom->stream_index = phantom_stream_index;
 	phantom->overrides.refresh_from_mall = dml2_refresh_from_mall_mode_override_force_disable;
 	phantom->overrides.legacy_svp_config = dml2_svp_mode_override_phantom_pipe_no_data_return;
-	phantom->composition.viewport.plane0.height = (long int unsigned) math_min2(math_ceil2(
+	phantom->composition.viewport.plane0.height = (unsigned long) math_min2(math_ceil2(
 		(double)main->composition.scaler_info.plane0.v_ratio * (double)phantom_stream->timing.v_active, 16.0),
 		(double)main->composition.viewport.plane0.height);
-	phantom->composition.viewport.plane1.height = (long int unsigned) math_min2(math_ceil2(
+	phantom->composition.viewport.plane1.height = (unsigned long) math_min2(math_ceil2(
 		(double)main->composition.scaler_info.plane1.v_ratio * (double)phantom_stream->timing.v_active, 16.0),
 		(double)main->composition.viewport.plane1.height);
 	phantom->immediate_flip = false;
@@ -527,7 +527,7 @@ bool core_dcn4_mode_support(struct dml2_core_mode_support_in_out *in_out)
 
 	bool result;
 	unsigned int i, stream_index, stream_bitmask;
-	int unsigned odm_count, num_odm_output_segments, dpp_count;
+	unsigned int odm_count, num_odm_output_segments, dpp_count;
 
 	expand_implict_subvp(in_out->display_cfg, &l->svp_expanded_display_cfg, &core->scratch);
 
diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.c b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.c
index 4f5533dc0430..77044c77fa44 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.c
+++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.c
@@ -384,7 +384,9 @@ unsigned int dml2_core_utils_round_to_multiple(unsigned int num, unsigned int mu
 		return (num - remainder);
 }
 
-unsigned int dml2_core_util_get_num_active_pipes(int unsigned num_planes, const struct core_display_cfg_support_info *cfg_support_info)
+unsigned int
+dml2_core_util_get_num_active_pipes(unsigned int num_planes,
+				    const struct core_display_cfg_support_info *cfg_support_info)
 {
 	unsigned int num_active_pipes = 0;
 
@@ -480,9 +482,9 @@ bool dml2_core_utils_is_vertical_rotation(enum dml2_rotation_angle Scan)
 	return is_vert;
 }
 
-int unsigned dml2_core_utils_get_gfx_version(enum dml2_swizzle_mode sw_mode)
+unsigned int dml2_core_utils_get_gfx_version(enum dml2_swizzle_mode sw_mode)
 {
-	int unsigned version = 0;
+	unsigned int version = 0;
 
 	if (sw_mode == dml2_sw_linear ||
 		sw_mode == dml2_sw_256b_2d ||
@@ -594,10 +596,10 @@ static void create_phantom_plane_from_main_plane(struct dml2_plane_parameters *p
 	phantom->stream_index = phantom_stream_index;
 	phantom->overrides.refresh_from_mall = dml2_refresh_from_mall_mode_override_force_disable;
 	phantom->overrides.legacy_svp_config = dml2_svp_mode_override_phantom_pipe_no_data_return;
-	phantom->composition.viewport.plane0.height = (long int unsigned) math_min2(math_ceil2(
+	phantom->composition.viewport.plane0.height = (unsigned long) math_min2(math_ceil2(
 		(double)main->composition.scaler_info.plane0.v_ratio * (double)phantom_stream->timing.v_active, 16.0),
 		(double)main->composition.viewport.plane0.height);
-	phantom->composition.viewport.plane1.height = (long int unsigned) math_min2(math_ceil2(
+	phantom->composition.viewport.plane1.height = (unsigned long) math_min2(math_ceil2(
 		(double)main->composition.scaler_info.plane1.v_ratio * (double)phantom_stream->timing.v_active, 16.0),
 		(double)main->composition.viewport.plane1.height);
 	phantom->immediate_flip = false;
diff --git a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.h b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.h
index 60fa2abfef85..2a2177ad7cd9 100644
--- a/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.h
+++ b/drivers/gpu/drm/amd/display/dc/dml2_0/dml21/src/dml2_core/dml2_core_utils.h
@@ -17,14 +17,16 @@ void dml2_core_utils_print_mode_support_info(const struct dml2_core_internal_mod
 const char *dml2_core_utils_internal_soc_state_type_str(enum dml2_core_internal_soc_state_type dml2_core_internal_soc_state_type);
 void dml2_core_utils_get_stream_output_bpp(double *out_bpp, const struct dml2_display_cfg *display_cfg);
 unsigned int dml2_core_utils_round_to_multiple(unsigned int num, unsigned int multiple, bool up);
-unsigned int dml2_core_util_get_num_active_pipes(int unsigned num_planes, const struct core_display_cfg_support_info *cfg_support_info);
+unsigned int
+dml2_core_util_get_num_active_pipes(unsigned int num_planes,
+				    const struct core_display_cfg_support_info *cfg_support_info);
 void dml2_core_utils_pipe_plane_mapping(const struct core_display_cfg_support_info *cfg_support_info, unsigned int *pipe_plane);
 bool dml2_core_utils_is_phantom_pipe(const struct dml2_plane_parameters *plane_cfg);
 unsigned int dml2_core_utils_get_tile_block_size_bytes(enum dml2_swizzle_mode sw_mode, unsigned int byte_per_pixel);
 bool dml2_core_utils_get_segment_horizontal_contiguous(enum dml2_swizzle_mode sw_mode, unsigned int byte_per_pixel);
 bool dml2_core_utils_is_vertical_rotation(enum dml2_rotation_angle Scan);
 bool dml2_core_utils_is_linear(enum dml2_swizzle_mode sw_mode);
-int unsigned dml2_core_utils_get_gfx_version(enum dml2_swizzle_mode sw_mode);
+unsigned int dml2_core_utils_get_gfx_version(enum dml2_swizzle_mode sw_mode);
 unsigned int dml2_core_utils_get_qos_param_index(unsigned long uclk_freq_khz, const struct dml2_dcn4_uclk_dpm_dependent_qos_params *per_uclk_dpm_params);
 unsigned int dml2_core_utils_get_active_min_uclk_dpm_index(unsigned long uclk_freq_khz, const struct dml2_soc_state_table *clk_table);
 bool dml2_core_utils_is_dual_plane(enum dml2_source_format_class source_format);
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Claude review: drm/amd/display: clean up reversed type specifiers in dml2_core
  2026-04-29 21:02 [PATCH] drm/amd/display: clean up reversed type specifiers in dml2_core Adriano Vero
  2026-04-30  0:53 ` Claude review: " Claude Code Review Bot
@ 2026-04-30  0:53 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-30  0:53 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/amd/display: clean up reversed type specifiers in dml2_core
Author: Adriano Vero <adri.vero.dev@gmail.com>
Patches: 1
Reviewed: 2026-04-30T10:53:42.592152

---

This is a single-patch cleanup that fixes non-standard C type specifier ordering in the DML2 core code under `drivers/gpu/drm/amd/display/`. The changes are purely cosmetic:

- `int unsigned` → `unsigned int`
- `long int unsigned` → `unsigned long`

The patch is **correct and straightforward**. All replacements are semantically identical in C (the standard allows specifiers in any order, but canonical ordering is `unsigned int` / `unsigned long`). The cast targets (`unsigned long`) match the actual field type (`unsigned long`). The function signature changes in the `.h` file are consistent with the `.c` file changes.

The patch also takes the opportunity to reformat the `dml2_core_util_get_num_active_pipes` declaration/definition to fit within 80 columns, which is a reasonable companion change.

**Verdict:** Looks good. No functional change, no issues found.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Claude review: drm/amd/display: clean up reversed type specifiers in dml2_core
  2026-04-29 21:02 [PATCH] drm/amd/display: clean up reversed type specifiers in dml2_core Adriano Vero
@ 2026-04-30  0:53 ` Claude Code Review Bot
  2026-04-30  0:53 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-30  0:53 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Changes in `dml2_core_dcn4.c`:**

The two viewport height casts are fixed:
```c
-	phantom->composition.viewport.plane0.height = (long int unsigned) math_min2(...)
+	phantom->composition.viewport.plane0.height = (unsigned long) math_min2(...)
```
And the local variable declaration:
```c
-	int unsigned odm_count, num_odm_output_segments, dpp_count;
+	unsigned int odm_count, num_odm_output_segments, dpp_count;
```
Both correct. The `height` field is `unsigned long` per `dml_top_display_cfg_types.h:223`, so the cast target type matches.

**Changes in `dml2_core_utils.c`:**

Return type and local variable fix:
```c
-int unsigned dml2_core_utils_get_gfx_version(enum dml2_swizzle_mode sw_mode)
+unsigned int dml2_core_utils_get_gfx_version(enum dml2_swizzle_mode sw_mode)
 {
-	int unsigned version = 0;
+	unsigned int version = 0;
```
Correct.

Parameter type fix with line-length reformatting:
```c
-unsigned int dml2_core_util_get_num_active_pipes(int unsigned num_planes, const struct core_display_cfg_support_info *cfg_support_info)
+unsigned int
+dml2_core_util_get_num_active_pipes(unsigned int num_planes,
+				    const struct core_display_cfg_support_info *cfg_support_info)
```
Correct, and the reformatting is welcome since the old line was well over 80 columns.

Same viewport height cast fixes as in `dml2_core_dcn4.c` — this is a duplicate `create_phantom_plane_from_main_plane` function (one static copy per file). Both fixed consistently.

**Changes in `dml2_core_utils.h`:**

Declarations updated to match the `.c` changes for both `dml2_core_util_get_num_active_pipes` and `dml2_core_utils_get_gfx_version`. Consistent with the source.

**Minor observation:** The two separate static copies of `create_phantom_plane_from_main_plane` in `dml2_core_dcn4.c` and `dml2_core_utils.c` are a pre-existing code duplication issue, not introduced by this patch.

**Reviewed-by worthy:** Yes. No issues.

---
Generated by Claude Code Patch Reviewer

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-30  0:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29 21:02 [PATCH] drm/amd/display: clean up reversed type specifiers in dml2_core Adriano Vero
2026-04-30  0:53 ` Claude review: " Claude Code Review Bot
2026-04-30  0:53 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox