1. 14 Jan, 2021 40 commits
    • Lee Jones's avatar
      drm/amd/display/dc/dce120/Makefile: Ignore -Woverride-init warning · 8a6ab2f1
      Lee Jones authored
      This file uses a complex abstracted set of hierarchical macros to
      setup its applicable register lists within constant structures.
      However in the case of TMDS_CNTL we wish to mark it as not applicable
      for this use-case.
      
      One method would be to de-const all of the definitions and users, then
      manually zero out TMDS_CNTL from the list.  Another would be to create
      a new set of hierarchical macros to omit TMDS_CNTL entirely.  Both
      would entail a great deal of unnecessary changes and maintenance
      burden.
      
      Instead, let's just silence the warning.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: note: (near initialization for ‘stream_enc_regs[0].TMDS_CNTL’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:281:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: note: (near initialization for ‘stream_enc_regs[1].TMDS_CNTL’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:282:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: note: (near initialization for ‘stream_enc_regs[2].TMDS_CNTL’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:283:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: note: (near initialization for ‘stream_enc_regs[3].TMDS_CNTL’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:284:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: note: (near initialization for ‘stream_enc_regs[4].TMDS_CNTL’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:285:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: warning: initialized field overwritten [-Woverride-init]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: note: in expansion of macro ‘stream_enc_regs’
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:277:15: note: (near initialization for ‘stream_enc_regs[5].TMDS_CNTL’)
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_resource.c:286:2: note: in expansion of macro ‘stream_enc_regs’
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      8a6ab2f1
    • Lee Jones's avatar
      drm/amd/display/dc/dce120/dce120_timing_generator: · eea08ecb
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:101:6: warning: no previous prototype for ‘dce120_timing_generator_validate_timing’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:128:6: warning: no previous prototype for ‘dce120_tg_validate_timing’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:136:6: warning: no previous prototype for ‘dce120_timing_generator_enable_crtc’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:156:6: warning: no previous prototype for ‘dce120_timing_generator_set_early_control’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:169:10: warning: no previous prototype for ‘dce120_timing_generator_get_vblank_counter’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:184:6: warning: no previous prototype for ‘dce120_timing_generator_get_crtc_position’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:210:6: warning: no previous prototype for ‘dce120_timing_generator_wait_for_vblank’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:232:6: warning: no previous prototype for ‘dce120_timing_generator_wait_for_vactive’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:245:6: warning: no previous prototype for ‘dce120_timing_generator_setup_global_swap_lock’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:282:6: warning: no previous prototype for ‘dce120_timing_generator_tear_down_global_swap_lock’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:303:6: warning: no previous prototype for ‘dce120_timing_generator_enable_reset_trigger’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:350:6: warning: no previous prototype for ‘dce120_timing_generator_disable_reset_trigger’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:370:6: warning: no previous prototype for ‘dce120_timing_generator_did_triggered_reset_occur’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:387:6: warning: no previous prototype for ‘dce120_timing_generator_disable_vga’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:428:6: warning: no previous prototype for ‘dce120_timing_generator_program_blanking’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:488:6: warning: no previous prototype for ‘dce120_timing_generator_program_blank_color’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:501:6: warning: no previous prototype for ‘dce120_timing_generator_set_overscan_color_black’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:543:6: warning: no previous prototype for ‘dce120_timing_generator_set_drr’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:602:6: warning: no previous prototype for ‘dce120_timing_generator_get_position’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:635:6: warning: no previous prototype for ‘dce120_timing_generator_get_crtc_scanoutpos’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:664:6: warning: no previous prototype for ‘dce120_timing_generator_enable_advanced_request’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:702:6: warning: no previous prototype for ‘dce120_tg_program_blank_color’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:725:6: warning: no previous prototype for ‘dce120_tg_set_overscan_color’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:752:6: warning: no previous prototype for ‘dce120_tg_is_blanked’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:773:6: warning: no previous prototype for ‘dce120_tg_set_blank’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:792:6: warning: no previous prototype for ‘dce120_tg_wait_for_state’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:809:6: warning: no previous prototype for ‘dce120_tg_set_colors’ [-Wmissing-prototypes]
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_timing_generator.c:836:6: warning: no previous prototype for ‘dce120_timing_generator_set_test_pattern’ [-Wmissing-prototypes]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Aric Cyr <aric.cyr@amd.com>
      Cc: Anthony Koo <Anthony.Koo@amd.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      eea08ecb
    • Lee Jones's avatar
      drm/amd/display/dc/dce120/dce120_hw_sequencer: Encompass defines in same clause as their use · 9c92cda3
      Lee Jones authored
      Ideally someone should strip-out all these garbage 'if 0's.
      
      Tempted to carry out the work myself on principle!
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce120/dce120_hw_sequencer.c:53:47: warning: ‘reg_offsets’ defined but not used [-Wunused-const-variable=]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      9c92cda3
    • Lee Jones's avatar
      drm/amd/display/dc/gpio/diagnostics/hw_factory_diag: Include our own header containing prototypes · 469b1133
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.c:50:6: warning: no previous prototype for ‘dal_hw_factory_diag_fpga_init’ [-Wmissing-prototypes]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      469b1133
    • Lee Jones's avatar
      drm/amd/display/dc/gpio/diagnostics/hw_factory_diag: Fix struct declared... · d1f825dd
      Lee Jones authored
      drm/amd/display/dc/gpio/diagnostics/hw_factory_diag: Fix struct declared inside parameter list error
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:43: warning: ‘struct hw_factory’ declared inside parameter list will not be visible outside of this definition or declaration
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:6: note: previous declaration of ‘dal_hw_factory_diag_fpga_init’ was here
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:43: warning: ‘struct hw_factory’ declared inside parameter list will not be visible outside of this definition or declaration
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:6: note: previous declaration of ‘dal_hw_factory_diag_fpga_init’ was here
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:43: warning: ‘struct hw_factory’ declared inside parameter list will not be visible outside of this definition or declaration
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_factory_diag.h:30:6: note: previous declaration of ‘dal_hw_factory_diag_fpga_init’ was here
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      d1f825dd
    • Lee Jones's avatar
      drm/amd/display/dc/irq/irq_service: Make local function static · 23ca7e9f
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/irq/irq_service.c:82:31: warning: no previous prototype for ‘find_irq_source_info’ [-Wmissing-prototypes]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Mauro Rossi <issor.oruam@gmail.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      23ca7e9f
    • Lee Jones's avatar
      drm/amd/display/dc/gpio/diagnostics/hw_translate_diag: Include our own header containing prototypes · 4b93ebcc
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/diagnostics/hw_translate_diag.c:37:6: warning: no previous prototype for ‘dal_hw_translate_diag_fpga_init’ [-Wmissing-prototypes]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      4b93ebcc
    • Lee Jones's avatar
      drm/amd/display/dc/dce/dce_transform: Demote kernel-doc abuse · 9a9fba5b
      Lee Jones authored
      The header doesn't provide any additional parameter descriptions.
      
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.c:1104: warning: Cannot understand  *****************************************************************************
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Mauro Rossi <issor.oruam@gmail.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      9a9fba5b
    • Lee Jones's avatar
      drm/amd/display/dc/dce/dce_opp: Demote non-compliant kernel-doc headers · 995d4de1
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:109: warning: Function parameter or member 'opp110' not described in 'set_truncation'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:109: warning: Function parameter or member 'params' not described in 'set_truncation'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:154: warning: Function parameter or member 'opp110' not described in 'dce60_set_truncation'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:154: warning: Function parameter or member 'params' not described in 'dce60_set_truncation'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:204: warning: Function parameter or member 'opp110' not described in 'set_spatial_dither'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:204: warning: Function parameter or member 'params' not described in 'set_spatial_dither'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:308: warning: Function parameter or member 'opp110' not described in 'set_temporal_dither'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:308: warning: Function parameter or member 'params' not described in 'set_temporal_dither'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:370: warning: Function parameter or member 'opp110' not described in 'dce110_opp_set_clamping'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:370: warning: Function parameter or member 'params' not described in 'dce110_opp_set_clamping'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:430: warning: Function parameter or member 'opp110' not described in 'dce60_opp_set_clamping'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:430: warning: Function parameter or member 'params' not described in 'dce60_opp_set_clamping'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:478: warning: Function parameter or member 'opp110' not described in 'set_pixel_encoding'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:478: warning: Function parameter or member 'params' not described in 'set_pixel_encoding'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:514: warning: Function parameter or member 'opp110' not described in 'dce60_set_pixel_encoding'
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_opp.c:514: warning: Function parameter or member 'params' not described in 'dce60_set_pixel_encoding'
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Mauro Rossi <issor.oruam@gmail.com>
      Cc: Lee Jones <lee.jones@linaro.org>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      995d4de1
    • Lee Jones's avatar
      drm/amd/display/dc/gpio/hw_ddc: Remove unused variable 'reg2' · 93e67af4
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_ddc.c: In function ‘set_config’:
       drivers/gpu/drm/amd/amdgpu/../display/dc/gpio/hw_ddc.c:110:13: warning: variable ‘reg2’ set but not used [-Wunused-but-set-variable]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      93e67af4
    • Lee Jones's avatar
      drm/amd/display/dc/dce/dce_link_encoder: Remove unused variable 'value0' · 08c06e26
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_link_encoder.c: In function ‘dce110_link_encoder_update_mst_stream_allocation_table’:
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_link_encoder.c:1506:11: warning: variable ‘value0’ set but not used [-Wunused-but-set-variable]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Mauro Rossi <issor.oruam@gmail.com>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      08c06e26
    • Lee Jones's avatar
      drm/amd/display/dc/dce/dce_aux: Mark 'dce_aux_transfer_raw' as __maybe_unused · 7d11d258
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c: In function ‘dce_aux_transfer_raw’:
       drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_aux.c:579:7: warning: variable ‘bytes_replied’ set but not used [-Wunused-but-set-variable]
      
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: amd-gfx@lists.freedesktop.org
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      7d11d258
    • Souptick Joarder's avatar
      drm: amdgpu: pm: Mark vangogh_clk_dpm_is_enabled() as static · 8f8150fa
      Souptick Joarder authored
      kernel test robot throws below warnings ->
      
      drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
      warning: no previous prototype for 'vangogh_clk_dpm_is_enabled'
      [-Wmissing-prototypes]
      drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/vangogh_ppt.c:594:6:
      warning: no previous prototype for function 'vangogh_clk_dpm_is_enabled'
      [-Wmissing-prototypes]
      
      Mark vangogh_clk_dpm_is_enabled() as static.
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      8f8150fa
    • Huang Rui's avatar
      drm/amdgpu: fix vram type and bandwidth error for DDR5 and DDR4 · 78683229
      Huang Rui authored
      This patch is to update atomfirmware parser for the memory type and
      bandwidth of DDR5 and DDR4.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      78683229
    • chen gong's avatar
      drm/amdgpu/gfx10: add updated GOLDEN_TSC_COUNT_UPPER/LOWER register offsets for VGH · 527687e6
      chen gong authored
      The address of the GOLDEN_TSC_COUNT_UPPER/GOLDEN_TSC_COUNT_LOWER for
      Vnagogh are different from the others.
      
      The offset of the GOLDEN_TSC_COUNT_UPPER for Vangogh is 0x0025 by
      calculation.
      The offset of the GOLDEN_TSC_COUNT_LOWER for Vangogh is 0x0026 by
      calculation.
      Signed-off-by: default avatarchen gong <curry.gong@amd.com>
      Acked-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      527687e6
    • Huang Rui's avatar
      drm/amd/pm: implement processor fine grain feature for vangogh (v3) · 0d90d0dd
      Huang Rui authored
      This patch is to implement the processor fine grain feature for vangogh.
      It's similar with gfx clock, the only difference is below:
      
      echo "p core_id level value" > pp_od_clk_voltage
      
      1. "p" - set the cclk (processor) frequency
      2. "core_id" - 0/1/2/3, represents which cpu core you want to select
      2. "level" - 0 or 1, "0" represents the min value,  "1" represents the
         max value
      3. "value" - the target value of cclk frequency, it should be limited in
         the safe range
      
      v2: fix some missing changes as Evan's suggestion.
      v3: add version check and fix the restore.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      0d90d0dd
    • Huang Rui's avatar
      drm/amd/pm: implement the processor clocks which read by metric · 517cb957
      Huang Rui authored
      The core processor clocks will be stored in smu metric table, then we
      add this runtime information into amdgpu_pm_info interface.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      517cb957
    • Xiaojian Du's avatar
      drm/amd/pm: add the workload map for vangogh · ec3b35c8
      Xiaojian Du authored
      This patch is to add the workload map for vangogh.
      Signed-off-by: default avatarXiaojian Du <Xiaojian.Du@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      ec3b35c8
    • Xiaojian Du's avatar
      drm/amd/pm: fix one superfluous error for renoir · 79af0681
      Xiaojian Du authored
      This patch is to fix one superfluous error for renoir.
      Renoir supports 5 kinds of power profile mode:
      "FULL SCREEN 3D", "VIDEO", "VR", "COMPUTE" and "CUSTOM".
      After loading amdgpu driver, the driver will set "BOOTUP_DEFAULT"
      mode to APU, and it will get one superfluouserror error,
      which is saying "Unsupported power profile mode 0 on RENOIR",
      but it will not make any other harmful events, so fix this error.
      Signed-off-by: default avatarXiaojian Du <Xiaojian.Du@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      79af0681
    • Xiaojian Du's avatar
      drm/amd/pm: support the function to change power profile mode for vangogh · f727ebeb
      Xiaojian Du authored
      This patch is to support the function to change power profile mode for
      vangogh. Vangogh supports 5 kinds of power profile mode:
      "FULL SCREEN 3D", "VIDEO", "VR", "COMPUTE" and "CUSTOM".
      Signed-off-by: default avatarXiaojian Du <Xiaojian.Du@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      f727ebeb
    • Jinzhou Su's avatar
      drm/amd/pm: Enable GfxOff for Vangogh · 3313ef18
      Jinzhou Su authored
      Add Enable gfxoff for Vangogh during smu_post_init.
      System will not enter GfxOff without allow message.
      Signed-off-by: default avatarJinzhou Su <Jinzhou.Su@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      3313ef18
    • Jinzhou Su's avatar
      drm/amd/pm: Add GFXOFF interface for Vangogh · b58ce1fe
      Jinzhou Su authored
      Steps to enter gfxoff mode on Vangogh
      
      1. Send EnableGfxOff message to SMU
      2. Send AllowGfxOff message to SMU
      Signed-off-by: default avatarJinzhou Su <Jinzhou.Su@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      b58ce1fe
    • Bhawanpreet Lakha's avatar
      drm/amd/display: Fix deadlock during gpu reset v3 · 98ab5f35
      Bhawanpreet Lakha authored
      [Why]
      during idle optimizations we acquire the dc_lock, this lock is also
      acquired during gpu_reset so we end up hanging the system due to a
      deadlock
      
      [How]
      If we are in gpu reset:
       - disable idle optimizations and skip calls to the dc function
      
      v2: skip idle optimizations calls
      v3: add guard for DCN
      
      Fixes: 71338cb4 ("drm/amd/display: enable idle optimizations for linux (MALL stutter)")
      Signed-off-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
      Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      98ab5f35
    • Huang Rui's avatar
      drm/amd/pm: fix the return value of pm message · 96673790
      Huang Rui authored
      0 should be right driver return value, 0x1 is the right firmware
      return value. So switch to 0 at last.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarXiaojian Du <xiaojian.du@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      96673790
    • Huang Rui's avatar
      drm/amdgpu: revise the mode2 reset for vangogh · 74353883
      Huang Rui authored
      PCIE MMIO bar needs to be restored firstly after the reset event
      triggers. So it's unable to access the registers to wait for response
      from SMU. Becasue the value of mmMP1_SMN_C2PMSG_90 is invalid at that
      moment.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Acked-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      74353883
    • Alex Deucher's avatar
      drm/amdgpu: Enable GPU reset for vangogh · b6903089
      Alex Deucher authored
      Enable GPU reset when we encounter a hang.
      Acked-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      b6903089
    • Alex Deucher's avatar
      drm/amdgpu: fix mode2 reset sequence for vangogh · b913ec62
      Alex Deucher authored
      We need to save and restore PCI config space.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      b913ec62
    • Alex Deucher's avatar
      drm/amdgpu/nv: add mode2 reset handling · 16086355
      Alex Deucher authored
      Vangogh will use mode2 reset, so plumb it through the nv
      soc driver.
      Acked-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      16086355
    • Alex Deucher's avatar
      drm/amdgpu: add mode2 reset support for vangogh · 20e157c7
      Alex Deucher authored
      GPU reset is handled via SMU similar to previous APUs.
      Acked-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarHuang Rui <ray.huang@amd.com>
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      20e157c7
    • Jack Zhang's avatar
      drm/amdgpu/sriov Stop data exchange for wholegpu reset · 3c2a01cb
      Jack Zhang authored
      [Why]
      When host trigger a whole gpu reset, guest will keep
      waiting till host finish reset. But there's a work
      queue in guest exchanging data between vf&pf which need
      to access frame buffer. During whole gpu reset, frame
      buffer is not accessable, and this causes the call trace.
      
      [How]
      After vf get reset notification from pf, stop data exchange.
      Signed-off-by: default avatarJingwen Chen <Jingwen.Chen2@amd.com>
      Signed-off-by: default avatarJack Zhang <Jack.Zhang1@amd.com>
      Reviewed-by: default avatarMonk Liu <monk.liu@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      3c2a01cb
    • Huang Rui's avatar
      drm/amd/pm: don't mark all apu as true on feature mask · 47381540
      Huang Rui authored
      VHG based APU will support feature mask checking.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      47381540
    • Huang Rui's avatar
      drm/amd/pm: initial feature_enabled/feature_support bitmap for vangogh · aedebd40
      Huang Rui authored
      VanGogh supports feature mask checking which exposed by smu firmware. It
      has to initial at first, otherwise, all SMU_FEATURE_xxx masks are
      invalid.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      aedebd40
    • Huang Rui's avatar
      drm/amd/pm: clean up get_allowed_feature_mask function · 4dac9f20
      Huang Rui authored
      The get_allowed_feature_mask is superfluous on vangogh.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      4dac9f20
    • Huang Rui's avatar
      drm/amd/pm: enhance the real response for smu message (v2) · 11db224b
      Huang Rui authored
      The user prefers to know the real response value from C2PMSG 90 register
      which is written by firmware not -EIO.
      
      v2: return C2PMSG 90 value
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      11db224b
    • Huang Rui's avatar
      drm/amd/pm: remove vcn/jpeg powergating feature checking for vangogh · 1acc0802
      Huang Rui authored
      VCN/JPEG PG won't be a feature mask bit which exposed by vangogh smu
      firmware. So remove it.
      Signed-off-by: default avatarHuang Rui <ray.huang@amd.com>
      Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      1acc0802
    • Jeremy Cline's avatar
      drm/amdkfd: Fix out-of-bounds read in kdf_create_vcrat_image_cpu() · 0257b464
      Jeremy Cline authored
      KASAN reported a slab-out-of-bounds read of size 1 in
      kdf_create_vcrat_image_cpu().
      
      This occurs when, for example, when on an x86_64 with a single NUMA node
      because kfd_fill_iolink_info_for_cpu() is a no-op, but afterwards the
      sub_type_hdr->length, which is out-of-bounds, is read and multiplied by
      entries. Fortunately, entries is 0 in this case so the overall
      crat_table->length is still correct.
      
      Check if there were any entries before de-referencing sub_type_hdr which
      may be pointing to out-of-bounds memory.
      
      Fixes: b7b6c385 ("drm/amdkfd: Calculate CPU VCRAT size dynamically (v2)")
      Suggested-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarJeremy Cline <jcline@redhat.com>
      Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      0257b464
    • Emily.Deng's avatar
      drm/amdgpu: Decrease compute timeout to 10 s for sriov multiple VF · 9882e278
      Emily.Deng authored
      For multiple VF, after engine hang,as host driver will first
      encounter FLR, so has no meanning to set compute to 60s.
      
      v2:
         Refine the patch and comment
      Signed-off-by: default avatarEmily.Deng <Emily.Deng@amd.com>
      Acked-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      9882e278
    • Rodrigo Siqueira's avatar
      Revert "drm/amd/display: Fixed Intermittent blue screen on OLED panel" · b65650a3
      Rodrigo Siqueira authored
      commit a861736d ("drm/amd/display: Fixed Intermittent blue screen on OLED panel")
      
      causes power regression for many users. It seems that this change causes
      the MCLK to get forced high; this creates a regression for many users
      since their devices were not able to drop to a low state after this
      change. For this reason, this reverts commit
      a861736d.
      
      Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1407
      Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Harry Wentland <harry.wentland@amd.com>
      Cc: Naveed Ashfaq <Naveed.Ashfaq@amd.com>
      Cc: Hersen Wu <hersenxs.wu@amd.com>
      Cc: Roman Li <roman.li@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      b65650a3
    • Charlene Liu's avatar
      drm/amd/display: change SMU repsonse timeout to 2s · 8d5fdaa6
      Charlene Liu authored
      [why]
      driver has sent PMFW VBIOSSMC_MSG_SetDisplayIdleOptimizations while SMU
      still processing a previous VBIOSSMC_MSG_SetHardMinDcfclkByFreq message.
      
      [how]
      same as RN, change the time out to2s.
      Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
      Signed-off-by: default avatarCharlene Liu <Charlene.Liu@amd.com>
      Reviewed-by: default avatarChris Park <Chris.Park@amd.com>
      Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      8d5fdaa6
    • Li, Roman's avatar
      drm/amd/display: disable dcn10 pipe split by default · 9c63852f
      Li, Roman authored
      [Why]
      The initial purpose of dcn10 pipe split is to support some high
      bandwidth mode which requires dispclk greater than max dispclk. By
      initial bring up power measurement data, it showed power consumption is
      less with pipe split for dcn block. This could be reason for enable pipe
      split by default. By battery life measurement of some Chromebooks,
      result shows battery life is longer with pipe split disabled.
      
      [How]
      Disable pipe split by default. Pipe split could be still enabled when
      required dispclk is greater than max dispclk.
      Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
      Signed-off-by: default avatarHersen Wu <hersenxs.wu@amd.com>
      Signed-off-by: default avatarRoman Li <Roman.Li@amd.com>
      Reviewed-by: default avatarRoman Li <Roman.Li@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      9c63852f