public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdgpu: mark gfx_v9_4_3_disable_gpa_mode() static
@ 2023-04-20  8:47 Arnd Bergmann
  2023-04-20  8:47 ` [PATCH 2/3] drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings Arnd Bergmann
  2023-04-20  8:47 ` [PATCH 3/3] drm/amd/display: remove unused variables in dcn21_set_backlight_level Arnd Bergmann
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2023-04-20  8:47 UTC (permalink / raw)
  To: Alex Deucher, Christian König, Pan, Xinhui, David Airlie,
	Daniel Vetter, Hawking Zhang, Le Ma
  Cc: Arnd Bergmann, Morris Zhang, amd-gfx, dri-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

This was left global by accident, the corresponding functions for other
hardware types are already static:

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c:1072:6: error: no previous prototype for function 'gfx_v9_4_3_disable_gpa_mode' [-Werror,-Wmissing-prototypes]

Fixes: 86301129698b ("drm/amdgpu: split gc v9_4_3 functionality from gc v9_0")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
index baa10ee8ec69..5d3aafba1f8e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
@@ -1069,7 +1069,7 @@ static void gfx_v9_4_3_init_pg(struct amdgpu_device *adev, int xcc_id)
 	}
 }
 
-void gfx_v9_4_3_disable_gpa_mode(struct amdgpu_device *adev, int xcc_id)
+static void gfx_v9_4_3_disable_gpa_mode(struct amdgpu_device *adev, int xcc_id)
 {
 	uint32_t data;
 
-- 
2.39.2


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

* [PATCH 2/3] drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings
  2023-04-20  8:47 [PATCH 1/3] drm/amdgpu: mark gfx_v9_4_3_disable_gpa_mode() static Arnd Bergmann
@ 2023-04-20  8:47 ` Arnd Bergmann
  2023-04-20 14:29   ` Hamza Mahfooz
  2023-04-20  8:47 ` [PATCH 3/3] drm/amd/display: remove unused variables in dcn21_set_backlight_level Arnd Bergmann
  1 sibling, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2023-04-20  8:47 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, Pan, Xinhui, David Airlie, Daniel Vetter,
	Leon Huang
  Cc: Arnd Bergmann, Qingqing Zhuo, Jun Lei, Nicholas Kazlauskas,
	Wenjing Liu, Josip Pavic, amd-gfx, dri-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The dmub_abm_set_ambient_level() function has no caller and can
just be removed, the other ones have a declaration in the
header file and just need to see the prototype:

drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:122:14: error: no previous prototype for function 'dmub_abm_get_current_backlight' [-Werror,-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:133:14: error: no previous prototype for function 'dmub_abm_get_target_backlight' [-Werror,-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:144:6: error: no previous prototype for function 'dmub_abm_set_level' [-Werror,-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:163:6: error: no previous prototype for function 'dmub_abm_set_ambient_level' [-Werror,-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:183:6: error: no previous prototype for function 'dmub_abm_init_config' [-Werror,-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:213:6: error: no previous prototype for function 'dmub_abm_set_pause' [-Werror,-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:231:6: error: no previous prototype for function 'dmub_abm_set_pipe' [-Werror,-Wmissing-prototypes]
drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:251:6: error: no previous prototype for function 'dmub_abm_set_backlight_level' [-Werror,-Wmissing-prototypes]

Fixes: b8fe56375f78 ("drm/amd/display: Refactor ABM feature")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 22 +------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
index e152c68edfd1..39da73eba86e 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
@@ -24,6 +24,7 @@
  */
 
 #include "dmub_abm.h"
+#include "dmub_abm_lcd.h"
 #include "dce_abm.h"
 #include "dc.h"
 #include "dc_dmub_srv.h"
@@ -159,27 +160,6 @@ bool dmub_abm_set_level(struct abm *abm, uint32_t level, uint8_t panel_mask)
 	return true;
 }
 
-#ifndef TRIM_AMBIENT_GAMMA
-void dmub_abm_set_ambient_level(struct abm *abm, unsigned int ambient_lux, uint8_t panel_mask)
-{
-	union dmub_rb_cmd cmd;
-	struct dc_context *dc = abm->ctx;
-
-	if (ambient_lux > 0xFFFF)
-		ambient_lux = 0xFFFF;
-
-	memset(&cmd, 0, sizeof(cmd));
-	cmd.abm_set_ambient_level.header.type = DMUB_CMD__ABM;
-	cmd.abm_set_ambient_level.header.sub_type = DMUB_CMD__ABM_SET_AMBIENT_LEVEL;
-	cmd.abm_set_ambient_level.abm_set_ambient_level_data.ambient_lux = ambient_lux;
-	cmd.abm_set_ambient_level.abm_set_ambient_level_data.version = DMUB_CMD_ABM_CONTROL_VERSION_1;
-	cmd.abm_set_ambient_level.abm_set_ambient_level_data.panel_mask = panel_mask;
-	cmd.abm_set_ambient_level.header.payload_bytes = sizeof(struct dmub_cmd_abm_set_ambient_level_data);
-
-	dm_execute_dmub_cmd(dc, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
-}
-#endif
-
 void dmub_abm_init_config(struct abm *abm,
 	const char *src,
 	unsigned int bytes,
-- 
2.39.2


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

* [PATCH 3/3] drm/amd/display: remove unused variables in dcn21_set_backlight_level
  2023-04-20  8:47 [PATCH 1/3] drm/amdgpu: mark gfx_v9_4_3_disable_gpa_mode() static Arnd Bergmann
  2023-04-20  8:47 ` [PATCH 2/3] drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings Arnd Bergmann
@ 2023-04-20  8:47 ` Arnd Bergmann
  2023-04-20 14:21   ` Hamza Mahfooz
  1 sibling, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2023-04-20  8:47 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, Pan, Xinhui, David Airlie, Daniel Vetter,
	Leon Huang
  Cc: Arnd Bergmann, Qingqing Zhuo, Wenjing Liu, amd-gfx, dri-devel,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The only references to these variables were removed, so they now cause
warnings and have to be removed as well:

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:226:20: error: unused variable 'cmd' [-Werror,-Wunused-variable]
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:229:11: error: unused variable 'otg_inst' [-Werror,-Wunused-variable]

Fixes: 6f0ef80a00ad ("drm/amd/display: Fix ABM pipe/backlight issues when change backlight")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
index 55a464a39529..43463d08f21b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
@@ -223,10 +223,8 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
 		uint32_t backlight_pwm_u16_16,
 		uint32_t frame_ramp)
 {
-	union dmub_rb_cmd cmd;
 	struct dc_context *dc = pipe_ctx->stream->ctx;
 	struct abm *abm = pipe_ctx->stream_res.abm;
-	uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
 	struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
 
 	if (dc->dc->res_pool->dmcu) {
-- 
2.39.2


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

* Re: [PATCH 3/3] drm/amd/display: remove unused variables in dcn21_set_backlight_level
  2023-04-20  8:47 ` [PATCH 3/3] drm/amd/display: remove unused variables in dcn21_set_backlight_level Arnd Bergmann
@ 2023-04-20 14:21   ` Hamza Mahfooz
  0 siblings, 0 replies; 5+ messages in thread
From: Hamza Mahfooz @ 2023-04-20 14:21 UTC (permalink / raw)
  To: Arnd Bergmann, Harry Wentland, Leo Li, Rodrigo Siqueira,
	Alex Deucher, Christian König, Pan, Xinhui, David Airlie,
	Daniel Vetter, Leon Huang
  Cc: Arnd Bergmann, Qingqing Zhuo, Wenjing Liu, linux-kernel,
	dri-devel, amd-gfx


On 4/20/23 04:47, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The only references to these variables were removed, so they now cause
> warnings and have to be removed as well:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:226:20: error: unused variable 'cmd' [-Werror,-Wunused-variable]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn21/dcn21_hwseq.c:229:11: error: unused variable 'otg_inst' [-Werror,-Wunused-variable]
> 
> Fixes: 6f0ef80a00ad ("drm/amd/display: Fix ABM pipe/backlight issues when change backlight")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

This has already been fixed, as of commit 1adb4dd5bd4b
("drm/amd/display: Remove unused variables in dcn21_hwseq.c") in
amd-staging-drm-next.

> ---
>   drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
> index 55a464a39529..43463d08f21b 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hwseq.c
> @@ -223,10 +223,8 @@ bool dcn21_set_backlight_level(struct pipe_ctx *pipe_ctx,
>   		uint32_t backlight_pwm_u16_16,
>   		uint32_t frame_ramp)
>   {
> -	union dmub_rb_cmd cmd;
>   	struct dc_context *dc = pipe_ctx->stream->ctx;
>   	struct abm *abm = pipe_ctx->stream_res.abm;
> -	uint32_t otg_inst = pipe_ctx->stream_res.tg->inst;
>   	struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
>   
>   	if (dc->dc->res_pool->dmcu) {
-- 
Hamza


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

* Re: [PATCH 2/3] drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings
  2023-04-20  8:47 ` [PATCH 2/3] drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings Arnd Bergmann
@ 2023-04-20 14:29   ` Hamza Mahfooz
  0 siblings, 0 replies; 5+ messages in thread
From: Hamza Mahfooz @ 2023-04-20 14:29 UTC (permalink / raw)
  To: Arnd Bergmann, Harry Wentland, Leo Li, Rodrigo Siqueira,
	Alex Deucher, Christian König, Pan, Xinhui, David Airlie,
	Daniel Vetter, Leon Huang
  Cc: Arnd Bergmann, Qingqing Zhuo, Wenjing Liu, linux-kernel, amd-gfx,
	dri-devel, Jun Lei, Josip Pavic, Nicholas Kazlauskas

On 4/20/23 04:47, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The dmub_abm_set_ambient_level() function has no caller and can
> just be removed, the other ones have a declaration in the
> header file and just need to see the prototype:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:122:14: error: no previous prototype for function 'dmub_abm_get_current_backlight' [-Werror,-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:133:14: error: no previous prototype for function 'dmub_abm_get_target_backlight' [-Werror,-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:144:6: error: no previous prototype for function 'dmub_abm_set_level' [-Werror,-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:163:6: error: no previous prototype for function 'dmub_abm_set_ambient_level' [-Werror,-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:183:6: error: no previous prototype for function 'dmub_abm_init_config' [-Werror,-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:213:6: error: no previous prototype for function 'dmub_abm_set_pause' [-Werror,-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:231:6: error: no previous prototype for function 'dmub_abm_set_pipe' [-Werror,-Wmissing-prototypes]
> drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dmub_abm_lcd.c:251:6: error: no previous prototype for function 'dmub_abm_set_backlight_level' [-Werror,-Wmissing-prototypes]
> 
> Fixes: b8fe56375f78 ("drm/amd/display: Refactor ABM feature")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks!

> ---
>   .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 22 +------------------
>   1 file changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
> index e152c68edfd1..39da73eba86e 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c
> @@ -24,6 +24,7 @@
>    */
>   
>   #include "dmub_abm.h"
> +#include "dmub_abm_lcd.h"
>   #include "dce_abm.h"
>   #include "dc.h"
>   #include "dc_dmub_srv.h"
> @@ -159,27 +160,6 @@ bool dmub_abm_set_level(struct abm *abm, uint32_t level, uint8_t panel_mask)
>   	return true;
>   }
>   
> -#ifndef TRIM_AMBIENT_GAMMA
> -void dmub_abm_set_ambient_level(struct abm *abm, unsigned int ambient_lux, uint8_t panel_mask)
> -{
> -	union dmub_rb_cmd cmd;
> -	struct dc_context *dc = abm->ctx;
> -
> -	if (ambient_lux > 0xFFFF)
> -		ambient_lux = 0xFFFF;
> -
> -	memset(&cmd, 0, sizeof(cmd));
> -	cmd.abm_set_ambient_level.header.type = DMUB_CMD__ABM;
> -	cmd.abm_set_ambient_level.header.sub_type = DMUB_CMD__ABM_SET_AMBIENT_LEVEL;
> -	cmd.abm_set_ambient_level.abm_set_ambient_level_data.ambient_lux = ambient_lux;
> -	cmd.abm_set_ambient_level.abm_set_ambient_level_data.version = DMUB_CMD_ABM_CONTROL_VERSION_1;
> -	cmd.abm_set_ambient_level.abm_set_ambient_level_data.panel_mask = panel_mask;
> -	cmd.abm_set_ambient_level.header.payload_bytes = sizeof(struct dmub_cmd_abm_set_ambient_level_data);
> -
> -	dm_execute_dmub_cmd(dc, &cmd, DM_DMUB_WAIT_TYPE_WAIT);
> -}
> -#endif
> -
>   void dmub_abm_init_config(struct abm *abm,
>   	const char *src,
>   	unsigned int bytes,
-- 
Hamza


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

end of thread, other threads:[~2023-04-20 14:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20  8:47 [PATCH 1/3] drm/amdgpu: mark gfx_v9_4_3_disable_gpa_mode() static Arnd Bergmann
2023-04-20  8:47 ` [PATCH 2/3] drm/amd/display: dumb_abm_lcd: avoid missing-prototype warnings Arnd Bergmann
2023-04-20 14:29   ` Hamza Mahfooz
2023-04-20  8:47 ` [PATCH 3/3] drm/amd/display: remove unused variables in dcn21_set_backlight_level Arnd Bergmann
2023-04-20 14:21   ` Hamza Mahfooz

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