Skip to content

Commit

Permalink
Merge tag 'drm-fixes-2025-02-14' of https://gitlab.freedesktop.org/dr…
Browse files Browse the repository at this point in the history
…m/kernel

Pull drm fixes from Dave Airlie:
 "Weekly drm fixes pull request, nothing too unusual, the hdmi tests
  needs a bit of refactoring after lockdep shouted at them, otherwise
  amdgpu and xe lead and a few misc otherwise.

  amdgpu:
   - Fix shutdown regression on old APUs
   - Fix compute queue hang on gfx9 APUs
   - Fix possible invalid access in PSP failure path
   - Avoid possible buffer overflow in pptable override

  amdkfd:
   - Properly free gang bo in failure path
   - GFX12 trap handler fix

  i915:
   - selftest fix: avoid using uninitialized context

  xe:
   - Remove bo->clients out of bos_lock area
   - Carve out wopcm portion from the stolen memory

  tests:
   - fix lockdep with hdmi infrastructure tests

  host1x:
   - fix uninitialised mutex usage

  panthor:
   - fix uninit variable

  hibmc:
   - fix missing Kconfig select"

* tag 'drm-fixes-2025-02-14' of https://gitlab.freedesktop.org/drm/kernel:
  drm: Fix DSC BPP increment decoding
  drm/amdgpu: avoid buffer overflow attach in smu_sys_set_pp_table()
  drm/amdkfd: Ensure consistent barrier state saved in gfx12 trap handler
  drm/amdgpu: bail out when failed to load fw in psp_init_cap_microcode()
  amdkfd: properly free gang_ctx_bo when failed to init user queue
  drm/amdgpu: bump version for RV/PCO compute fix
  drm/amdgpu/gfx9: manually control gfxoff for CS on RV
  drm/amdgpu/pm: fix UVD handing in amdgpu_dpm_set_powergating_by_smu()
  drm/xe: Carve out wopcm portion from the stolen memory
  drm/i915/selftests: avoid using uninitialized context
  drm/xe/client: bo->client does not need bos_lock
  drm/hisilicon/hibmc: select CONFIG_DRM_DISPLAY_DP_HELPER
  drm/panthor: avoid garbage value in panthor_ioctl_dev_query()
  gpu: host1x: Fix a use of uninitialized mutex
  drm/tests: hdmi: Fix recursive locking
  drm/tests: hdmi: Reorder DRM entities variables assignment
  drm/tests: hdmi: Remove redundant assignments
  drm/tests: hdmi: Fix WW_MUTEX_SLOWPATH failures
  • Loading branch information
torvalds committed Feb 14, 2025
2 parents 68763b2 + 04485cc commit 128c8f9
Show file tree
Hide file tree
Showing 18 changed files with 192 additions and 136 deletions.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@
* - 3.58.0 - Add GFX12 DCC support
* - 3.59.0 - Cleared VRAM
* - 3.60.0 - Add AMDGPU_TILING_GFX12_DCC_WRITE_COMPRESS_DISABLE (Vulkan requirement)
* - 3.61.0 - Contains fix for RV/PCO compute queues
*/
#define KMS_DRIVER_MAJOR 3
#define KMS_DRIVER_MINOR 60
#define KMS_DRIVER_MINOR 61
#define KMS_DRIVER_PATCHLEVEL 0

/*
Expand Down
5 changes: 3 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3815,9 +3815,10 @@ int psp_init_cap_microcode(struct psp_context *psp, const char *chip_name)
if (err == -ENODEV) {
dev_warn(adev->dev, "cap microcode does not exist, skip\n");
err = 0;
goto out;
} else {
dev_err(adev->dev, "fail to initialize cap microcode\n");
}
dev_err(adev->dev, "fail to initialize cap microcode\n");
goto out;
}

info = &adev->firmware.ucode[AMDGPU_UCODE_ID_CAP];
Expand Down
36 changes: 34 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -7437,6 +7437,38 @@ static void gfx_v9_0_ring_emit_cleaner_shader(struct amdgpu_ring *ring)
amdgpu_ring_write(ring, 0); /* RESERVED field, programmed to zero */
}

static void gfx_v9_0_ring_begin_use_compute(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
struct amdgpu_ip_block *gfx_block =
amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX);

amdgpu_gfx_enforce_isolation_ring_begin_use(ring);

/* Raven and PCO APUs seem to have stability issues
* with compute and gfxoff and gfx pg. Disable gfx pg during
* submission and allow again afterwards.
*/
if (gfx_block && amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
gfx_v9_0_set_powergating_state(gfx_block, AMD_PG_STATE_UNGATE);
}

static void gfx_v9_0_ring_end_use_compute(struct amdgpu_ring *ring)
{
struct amdgpu_device *adev = ring->adev;
struct amdgpu_ip_block *gfx_block =
amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX);

/* Raven and PCO APUs seem to have stability issues
* with compute and gfxoff and gfx pg. Disable gfx pg during
* submission and allow again afterwards.
*/
if (gfx_block && amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 1, 0))
gfx_v9_0_set_powergating_state(gfx_block, AMD_PG_STATE_GATE);

amdgpu_gfx_enforce_isolation_ring_end_use(ring);
}

static const struct amd_ip_funcs gfx_v9_0_ip_funcs = {
.name = "gfx_v9_0",
.early_init = gfx_v9_0_early_init,
Expand Down Expand Up @@ -7613,8 +7645,8 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
.emit_wave_limit = gfx_v9_0_emit_wave_limit,
.reset = gfx_v9_0_reset_kcq,
.emit_cleaner_shader = gfx_v9_0_ring_emit_cleaner_shader,
.begin_use = amdgpu_gfx_enforce_isolation_ring_begin_use,
.end_use = amdgpu_gfx_enforce_isolation_ring_end_use,
.begin_use = gfx_v9_0_ring_begin_use_compute,
.end_use = gfx_v9_0_ring_end_use_compute,
};

static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -4121,7 +4121,8 @@ static const uint32_t cwsr_trap_gfx12_hex[] = {
0x0000ffff, 0x8bfe7e7e,
0x8bea6a6a, 0xb97af804,
0xbe804ec2, 0xbf94fffe,
0xbe804a6c, 0xbfb10000,
0xbe804a6c, 0xbe804ec2,
0xbf94fffe, 0xbfb10000,
0xbf9f0000, 0xbf9f0000,
0xbf9f0000, 0xbf9f0000,
0xbf9f0000, 0x00000000,
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/amd/amdkfd/cwsr_trap_handler_gfx12.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,10 @@ L_SKIP_BARRIER_RESTORE:
s_rfe_b64 s_restore_pc_lo //Return to the main shader program and resume execution

L_END_PGM:
// Make sure that no wave of the workgroup can exit the trap handler
// before the workgroup barrier state is saved.
s_barrier_signal -2
s_barrier_wait -2
s_endpgm_saved
end

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ static int init_user_queue(struct process_queue_manager *pqm,
return 0;

free_gang_ctx_bo:
amdgpu_amdkfd_free_gtt_mem(dev->adev, (*q)->gang_ctx_bo);
amdgpu_amdkfd_free_gtt_mem(dev->adev, &(*q)->gang_ctx_bo);
cleanup:
uninit_queue(*q);
*q = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/pm/amdgpu_dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev,
int ret = 0;
const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs;
enum ip_power_state pwr_state = gate ? POWER_STATE_OFF : POWER_STATE_ON;
bool is_vcn = (block_type == AMD_IP_BLOCK_TYPE_UVD || block_type == AMD_IP_BLOCK_TYPE_VCN);
bool is_vcn = block_type == AMD_IP_BLOCK_TYPE_VCN;

if (atomic_read(&adev->pm.pwr_state[block_type]) == pwr_state &&
(!is_vcn || adev->vcn.num_vcn_inst == 1)) {
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ static int smu_sys_set_pp_table(void *handle,
return -EIO;
}

if (!smu_table->hardcode_pptable) {
if (!smu_table->hardcode_pptable || smu_table->power_play_table_size < size) {
kfree(smu_table->hardcode_pptable);
smu_table->hardcode_pptable = kzalloc(size, GFP_KERNEL);
if (!smu_table->hardcode_pptable)
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/display/drm_dp_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ u8 drm_dp_dsc_sink_bpp_incr(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
{
u8 bpp_increment_dpcd = dsc_dpcd[DP_DSC_BITS_PER_PIXEL_INC - DP_DSC_SUPPORT];

switch (bpp_increment_dpcd) {
switch (bpp_increment_dpcd & DP_DSC_BITS_PER_PIXEL_MASK) {
case DP_DSC_BITS_PER_PIXEL_1_16:
return 16;
case DP_DSC_BITS_PER_PIXEL_1_8:
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/hisilicon/hibmc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ config DRM_HISI_HIBMC
depends on DRM && PCI
depends on MMU
select DRM_CLIENT_SELECTION
select DRM_DISPLAY_HELPER
select DRM_DISPLAY_DP_HELPER
select DRM_KMS_HELPER
select DRM_VRAM_HELPER
select DRM_TTM
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static int igt_ppgtt_alloc(void *arg)
return PTR_ERR(ppgtt);

if (!ppgtt->vm.allocate_va_range)
goto err_ppgtt_cleanup;
goto ppgtt_vm_put;

/*
* While we only allocate the page tables here and so we could
Expand Down Expand Up @@ -236,7 +236,7 @@ static int igt_ppgtt_alloc(void *arg)
goto retry;
}
i915_gem_ww_ctx_fini(&ww);

ppgtt_vm_put:
i915_vm_put(&ppgtt->vm);
return err;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/panthor/panthor_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ static void panthor_query_group_priorities_info(struct drm_file *file,
{
int prio;

memset(arg, 0, sizeof(*arg));
for (prio = PANTHOR_GROUP_PRIORITY_REALTIME; prio >= 0; prio--) {
if (!group_priority_permit(file, prio))
arg->allowed_mask |= BIT(prio);
Expand Down
Loading

0 comments on commit 128c8f9

Please sign in to comment.