* [PATCH 1/3] drm/amd/display: Simplify data output in psr_capability_show()
2026-06-05 11:30 [PATCH 0/3] drm/amd/display: More efficient data output in four functions Markus Elfring
@ 2026-06-05 11:31 ` Markus Elfring
2026-06-15 17:49 ` Alex Deucher
2026-06-05 11:32 ` [PATCH 2/3] drm/amd/display: Simplify data output in ips_status_show() Markus Elfring
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Markus Elfring @ 2026-06-05 11:31 UTC (permalink / raw)
To: amd-gfx, dri-devel, Alex Deucher, Chenyu Chen,
Christian König, David Airlie, Harry Wentland, Ivan Lipski,
Kees Cook, Leo Li, Mario Limonciello, Ray Wu, Rodrigo Siqueira,
Rong Zhang, Simona Vetter, Timur Kristóf, Tom Chung
Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 5 Jun 2026 11:39:13 +0200
Move the specification for a line break from a seq_puts() call
to a seq_printf() call.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 4b09a740f205..6e6f391b640e 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -1076,9 +1076,9 @@ static int psr_capability_show(struct seq_file *m, void *data)
seq_printf(m, "Sink support: %s", str_yes_no(link->dpcd_caps.psr_info.psr_version != 0));
if (link->dpcd_caps.psr_info.psr_version)
seq_printf(m, " [0x%02x]", link->dpcd_caps.psr_info.psr_version);
- seq_puts(m, "\n");
- seq_printf(m, "Driver support: %s", str_yes_no(link->psr_settings.psr_feature_enabled));
+ seq_printf(m, "\nDriver support: %s",
+ str_yes_no(link->psr_settings.psr_feature_enabled));
if (link->psr_settings.psr_version)
seq_printf(m, " [0x%02x]", link->psr_settings.psr_version);
seq_puts(m, "\n");
--
2.54.0
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 1/3] drm/amd/display: Simplify data output in psr_capability_show()
2026-06-05 11:31 ` [PATCH 1/3] drm/amd/display: Simplify data output in psr_capability_show() Markus Elfring
@ 2026-06-15 17:49 ` Alex Deucher
2026-06-16 7:19 ` Markus Elfring
0 siblings, 1 reply; 9+ messages in thread
From: Alex Deucher @ 2026-06-15 17:49 UTC (permalink / raw)
To: Markus Elfring
Cc: amd-gfx, dri-devel, Alex Deucher, Chenyu Chen,
Christian König, David Airlie, Harry Wentland, Ivan Lipski,
Kees Cook, Leo Li, Mario Limonciello, Ray Wu, Rodrigo Siqueira,
Rong Zhang, Simona Vetter, Timur Kristóf, Tom Chung, LKML
On Fri, Jun 5, 2026 at 7:49 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 5 Jun 2026 11:39:13 +0200
>
> Move the specification for a line break from a seq_puts() call
> to a seq_printf() call.
>
> The source code was transformed by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 4b09a740f205..6e6f391b640e 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -1076,9 +1076,9 @@ static int psr_capability_show(struct seq_file *m, void *data)
> seq_printf(m, "Sink support: %s", str_yes_no(link->dpcd_caps.psr_info.psr_version != 0));
> if (link->dpcd_caps.psr_info.psr_version)
> seq_printf(m, " [0x%02x]", link->dpcd_caps.psr_info.psr_version);
> - seq_puts(m, "\n");
Why not just convert this to seq_putc() and drop the rest? It seems
more logical from a code structure perspective.
Alex
>
> - seq_printf(m, "Driver support: %s", str_yes_no(link->psr_settings.psr_feature_enabled));
> + seq_printf(m, "\nDriver support: %s",
> + str_yes_no(link->psr_settings.psr_feature_enabled));
> if (link->psr_settings.psr_version)
> seq_printf(m, " [0x%02x]", link->psr_settings.psr_version);
> seq_puts(m, "\n");
> --
> 2.54.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] drm/amd/display: Simplify data output in psr_capability_show()
2026-06-15 17:49 ` Alex Deucher
@ 2026-06-16 7:19 ` Markus Elfring
2026-06-16 18:51 ` Alex Deucher
0 siblings, 1 reply; 9+ messages in thread
From: Markus Elfring @ 2026-06-16 7:19 UTC (permalink / raw)
To: Alex Deucher, amd-gfx
Cc: dri-devel, Alex Deucher, Chenyu Chen, Christian König,
David Airlie, Harry Wentland, Ivan Lipski, Kees Cook, Leo Li,
Mario Limonciello, Ray Wu, Rodrigo Siqueira, Rong Zhang,
Simona Vetter, Timur Kristóf, Tom Chung, LKML
>> Move the specification for a line break from a seq_puts() call
>> to a seq_printf() call.
>>
>> The source code was transformed by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>> ---
>> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
>> index 4b09a740f205..6e6f391b640e 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
>> @@ -1076,9 +1076,9 @@ static int psr_capability_show(struct seq_file *m, void *data)
>> seq_printf(m, "Sink support: %s", str_yes_no(link->dpcd_caps.psr_info.psr_version != 0));
>> if (link->dpcd_caps.psr_info.psr_version)
>> seq_printf(m, " [0x%02x]", link->dpcd_caps.psr_info.psr_version);
>> - seq_puts(m, "\n");
>
> Why not just convert this to seq_putc() and drop the rest? It seems
> more logical from a code structure perspective.
I obviously propose to omit a function call at this source code place
because an intended line break output can be achieved also with the subsequent function call.
Do you insist to preserve a similar statement here?
>>
>> - seq_printf(m, "Driver support: %s", str_yes_no(link->psr_settings.psr_feature_enabled));
>> + seq_printf(m, "\nDriver support: %s",
>> + str_yes_no(link->psr_settings.psr_feature_enabled));
>> if (link->psr_settings.psr_version)
>> seq_printf(m, " [0x%02x]", link->psr_settings.psr_version);
>> seq_puts(m, "\n");
Regards,
Markus
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] drm/amd/display: Simplify data output in psr_capability_show()
2026-06-16 7:19 ` Markus Elfring
@ 2026-06-16 18:51 ` Alex Deucher
0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2026-06-16 18:51 UTC (permalink / raw)
To: Markus Elfring
Cc: amd-gfx, dri-devel, Alex Deucher, Chenyu Chen,
Christian König, David Airlie, Harry Wentland, Ivan Lipski,
Kees Cook, Leo Li, Mario Limonciello, Ray Wu, Rodrigo Siqueira,
Rong Zhang, Simona Vetter, Timur Kristóf, Tom Chung, LKML
On Tue, Jun 16, 2026 at 3:19 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> >> Move the specification for a line break from a seq_puts() call
> >> to a seq_printf() call.
> >>
> >> The source code was transformed by using the Coccinelle software.
> >>
> >> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> >> ---
> >> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> >> index 4b09a740f205..6e6f391b640e 100644
> >> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> >> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> >> @@ -1076,9 +1076,9 @@ static int psr_capability_show(struct seq_file *m, void *data)
> >> seq_printf(m, "Sink support: %s", str_yes_no(link->dpcd_caps.psr_info.psr_version != 0));
> >> if (link->dpcd_caps.psr_info.psr_version)
> >> seq_printf(m, " [0x%02x]", link->dpcd_caps.psr_info.psr_version);
> >> - seq_puts(m, "\n");
> >
> > Why not just convert this to seq_putc() and drop the rest? It seems
> > more logical from a code structure perspective.
>
> I obviously propose to omit a function call at this source code place
> because an intended line break output can be achieved also with the subsequent function call.
>
> Do you insist to preserve a similar statement here?
I think the code reads more cleanly that way, but it's not a big deal
either way.
Alex
>
>
> >>
> >> - seq_printf(m, "Driver support: %s", str_yes_no(link->psr_settings.psr_feature_enabled));
> >> + seq_printf(m, "\nDriver support: %s",
> >> + str_yes_no(link->psr_settings.psr_feature_enabled));
> >> if (link->psr_settings.psr_version)
> >> seq_printf(m, " [0x%02x]", link->psr_settings.psr_version);
> >> seq_puts(m, "\n");
>
> Regards,
> Markus
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 2/3] drm/amd/display: Simplify data output in ips_status_show()
2026-06-05 11:30 [PATCH 0/3] drm/amd/display: More efficient data output in four functions Markus Elfring
2026-06-05 11:31 ` [PATCH 1/3] drm/amd/display: Simplify data output in psr_capability_show() Markus Elfring
@ 2026-06-05 11:32 ` Markus Elfring
2026-06-05 11:33 ` [PATCH 3/3] drm/amd/display: Use seq_putc() in three functions Markus Elfring
2026-06-13 11:05 ` [PATCH 0/3] drm/amd/display: More efficient data output in four functions Timur Kristóf
3 siblings, 0 replies; 9+ messages in thread
From: Markus Elfring @ 2026-06-05 11:32 UTC (permalink / raw)
To: amd-gfx, dri-devel, Alex Deucher, Chenyu Chen,
Christian König, David Airlie, Harry Wentland, Ivan Lipski,
Kees Cook, Leo Li, Mario Limonciello, Ray Wu, Rodrigo Siqueira,
Rong Zhang, Simona Vetter, Timur Kristóf, Tom Chung
Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 5 Jun 2026 12:40:31 +0200
Move the specification for a line break from a seq_puts() call
to a previous seq_printf() call.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 6e6f391b640e..885e9b7bc27a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -2705,11 +2705,10 @@ static int ips_status_show(struct seq_file *m, void *unused)
rcg_count = ips_fw->rcg_exit_count;
ips1_count = ips_fw->ips1_exit_count;
ips2_count = ips_fw->ips2_exit_count;
- seq_printf(m, "exit counts: rcg=%u ips1=%u ips2=%u",
+ seq_printf(m, "exit counts: rcg=%u ips1=%u ips2=%u\n",
rcg_count,
ips1_count,
ips2_count);
- seq_puts(m, "\n");
}
return 0;
}
--
2.54.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 3/3] drm/amd/display: Use seq_putc() in three functions
2026-06-05 11:30 [PATCH 0/3] drm/amd/display: More efficient data output in four functions Markus Elfring
2026-06-05 11:31 ` [PATCH 1/3] drm/amd/display: Simplify data output in psr_capability_show() Markus Elfring
2026-06-05 11:32 ` [PATCH 2/3] drm/amd/display: Simplify data output in ips_status_show() Markus Elfring
@ 2026-06-05 11:33 ` Markus Elfring
2026-06-15 17:53 ` Alex Deucher
2026-06-13 11:05 ` [PATCH 0/3] drm/amd/display: More efficient data output in four functions Timur Kristóf
3 siblings, 1 reply; 9+ messages in thread
From: Markus Elfring @ 2026-06-05 11:33 UTC (permalink / raw)
To: amd-gfx, dri-devel, Alex Deucher, Chenyu Chen,
Christian König, David Airlie, Harry Wentland, Ivan Lipski,
Kees Cook, Leo Li, Mario Limonciello, Ray Wu, Rodrigo Siqueira,
Rong Zhang, Simona Vetter, Timur Kristóf, Tom Chung
Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 5 Jun 2026 12:44:01 +0200
Single characters should occasionally be put into a sequence.
Thus use the corresponding function “seq_putc”.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 885e9b7bc27a..e45fa6e97fc6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -606,7 +606,7 @@ static int dp_lttpr_status_show(struct seq_file *m, void *unused)
break;
}
- seq_puts(m, "\n");
+ seq_putc(m, '\n');
return 0;
}
@@ -1081,7 +1081,7 @@ static int psr_capability_show(struct seq_file *m, void *data)
str_yes_no(link->psr_settings.psr_feature_enabled));
if (link->psr_settings.psr_version)
seq_printf(m, " [0x%02x]", link->psr_settings.psr_version);
- seq_puts(m, "\n");
+ seq_putc(m, '\n');
return 0;
}
@@ -1266,7 +1266,7 @@ static int hdcp_sink_capability_show(struct seq_file *m, void *data)
if (!hdcp_cap && !hdcp2_cap)
seq_printf(m, "%s ", "None");
- seq_puts(m, "\n");
+ seq_putc(m, '\n');
return 0;
}
--
2.54.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] drm/amd/display: Use seq_putc() in three functions
2026-06-05 11:33 ` [PATCH 3/3] drm/amd/display: Use seq_putc() in three functions Markus Elfring
@ 2026-06-15 17:53 ` Alex Deucher
0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2026-06-15 17:53 UTC (permalink / raw)
To: Markus Elfring
Cc: amd-gfx, dri-devel, Alex Deucher, Chenyu Chen,
Christian König, David Airlie, Harry Wentland, Ivan Lipski,
Kees Cook, Leo Li, Mario Limonciello, Ray Wu, Rodrigo Siqueira,
Rong Zhang, Simona Vetter, Timur Kristóf, Tom Chung, LKML
Applied patches 2 and 3. Thanks!
Alex
On Fri, Jun 5, 2026 at 8:09 AM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 5 Jun 2026 12:44:01 +0200
>
> Single characters should occasionally be put into a sequence.
> Thus use the corresponding function “seq_putc”.
>
> The source code was transformed by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 885e9b7bc27a..e45fa6e97fc6 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -606,7 +606,7 @@ static int dp_lttpr_status_show(struct seq_file *m, void *unused)
> break;
> }
>
> - seq_puts(m, "\n");
> + seq_putc(m, '\n');
> return 0;
> }
>
> @@ -1081,7 +1081,7 @@ static int psr_capability_show(struct seq_file *m, void *data)
> str_yes_no(link->psr_settings.psr_feature_enabled));
> if (link->psr_settings.psr_version)
> seq_printf(m, " [0x%02x]", link->psr_settings.psr_version);
> - seq_puts(m, "\n");
> + seq_putc(m, '\n');
>
> return 0;
> }
> @@ -1266,7 +1266,7 @@ static int hdcp_sink_capability_show(struct seq_file *m, void *data)
> if (!hdcp_cap && !hdcp2_cap)
> seq_printf(m, "%s ", "None");
>
> - seq_puts(m, "\n");
> + seq_putc(m, '\n');
>
> return 0;
> }
> --
> 2.54.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] drm/amd/display: More efficient data output in four functions
2026-06-05 11:30 [PATCH 0/3] drm/amd/display: More efficient data output in four functions Markus Elfring
` (2 preceding siblings ...)
2026-06-05 11:33 ` [PATCH 3/3] drm/amd/display: Use seq_putc() in three functions Markus Elfring
@ 2026-06-13 11:05 ` Timur Kristóf
3 siblings, 0 replies; 9+ messages in thread
From: Timur Kristóf @ 2026-06-13 11:05 UTC (permalink / raw)
To: amd-gfx, dri-devel, Alex Deucher, Chenyu Chen,
Christian König, David Airlie, Harry Wentland, Ivan Lipski,
Kees Cook, Leo Li, Mario Limonciello, Ray Wu, Rodrigo Siqueira,
Rong Zhang, Simona Vetter, Tom Chung, Markus Elfring
Cc: LKML
On 2026. június 5., péntek 13:30:13 közép-európai nyári idő Markus Elfring
wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 5 Jun 2026 13:00:03 +0200
>
> A few update suggestions were taken into account
> from static source code analysis.
The series looks good to me. Thank you!
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
>
> Markus Elfring (3):
> Simplify data output in psr_capability_show()
> Simplify data output in ips_status_show()
> Use seq_putc() in three functions
>
> .../drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 9+ messages in thread