public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/display: mark dccg314_init() static
@ 2023-04-17 21:05 Arnd Bergmann
  2023-04-17 21:05 ` [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings Arnd Bergmann
  2023-04-17 21:12 ` [PATCH 1/2] drm/amd/display: mark dccg314_init() static Hamza Mahfooz
  0 siblings, 2 replies; 6+ messages in thread
From: Arnd Bergmann @ 2023-04-17 21:05 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, Pan, Xinhui, David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, Nicholas Kazlauskas, Taimur Hassan,
	Jasdeep Dhillon, Alex Hung, Michael Strauss, Aurabindo Pillai,
	Qingqing Zhuo, Hamza Mahfooz, amd-gfx, dri-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The newly introduced global function is not declared in a header or
called from another file, causing a harmless warning with sparse
or W=1 builds:

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:277:6: error: no previous prototype for 'dccg314_init' [-Werror=missing-prototypes]

Mark it static instead.

Fixes: 6f6869dcf415 ("drm/amd/display: prep work for root clock optimization enablement for DCN314")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
index 6f879265ad9c..de7bfba2c179 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
@@ -274,7 +274,7 @@ static void dccg314_set_dpstreamclk(
 	}
 }
 
-void dccg314_init(struct dccg *dccg)
+static void dccg314_init(struct dccg *dccg)
 {
 	int otg_inst;
 
-- 
2.39.2


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

* [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings
  2023-04-17 21:05 [PATCH 1/2] drm/amd/display: mark dccg314_init() static Arnd Bergmann
@ 2023-04-17 21:05 ` Arnd Bergmann
  2023-04-17 21:17   ` Hamza Mahfooz
  2023-04-17 21:12 ` [PATCH 1/2] drm/amd/display: mark dccg314_init() static Hamza Mahfooz
  1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2023-04-17 21:05 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, Pan, Xinhui, David Airlie, Daniel Vetter
  Cc: Arnd Bergmann, Lyude Paul, Wayne Lin, hersen wu, Fangzhi Zuo,
	Hamza Mahfooz, Aurabindo Pillai, Alan Liu, Wenjing Liu, Jun Lei,
	Alex Hung, Aric Cyr, Qingqing Zhuo, Alvin Lee, Roman Li,
	Jasdeep Dhillon, Wesley Chalmers, amd-gfx, dri-devel,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Three functions in the amdgpu display driver cause -Wmissing-prototype
warnings:

drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1858:6: error: no previous prototype for 'is_timing_changed' [-Werror=missing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:210:6: error: no previous prototype for 'is_synaptics_cascaded_panamera' [-Werror=missing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_optc.c:294:6: error: no previous prototype for 'optc3_wait_drr_doublebuffer_pending_clear' [-Werror=missing-prototypes]

is_timing_changed() is actually meant to be a global symbol, but needs
a proper name and prototype, while the other two can just be made static.

Fixes: 54c7b715b5ef ("drm/amd/display: Add DSC Support for Synaptics Cascaded MST Hub")
Fixes: 17ce8a6907f7 ("drm/amd/display: Add dsc pre-validation in atomic check")
Fixes: 8f0d304d21b3 ("drm/amd/display: Do not commit pipe when updating DRR")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 ++---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c           | 6 +++---
 drivers/gpu/drm/amd/display/dc/dc.h                         | 3 +++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
index 994ba426ca66..442511061178 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
@@ -45,8 +45,7 @@
 #endif
 
 #include "dc/dcn20/dcn20_resource.h"
-bool is_timing_changed(struct dc_stream_state *cur_stream,
-		       struct dc_stream_state *new_stream);
+
 #define PEAK_FACTOR_X1000 1006
 
 static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
@@ -1417,7 +1416,7 @@ int pre_validate_dsc(struct drm_atomic_state *state,
 		struct dc_stream_state *stream = dm_state->context->streams[i];
 
 		if (local_dc_state->streams[i] &&
-		    is_timing_changed(stream, local_dc_state->streams[i])) {
+		    dc_is_timing_changed(stream, local_dc_state->streams[i])) {
 			DRM_INFO_ONCE("crtc[%d] needs mode_changed\n", i);
 		} else {
 			int ind = find_crtc_index_in_state_by_stream(state, stream);
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 85d54bfb595c..344533623cb9 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -1855,7 +1855,7 @@ bool dc_add_all_planes_for_stream(
 	return add_all_planes_for_stream(dc, stream, &set, 1, context);
 }
 
-bool is_timing_changed(struct dc_stream_state *cur_stream,
+bool dc_is_timing_changed(struct dc_stream_state *cur_stream,
 		       struct dc_stream_state *new_stream)
 {
 	if (cur_stream == NULL)
@@ -1880,7 +1880,7 @@ static bool are_stream_backends_same(
 	if (stream_a == NULL || stream_b == NULL)
 		return false;
 
-	if (is_timing_changed(stream_a, stream_b))
+	if (dc_is_timing_changed(stream_a, stream_b))
 		return false;
 
 	if (stream_a->signal != stream_b->signal)
@@ -3505,7 +3505,7 @@ bool pipe_need_reprogram(
 	if (pipe_ctx_old->stream_res.stream_enc != pipe_ctx->stream_res.stream_enc)
 		return true;
 
-	if (is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream))
+	if (dc_is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream))
 		return true;
 
 	if (pipe_ctx_old->stream->dpms_off != pipe_ctx->stream->dpms_off)
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 23ee63b98dcd..e7ab6cb3769b 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -2225,4 +2225,7 @@ void dc_process_dmub_dpia_hpd_int_enable(const struct dc *dc,
 /* Disable acc mode Interfaces */
 void dc_disable_accelerated_mode(struct dc *dc);
 
+bool dc_is_timing_changed(struct dc_stream_state *cur_stream,
+		       struct dc_stream_state *new_stream);
+
 #endif /* DC_INTERFACE_H_ */
-- 
2.39.2


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

* Re: [PATCH 1/2] drm/amd/display: mark dccg314_init() static
  2023-04-17 21:05 [PATCH 1/2] drm/amd/display: mark dccg314_init() static Arnd Bergmann
  2023-04-17 21:05 ` [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings Arnd Bergmann
@ 2023-04-17 21:12 ` Hamza Mahfooz
  2023-04-17 21:14   ` Arnd Bergmann
  1 sibling, 1 reply; 6+ messages in thread
From: Hamza Mahfooz @ 2023-04-17 21:12 UTC (permalink / raw)
  To: Arnd Bergmann, Harry Wentland, Leo Li, Rodrigo Siqueira,
	Alex Deucher, Christian König, Pan, Xinhui, David Airlie,
	Daniel Vetter
  Cc: Arnd Bergmann, Nicholas Kazlauskas, Taimur Hassan,
	Jasdeep Dhillon, Alex Hung, Michael Strauss, Aurabindo Pillai,
	Qingqing Zhuo, amd-gfx, dri-devel, linux-kernel


On 4/17/23 17:05, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The newly introduced global function is not declared in a header or
> called from another file, causing a harmless warning with sparse
> or W=1 builds:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:277:6: error: no previous prototype for 'dccg314_init' [-Werror=missing-prototypes]
> 
> Mark it static instead.
> 
> Fixes: 6f6869dcf415 ("drm/amd/display: prep work for root clock optimization enablement for DCN314")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

This has already been fixed as of commit 669f4ac40947 ("drm/amd/display:
set variable dccg314_init storage-class-specifier to static") in
amd-staging-drm-next.

> ---
>   drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
> index 6f879265ad9c..de7bfba2c179 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c
> @@ -274,7 +274,7 @@ static void dccg314_set_dpstreamclk(
>   	}
>   }
>   
> -void dccg314_init(struct dccg *dccg)
> +static void dccg314_init(struct dccg *dccg)
>   {
>   	int otg_inst;
>   
-- 
Hamza


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

* Re: [PATCH 1/2] drm/amd/display: mark dccg314_init() static
  2023-04-17 21:12 ` [PATCH 1/2] drm/amd/display: mark dccg314_init() static Hamza Mahfooz
@ 2023-04-17 21:14   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2023-04-17 21:14 UTC (permalink / raw)
  To: Hamza Mahfooz, Arnd Bergmann, Harry Wentland, Leo Li,
	Rodrigo Siqueira, Alex Deucher, Christian König, Pan, Xinhui,
	Dave Airlie, Daniel Vetter
  Cc: Nicholas Kazlauskas, Taimur Hassan, Jasdeep Dhillon, Alex Hung,
	Michael Strauss, Aurabindo Pillai, Qingqing Zhuo, amd-gfx,
	dri-devel, linux-kernel

On Mon, Apr 17, 2023, at 23:12, Hamza Mahfooz wrote:
> On 4/17/23 17:05, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>> 
>> The newly introduced global function is not declared in a header or
>> called from another file, causing a harmless warning with sparse
>> or W=1 builds:
>> 
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn314/dcn314_dccg.c:277:6: error: no previous prototype for 'dccg314_init' [-Werror=missing-prototypes]
>> 
>> Mark it static instead.
>> 
>> Fixes: 6f6869dcf415 ("drm/amd/display: prep work for root clock optimization enablement for DCN314")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> This has already been fixed as of commit 669f4ac40947 ("drm/amd/display:
> set variable dccg314_init storage-class-specifier to static") in
> amd-staging-drm-next.

Ok, thanks. I waited for a rebase on today's linux-next before posting
mine to make sure it's not already fixed, it must have just missed the
cut-off.

      Arnd

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

* Re: [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings
  2023-04-17 21:05 ` [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings Arnd Bergmann
@ 2023-04-17 21:17   ` Hamza Mahfooz
  2023-04-17 22:10     ` Arnd Bergmann
  0 siblings, 1 reply; 6+ messages in thread
From: Hamza Mahfooz @ 2023-04-17 21:17 UTC (permalink / raw)
  To: Arnd Bergmann, Harry Wentland, Leo Li, Rodrigo Siqueira,
	Alex Deucher, Christian König, Pan, Xinhui, David Airlie,
	Daniel Vetter
  Cc: Arnd Bergmann, Lyude Paul, Wayne Lin, hersen wu, Fangzhi Zuo,
	Aurabindo Pillai, Alan Liu, Wenjing Liu, Jun Lei, Alex Hung,
	Aric Cyr, Qingqing Zhuo, Alvin Lee, Roman Li, Jasdeep Dhillon,
	Wesley Chalmers, amd-gfx, dri-devel, linux-kernel

On 4/17/23 17:05, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Three functions in the amdgpu display driver cause -Wmissing-prototype
> warnings:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1858:6: error: no previous prototype for 'is_timing_changed' [-Werror=missing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:210:6: error: no previous prototype for 'is_synaptics_cascaded_panamera' [-Werror=missing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_optc.c:294:6: error: no previous prototype for 'optc3_wait_drr_doublebuffer_pending_clear' [-Werror=missing-prototypes]
> 
> is_timing_changed() is actually meant to be a global symbol, but needs
> a proper name and prototype, while the other two can just be made static.
> 
> Fixes: 54c7b715b5ef ("drm/amd/display: Add DSC Support for Synaptics Cascaded MST Hub")
> Fixes: 17ce8a6907f7 ("drm/amd/display: Add dsc pre-validation in atomic check")
> Fixes: 8f0d304d21b3 ("drm/amd/display: Do not commit pipe when updating DRR")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

It seems like, only the changes for is_timing_changed() are in this patch.

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 5 ++---
>   drivers/gpu/drm/amd/display/dc/core/dc_resource.c           | 6 +++---
>   drivers/gpu/drm/amd/display/dc/dc.h                         | 3 +++
>   3 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 994ba426ca66..442511061178 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -45,8 +45,7 @@
>   #endif
>   
>   #include "dc/dcn20/dcn20_resource.h"
> -bool is_timing_changed(struct dc_stream_state *cur_stream,
> -		       struct dc_stream_state *new_stream);
> +
>   #define PEAK_FACTOR_X1000 1006
>   
>   static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
> @@ -1417,7 +1416,7 @@ int pre_validate_dsc(struct drm_atomic_state *state,
>   		struct dc_stream_state *stream = dm_state->context->streams[i];
>   
>   		if (local_dc_state->streams[i] &&
> -		    is_timing_changed(stream, local_dc_state->streams[i])) {
> +		    dc_is_timing_changed(stream, local_dc_state->streams[i])) {
>   			DRM_INFO_ONCE("crtc[%d] needs mode_changed\n", i);
>   		} else {
>   			int ind = find_crtc_index_in_state_by_stream(state, stream);
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> index 85d54bfb595c..344533623cb9 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
> @@ -1855,7 +1855,7 @@ bool dc_add_all_planes_for_stream(
>   	return add_all_planes_for_stream(dc, stream, &set, 1, context);
>   }
>   
> -bool is_timing_changed(struct dc_stream_state *cur_stream,
> +bool dc_is_timing_changed(struct dc_stream_state *cur_stream,
>   		       struct dc_stream_state *new_stream)
>   {
>   	if (cur_stream == NULL)
> @@ -1880,7 +1880,7 @@ static bool are_stream_backends_same(
>   	if (stream_a == NULL || stream_b == NULL)
>   		return false;
>   
> -	if (is_timing_changed(stream_a, stream_b))
> +	if (dc_is_timing_changed(stream_a, stream_b))
>   		return false;
>   
>   	if (stream_a->signal != stream_b->signal)
> @@ -3505,7 +3505,7 @@ bool pipe_need_reprogram(
>   	if (pipe_ctx_old->stream_res.stream_enc != pipe_ctx->stream_res.stream_enc)
>   		return true;
>   
> -	if (is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream))
> +	if (dc_is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream))
>   		return true;
>   
>   	if (pipe_ctx_old->stream->dpms_off != pipe_ctx->stream->dpms_off)
> diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
> index 23ee63b98dcd..e7ab6cb3769b 100644
> --- a/drivers/gpu/drm/amd/display/dc/dc.h
> +++ b/drivers/gpu/drm/amd/display/dc/dc.h
> @@ -2225,4 +2225,7 @@ void dc_process_dmub_dpia_hpd_int_enable(const struct dc *dc,
>   /* Disable acc mode Interfaces */
>   void dc_disable_accelerated_mode(struct dc *dc);
>   
> +bool dc_is_timing_changed(struct dc_stream_state *cur_stream,
> +		       struct dc_stream_state *new_stream);
> +
>   #endif /* DC_INTERFACE_H_ */
-- 
Hamza


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

* Re: [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings
  2023-04-17 21:17   ` Hamza Mahfooz
@ 2023-04-17 22:10     ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2023-04-17 22:10 UTC (permalink / raw)
  To: Hamza Mahfooz, Arnd Bergmann, Harry Wentland, Leo Li,
	Rodrigo Siqueira, Alex Deucher, Christian König, Pan, Xinhui,
	Dave Airlie, Daniel Vetter
  Cc: Lyude Paul, Wayne Lin, hersen wu, Fangzhi Zuo, Aurabindo Pillai,
	Alan Liu, Wenjing Liu, Jun Lei, Alex Hung, Aric Cyr,
	Qingqing Zhuo, Alvin Lee, Roman Li, Jasdeep Dhillon,
	Wesley Chalmers, amd-gfx, dri-devel, linux-kernel

On Mon, Apr 17, 2023, at 23:17, Hamza Mahfooz wrote:
> On 4/17/23 17:05, Arnd Bergmann wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>> 
>> Three functions in the amdgpu display driver cause -Wmissing-prototype
>> warnings:
>> 
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_resource.c:1858:6: error: no previous prototype for 'is_timing_changed' [-Werror=missing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_mst_types.c:210:6: error: no previous prototype for 'is_synaptics_cascaded_panamera' [-Werror=missing-prototypes]
>> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_optc.c:294:6: error: no previous prototype for 'optc3_wait_drr_doublebuffer_pending_clear' [-Werror=missing-prototypes]
>> 
>> is_timing_changed() is actually meant to be a global symbol, but needs
>> a proper name and prototype, while the other two can just be made static.
>> 
>> Fixes: 54c7b715b5ef ("drm/amd/display: Add DSC Support for Synaptics Cascaded MST Hub")
>> Fixes: 17ce8a6907f7 ("drm/amd/display: Add dsc pre-validation in atomic check")
>> Fixes: 8f0d304d21b3 ("drm/amd/display: Do not commit pipe when updating DRR")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> It seems like, only the changes for is_timing_changed() are in this patch.

Indeed. I made this patch a few weeks ago, and it looks like the other
two were fixed in the same way that I had in the meantime, so the other
changes got silently dropped during a rebase. I've updated the changelog
text and sent a v2 now.

      Arnd

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

end of thread, other threads:[~2023-04-17 22:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-17 21:05 [PATCH 1/2] drm/amd/display: mark dccg314_init() static Arnd Bergmann
2023-04-17 21:05 ` [PATCH 2/2] drm/amd/display: fix missing=prototypes warnings Arnd Bergmann
2023-04-17 21:17   ` Hamza Mahfooz
2023-04-17 22:10     ` Arnd Bergmann
2023-04-17 21:12 ` [PATCH 1/2] drm/amd/display: mark dccg314_init() static Hamza Mahfooz
2023-04-17 21:14   ` Arnd Bergmann

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