1. 12 Feb, 2024 36 commits
  2. 07 Feb, 2024 4 commits
    • Lijo Lazar's avatar
      drm/amdgpu: Fix HDP flush for VFs on nbio v7.9 · d5597444
      Lijo Lazar authored
      HDP flush remapping is not done for VFs. Keep the original offsets in VF
      environment.
      Signed-off-by: default avatarLijo Lazar <lijo.lazar@amd.com>
      Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      d5597444
    • Srinivasan Shanmugam's avatar
      drm/amd/display: Implement bounds check for stream encoder creation in DCN301 · 15dba12c
      Srinivasan Shanmugam authored
      'stream_enc_regs' array is an array of dcn10_stream_enc_registers
      structures. The array is initialized with four elements, corresponding
      to the four calls to stream_enc_regs() in the array initializer. This
      means that valid indices for this array are 0, 1, 2, and 3.
      
      The error message 'stream_enc_regs' 4 <= 5 below, is indicating that
      there is an attempt to access this array with an index of 5, which is
      out of bounds. This could lead to undefined behavior
      
      Here, eng_id is used as an index to access the stream_enc_regs array. If
      eng_id is 5, this would result in an out-of-bounds access on the
      stream_enc_regs array.
      
      Thus fixing Buffer overflow error in dcn301_stream_encoder_create
      reported by Smatch:
      drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn301/dcn301_resource.c:1011 dcn301_stream_encoder_create() error: buffer overflow 'stream_enc_regs' 4 <= 5
      
      Fixes: 3a83e4e6 ("drm/amd/display: Add dcn3.01 support to DC (v2)")
      Cc: Roman Li <Roman.Li@amd.com>
      Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
      Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
      Signed-off-by: default avatarSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
      Reviewed-by: default avatarRoman Li <roman.li@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      15dba12c
    • Nathan Chancellor's avatar
      drm/amd/display: Increase frame-larger-than for all display_mode_vba files · 321036db
      Nathan Chancellor authored
      After a recent change in LLVM, allmodconfig (which has CONFIG_KCSAN=y
      and CONFIG_WERROR=y enabled) has a few new instances of
      -Wframe-larger-than for the mode support and system configuration
      functions:
      
        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_mode_vba_20v2.c:3393:6: error: stack frame size (2144) exceeds limit (2048) in 'dml20v2_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than]
         3393 | void dml20v2_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib)
              |      ^
        1 error generated.
      
        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn21/display_mode_vba_21.c:3520:6: error: stack frame size (2192) exceeds limit (2048) in 'dml21_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than]
         3520 | void dml21_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib)
              |      ^
        1 error generated.
      
        drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/display_mode_vba_20.c:3286:6: error: stack frame size (2128) exceeds limit (2048) in 'dml20_ModeSupportAndSystemConfigurationFull' [-Werror,-Wframe-larger-than]
         3286 | void dml20_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib)
              |      ^
        1 error generated.
      
      Without the sanitizers enabled, there are no warnings.
      
      This was the catalyst for commit 6740ec97 ("drm/amd/display:
      Increase frame warning limit with KASAN or KCSAN in dml2") and that same
      change was made to dml in commit 5b750b22 ("drm/amd/display:
      Increase frame warning limit with KASAN or KCSAN in dml") but the
      frame_warn_flag variable was not applied to all files. Do so now to
      clear up the warnings and make all these files consistent.
      
      Cc: stable@vger.kernel.org
      Closes: https://github.com/ClangBuiltLinux/linux/issue/1990Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      321036db
    • Mario Limonciello's avatar
      drm/amd/display: Clear phantom stream count and plane count · 3cafcc93
      Mario Limonciello authored
      When dc_state_destruct() was refactored the new phantom_stream_count
      and phantom_plane_count members weren't cleared.
      
      Fixes: 012a04b1 ("drm/amd/display: Refactor phantom resource allocation")
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      3cafcc93