Resolve warnings from AMDGPU
cover Resolve warnings from AMDGPU
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(-)
Signature · 1 line
2.39.1
PATCH 1/10 drm/amd/display: Turn global functions into static
Turn global functions that are only used locally into static ones. This reduces the number of -Wmissing-prototypes warnings.
--- 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(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +1 -1
@@ -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;
drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c +1 -1
@@ -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)
Signature · 1 line
2.39.1
Re: [PATCH 01/10] drm/amd/display: Turn global functions into static
Quoted 5 lines · Arthur Grillo
Turn global functions that are only used locally into static ones. This reduces the number of -Wmissing-prototypes warnings.
Signed-off-by Arthur Grillo <[email protected]>
The first hunk was already fixed, but I applied the second hunk.
Alex
Quoted 34 lines
--- 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(-)drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +1
-1@@ -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;drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c +1
-2@@ -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
PATCH 2/10 drm/amd/display: Add function prototypes to headers
In reply to Arthur GrilloAdd function prototypes to headers to reduce the number of -Wmissing-prototypes warnings.
--- 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(+)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h +2 -0
@@ -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,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h +2 -0
@@ -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,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h +2 -0
@@ -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,
Signature · 1 line
2.39.1
Alex Deucher
AppliedRe: [PATCH 02/10] drm/amd/display: Add function prototypes to headers
Applied. Thanks!
Quoted 53 lines · Arthur Grillo
Add function prototypes to headers to reduce the number of -Wmissing-prototypes warnings.
Signed-off-by Arthur Grillo <[email protected]>--- 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(+)drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hubbub.h +2
-0@@ -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,drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubbub.h +2
-0@@ -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,drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hubp.h +2
-1@@ -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
PATCH 3/10 drm/amd/amdgpu: Add function prototypes to headers
In reply to Arthur GrilloAdd function prototypes to headers to reduce the number of -Wmissing-prototypes warnings.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1 -0
@@ -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);
Signature · 1 line
2.39.1
Alex Deucher
AppliedRe: [PATCH 03/10] drm/amd/amdgpu: Add function prototypes to headers
Applied. Thanks!
Quoted 24 lines · Arthur Grillo
Add function prototypes to headers to reduce the number of -Wmissing-prototypes warnings.
Signed-off-by Arthur Grillo <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.h +1
-1@@ -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
PATCH 4/10 drm/amd/display: Add previously missing includes
In reply to Arthur GrilloAdd includes that were previously missing to reduce the number of -Wmissing-prototypes warnings.
--- 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(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1 -0
@@ -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,
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c +1 -0
@@ -24,6 +24,7 @@*/ #include "dc_link.h" #include "link_dp_trace.h" +#include "link.h" void dp_trace_init (struct dc_link *link) {
Signature · 1 line
2.39.1
Alex Deucher
AppliedRe: [PATCH 04/10] drm/amd/display: Add previously missing includes
Applied. Thanks!
Quoted 37 lines · Arthur Grillo
Add includes that were previously missing to reduce the number of -Wmissing-prototypes warnings.
Signed-off-by Arthur Grillo <[email protected]>--- 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(+)drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1
-0@@ -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,drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c +1
-1@@ -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
PATCH 5/10 drm/amd/display: Fix excess arguments on kernel-doc
In reply to Arthur GrilloRemove arguments present on kernel-doc that are not present on the function declaration and add the new ones if present.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +7 -8
@@ -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
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +1 -1
@@ -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).
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +1 -1
@@ -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.
Signature · 1 line
2.39.1
Alex Deucher
AppliedRe: [PATCH 05/10] drm/amd/display: Fix excess arguments on kernel-doc
Applied. Thanks!
Quoted 106 lines · Arthur Grillo
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 <[email protected]>--- 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(-)drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +7
-8@@ -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 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +1
-1@@ -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). drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +1
-2@@ -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
PATCH 6/10 drm/amd/display: Fix implicit enum conversion
In reply to Arthur GrilloMake 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;
| ^
--- .../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(-)
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c +5 -4
@@ -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]
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c +5 -5
@@ -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]
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c +6 -6
@@ -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];
Signature · 1 line
2.39.1
Re: [PATCH 06/10] drm/amd/display: Fix implicit enum conversion
Quoted 10 lines · Arthur Grillo
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;
| ^[...]
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · line 3901
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20.c +1
-1@@ -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.
Review void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · line 3902
Quoted 2 lines
(quoted diff) +1
-1- 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.
Signature · 2 lines
Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and Xwayland developer
PATCH 7/10 drm/amd/amdgpu: Deal with possible fail allocation
In reply to Arthur GrilloDeal with return value of an allocation. This reduces the number of -Wunused-but-set-variable warnings.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +2 -0
@@ -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 ;
Signature · 1 line
2.39.1
Christian König
maintainerRe: [PATCH 07/10] drm/amd/amdgpu: Deal with possible fail allocation
Am 13.02.23 um 21:49 schrieb Arthur Grillo:
Quoted 13 lines
Deal with return value of an allocation. This reduces the number of -Wunused-but-set-variable warnings.
Signed-off-by Arthur Grillo <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c int amdgpu_mes_ctx_alloc_meta_data(struct amdgpu_device *adev, · line 1110
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c +2
-0@@ -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.
PATCH 8/10 drm/amd/display: Remove unused local variables
In reply to Arthur GrilloRemove local variables that were just set but were never used. This decrease the number of -Wunused-but-set-variable warnings.
--- 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(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +0 -3
@@ -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);
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c +0 -7
@@ -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 &&
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c +0 -2
@@ -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 */
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c +0 -2
@@ -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) */
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c +0 -4
@@ -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 ;
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +0 -3
@@ -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);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -4
@@ -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++;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +0 -4
@@ -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 ; }
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c +0 -2
@@ -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;
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +0 -4
@@ -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
Signature · 1 line
2.39.1
Re: [PATCH 08/10] drm/amd/display: Remove unused local variables
Quoted 31 lines · Arthur Grillo
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 <[email protected]>--- 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(-)drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +0
-1@@ -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 ;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c void dcn10_link_encoder_update_mst_stream_allocation_table( · line 1325
Quoted 5 lines
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +0
-2@@ -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
Quoted 202 lines
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c +0
-0REG_GET (DP_MSE_SAT_UPDATE ,DP_MSE_SAT_UPDATE , &value1);drivers/gpu/drm/amd/display/dc/dcn201/dcn201_dpp.c +0
-7@@ -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 &&drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c +0
-2@@ -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 */ drivers/gpu/drm/amd/display/dc/dcn30/dcn30_afmt.c +0
-2@@ -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) */ drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hubp.c +0
-4@@ -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 ;drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +0
-3@@ -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);drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1
-4@@ -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++;drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +0
-4@@ -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 ; }drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c +0
-2@@ -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;drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +0
-5@@ -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
PATCH 9/10 drm/amd/display: Make variables declaration inside ifdef guard
In reply to Arthur GrilloMake 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.
--- .../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(+)
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +4 -0
@@ -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__
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +4 -0
@@ -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__
Signature · 1 line
2.39.1
Alex Deucher
AppliedRe: [PATCH 09/10] drm/amd/display: Make variables declaration inside ifdef guard
Applied. Thanks!
Quoted 62 lines · Arthur Grillo
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 <[email protected]>--- .../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(+)drivers/gpu/drm/amd/display/dc/dml/dcn31/display_mode_vba_31.c +4
-0@@ -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__drivers/gpu/drm/amd/display/dc/dml/dcn314/display_mode_vba_314.c +4
-1@@ -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
PATCH 10/10 drm/amd/display: Remove unused local variables and function
In reply to Arthur GrilloRemove 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.
--- .../gpu/drm/amd/display/dc/dcn31/dcn31_apg.c | 41 ------------------- 1 file changed, 41 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_apg.c +0 -41
@@ -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 );
Signature · 1 line
2.39.1