dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] Resolve warnings from AMDGPU
@ 2023-02-13 20:49 Arthur Grillo
  2023-02-13 20:49 ` [PATCH 01/10] drm/amd/display: Turn global functions into static Arthur Grillo
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Hi,

This series resolve some of the warnings that appear when compiling AMDGPU
with W=1.

Each patch is focused in a specific warning.

This is my First Patch for the GSoC Project Idea about increasing code
coverage of the DRM code[1].

Thanks for reviewing!

Best regards,
Arthur Grillo

[1]: https://www.x.org/wiki/DRMcoverage2023/#firstpatch

---

Arthur Grillo (10):
  drm/amd/display: Turn global functions into static
  drm/amd/display: Add function prototypes to headers
  drm/amd/amdgpu: Add function prototypes to headers
  drm/amd/display: Add previously missing includes
  drm/amd/display: Fix excess arguments on kernel-doc
  drm/amd/display: Fix implicit enum conversion
  drm/amd/amdgpu: Deal with possible fail allocation
  drm/amd/display: Remove unused local variables
  drm/amd/display: Make variables declaration inside ifdef guard
  drm/amd/display: Remove unused local variables and function

 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c       |  2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h     |  1 +
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c        | 15 ++++---
 .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c        |  2 +-
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c  |  2 +-
 .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c |  2 +-
 .../amd/display/dc/dcn10/dcn10_link_encoder.c |  3 --
 .../drm/amd/display/dc/dcn201/dcn201_dpp.c    |  7 ----
 .../drm/amd/display/dc/dcn201/dcn201_hwseq.c  |  2 -
 .../gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c |  2 -
 .../gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c |  4 --
 .../drm/amd/display/dc/dcn30/dcn30_hwseq.c    |  3 --
 .../gpu/drm/amd/display/dc/dcn31/dcn31_apg.c  | 41 -------------------
 .../drm/amd/display/dc/dcn31/dcn31_hubbub.h   |  2 +
 .../drm/amd/display/dc/dcn32/dcn32_hubbub.h   |  2 +
 .../gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h |  2 +
 .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c |  1 +
 .../drm/amd/display/dc/dcn32/dcn32_resource.c |  5 +--
 .../display/dc/dcn32/dcn32_resource_helpers.c |  4 --
 .../dc/dml/dcn20/display_mode_vba_20.c        |  9 ++--
 .../dc/dml/dcn20/display_mode_vba_20v2.c      | 10 ++---
 .../dc/dml/dcn21/display_mode_vba_21.c        | 12 +++---
 .../dc/dml/dcn31/display_mode_vba_31.c        |  4 ++
 .../dc/dml/dcn31/display_rq_dlg_calc_31.c     |  2 -
 .../dc/dml/dcn314/display_mode_vba_314.c      |  4 ++
 .../dc/irq/dcn201/irq_service_dcn201.c        |  2 +-
 .../dc/link/accessories/link_dp_trace.c       |  1 +
 .../dc/link/protocols/link_dp_capability.c    |  4 --
 28 files changed, 47 insertions(+), 103 deletions(-)

-- 
2.39.1


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

* [PATCH 01/10] drm/amd/display: Turn global functions into static
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-14 17:39   ` Alex Deucher
  2023-02-13 20:49 ` [PATCH 02/10] drm/amd/display: Add function prototypes to headers Arthur Grillo
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Turn global functions that are only used locally into static ones. This
reduces the number of -Wmissing-prototypes warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 2 +-
 drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
index 8c368bcc8e7e..a737782b2840 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
@@ -87,7 +87,7 @@ static int dcn315_get_active_display_cnt_wa(
 	return display_count;
 }
 
-bool should_disable_otg(struct pipe_ctx *pipe)
+static bool should_disable_otg(struct pipe_ctx *pipe)
 {
 	bool ret = true;
 
diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
index 27dc8c9955f4..3c7cb3dc046b 100644
--- a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
+++ b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
@@ -37,7 +37,7 @@
 #include "soc15_hw_ip.h"
 #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h"
 
-enum dc_irq_source to_dal_irq_source_dcn201(
+static enum dc_irq_source to_dal_irq_source_dcn201(
 		struct irq_service *irq_service,
 		uint32_t src_id,
 		uint32_t ext_id)
-- 
2.39.1


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

* [PATCH 02/10] drm/amd/display: Add function prototypes to headers
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
  2023-02-13 20:49 ` [PATCH 01/10] drm/amd/display: Turn global functions into static Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-14 17:40   ` Alex Deucher
  2023-02-13 20:49 ` [PATCH 03/10] drm/amd/amdgpu: " Arthur Grillo
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Add function prototypes to headers to reduce the number of
-Wmissing-prototypes warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h | 2 ++
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h | 2 ++
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h
index e015e5a6c866..89d6208287b5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h
@@ -133,6 +133,8 @@
 int hubbub31_init_dchub_sys_ctx(struct hubbub *hubbub,
 		struct dcn_hubbub_phys_addr_config *pa_config);
 
+void hubbub31_init(struct hubbub *hubbub);
+
 void hubbub31_construct(struct dcn20_hubbub *hubbub3,
 	struct dc_context *ctx,
 	const struct dcn_hubbub_registers *hubbub_regs,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h
index bdc146890fca..b20eb04724bb 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h
@@ -204,6 +204,8 @@ void hubbub32_force_usr_retraining_allow(struct hubbub *hubbub, bool allow);
 
 void hubbub32_force_wm_propagate_to_pipes(struct hubbub *hubbub);
 
+void hubbub32_init(struct hubbub *hubbub);
+
 void dcn32_program_det_size(struct hubbub *hubbub, int hubp_inst, unsigned int det_buffer_size_in_kbyte);
 
 void hubbub32_construct(struct dcn20_hubbub *hubbub2,
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h
index 56ef71151536..4cdbf63c952b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h
@@ -61,6 +61,8 @@ void hubp32_phantom_hubp_post_enable(struct hubp *hubp);
 void hubp32_cursor_set_attributes(struct hubp *hubp,
 		const struct dc_cursor_attributes *attr);
 
+void hubp32_init(struct hubp *hubp);
+
 bool hubp32_construct(
 	struct dcn20_hubp *hubp2,
 	struct dc_context *ctx,
-- 
2.39.1


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

* [PATCH 03/10] drm/amd/amdgpu: Add function prototypes to headers
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
  2023-02-13 20:49 ` [PATCH 01/10] drm/amd/display: Turn global functions into static Arthur Grillo
  2023-02-13 20:49 ` [PATCH 02/10] drm/amd/display: Add function prototypes to headers Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-14 17:41   ` Alex Deucher
  2023-02-13 20:49 ` [PATCH 04/10] drm/amd/display: Add previously missing includes Arthur Grillo
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Add function prototypes to headers to reduce the number of
-Wmissing-prototypes warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
index bee93ab4298f..b03321e7d2d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
@@ -538,6 +538,7 @@ struct amdgpu_firmware {
 
 void amdgpu_ucode_print_mc_hdr(const struct common_firmware_header *hdr);
 void amdgpu_ucode_print_smc_hdr(const struct common_firmware_header *hdr);
+void amdgpu_ucode_print_imu_hdr(const struct common_firmware_header *hdr);
 void amdgpu_ucode_print_gfx_hdr(const struct common_firmware_header *hdr);
 void amdgpu_ucode_print_rlc_hdr(const struct common_firmware_header *hdr);
 void amdgpu_ucode_print_sdma_hdr(const struct common_firmware_header *hdr);
-- 
2.39.1


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

* [PATCH 04/10] drm/amd/display: Add previously missing includes
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
                   ` (2 preceding siblings ...)
  2023-02-13 20:49 ` [PATCH 03/10] drm/amd/amdgpu: " Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-14 17:45   ` Alex Deucher
  2023-02-13 20:49 ` [PATCH 05/10] drm/amd/display: Fix excess arguments on kernel-doc Arthur Grillo
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Add includes that were previously missing to reduce the number of
-Wmissing-prototypes warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c               | 1 +
 drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
index 330d7cbc7398..3069af3684c6 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
@@ -30,6 +30,7 @@
 #include "dcn30/dcn30_hwseq.h"
 #include "dcn31/dcn31_hwseq.h"
 #include "dcn32_hwseq.h"
+#include "dcn32_init.h"
 
 static const struct hw_sequencer_funcs dcn32_funcs = {
 	.program_gamut_remap = dcn10_program_gamut_remap,
diff --git a/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c b/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
index 04838a31e513..257f4fc065a5 100644
--- a/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
+++ b/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
@@ -24,6 +24,7 @@
  */
 #include "dc_link.h"
 #include "link_dp_trace.h"
+#include "link.h"
 
 void dp_trace_init(struct dc_link *link)
 {
-- 
2.39.1


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

* [PATCH 05/10] drm/amd/display: Fix excess arguments on kernel-doc
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
                   ` (3 preceding siblings ...)
  2023-02-13 20:49 ` [PATCH 04/10] drm/amd/display: Add previously missing includes Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-14 17:49   ` Alex Deucher
  2023-02-13 20:49 ` [PATCH 06/10] drm/amd/display: Fix implicit enum conversion Arthur Grillo
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Remove arguments present on kernel-doc that are not present on the
function declaration and add the new ones if present.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c            | 15 +++++++--------
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c      |  2 +-
 .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c |  2 +-
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
index 3d36329be384..40e6b22daa22 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
@@ -273,8 +273,6 @@ static void sdma_v6_0_ring_emit_ib(struct amdgpu_ring *ring,
  * sdma_v6_0_ring_emit_mem_sync - flush the IB by graphics cache rinse
  *
  * @ring: amdgpu ring pointer
- * @job: job to retrieve vmid from
- * @ib: IB object to schedule
  *
  * flush the IB by graphics cache rinse.
  */
@@ -326,7 +324,9 @@ static void sdma_v6_0_ring_emit_hdp_flush(struct amdgpu_ring *ring)
  * sdma_v6_0_ring_emit_fence - emit a fence on the DMA ring
  *
  * @ring: amdgpu ring pointer
- * @fence: amdgpu fence object
+ * @addr: address
+ * @seq: fence seq number
+ * @flags: fence flags
  *
  * Add a DMA fence packet to the ring to write
  * the fence seq number and DMA trap packet to generate
@@ -1060,10 +1060,9 @@ static void sdma_v6_0_vm_copy_pte(struct amdgpu_ib *ib,
  *
  * @ib: indirect buffer to fill with commands
  * @pe: addr of the page entry
- * @addr: dst addr to write into pe
+ * @value: dst addr to write into pe
  * @count: number of page entries to update
  * @incr: increase next addr by incr bytes
- * @flags: access flags
  *
  * Update PTEs by writing them manually using sDMA.
  */
@@ -1167,7 +1166,6 @@ static void sdma_v6_0_ring_emit_pipeline_sync(struct amdgpu_ring *ring)
  * sdma_v6_0_ring_emit_vm_flush - vm flush using sDMA
  *
  * @ring: amdgpu_ring pointer
- * @vm: amdgpu_vm pointer
  *
  * Update the page table base and flush the VM TLB
  * using sDMA.
@@ -1591,10 +1589,11 @@ static void sdma_v6_0_set_irq_funcs(struct amdgpu_device *adev)
 /**
  * sdma_v6_0_emit_copy_buffer - copy buffer using the sDMA engine
  *
- * @ring: amdgpu_ring structure holding ring information
+ * @ib: indirect buffer to fill with commands
  * @src_offset: src GPU address
  * @dst_offset: dst GPU address
  * @byte_count: number of bytes to xfer
+ * @tmz: if a secure copy should be used
  *
  * Copy GPU buffers using the DMA engine.
  * Used by the amdgpu ttm implementation to move pages if
@@ -1620,7 +1619,7 @@ static void sdma_v6_0_emit_copy_buffer(struct amdgpu_ib *ib,
 /**
  * sdma_v6_0_emit_fill_buffer - fill buffer using the sDMA engine
  *
- * @ring: amdgpu_ring structure holding ring information
+ * @ib: indirect buffer to fill
  * @src_data: value to write to buffer
  * @dst_offset: dst GPU address
  * @byte_count: number of bytes to xfer
diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index 6ccf477d1c4d..c2092775ca88 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -698,7 +698,7 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,
  *
  * @dc: [in] current dc state
  * @context: [in] new dc state
- * @cmd: [in] DMUB cmd to be populated with SubVP info
+ * @enable: [in] if true enables the pipes population
  *
  * This function loops through each pipe and populates the DMUB SubVP CMD info
  * based on the pipe (e.g. SubVP, VBLANK).
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
index f607a0e28f14..f62368da875d 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
@@ -581,7 +581,7 @@ static void dpp1_dscl_set_manual_ratio_init(
  * dpp1_dscl_set_recout - Set the first pixel of RECOUT in the OTG active area
  *
  * @dpp: DPP data struct
- * @recount: Rectangle information
+ * @recout: Rectangle information
  *
  * This function sets the MPC RECOUT_START and RECOUT_SIZE registers based on
  * the values specified in the recount parameter.
-- 
2.39.1


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

* [PATCH 06/10] drm/amd/display: Fix implicit enum conversion
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
                   ` (4 preceding siblings ...)
  2023-02-13 20:49 ` [PATCH 05/10] drm/amd/display: Fix excess arguments on kernel-doc Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-14 11:42   ` Michel Dänzer
  2023-02-13 20:49 ` [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation Arthur Grillo
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Make implicit enum conversion to avoid -Wenum-conversion warning, such
as:

drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn21/display_mode_vba_21.c:4109:88: warning: implicit conversion from ‘enum <anonymous>’ to ‘enum odm_combine_mode’ [-Wenum-conversion]
 4109 |                                                 locals->ODMCombineEnablePerState[i][k] = true;
      |                                                                                        ^

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 .../amd/display/dc/dml/dcn20/display_mode_vba_20.c   |  9 +++++----
 .../amd/display/dc/dml/dcn20/display_mode_vba_20v2.c | 10 +++++-----
 .../amd/display/dc/dml/dcn21/display_mode_vba_21.c   | 12 ++++++------
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
index d3b5b6fedf04..a7d1884ea38c 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c
@@ -26,6 +26,7 @@
 #include "../display_mode_lib.h"
 #include "display_mode_vba_20.h"
 #include "../dml_inline_defs.h"
+#include "dml/display_mode_enums.h"
 
 /*
  * NOTE:
@@ -3897,14 +3898,14 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 					mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine = mode_lib->vba.PixelClock[k] / 2
 							* (1 + mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading / 100.0);
 
-				locals->ODMCombineEnablePerState[i][k] = false;
+				locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)false;
 				mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithoutODMCombine;
 				if (mode_lib->vba.ODMCapability) {
 					if (locals->PlaneRequiredDISPCLKWithoutODMCombine > mode_lib->vba.MaxDispclkRoundedDownToDFSGranularity) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					} else if (locals->HActive[k] > DCN20_MAX_420_IMAGE_WIDTH && locals->OutputFormat[k] == dm_420) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					}
 				}
@@ -3957,7 +3958,7 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 				locals->RequiredDISPCLK[i][j] = 0.0;
 				locals->DISPCLK_DPPCLK_Support[i][j] = true;
 				for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
-					locals->ODMCombineEnablePerState[i][k] = false;
+					locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)false;
 					if (locals->SwathWidthYSingleDPP[k] <= locals->MaximumSwathWidth[k]) {
 						locals->NoOfDPP[i][j][k] = 1;
 						locals->RequiredDPPCLK[i][j][k] = locals->MinDPPCLKUsingSingleDPP[k]
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
index edd098c7eb92..8e8096eec3f8 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
@@ -4008,17 +4008,17 @@ void dml20v2_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode
 					mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine = mode_lib->vba.PixelClock[k] / 2
 							* (1 + mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading / 100.0);
 
-				locals->ODMCombineEnablePerState[i][k] = false;
+				locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)false;
 				mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithoutODMCombine;
 				if (mode_lib->vba.ODMCapability) {
 					if (locals->PlaneRequiredDISPCLKWithoutODMCombine > MaxMaxDispclkRoundedDown) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					} else if (locals->DSCEnabled[k] && (locals->HActive[k] > DCN20_MAX_DSC_IMAGE_WIDTH)) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					} else if (locals->HActive[k] > DCN20_MAX_420_IMAGE_WIDTH && locals->OutputFormat[k] == dm_420) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					}
 				}
@@ -4071,7 +4071,7 @@ void dml20v2_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode
 				locals->RequiredDISPCLK[i][j] = 0.0;
 				locals->DISPCLK_DPPCLK_Support[i][j] = true;
 				for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
-					locals->ODMCombineEnablePerState[i][k] = false;
+					locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)false;
 					if (locals->SwathWidthYSingleDPP[k] <= locals->MaximumSwathWidth[k]) {
 						locals->NoOfDPP[i][j][k] = 1;
 						locals->RequiredDPPCLK[i][j][k] = locals->MinDPPCLKUsingSingleDPP[k]
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
index 1d84ae50311d..f5bdfd8f0fc8 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c
@@ -4102,17 +4102,17 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 					mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine = mode_lib->vba.PixelClock[k] / 2
 							* (1 + mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading / 100.0);
 
-				locals->ODMCombineEnablePerState[i][k] = false;
+				locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)false;
 				mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithoutODMCombine;
 				if (mode_lib->vba.ODMCapability) {
 					if (locals->PlaneRequiredDISPCLKWithoutODMCombine > MaxMaxDispclkRoundedDown) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					} else if (locals->DSCEnabled[k] && (locals->HActive[k] > DCN21_MAX_DSC_IMAGE_WIDTH)) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					} else if (locals->HActive[k] > DCN21_MAX_420_IMAGE_WIDTH && locals->OutputFormat[k] == dm_420) {
-						locals->ODMCombineEnablePerState[i][k] = true;
+						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;
 						mode_lib->vba.PlaneRequiredDISPCLK = mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine;
 					}
 				}
@@ -4165,7 +4165,7 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 				locals->RequiredDISPCLK[i][j] = 0.0;
 				locals->DISPCLK_DPPCLK_Support[i][j] = true;
 				for (k = 0; k <= mode_lib->vba.NumberOfActivePlanes - 1; k++) {
-					locals->ODMCombineEnablePerState[i][k] = false;
+					locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)false;
 					if (locals->SwathWidthYSingleDPP[k] <= locals->MaximumSwathWidth[k]) {
 						locals->NoOfDPP[i][j][k] = 1;
 						locals->RequiredDPPCLK[i][j][k] = locals->MinDPPCLKUsingSingleDPP[k]
@@ -5230,7 +5230,7 @@ void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
 			mode_lib->vba.ODMCombineEnabled[k] =
 					locals->ODMCombineEnablePerState[mode_lib->vba.VoltageLevel][k];
 		} else {
-			mode_lib->vba.ODMCombineEnabled[k] = false;
+			mode_lib->vba.ODMCombineEnabled[k] = (enum odm_combine_mode)false;
 		}
 		mode_lib->vba.DSCEnabled[k] =
 				locals->RequiresDSC[mode_lib->vba.VoltageLevel][k];
-- 
2.39.1


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

* [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
                   ` (5 preceding siblings ...)
  2023-02-13 20:49 ` [PATCH 06/10] drm/amd/display: Fix implicit enum conversion Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-13 21:01   ` Christian König
  2023-02-13 20:49 ` [PATCH 08/10] drm/amd/display: Remove unused local variables Arthur Grillo
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Deal with return value of an allocation. This reduces the number of
-Wunused-but-set-variable warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
index 82e27bd4f038..00c0876840c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
@@ -1104,6 +1104,8 @@ int amdgpu_mes_ctx_alloc_meta_data(struct amdgpu_device *adev,
 			    &ctx_data->meta_data_obj,
 			    &ctx_data->meta_data_mc_addr,
 			    &ctx_data->meta_data_ptr);
+	if (r)
+		return r;
 	if (!ctx_data->meta_data_obj)
 		return -ENOMEM;
 
-- 
2.39.1


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

* [PATCH 08/10] drm/amd/display: Remove unused local variables
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
                   ` (6 preceding siblings ...)
  2023-02-13 20:49 ` [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-13 21:09   ` Alex Deucher
  2023-02-13 20:49 ` [PATCH 09/10] drm/amd/display: Make variables declaration inside ifdef guard Arthur Grillo
  2023-02-13 20:49 ` [PATCH 10/10] drm/amd/display: Remove unused local variables and function Arthur Grillo
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Remove local variables that were just set but were never used. This
decrease the number of -Wunused-but-set-variable warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c  | 3 ---
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c         | 7 -------
 drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c       | 2 --
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c          | 2 --
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c          | 4 ----
 drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c         | 3 ---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c      | 5 +----
 .../gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c  | 4 ----
 .../drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c  | 2 --
 .../drm/amd/display/dc/link/protocols/link_dp_capability.c | 4 ----
 10 files changed, 1 insertion(+), 35 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
index c4287147b853..81aa1631945a 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
@@ -1219,7 +1219,6 @@ void dcn10_link_encoder_update_mst_stream_allocation_table(
 	const struct link_mst_stream_allocation_table *table)
 {
 	struct dcn10_link_encoder *enc10 = TO_DCN10_LINK_ENC(enc);
-	uint32_t value0 = 0;
 	uint32_t value1 = 0;
 	uint32_t value2 = 0;
 	uint32_t slots = 0;
@@ -1321,8 +1320,6 @@ void dcn10_link_encoder_update_mst_stream_allocation_table(
 	do {
 		udelay(10);
 
-		value0 = REG_READ(DP_MSE_SAT_UPDATE);
-
 		REG_GET(DP_MSE_SAT_UPDATE,
 				DP_MSE_SAT_UPDATE, &value1);
 
diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c
index f50ab961bc17..a7268027a472 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c
@@ -185,13 +185,6 @@ static bool dpp201_get_optimal_number_of_taps(
 		struct scaler_data *scl_data,
 		const struct scaling_taps *in_taps)
 {
-	uint32_t pixel_width;
-
-	if (scl_data->viewport.width > scl_data->recout.width)
-		pixel_width = scl_data->recout.width;
-	else
-		pixel_width = scl_data->viewport.width;
-
 	if (scl_data->viewport.width  != scl_data->h_active &&
 		scl_data->viewport.height != scl_data->v_active &&
 		dpp->caps->dscl_data_proc_format == DSCL_DATA_PRCESSING_FIXED_FORMAT &&
diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
index 61bcfa03c4e7..1aeb04fbd89d 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
@@ -541,8 +541,6 @@ void dcn201_pipe_control_lock(
 	bool lock)
 {
 	struct dce_hwseq *hws = dc->hwseq;
-	struct hubp *hubp = NULL;
-	hubp = dc->res_pool->hubps[pipe->pipe_idx];
 	/* use TG master update lock to lock everything on the TG
 	 * therefore only top pipe need to lock
 	 */
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c
index 95528e5ef89e..55e388c4c98b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c
@@ -123,7 +123,6 @@ void afmt3_se_audio_setup(
 {
 	struct dcn30_afmt *afmt3 = DCN30_AFMT_FROM_AFMT(afmt);
 
-	uint32_t speakers = 0;
 	uint32_t channels = 0;
 
 	ASSERT(audio_info);
@@ -131,7 +130,6 @@ void afmt3_se_audio_setup(
 	if (audio_info == NULL)
 		return;
 
-	speakers = audio_info->flags.info.ALLSPEAKERS;
 	channels = speakers_to_channels(audio_info->flags.speaker_flags).all;
 
 	/* setup the audio stream source select (audio -> dig mapping) */
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
index dc3e8df706b3..e46bbe7ddcc9 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
@@ -47,13 +47,9 @@ void hubp3_set_vm_system_aperture_settings(struct hubp *hubp,
 {
 	struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp);
 
-	PHYSICAL_ADDRESS_LOC mc_vm_apt_default;
 	PHYSICAL_ADDRESS_LOC mc_vm_apt_low;
 	PHYSICAL_ADDRESS_LOC mc_vm_apt_high;
 
-	// The format of default addr is 48:12 of the 48 bit addr
-	mc_vm_apt_default.quad_part = apt->sys_default.quad_part >> 12;
-
 	// The format of high/low are 48:18 of the 48 bit addr
 	mc_vm_apt_low.quad_part = apt->sys_low.quad_part >> 18;
 	mc_vm_apt_high.quad_part = apt->sys_high.quad_part >> 18;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
index 444f9fad3de6..1d848d14508b 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
@@ -322,13 +322,10 @@ void dcn30_enable_writeback(
 {
 	struct dwbc *dwb;
 	struct mcif_wb *mcif_wb;
-	struct timing_generator *optc;
 
 	dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
 	mcif_wb = dc->res_pool->mcif_wb[wb_info->dwb_pipe_inst];
 
-	/* set the OPTC source mux */
-	optc = dc->res_pool->timing_generators[dwb->otg_inst];
 	DC_LOG_DWB("%s dwb_pipe_inst = %d, mpcc_inst = %d",\
 		__func__, wb_info->dwb_pipe_inst,\
 		wb_info->mpcc_inst);
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
index 74e50c09bb62..e997bb98b43d 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
@@ -1611,7 +1611,6 @@ bool dcn32_acquire_post_bldn_3dlut(
 		struct dc_transfer_func **shaper)
 {
 	bool ret = false;
-	union dc_3dlut_state *state;
 
 	ASSERT(*lut == NULL && *shaper == NULL);
 	*lut = NULL;
@@ -1620,7 +1619,6 @@ bool dcn32_acquire_post_bldn_3dlut(
 	if (!res_ctx->is_mpc_3dlut_acquired[mpcc_id]) {
 		*lut = pool->mpc_lut[mpcc_id];
 		*shaper = pool->mpc_shaper[mpcc_id];
-		state = &pool->mpc_lut[mpcc_id]->state;
 		res_ctx->is_mpc_3dlut_acquired[mpcc_id] = true;
 		ret = true;
 	}
@@ -1913,7 +1911,6 @@ int dcn32_populate_dml_pipes_from_context(
 	struct resource_context *res_ctx = &context->res_ctx;
 	struct pipe_ctx *pipe;
 	bool subvp_in_use = false;
-	uint8_t is_pipe_split_expected[MAX_PIPES] = {0};
 	struct dc_crtc_timing *timing;
 
 	dcn20_populate_dml_pipes_from_context(dc, context, pipes, fast_validate);
@@ -2002,7 +1999,7 @@ int dcn32_populate_dml_pipes_from_context(
 		}
 
 		DC_FP_START();
-		is_pipe_split_expected[i] = dcn32_predict_pipe_split(context, &pipes[pipe_cnt]);
+		dcn32_predict_pipe_split(context, &pipes[pipe_cnt]);
 		DC_FP_END();
 
 		pipe_cnt++;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
index 3a2d7bcc4b6d..a616cf078cf4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
@@ -59,25 +59,21 @@ uint32_t dcn32_helper_calculate_mall_bytes_for_cursor(
 {
 	struct hubp *hubp = pipe_ctx->plane_res.hubp;
 	uint32_t cursor_size = hubp->curs_attr.pitch * hubp->curs_attr.height;
-	uint32_t cursor_bpp = 4;
 	uint32_t cursor_mall_size_bytes = 0;
 
 	switch (pipe_ctx->stream->cursor_attributes.color_format) {
 	case CURSOR_MODE_MONO:
 		cursor_size /= 2;
-		cursor_bpp = 4;
 		break;
 	case CURSOR_MODE_COLOR_1BIT_AND:
 	case CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA:
 	case CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA:
 		cursor_size *= 4;
-		cursor_bpp = 4;
 		break;
 
 	case CURSOR_MODE_COLOR_64BIT_FP_PRE_MULTIPLIED:
 	case CURSOR_MODE_COLOR_64BIT_FP_UN_PRE_MULTIPLIED:
 		cursor_size *= 8;
-		cursor_bpp = 8;
 		break;
 	}
 
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
index 35d10b4d018b..2244e4fb8c96 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
@@ -902,7 +902,6 @@ static void dml_rq_dlg_get_dlg_params(
 	double hratio_c;
 	double vratio_l;
 	double vratio_c;
-	bool scl_enable;
 
 	unsigned int swath_width_ub_l;
 	unsigned int dpte_groups_per_row_ub_l;
@@ -1020,7 +1019,6 @@ static void dml_rq_dlg_get_dlg_params(
 	hratio_c = scl->hscl_ratio_c;
 	vratio_l = scl->vscl_ratio;
 	vratio_c = scl->vscl_ratio_c;
-	scl_enable = scl->scl_enable;
 
 	swath_width_ub_l = rq_dlg_param->rq_l.swath_width_ub;
 	dpte_groups_per_row_ub_l = rq_dlg_param->rq_l.dpte_groups_per_row_ub;
diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
index 138e5684c7fd..1c2ce08bdece 100644
--- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
+++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
@@ -276,7 +276,6 @@ static void dp_wa_power_up_0010FA(struct dc_link *link, uint8_t *dpcd_data,
 		int length)
 {
 	int retry = 0;
-	union dp_downstream_port_present ds_port = { 0 };
 
 	if (!link->dpcd_caps.dpcd_rev.raw) {
 		do {
@@ -289,9 +288,6 @@ static void dp_wa_power_up_0010FA(struct dc_link *link, uint8_t *dpcd_data,
 		} while (retry++ < 4 && !link->dpcd_caps.dpcd_rev.raw);
 	}
 
-	ds_port.byte = dpcd_data[DP_DOWNSTREAMPORT_PRESENT -
-				 DP_DPCD_REV];
-
 	if (link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_VGA_CONVERTER) {
 		switch (link->dpcd_caps.branch_dev_id) {
 		/* 0010FA active dongles (DP-VGA, DP-DLDVI converters) power down
-- 
2.39.1


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

* [PATCH 09/10] drm/amd/display: Make variables declaration inside ifdef guard
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
                   ` (7 preceding siblings ...)
  2023-02-13 20:49 ` [PATCH 08/10] drm/amd/display: Remove unused local variables Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  2023-02-14 17:52   ` Alex Deucher
  2023-02-13 20:49 ` [PATCH 10/10] drm/amd/display: Remove unused local variables and function Arthur Grillo
  9 siblings, 1 reply; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Make variables declaration inside ifdef guard, as they are only used
inside the same ifdef guard. This remove some of the
-Wunused-but-set-variable warning.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 .../gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c    | 4 ++++
 .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
index ec351c8418cb..27f488405335 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
@@ -878,7 +878,9 @@ static bool CalculatePrefetchSchedule(
 	double DSTTotalPixelsAfterScaler;
 	double LineTime;
 	double dst_y_prefetch_equ;
+#ifdef __DML_VBA_DEBUG__
 	double Tsw_oto;
+#endif
 	double prefetch_bw_oto;
 	double prefetch_bw_pr;
 	double Tvm_oto;
@@ -1060,7 +1062,9 @@ static bool CalculatePrefetchSchedule(
 
 	min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre);
 	Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4;
+#ifdef __DML_VBA_DEBUG__
 	Tsw_oto = Lsw_oto * LineTime;
+#endif
 
 
 #ifdef __DML_VBA_DEBUG__
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
index 950669f2c10d..0fd3889c2061 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
@@ -900,7 +900,9 @@ static bool CalculatePrefetchSchedule(
 	double DSTTotalPixelsAfterScaler;
 	double LineTime;
 	double dst_y_prefetch_equ;
+#ifdef __DML_VBA_DEBUG__
 	double Tsw_oto;
+#endif
 	double prefetch_bw_oto;
 	double prefetch_bw_pr;
 	double Tvm_oto;
@@ -1082,7 +1084,9 @@ static bool CalculatePrefetchSchedule(
 
 	min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre);
 	Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4;
+#ifdef __DML_VBA_DEBUG__
 	Tsw_oto = Lsw_oto * LineTime;
+#endif
 
 
 #ifdef __DML_VBA_DEBUG__
-- 
2.39.1


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

* [PATCH 10/10] drm/amd/display: Remove unused local variables and function
  2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
                   ` (8 preceding siblings ...)
  2023-02-13 20:49 ` [PATCH 09/10] drm/amd/display: Make variables declaration inside ifdef guard Arthur Grillo
@ 2023-02-13 20:49 ` Arthur Grillo
  9 siblings, 0 replies; 20+ messages in thread
From: Arthur Grillo @ 2023-02-13 20:49 UTC (permalink / raw)
  To: amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	Arthur Grillo, mairacanal, alexander.deucher, andrealmeid,
	christian.koenig

Remove a couple of local variables that are only set but never used,
also remove an static utility function that is never used in consequence
of the variable removal.

This decrease the number of -Wunused-but-set-variable warnings.

Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
---
 .../gpu/drm/amd/display/dc/dcn31/dcn31_apg.c  | 41 -------------------
 1 file changed, 41 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c
index 24e9ff65434d..05aac3e444b4 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c
@@ -72,40 +72,6 @@ static void apg31_disable(
 	REG_UPDATE(APG_CONTROL2, APG_ENABLE, 0);
 }
 
-static union audio_cea_channels speakers_to_channels(
-	struct audio_speaker_flags speaker_flags)
-{
-	union audio_cea_channels cea_channels = {0};
-
-	/* these are one to one */
-	cea_channels.channels.FL = speaker_flags.FL_FR;
-	cea_channels.channels.FR = speaker_flags.FL_FR;
-	cea_channels.channels.LFE = speaker_flags.LFE;
-	cea_channels.channels.FC = speaker_flags.FC;
-
-	/* if Rear Left and Right exist move RC speaker to channel 7
-	 * otherwise to channel 5
-	 */
-	if (speaker_flags.RL_RR) {
-		cea_channels.channels.RL_RC = speaker_flags.RL_RR;
-		cea_channels.channels.RR = speaker_flags.RL_RR;
-		cea_channels.channels.RC_RLC_FLC = speaker_flags.RC;
-	} else {
-		cea_channels.channels.RL_RC = speaker_flags.RC;
-	}
-
-	/* FRONT Left Right Center and REAR Left Right Center are exclusive */
-	if (speaker_flags.FLC_FRC) {
-		cea_channels.channels.RC_RLC_FLC = speaker_flags.FLC_FRC;
-		cea_channels.channels.RRC_FRC = speaker_flags.FLC_FRC;
-	} else {
-		cea_channels.channels.RC_RLC_FLC = speaker_flags.RLC_RRC;
-		cea_channels.channels.RRC_FRC = speaker_flags.RLC_RRC;
-	}
-
-	return cea_channels;
-}
-
 static void apg31_se_audio_setup(
 	struct apg *apg,
 	unsigned int az_inst,
@@ -113,24 +79,17 @@ static void apg31_se_audio_setup(
 {
 	struct dcn31_apg *apg31 = DCN31_APG_FROM_APG(apg);
 
-	uint32_t speakers = 0;
-	uint32_t channels = 0;
-
 	ASSERT(audio_info);
 	/* This should not happen.it does so we don't get BSOD*/
 	if (audio_info == NULL)
 		return;
 
-	speakers = audio_info->flags.info.ALLSPEAKERS;
-	channels = speakers_to_channels(audio_info->flags.speaker_flags).all;
-
 	/* DisplayPort only allows for one audio stream with stream ID 0 */
 	REG_UPDATE(APG_CONTROL2, APG_DP_AUDIO_STREAM_ID, 0);
 
 	/* When running in "pair mode", pairs of audio channels have their own enable
 	 * this is for really old audio drivers */
 	REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, 0xFF);
-	// REG_UPDATE(APG_DBG_GEN_CONTROL, APG_DBG_AUDIO_CHANNEL_ENABLE, channels);
 
 	/* Disable forced mem power off */
 	REG_UPDATE(APG_MEM_PWR, APG_MEM_PWR_FORCE, 0);
-- 
2.39.1


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

* Re: [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation
  2023-02-13 20:49 ` [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation Arthur Grillo
@ 2023-02-13 21:01   ` Christian König
  0 siblings, 0 replies; 20+ messages in thread
From: Christian König @ 2023-02-13 21:01 UTC (permalink / raw)
  To: Arthur Grillo, amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	mairacanal, alexander.deucher, andrealmeid

Am 13.02.23 um 21:49 schrieb Arthur Grillo:
> Deal with return value of an allocation. This reduces the number of
> -Wunused-but-set-variable warnings.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> index 82e27bd4f038..00c0876840c1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
> @@ -1104,6 +1104,8 @@ int amdgpu_mes_ctx_alloc_meta_data(struct amdgpu_device *adev,
>   			    &ctx_data->meta_data_obj,
>   			    &ctx_data->meta_data_mc_addr,
>   			    &ctx_data->meta_data_ptr);
> +	if (r)
> +		return r;
>   	if (!ctx_data->meta_data_obj)
>   		return -ENOMEM;

That change doesn't make much sense.

We already check ctx_data->meta_data_obj and return -ENOMEM here when 
something goes wrong.

We could potentially remove that, but it's not really a problem as far 
as I can see.

Christian.

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

* Re: [PATCH 08/10] drm/amd/display: Remove unused local variables
  2023-02-13 20:49 ` [PATCH 08/10] drm/amd/display: Remove unused local variables Arthur Grillo
@ 2023-02-13 21:09   ` Alex Deucher
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Deucher @ 2023-02-13 21:09 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	dri-devel, mairacanal, amd-gfx, alexander.deucher, andrealmeid,
	christian.koenig

On Mon, Feb 13, 2023 at 3:50 PM Arthur Grillo <arthurgrillo@riseup.net> wrote:
>
> Remove local variables that were just set but were never used. This
> decrease the number of -Wunused-but-set-variable warnings.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c  | 3 ---
>  drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c         | 7 -------
>  drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c       | 2 --
>  drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c          | 2 --
>  drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c          | 4 ----
>  drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c         | 3 ---
>  drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c      | 5 +----
>  .../gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c  | 4 ----
>  .../drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c  | 2 --
>  .../drm/amd/display/dc/link/protocols/link_dp_capability.c | 4 ----
>  10 files changed, 1 insertion(+), 35 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
> index c4287147b853..81aa1631945a 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c
> @@ -1219,7 +1219,6 @@ void dcn10_link_encoder_update_mst_stream_allocation_table(
>         const struct link_mst_stream_allocation_table *table)
>  {
>         struct dcn10_link_encoder *enc10 = TO_DCN10_LINK_ENC(enc);
> -       uint32_t value0 = 0;
>         uint32_t value1 = 0;
>         uint32_t value2 = 0;
>         uint32_t slots = 0;
> @@ -1321,8 +1320,6 @@ void dcn10_link_encoder_update_mst_stream_allocation_table(
>         do {
>                 udelay(10);
>
> -               value0 = REG_READ(DP_MSE_SAT_UPDATE);
> -

This may have impacts on behavior since we are reading a register here.

Alex

>                 REG_GET(DP_MSE_SAT_UPDATE,
>                                 DP_MSE_SAT_UPDATE, &value1);
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c
> index f50ab961bc17..a7268027a472 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c
> @@ -185,13 +185,6 @@ static bool dpp201_get_optimal_number_of_taps(
>                 struct scaler_data *scl_data,
>                 const struct scaling_taps *in_taps)
>  {
> -       uint32_t pixel_width;
> -
> -       if (scl_data->viewport.width > scl_data->recout.width)
> -               pixel_width = scl_data->recout.width;
> -       else
> -               pixel_width = scl_data->viewport.width;
> -
>         if (scl_data->viewport.width  != scl_data->h_active &&
>                 scl_data->viewport.height != scl_data->v_active &&
>                 dpp->caps->dscl_data_proc_format == DSCL_DATA_PRCESSING_FIXED_FORMAT &&
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
> index 61bcfa03c4e7..1aeb04fbd89d 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c
> @@ -541,8 +541,6 @@ void dcn201_pipe_control_lock(
>         bool lock)
>  {
>         struct dce_hwseq *hws = dc->hwseq;
> -       struct hubp *hubp = NULL;
> -       hubp = dc->res_pool->hubps[pipe->pipe_idx];
>         /* use TG master update lock to lock everything on the TG
>          * therefore only top pipe need to lock
>          */
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c
> index 95528e5ef89e..55e388c4c98b 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c
> @@ -123,7 +123,6 @@ void afmt3_se_audio_setup(
>  {
>         struct dcn30_afmt *afmt3 = DCN30_AFMT_FROM_AFMT(afmt);
>
> -       uint32_t speakers = 0;
>         uint32_t channels = 0;
>
>         ASSERT(audio_info);
> @@ -131,7 +130,6 @@ void afmt3_se_audio_setup(
>         if (audio_info == NULL)
>                 return;
>
> -       speakers = audio_info->flags.info.ALLSPEAKERS;
>         channels = speakers_to_channels(audio_info->flags.speaker_flags).all;
>
>         /* setup the audio stream source select (audio -> dig mapping) */
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
> index dc3e8df706b3..e46bbe7ddcc9 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c
> @@ -47,13 +47,9 @@ void hubp3_set_vm_system_aperture_settings(struct hubp *hubp,
>  {
>         struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp);
>
> -       PHYSICAL_ADDRESS_LOC mc_vm_apt_default;
>         PHYSICAL_ADDRESS_LOC mc_vm_apt_low;
>         PHYSICAL_ADDRESS_LOC mc_vm_apt_high;
>
> -       // The format of default addr is 48:12 of the 48 bit addr
> -       mc_vm_apt_default.quad_part = apt->sys_default.quad_part >> 12;
> -
>         // The format of high/low are 48:18 of the 48 bit addr
>         mc_vm_apt_low.quad_part = apt->sys_low.quad_part >> 18;
>         mc_vm_apt_high.quad_part = apt->sys_high.quad_part >> 18;
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
> index 444f9fad3de6..1d848d14508b 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c
> @@ -322,13 +322,10 @@ void dcn30_enable_writeback(
>  {
>         struct dwbc *dwb;
>         struct mcif_wb *mcif_wb;
> -       struct timing_generator *optc;
>
>         dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst];
>         mcif_wb = dc->res_pool->mcif_wb[wb_info->dwb_pipe_inst];
>
> -       /* set the OPTC source mux */
> -       optc = dc->res_pool->timing_generators[dwb->otg_inst];
>         DC_LOG_DWB("%s dwb_pipe_inst = %d, mpcc_inst = %d",\
>                 __func__, wb_info->dwb_pipe_inst,\
>                 wb_info->mpcc_inst);
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
> index 74e50c09bb62..e997bb98b43d 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
> @@ -1611,7 +1611,6 @@ bool dcn32_acquire_post_bldn_3dlut(
>                 struct dc_transfer_func **shaper)
>  {
>         bool ret = false;
> -       union dc_3dlut_state *state;
>
>         ASSERT(*lut == NULL && *shaper == NULL);
>         *lut = NULL;
> @@ -1620,7 +1619,6 @@ bool dcn32_acquire_post_bldn_3dlut(
>         if (!res_ctx->is_mpc_3dlut_acquired[mpcc_id]) {
>                 *lut = pool->mpc_lut[mpcc_id];
>                 *shaper = pool->mpc_shaper[mpcc_id];
> -               state = &pool->mpc_lut[mpcc_id]->state;
>                 res_ctx->is_mpc_3dlut_acquired[mpcc_id] = true;
>                 ret = true;
>         }
> @@ -1913,7 +1911,6 @@ int dcn32_populate_dml_pipes_from_context(
>         struct resource_context *res_ctx = &context->res_ctx;
>         struct pipe_ctx *pipe;
>         bool subvp_in_use = false;
> -       uint8_t is_pipe_split_expected[MAX_PIPES] = {0};
>         struct dc_crtc_timing *timing;
>
>         dcn20_populate_dml_pipes_from_context(dc, context, pipes, fast_validate);
> @@ -2002,7 +1999,7 @@ int dcn32_populate_dml_pipes_from_context(
>                 }
>
>                 DC_FP_START();
> -               is_pipe_split_expected[i] = dcn32_predict_pipe_split(context, &pipes[pipe_cnt]);
> +               dcn32_predict_pipe_split(context, &pipes[pipe_cnt]);
>                 DC_FP_END();
>
>                 pipe_cnt++;
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
> index 3a2d7bcc4b6d..a616cf078cf4 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c
> @@ -59,25 +59,21 @@ uint32_t dcn32_helper_calculate_mall_bytes_for_cursor(
>  {
>         struct hubp *hubp = pipe_ctx->plane_res.hubp;
>         uint32_t cursor_size = hubp->curs_attr.pitch * hubp->curs_attr.height;
> -       uint32_t cursor_bpp = 4;
>         uint32_t cursor_mall_size_bytes = 0;
>
>         switch (pipe_ctx->stream->cursor_attributes.color_format) {
>         case CURSOR_MODE_MONO:
>                 cursor_size /= 2;
> -               cursor_bpp = 4;
>                 break;
>         case CURSOR_MODE_COLOR_1BIT_AND:
>         case CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA:
>         case CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA:
>                 cursor_size *= 4;
> -               cursor_bpp = 4;
>                 break;
>
>         case CURSOR_MODE_COLOR_64BIT_FP_PRE_MULTIPLIED:
>         case CURSOR_MODE_COLOR_64BIT_FP_UN_PRE_MULTIPLIED:
>                 cursor_size *= 8;
> -               cursor_bpp = 8;
>                 break;
>         }
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> index 35d10b4d018b..2244e4fb8c96 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c
> @@ -902,7 +902,6 @@ static void dml_rq_dlg_get_dlg_params(
>         double hratio_c;
>         double vratio_l;
>         double vratio_c;
> -       bool scl_enable;
>
>         unsigned int swath_width_ub_l;
>         unsigned int dpte_groups_per_row_ub_l;
> @@ -1020,7 +1019,6 @@ static void dml_rq_dlg_get_dlg_params(
>         hratio_c = scl->hscl_ratio_c;
>         vratio_l = scl->vscl_ratio;
>         vratio_c = scl->vscl_ratio_c;
> -       scl_enable = scl->scl_enable;
>
>         swath_width_ub_l = rq_dlg_param->rq_l.swath_width_ub;
>         dpte_groups_per_row_ub_l = rq_dlg_param->rq_l.dpte_groups_per_row_ub;
> diff --git a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
> index 138e5684c7fd..1c2ce08bdece 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
> @@ -276,7 +276,6 @@ static void dp_wa_power_up_0010FA(struct dc_link *link, uint8_t *dpcd_data,
>                 int length)
>  {
>         int retry = 0;
> -       union dp_downstream_port_present ds_port = { 0 };
>
>         if (!link->dpcd_caps.dpcd_rev.raw) {
>                 do {
> @@ -289,9 +288,6 @@ static void dp_wa_power_up_0010FA(struct dc_link *link, uint8_t *dpcd_data,
>                 } while (retry++ < 4 && !link->dpcd_caps.dpcd_rev.raw);
>         }
>
> -       ds_port.byte = dpcd_data[DP_DOWNSTREAMPORT_PRESENT -
> -                                DP_DPCD_REV];
> -
>         if (link->dpcd_caps.dongle_type == DISPLAY_DONGLE_DP_VGA_CONVERTER) {
>                 switch (link->dpcd_caps.branch_dev_id) {
>                 /* 0010FA active dongles (DP-VGA, DP-DLDVI converters) power down
> --
> 2.39.1
>

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

* Re: [PATCH 06/10] drm/amd/display: Fix implicit enum conversion
  2023-02-13 20:49 ` [PATCH 06/10] drm/amd/display: Fix implicit enum conversion Arthur Grillo
@ 2023-02-14 11:42   ` Michel Dänzer
  0 siblings, 0 replies; 20+ messages in thread
From: Michel Dänzer @ 2023-02-14 11:42 UTC (permalink / raw)
  To: Arthur Grillo, amd-gfx, dri-devel
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	mairacanal, alexander.deucher, andrealmeid, christian.koenig

On 2/13/23 21:49, Arthur Grillo wrote:
> Make implicit enum conversion to avoid -Wenum-conversion warning, such
> as:
> 
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn21/display_mode_vba_21.c:4109:88: warning: implicit conversion from ‘enum <anonymous>’ to ‘enum odm_combine_mode’ [-Wenum-conversion]
>  4109 |                                                 locals->ODMCombineEnablePerState[i][k] = true;
>       |                                                                                        ^
> 
> [...]
> 
> @@ -3897,14 +3898,14 @@ void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l
>  					mode_lib->vba.PlaneRequiredDISPCLKWithODMCombine = mode_lib->vba.PixelClock[k] / 2
>  							* (1 + mode_lib->vba.DISPCLKDPPCLKDSCCLKDownSpreading / 100.0);
>  
> -				locals->ODMCombineEnablePerState[i][k] = false;
> +				locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)false;

dm_odm_combine_mode_disabled would seem clearer than (enum odm_combine_mode)false.


> -						locals->ODMCombineEnablePerState[i][k] = true;
> +						locals->ODMCombineEnablePerState[i][k] = (enum odm_combine_mode)true;

I'm not sure which enum value (enum odm_combine_mode)true will be converted to, probably dm_odm_combine_mode_2to1? Is that really appropriate everywhere true is used? If so, again 
dm_odm_combine_mode_2to1 would seem clearer.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


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

* Re: [PATCH 01/10] drm/amd/display: Turn global functions into static
  2023-02-13 20:49 ` [PATCH 01/10] drm/amd/display: Turn global functions into static Arthur Grillo
@ 2023-02-14 17:39   ` Alex Deucher
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Deucher @ 2023-02-14 17:39 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	dri-devel, mairacanal, amd-gfx, alexander.deucher, andrealmeid,
	christian.koenig

On Mon, Feb 13, 2023 at 3:49 PM Arthur Grillo <arthurgrillo@riseup.net> wrote:
>
> Turn global functions that are only used locally into static ones. This
> reduces the number of -Wmissing-prototypes warnings.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>

The first hunk was already fixed, but I applied the second hunk.

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 2 +-
>  drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
> index 8c368bcc8e7e..a737782b2840 100644
> --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
> +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c
> @@ -87,7 +87,7 @@ static int dcn315_get_active_display_cnt_wa(
>         return display_count;
>  }
>
> -bool should_disable_otg(struct pipe_ctx *pipe)
> +static bool should_disable_otg(struct pipe_ctx *pipe)
>  {
>         bool ret = true;
>
> diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
> index 27dc8c9955f4..3c7cb3dc046b 100644
> --- a/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
> +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c
> @@ -37,7 +37,7 @@
>  #include "soc15_hw_ip.h"
>  #include "ivsrcid/dcn/irqsrcs_dcn_1_0.h"
>
> -enum dc_irq_source to_dal_irq_source_dcn201(
> +static enum dc_irq_source to_dal_irq_source_dcn201(
>                 struct irq_service *irq_service,
>                 uint32_t src_id,
>                 uint32_t ext_id)
> --
> 2.39.1
>

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

* Re: [PATCH 02/10] drm/amd/display: Add function prototypes to headers
  2023-02-13 20:49 ` [PATCH 02/10] drm/amd/display: Add function prototypes to headers Arthur Grillo
@ 2023-02-14 17:40   ` Alex Deucher
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Deucher @ 2023-02-14 17:40 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	dri-devel, mairacanal, amd-gfx, alexander.deucher, andrealmeid,
	christian.koenig

Applied.  Thanks!

On Mon, Feb 13, 2023 at 3:50 PM Arthur Grillo <arthurgrillo@riseup.net> wrote:
>
> Add function prototypes to headers to reduce the number of
> -Wmissing-prototypes warnings.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h | 2 ++
>  drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h | 2 ++
>  drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h   | 2 ++
>  3 files changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h
> index e015e5a6c866..89d6208287b5 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h
> +++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h
> @@ -133,6 +133,8 @@
>  int hubbub31_init_dchub_sys_ctx(struct hubbub *hubbub,
>                 struct dcn_hubbub_phys_addr_config *pa_config);
>
> +void hubbub31_init(struct hubbub *hubbub);
> +
>  void hubbub31_construct(struct dcn20_hubbub *hubbub3,
>         struct dc_context *ctx,
>         const struct dcn_hubbub_registers *hubbub_regs,
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h
> index bdc146890fca..b20eb04724bb 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h
> +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h
> @@ -204,6 +204,8 @@ void hubbub32_force_usr_retraining_allow(struct hubbub *hubbub, bool allow);
>
>  void hubbub32_force_wm_propagate_to_pipes(struct hubbub *hubbub);
>
> +void hubbub32_init(struct hubbub *hubbub);
> +
>  void dcn32_program_det_size(struct hubbub *hubbub, int hubp_inst, unsigned int det_buffer_size_in_kbyte);
>
>  void hubbub32_construct(struct dcn20_hubbub *hubbub2,
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h
> index 56ef71151536..4cdbf63c952b 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h
> +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h
> @@ -61,6 +61,8 @@ void hubp32_phantom_hubp_post_enable(struct hubp *hubp);
>  void hubp32_cursor_set_attributes(struct hubp *hubp,
>                 const struct dc_cursor_attributes *attr);
>
> +void hubp32_init(struct hubp *hubp);
> +
>  bool hubp32_construct(
>         struct dcn20_hubp *hubp2,
>         struct dc_context *ctx,
> --
> 2.39.1
>

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

* Re: [PATCH 03/10] drm/amd/amdgpu: Add function prototypes to headers
  2023-02-13 20:49 ` [PATCH 03/10] drm/amd/amdgpu: " Arthur Grillo
@ 2023-02-14 17:41   ` Alex Deucher
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Deucher @ 2023-02-14 17:41 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	dri-devel, mairacanal, amd-gfx, alexander.deucher, andrealmeid,
	christian.koenig

Applied.  Thanks!

On Mon, Feb 13, 2023 at 3:50 PM Arthur Grillo <arthurgrillo@riseup.net> wrote:
>
> Add function prototypes to headers to reduce the number of
> -Wmissing-prototypes warnings.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
> index bee93ab4298f..b03321e7d2d8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h
> @@ -538,6 +538,7 @@ struct amdgpu_firmware {
>
>  void amdgpu_ucode_print_mc_hdr(const struct common_firmware_header *hdr);
>  void amdgpu_ucode_print_smc_hdr(const struct common_firmware_header *hdr);
> +void amdgpu_ucode_print_imu_hdr(const struct common_firmware_header *hdr);
>  void amdgpu_ucode_print_gfx_hdr(const struct common_firmware_header *hdr);
>  void amdgpu_ucode_print_rlc_hdr(const struct common_firmware_header *hdr);
>  void amdgpu_ucode_print_sdma_hdr(const struct common_firmware_header *hdr);
> --
> 2.39.1
>

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

* Re: [PATCH 04/10] drm/amd/display: Add previously missing includes
  2023-02-13 20:49 ` [PATCH 04/10] drm/amd/display: Add previously missing includes Arthur Grillo
@ 2023-02-14 17:45   ` Alex Deucher
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Deucher @ 2023-02-14 17:45 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	dri-devel, mairacanal, amd-gfx, alexander.deucher, andrealmeid,
	christian.koenig

Applied.  Thanks!

On Mon, Feb 13, 2023 at 3:50 PM Arthur Grillo <arthurgrillo@riseup.net> wrote:
>
> Add includes that were previously missing to reduce the number of
> -Wmissing-prototypes warnings.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>  drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c               | 1 +
>  drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
> index 330d7cbc7398..3069af3684c6 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c
> @@ -30,6 +30,7 @@
>  #include "dcn30/dcn30_hwseq.h"
>  #include "dcn31/dcn31_hwseq.h"
>  #include "dcn32_hwseq.h"
> +#include "dcn32_init.h"
>
>  static const struct hw_sequencer_funcs dcn32_funcs = {
>         .program_gamut_remap = dcn10_program_gamut_remap,
> diff --git a/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c b/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
> index 04838a31e513..257f4fc065a5 100644
> --- a/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
> +++ b/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
> @@ -24,6 +24,7 @@
>   */
>  #include "dc_link.h"
>  #include "link_dp_trace.h"
> +#include "link.h"
>
>  void dp_trace_init(struct dc_link *link)
>  {
> --
> 2.39.1
>

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

* Re: [PATCH 05/10] drm/amd/display: Fix excess arguments on kernel-doc
  2023-02-13 20:49 ` [PATCH 05/10] drm/amd/display: Fix excess arguments on kernel-doc Arthur Grillo
@ 2023-02-14 17:49   ` Alex Deucher
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Deucher @ 2023-02-14 17:49 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	dri-devel, mairacanal, amd-gfx, alexander.deucher, andrealmeid,
	christian.koenig

Applied.  Thanks!

On Mon, Feb 13, 2023 at 3:50 PM Arthur Grillo <arthurgrillo@riseup.net> wrote:
>
> Remove arguments present on kernel-doc that are not present on the
> function declaration and add the new ones if present.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c            | 15 +++++++--------
>  drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c      |  2 +-
>  .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c |  2 +-
>  3 files changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> index 3d36329be384..40e6b22daa22 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> @@ -273,8 +273,6 @@ static void sdma_v6_0_ring_emit_ib(struct amdgpu_ring *ring,
>   * sdma_v6_0_ring_emit_mem_sync - flush the IB by graphics cache rinse
>   *
>   * @ring: amdgpu ring pointer
> - * @job: job to retrieve vmid from
> - * @ib: IB object to schedule
>   *
>   * flush the IB by graphics cache rinse.
>   */
> @@ -326,7 +324,9 @@ static void sdma_v6_0_ring_emit_hdp_flush(struct amdgpu_ring *ring)
>   * sdma_v6_0_ring_emit_fence - emit a fence on the DMA ring
>   *
>   * @ring: amdgpu ring pointer
> - * @fence: amdgpu fence object
> + * @addr: address
> + * @seq: fence seq number
> + * @flags: fence flags
>   *
>   * Add a DMA fence packet to the ring to write
>   * the fence seq number and DMA trap packet to generate
> @@ -1060,10 +1060,9 @@ static void sdma_v6_0_vm_copy_pte(struct amdgpu_ib *ib,
>   *
>   * @ib: indirect buffer to fill with commands
>   * @pe: addr of the page entry
> - * @addr: dst addr to write into pe
> + * @value: dst addr to write into pe
>   * @count: number of page entries to update
>   * @incr: increase next addr by incr bytes
> - * @flags: access flags
>   *
>   * Update PTEs by writing them manually using sDMA.
>   */
> @@ -1167,7 +1166,6 @@ static void sdma_v6_0_ring_emit_pipeline_sync(struct amdgpu_ring *ring)
>   * sdma_v6_0_ring_emit_vm_flush - vm flush using sDMA
>   *
>   * @ring: amdgpu_ring pointer
> - * @vm: amdgpu_vm pointer
>   *
>   * Update the page table base and flush the VM TLB
>   * using sDMA.
> @@ -1591,10 +1589,11 @@ static void sdma_v6_0_set_irq_funcs(struct amdgpu_device *adev)
>  /**
>   * sdma_v6_0_emit_copy_buffer - copy buffer using the sDMA engine
>   *
> - * @ring: amdgpu_ring structure holding ring information
> + * @ib: indirect buffer to fill with commands
>   * @src_offset: src GPU address
>   * @dst_offset: dst GPU address
>   * @byte_count: number of bytes to xfer
> + * @tmz: if a secure copy should be used
>   *
>   * Copy GPU buffers using the DMA engine.
>   * Used by the amdgpu ttm implementation to move pages if
> @@ -1620,7 +1619,7 @@ static void sdma_v6_0_emit_copy_buffer(struct amdgpu_ib *ib,
>  /**
>   * sdma_v6_0_emit_fill_buffer - fill buffer using the sDMA engine
>   *
> - * @ring: amdgpu_ring structure holding ring information
> + * @ib: indirect buffer to fill
>   * @src_data: value to write to buffer
>   * @dst_offset: dst GPU address
>   * @byte_count: number of bytes to xfer
> diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> index 6ccf477d1c4d..c2092775ca88 100644
> --- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> +++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
> @@ -698,7 +698,7 @@ static void populate_subvp_cmd_pipe_info(struct dc *dc,
>   *
>   * @dc: [in] current dc state
>   * @context: [in] new dc state
> - * @cmd: [in] DMUB cmd to be populated with SubVP info
> + * @enable: [in] if true enables the pipes population
>   *
>   * This function loops through each pipe and populates the DMUB SubVP CMD info
>   * based on the pipe (e.g. SubVP, VBLANK).
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
> index f607a0e28f14..f62368da875d 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
> @@ -581,7 +581,7 @@ static void dpp1_dscl_set_manual_ratio_init(
>   * dpp1_dscl_set_recout - Set the first pixel of RECOUT in the OTG active area
>   *
>   * @dpp: DPP data struct
> - * @recount: Rectangle information
> + * @recout: Rectangle information
>   *
>   * This function sets the MPC RECOUT_START and RECOUT_SIZE registers based on
>   * the values specified in the recount parameter.
> --
> 2.39.1
>

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

* Re: [PATCH 09/10] drm/amd/display: Make variables declaration inside ifdef guard
  2023-02-13 20:49 ` [PATCH 09/10] drm/amd/display: Make variables declaration inside ifdef guard Arthur Grillo
@ 2023-02-14 17:52   ` Alex Deucher
  0 siblings, 0 replies; 20+ messages in thread
From: Alex Deucher @ 2023-02-14 17:52 UTC (permalink / raw)
  To: Arthur Grillo
  Cc: sunpeng.li, tales.aparecida, Xinhui.Pan, Rodrigo.Siqueira,
	dri-devel, mairacanal, amd-gfx, alexander.deucher, andrealmeid,
	christian.koenig

Applied.  Thanks!

On Mon, Feb 13, 2023 at 3:50 PM Arthur Grillo <arthurgrillo@riseup.net> wrote:
>
> Make variables declaration inside ifdef guard, as they are only used
> inside the same ifdef guard. This remove some of the
> -Wunused-but-set-variable warning.
>
> Signed-off-by: Arthur Grillo <arthurgrillo@riseup.net>
> ---
>  .../gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c    | 4 ++++
>  .../gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c  | 4 ++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> index ec351c8418cb..27f488405335 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c
> @@ -878,7 +878,9 @@ static bool CalculatePrefetchSchedule(
>         double DSTTotalPixelsAfterScaler;
>         double LineTime;
>         double dst_y_prefetch_equ;
> +#ifdef __DML_VBA_DEBUG__
>         double Tsw_oto;
> +#endif
>         double prefetch_bw_oto;
>         double prefetch_bw_pr;
>         double Tvm_oto;
> @@ -1060,7 +1062,9 @@ static bool CalculatePrefetchSchedule(
>
>         min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre);
>         Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4;
> +#ifdef __DML_VBA_DEBUG__
>         Tsw_oto = Lsw_oto * LineTime;
> +#endif
>
>
>  #ifdef __DML_VBA_DEBUG__
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> index 950669f2c10d..0fd3889c2061 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c
> @@ -900,7 +900,9 @@ static bool CalculatePrefetchSchedule(
>         double DSTTotalPixelsAfterScaler;
>         double LineTime;
>         double dst_y_prefetch_equ;
> +#ifdef __DML_VBA_DEBUG__
>         double Tsw_oto;
> +#endif
>         double prefetch_bw_oto;
>         double prefetch_bw_pr;
>         double Tvm_oto;
> @@ -1082,7 +1084,9 @@ static bool CalculatePrefetchSchedule(
>
>         min_Lsw = dml_max(1, dml_max(PrefetchSourceLinesY, PrefetchSourceLinesC) / max_vratio_pre);
>         Lsw_oto = dml_ceil(4 * dml_max(prefetch_sw_bytes / prefetch_bw_oto / LineTime, min_Lsw), 1) / 4;
> +#ifdef __DML_VBA_DEBUG__
>         Tsw_oto = Lsw_oto * LineTime;
> +#endif
>
>
>  #ifdef __DML_VBA_DEBUG__
> --
> 2.39.1
>

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

end of thread, other threads:[~2023-02-14 17:52 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13 20:49 [PATCH 00/10] Resolve warnings from AMDGPU Arthur Grillo
2023-02-13 20:49 ` [PATCH 01/10] drm/amd/display: Turn global functions into static Arthur Grillo
2023-02-14 17:39   ` Alex Deucher
2023-02-13 20:49 ` [PATCH 02/10] drm/amd/display: Add function prototypes to headers Arthur Grillo
2023-02-14 17:40   ` Alex Deucher
2023-02-13 20:49 ` [PATCH 03/10] drm/amd/amdgpu: " Arthur Grillo
2023-02-14 17:41   ` Alex Deucher
2023-02-13 20:49 ` [PATCH 04/10] drm/amd/display: Add previously missing includes Arthur Grillo
2023-02-14 17:45   ` Alex Deucher
2023-02-13 20:49 ` [PATCH 05/10] drm/amd/display: Fix excess arguments on kernel-doc Arthur Grillo
2023-02-14 17:49   ` Alex Deucher
2023-02-13 20:49 ` [PATCH 06/10] drm/amd/display: Fix implicit enum conversion Arthur Grillo
2023-02-14 11:42   ` Michel Dänzer
2023-02-13 20:49 ` [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation Arthur Grillo
2023-02-13 21:01   ` Christian König
2023-02-13 20:49 ` [PATCH 08/10] drm/amd/display: Remove unused local variables Arthur Grillo
2023-02-13 21:09   ` Alex Deucher
2023-02-13 20:49 ` [PATCH 09/10] drm/amd/display: Make variables declaration inside ifdef guard Arthur Grillo
2023-02-14 17:52   ` Alex Deucher
2023-02-13 20:49 ` [PATCH 10/10] drm/amd/display: Remove unused local variables and function Arthur Grillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).