1. 09 Feb, 2024 5 commits
  2. 08 Feb, 2024 9 commits
  3. 07 Feb, 2024 16 commits
    • Lijo Lazar's avatar
      drm/amdgpu: Fix HDP flush for VFs on nbio v7.9 · 534c8a5b
      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>
      534c8a5b
    • Srinivasan Shanmugam's avatar
      drm/amd/display: Implement bounds check for stream encoder creation in DCN301 · 58fca355
      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>
      58fca355
    • Nathan Chancellor's avatar
      drm/amd/display: Increase frame-larger-than for all display_mode_vba files · e63e35f0
      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>
      e63e35f0
    • Mario Limonciello's avatar
      drm/amd/display: Clear phantom stream count and plane count · da48914e
      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>
      da48914e
    • Lijo Lazar's avatar
      drm/amdgpu: Avoid fetching VRAM vendor info · 55173942
      Lijo Lazar authored
      The present way to fetch VRAM vendor information turns out to be not
      reliable on GFX 9.4.3 dGPUs as well. Avoid using the data.
      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>
      Cc: stable@vger.kernel.org
      55173942
    • Rodrigo Siqueira's avatar
      drm/amd/display: Disable ODM by default for DCN35 · 29c5da1a
      Rodrigo Siqueira authored
      Just ensure that ODM optimization is disabled by default.
      Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
      Signed-off-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      29c5da1a
    • Alvin Lee's avatar
      drm/amd/display: Update phantom pipe enable / disable sequence · ca8179ba
      Alvin Lee authored
      Previously we would call apply_ctx_to_hw to enable and disable
      phantom pipes. However, apply_ctx_to_hw can potentially update
      non-phantom pipes as well which is undesired. Instead of calling
      apply_ctx_to_hw as a whole, call the relevant helpers for each
      phantom pipe when enabling / disabling which will avoid us modifying
      hardware state for non-phantom pipes unknowingly.
      
      The use case is for an FRL display where FRL_Update is requested
      by the display. In this case link_state_valid flag is cleared in
      a passive callback thread and should be handled in the next stream /
      link update. However, due to the call to apply_ctx_to_hw for the
      phantom pipes during a flip, the main pipes were modified outside
      of the desired sequence (driver does not handle link_state_valid = 0
      on flips).
      
      Cc: stable@vger.kernel.org # 6.6+
      Reviewed-by: default avatarSamson Tam <samson.tam@amd.com>
      Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
      Signed-off-by: default avatarAlvin Lee <alvin.lee2@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      ca8179ba
    • Fangzhi Zuo's avatar
      drm/amd/display: Fix MST Null Ptr for RV · e6a7df96
      Fangzhi Zuo authored
      The change try to fix below error specific to RV platform:
      
      BUG: kernel NULL pointer dereference, address: 0000000000000008
      PGD 0 P4D 0
      Oops: 0000 [#1] PREEMPT SMP NOPTI
      CPU: 4 PID: 917 Comm: sway Not tainted 6.3.9-arch1-1 #1 124dc55df4f5272ccb409f39ef4872fc2b3376a2
      Hardware name: LENOVO 20NKS01Y00/20NKS01Y00, BIOS R12ET61W(1.31 ) 07/28/2022
      RIP: 0010:drm_dp_atomic_find_time_slots+0x5e/0x260 [drm_display_helper]
      Code: 01 00 00 48 8b 85 60 05 00 00 48 63 80 88 00 00 00 3b 43 28 0f 8d 2e 01 00 00 48 8b 53 30 48 8d 04 80 48 8d 04 c2 48 8b 40 18 <48> 8>
      RSP: 0018:ffff960cc2df77d8 EFLAGS: 00010293
      RAX: 0000000000000000 RBX: ffff8afb87e81280 RCX: 0000000000000224
      RDX: ffff8afb9ee37c00 RSI: ffff8afb8da1a578 RDI: ffff8afb87e81280
      RBP: ffff8afb83d67000 R08: 0000000000000001 R09: ffff8afb9652f850
      R10: ffff960cc2df7908 R11: 0000000000000002 R12: 0000000000000000
      R13: ffff8afb8d7688a0 R14: ffff8afb8da1a578 R15: 0000000000000224
      FS:  00007f4dac35ce00(0000) GS:ffff8afe30b00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000008 CR3: 000000010ddc6000 CR4: 00000000003506e0
      Call Trace:
       <TASK>
       ? __die+0x23/0x70
       ? page_fault_oops+0x171/0x4e0
       ? plist_add+0xbe/0x100
       ? exc_page_fault+0x7c/0x180
       ? asm_exc_page_fault+0x26/0x30
       ? drm_dp_atomic_find_time_slots+0x5e/0x260 [drm_display_helper 0e67723696438d8e02b741593dd50d80b44c2026]
       ? drm_dp_atomic_find_time_slots+0x28/0x260 [drm_display_helper 0e67723696438d8e02b741593dd50d80b44c2026]
       compute_mst_dsc_configs_for_link+0x2ff/0xa40 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
       ? fill_plane_buffer_attributes+0x419/0x510 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
       compute_mst_dsc_configs_for_state+0x1e1/0x250 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
       amdgpu_dm_atomic_check+0xecd/0x1190 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
       drm_atomic_check_only+0x5c5/0xa40
       drm_mode_atomic_ioctl+0x76e/0xbc0
       ? _copy_to_user+0x25/0x30
       ? drm_ioctl+0x296/0x4b0
       ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
       drm_ioctl_kernel+0xcd/0x170
       drm_ioctl+0x26d/0x4b0
       ? __pfx_drm_mode_atomic_ioctl+0x10/0x10
       amdgpu_drm_ioctl+0x4e/0x90 [amdgpu 62e600d2a75e9158e1cd0a243bdc8e6da040c054]
       __x64_sys_ioctl+0x94/0xd0
       do_syscall_64+0x60/0x90
       ? do_syscall_64+0x6c/0x90
       entry_SYSCALL_64_after_hwframe+0x72/0xdc
      RIP: 0033:0x7f4dad17f76f
      Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c>
      RSP: 002b:00007ffd9ae859f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
      RAX: ffffffffffffffda RBX: 000055e255a55900 RCX: 00007f4dad17f76f
      RDX: 00007ffd9ae85a90 RSI: 00000000c03864bc RDI: 000000000000000b
      RBP: 00007ffd9ae85a90 R08: 0000000000000003 R09: 0000000000000003
      R10: 0000000000000000 R11: 0000000000000246 R12: 00000000c03864bc
      R13: 000000000000000b R14: 000055e255a7fc60 R15: 000055e255a01eb0
       </TASK>
      Modules linked in: rfcomm snd_seq_dummy snd_hrtimer snd_seq snd_seq_device ccm cmac algif_hash algif_skcipher af_alg joydev mousedev bnep >
       typec libphy k10temp ipmi_msghandler roles i2c_scmi acpi_cpufreq mac_hid nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_mas>
      CR2: 0000000000000008
      ---[ end trace 0000000000000000 ]---
      RIP: 0010:drm_dp_atomic_find_time_slots+0x5e/0x260 [drm_display_helper]
      Code: 01 00 00 48 8b 85 60 05 00 00 48 63 80 88 00 00 00 3b 43 28 0f 8d 2e 01 00 00 48 8b 53 30 48 8d 04 80 48 8d 04 c2 48 8b 40 18 <48> 8>
      RSP: 0018:ffff960cc2df77d8 EFLAGS: 00010293
      RAX: 0000000000000000 RBX: ffff8afb87e81280 RCX: 0000000000000224
      RDX: ffff8afb9ee37c00 RSI: ffff8afb8da1a578 RDI: ffff8afb87e81280
      RBP: ffff8afb83d67000 R08: 0000000000000001 R09: ffff8afb9652f850
      R10: ffff960cc2df7908 R11: 0000000000000002 R12: 0000000000000000
      R13: ffff8afb8d7688a0 R14: ffff8afb8da1a578 R15: 0000000000000224
      FS:  00007f4dac35ce00(0000) GS:ffff8afe30b00000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000008 CR3: 000000010ddc6000 CR4: 00000000003506e0
      
      With a second DP monitor connected, drm_atomic_state in dm atomic check
      sequence does not include the connector state for the old/existing/first
      DP monitor. In such case, dsc determination policy would hit a null ptr
      when it tries to iterate the old/existing stream that does not have a
      valid connector state attached to it. When that happens, dm atomic check
      should call drm_atomic_get_connector_state for a new connector state.
      Existing dm has already done that, except for RV due to it does not have
      official support of dsc where .num_dsc is not defined in dcn10 resource
      cap, that prevent from getting drm_atomic_get_connector_state called.
      So, skip dsc determination policy for ASICs that don't have DSC support.
      
      Cc: stable@vger.kernel.org # 6.1+
      Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2314Reviewed-by: default avatarWayne Lin <wayne.lin@amd.com>
      Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
      Signed-off-by: default avatarFangzhi Zuo <jerry.zuo@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      e6a7df96
    • Stanley.Yang's avatar
      drm/amdgpu: Fix shared buff copy to user · 2dcf82a8
      Stanley.Yang authored
      ta if invoke node buffer
      |-------- ta type ----------|
      |--------  ta id  ----------|
      |-------- cmd  id ----------|
      |------ shared buf len -----|
      |------ shared buffer ------|
      
      ta if invoke node buffer is as above, copy shared buffer data to correct location
      Signed-off-by: default avatarStanley.Yang <Stanley.Yang@amd.com>
      Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      2dcf82a8
    • Nicholas Kazlauskas's avatar
      drm/amd/display: Increase eval/entry delay for DCN35 · 280df499
      Nicholas Kazlauskas authored
      [Why]
      To match firmware measurements and avoid hanging when accessing HW
      that's in idle.
      
      [How]
      Increase the delays to what we've measured.
      Reviewed-by: default avatarOvidiu Bunea <ovidiu.bunea@amd.com>
      Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
      Signed-off-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      280df499
    • Li Ma's avatar
      drm/amdgpu: remove asymmetrical irq disabling in jpeg 4.0.5 suspend · 897925dc
      Li Ma authored
      A supplement to commit: 615dd56a
      There is an irq warning of jpeg during resume in s2idle process. No irq enabled in jpeg 4.0.5 resume.
      
      Fixes: 615dd56a ("drm/amdgpu: remove asymmetrical irq disabling in vcn 4.0.5 suspend")
      Signed-off-by: default avatarLi Ma <li.ma@amd.com>
      Acked-By: default avatarSaleemkhan Jamadar <saleemkhan.jamadar@amd.com>
      Reviewed-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
      Reviewed-by: default avatarVeerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      897925dc
    • Prike Liang's avatar
      drm/amdgpu: reset gpu for s3 suspend abort case · 6ef82ac6
      Prike Liang authored
      In the s3 suspend abort case some type of gfx9 power
      rail not turn off from FCH side and this will put the
      GPU in an unknown power status, so let's reset the gpu
      to a known good power state before reinitialize gpu
      device.
      Signed-off-by: default avatarPrike Liang <Prike.Liang@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      6ef82ac6
    • Prike Liang's avatar
      drm/amdgpu: skip to program GFXDEC registers for suspend abort · 93bafa32
      Prike Liang authored
      In the suspend abort cases, the gfx power rail doesn't turn off so
      some GFXDEC registers/CSB can't reset to default value and at this
      moment reinitialize GFXDEC/CSB will result in an unexpected error.
      So let skip those program sequence for the suspend abort case.
      Signed-off-by: default avatarPrike Liang <Prike.Liang@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      93bafa32
    • Wenjing Liu's avatar
      drm/amd/display: set odm_combine_policy based on context in dcn32 resource · 2103370a
      Wenjing Liu authored
      [why]
      When populating dml pipes, odm combine policy should be assigned based
      on the pipe topology of the context passed in. DML pipes could be
      repopulated multiple times during single validate bandwidth attempt. We
      need to make sure that whenever we repopulate the dml pipes it is always
      aligned with the updated context. There is a case where DML pipes get
      repopulated during FPO optimization after ODM combine policy is changed.
      Since in the current code we reinitlaize ODM combine policy, even though
      the current context has ODM combine enabled, we overwrite it despite the
      pipes are already split. This causes DML to think that MPC combine is
      used so we mistakenly enable MPC combine because we apply pipe split
      with ODM combine policy reset. This issue doesn't impact non windowed
      MPO with ODM case because the legacy policy has restricted use cases. We
      don't encounter the case where both ODM and FPO optimizations are
      enabled together. So we decide to leave it as is because it is about to
      be replaced anyway.
      
      Cc: stable@vger.kernel.org # 6.6+
      Reviewed-by: default avatarChaitanya Dhere <chaitanya.dhere@amd.com>
      Reviewed-by: default avatarAlvin Lee <alvin.lee2@amd.com>
      Acked-by: default avatarHamza Mahfooz <hamza.mahfooz@amd.com>
      Signed-off-by: default avatarWenjing Liu <wenjing.liu@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      2103370a
    • Srinivasan Shanmugam's avatar
      drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()' · 66951d98
      Srinivasan Shanmugam authored
      In "u32 otg_inst = pipe_ctx->stream_res.tg->inst;"
      pipe_ctx->stream_res.tg could be NULL, it is relying on the caller to
      ensure the tg is not NULL.
      
      Fixes: 474ac4a8 ("drm/amd/display: Implement some asic specific abm call backs.")
      Cc: Yongqiang Sun <yongqiang.sun@amd.com>
      Cc: Anthony Koo <Anthony.Koo@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 avatarAnthony Koo <Anthony.Koo@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      66951d98
    • Srinivasan Shanmugam's avatar
      drm/amd/display: Fix 'panel_cntl' could be null in 'dcn21_set_backlight_level()' · e96fddb3
      Srinivasan Shanmugam authored
      'panel_cntl' structure used to control the display panel could be null,
      dereferencing it could lead to a null pointer access.
      
      Fixes the below:
      drivers/gpu/drm/amd/amdgpu/../display/dc/hwss/dcn21/dcn21_hwseq.c:269 dcn21_set_backlight_level() error: we previously assumed 'panel_cntl' could be null (see line 250)
      
      Fixes: 474ac4a8 ("drm/amd/display: Implement some asic specific abm call backs.")
      Cc: Yongqiang Sun <yongqiang.sun@amd.com>
      Cc: Anthony Koo <Anthony.Koo@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 avatarAnthony Koo <Anthony.Koo@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      e96fddb3
  4. 06 Feb, 2024 7 commits
  5. 05 Feb, 2024 3 commits