Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 486291a

Browse files
committed
Merge tag 'drm-fixes-2024-03-30' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Regular fixes for rc2, quite a few i915/amdgpu as usual, some xe, and then mostly scattered around. rc3 might be quieter with the holidays but we shall see. bridge: - select DRM_KMS_HELPER dma-buf: - fix NULL-pointer deref dp: - fix div-by-zero in DP MST unplug code fbdev: - select FB_IOMEM_FOPS for SBus sched: - fix NULL-pointer deref xe: - Fix build on mips - Fix wrong bound checks - Fix use of msec rather than jiffies - Remove dead code amdgpu: - SMU 14.0.1 updates - DCN 3.5.x updates - VPE fix - eDP panel flickering fix - Suspend fix - PSR fix - DCN 3.0+ fix - VCN 4.0.6 updates - debugfs fix amdkfd: - DMA-Buf fix - GFX 9.4.2 TLB flush fix - CP interrupt fix i915: - Fix for BUG_ON/BUILD_BUG_ON IN I915_memcpy.c - Update a MTL workaround - Fix locking inversion in hwmon's sysfs - Remove a bogus error message around PXP - Fix UAF on VMA - Reset queue_priority_hint on parking - Display Fixes: - Remove duplicated audio enable/disable on SDVO and DP - Disable AuxCCS for Xe driver - Revert init order of MIPI DSI - DRRS debugfs fix with an extra refactor patch - VRR related fixes - Fix a JSL eDP corruption - Fix the cursor physical dma address - BIOS VBT related fix nouveau: - dmem: handle kcalloc() allocation failures qxl: - remove unused variables rockchip: - vop2: remove support for AR30 and AB30 formats vmwgfx: - debugfs: create ttm_resource_manager entry only if needed" * tag 'drm-fixes-2024-03-30' of https://gitlab.freedesktop.org/drm/kernel: (55 commits) drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode() drm/i915: Pre-populate the cursor physical dma address drm/i915/gt: Reset queue_priority_hint on parking drm/i915/vma: Fix UAF on destroy against retire race drm/i915: Do not print 'pxp init failed with 0' when it succeed drm/i915: Do not match JSL in ehl_combo_pll_div_frac_wa_needed() drm/i915/hwmon: Fix locking inversion in sysfs getter drm/i915/dsb: Fix DSB vblank waits when using VRR drm/i915/vrr: Generate VRR "safe window" for DSB drm/i915/display/debugfs: Fix duplicate checks in i915_drrs_status drm/i915/drrs: Refactor CPU transcoder DRRS check drm/i915/mtl: Update workaround 14018575942 drm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly drm/i915/display: Disable AuxCCS framebuffers if built for Xe drm/i915: Stop doing double audio enable/disable on SDVO and g4x+ DP drm/i915: Add includes for BUG_ON/BUILD_BUG_ON in i915_memcpy.c drm/qxl: remove unused variable from `qxl_process_single_command()` drm/qxl: remove unused `count` variable from `qxl_surface_id_alloc()` drm/i915: add bug.h include to i915_memcpy.c drm/vmwgfx: Create debugfs ttm_resource_manager entry only if needed ...
2 parents 1ab5c8a + b01f596 commit 486291a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+565
-448
lines changed

drivers/dma-buf/st-dma-fence-chain.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ static int sanitycheck(void *arg)
8484
return -ENOMEM;
8585

8686
chain = mock_chain(NULL, f, 1);
87-
if (!chain)
87+
if (chain)
88+
dma_fence_enable_sw_signaling(chain);
89+
else
8890
err = -ENOMEM;
8991

90-
dma_fence_enable_sw_signaling(chain);
91-
9292
dma_fence_signal(f);
9393
dma_fence_put(f);
9494

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4539,6 +4539,8 @@ int amdgpu_device_prepare(struct drm_device *dev)
45394539
if (r)
45404540
goto unprepare;
45414541

4542+
flush_delayed_work(&adev->gfx.gfx_off_delay_work);
4543+
45424544
for (i = 0; i < adev->num_ip_blocks; i++) {
45434545
if (!adev->ip_blocks[i].status.valid)
45444546
continue;

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,7 @@ static int amdgpu_discovery_set_umsch_mm_ip_blocks(struct amdgpu_device *adev)
22372237
{
22382238
switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
22392239
case IP_VERSION(4, 0, 5):
2240+
case IP_VERSION(4, 0, 6):
22402241
if (amdgpu_umsch_mm & 0x1) {
22412242
amdgpu_device_ip_block_add(adev, &umsch_mm_v4_0_ip_block);
22422243
adev->enable_umsch_mm = true;

drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -524,46 +524,58 @@ static ssize_t amdgpu_debugfs_mqd_read(struct file *f, char __user *buf,
524524
{
525525
struct amdgpu_ring *ring = file_inode(f)->i_private;
526526
volatile u32 *mqd;
527-
int r;
527+
u32 *kbuf;
528+
int r, i;
528529
uint32_t value, result;
529530

530531
if (*pos & 3 || size & 3)
531532
return -EINVAL;
532533

533-
result = 0;
534+
kbuf = kmalloc(ring->mqd_size, GFP_KERNEL);
535+
if (!kbuf)
536+
return -ENOMEM;
534537

535538
r = amdgpu_bo_reserve(ring->mqd_obj, false);
536539
if (unlikely(r != 0))
537-
return r;
540+
goto err_free;
538541

539542
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&mqd);
540-
if (r) {
541-
amdgpu_bo_unreserve(ring->mqd_obj);
542-
return r;
543-
}
543+
if (r)
544+
goto err_unreserve;
544545

546+
/*
547+
* Copy to local buffer to avoid put_user(), which might fault
548+
* and acquire mmap_sem, under reservation_ww_class_mutex.
549+
*/
550+
for (i = 0; i < ring->mqd_size/sizeof(u32); i++)
551+
kbuf[i] = mqd[i];
552+
553+
amdgpu_bo_kunmap(ring->mqd_obj);
554+
amdgpu_bo_unreserve(ring->mqd_obj);
555+
556+
result = 0;
545557
while (size) {
546558
if (*pos >= ring->mqd_size)
547-
goto done;
559+
break;
548560

549-
value = mqd[*pos/4];
561+
value = kbuf[*pos/4];
550562
r = put_user(value, (uint32_t *)buf);
551563
if (r)
552-
goto done;
564+
goto err_free;
553565
buf += 4;
554566
result += 4;
555567
size -= 4;
556568
*pos += 4;
557569
}
558570

559-
done:
560-
amdgpu_bo_kunmap(ring->mqd_obj);
561-
mqd = NULL;
562-
amdgpu_bo_unreserve(ring->mqd_obj);
563-
if (r)
564-
return r;
565-
571+
kfree(kbuf);
566572
return result;
573+
574+
err_unreserve:
575+
amdgpu_bo_unreserve(ring->mqd_obj);
576+
err_free:
577+
kfree(kbuf);
578+
return r;
567579
}
568580

569581
static const struct file_operations amdgpu_debugfs_mqd_fops = {

drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,13 @@ static void setup_vpe_queue(struct amdgpu_device *adev,
189189
mqd->rptr_val = 0;
190190
mqd->unmapped = 1;
191191

192+
if (adev->vpe.collaborate_mode)
193+
memcpy(++mqd, test->mqd_data_cpu_addr, sizeof(struct MQD_INFO));
194+
192195
qinfo->mqd_addr = test->mqd_data_gpu_addr;
193196
qinfo->csa_addr = test->ctx_data_gpu_addr +
194197
offsetof(struct umsch_mm_test_ctx_data, vpe_ctx_csa);
195-
qinfo->doorbell_offset_0 = (adev->doorbell_index.vpe_ring + 1) << 1;
198+
qinfo->doorbell_offset_0 = 0;
196199
qinfo->doorbell_offset_1 = 0;
197200
}
198201

@@ -287,7 +290,10 @@ static int submit_vpe_queue(struct amdgpu_device *adev, struct umsch_mm_test *te
287290
ring[5] = 0;
288291

289292
mqd->wptr_val = (6 << 2);
290-
// WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);
293+
if (adev->vpe.collaborate_mode)
294+
(++mqd)->wptr_val = (6 << 2);
295+
296+
WDOORBELL32(adev->umsch_mm.agdb_index[CONTEXT_PRIORITY_LEVEL_NORMAL], mqd->wptr_val);
291297

292298
for (i = 0; i < adev->usec_timeout; i++) {
293299
if (*fence == test_pattern)
@@ -571,6 +577,7 @@ int amdgpu_umsch_mm_init_microcode(struct amdgpu_umsch_mm *umsch)
571577

572578
switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
573579
case IP_VERSION(4, 0, 5):
580+
case IP_VERSION(4, 0, 6):
574581
fw_name = "amdgpu/umsch_mm_4_0_0.bin";
575582
break;
576583
default:
@@ -750,6 +757,7 @@ static int umsch_mm_early_init(void *handle)
750757

751758
switch (amdgpu_ip_version(adev, VCN_HWIP, 0)) {
752759
case IP_VERSION(4, 0, 5):
760+
case IP_VERSION(4, 0, 6):
753761
umsch_mm_v4_0_set_funcs(&adev->umsch_mm);
754762
break;
755763
default:

drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ enum UMSCH_SWIP_ENGINE_TYPE {
3333
UMSCH_SWIP_ENGINE_TYPE_MAX
3434
};
3535

36-
enum UMSCH_SWIP_AFFINITY_TYPE {
37-
UMSCH_SWIP_AFFINITY_TYPE_ANY = 0,
38-
UMSCH_SWIP_AFFINITY_TYPE_VCN0 = 1,
39-
UMSCH_SWIP_AFFINITY_TYPE_VCN1 = 2,
40-
UMSCH_SWIP_AFFINITY_TYPE_MAX
41-
};
42-
4336
enum UMSCH_CONTEXT_PRIORITY_LEVEL {
4437
CONTEXT_PRIORITY_LEVEL_IDLE = 0,
4538
CONTEXT_PRIORITY_LEVEL_NORMAL = 1,
@@ -51,13 +44,15 @@ enum UMSCH_CONTEXT_PRIORITY_LEVEL {
5144
struct umsch_mm_set_resource_input {
5245
uint32_t vmid_mask_mm_vcn;
5346
uint32_t vmid_mask_mm_vpe;
47+
uint32_t collaboration_mask_vpe;
5448
uint32_t logging_vmid;
5549
uint32_t engine_mask;
5650
union {
5751
struct {
5852
uint32_t disable_reset : 1;
5953
uint32_t disable_umsch_mm_log : 1;
60-
uint32_t reserved : 30;
54+
uint32_t use_rs64mem_for_proc_ctx_csa : 1;
55+
uint32_t reserved : 29;
6156
};
6257
uint32_t uint32_all;
6358
};
@@ -78,22 +73,26 @@ struct umsch_mm_add_queue_input {
7873
uint32_t doorbell_offset_1;
7974
enum UMSCH_SWIP_ENGINE_TYPE engine_type;
8075
uint32_t affinity;
81-
enum UMSCH_SWIP_AFFINITY_TYPE affinity_type;
8276
uint64_t mqd_addr;
8377
uint64_t h_context;
8478
uint64_t h_queue;
8579
uint32_t vm_context_cntl;
8680

81+
uint32_t process_csa_array_index;
82+
uint32_t context_csa_array_index;
83+
8784
struct {
8885
uint32_t is_context_suspended : 1;
89-
uint32_t reserved : 31;
86+
uint32_t collaboration_mode : 1;
87+
uint32_t reserved : 30;
9088
};
9189
};
9290

9391
struct umsch_mm_remove_queue_input {
9492
uint32_t doorbell_offset_0;
9593
uint32_t doorbell_offset_1;
9694
uint64_t context_csa_addr;
95+
uint32_t context_csa_array_index;
9796
};
9897

9998
struct MQD_INFO {
@@ -103,6 +102,7 @@ struct MQD_INFO {
103102
uint32_t wptr_val;
104103
uint32_t rptr_val;
105104
uint32_t unmapped;
105+
uint32_t vmid;
106106
};
107107

108108
struct amdgpu_umsch_mm;

drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,12 @@ static int vpe_hw_init(void *handle)
396396
struct amdgpu_vpe *vpe = &adev->vpe;
397397
int ret;
398398

399+
/* Power on VPE */
400+
ret = amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VPE,
401+
AMD_PG_STATE_UNGATE);
402+
if (ret)
403+
return ret;
404+
399405
ret = vpe_load_microcode(vpe);
400406
if (ret)
401407
return ret;

drivers/gpu/drm/amd/amdgpu/umsch_mm_v4_0.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int umsch_mm_v4_0_load_microcode(struct amdgpu_umsch_mm *umsch)
6060

6161
umsch->cmd_buf_curr_ptr = umsch->cmd_buf_ptr;
6262

63-
if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 5)) {
63+
if (amdgpu_ip_version(adev, VCN_HWIP, 0) >= IP_VERSION(4, 0, 5)) {
6464
WREG32_SOC15(VCN, 0, regUVD_IPX_DLDO_CONFIG,
6565
1 << UVD_IPX_DLDO_CONFIG__ONO0_PWR_CONFIG__SHIFT);
6666
SOC15_WAIT_ON_RREG(VCN, 0, regUVD_IPX_DLDO_STATUS,
@@ -248,7 +248,7 @@ static int umsch_mm_v4_0_ring_stop(struct amdgpu_umsch_mm *umsch)
248248
data = REG_SET_FIELD(data, VCN_UMSCH_RB_DB_CTRL, EN, 0);
249249
WREG32_SOC15(VCN, 0, regVCN_UMSCH_RB_DB_CTRL, data);
250250

251-
if (amdgpu_ip_version(adev, VCN_HWIP, 0) == IP_VERSION(4, 0, 5)) {
251+
if (amdgpu_ip_version(adev, VCN_HWIP, 0) >= IP_VERSION(4, 0, 5)) {
252252
WREG32_SOC15(VCN, 0, regUVD_IPX_DLDO_CONFIG,
253253
2 << UVD_IPX_DLDO_CONFIG__ONO0_PWR_CONFIG__SHIFT);
254254
SOC15_WAIT_ON_RREG(VCN, 0, regUVD_IPX_DLDO_STATUS,
@@ -271,6 +271,8 @@ static int umsch_mm_v4_0_set_hw_resources(struct amdgpu_umsch_mm *umsch)
271271

272272
set_hw_resources.vmid_mask_mm_vcn = umsch->vmid_mask_mm_vcn;
273273
set_hw_resources.vmid_mask_mm_vpe = umsch->vmid_mask_mm_vpe;
274+
set_hw_resources.collaboration_mask_vpe =
275+
adev->vpe.collaborate_mode ? 0x3 : 0x0;
274276
set_hw_resources.engine_mask = umsch->engine_mask;
275277

276278
set_hw_resources.vcn0_hqd_mask[0] = umsch->vcn0_hqd_mask;
@@ -346,6 +348,7 @@ static int umsch_mm_v4_0_add_queue(struct amdgpu_umsch_mm *umsch,
346348
add_queue.h_queue = input_ptr->h_queue;
347349
add_queue.vm_context_cntl = input_ptr->vm_context_cntl;
348350
add_queue.is_context_suspended = input_ptr->is_context_suspended;
351+
add_queue.collaboration_mode = adev->vpe.collaborate_mode ? 1 : 0;
349352

350353
add_queue.api_status.api_completion_fence_addr = umsch->ring.fence_drv.gpu_addr;
351354
add_queue.api_status.api_completion_fence_value = ++umsch->ring.fence_drv.sync_seq;

drivers/gpu/drm/amd/amdkfd/kfd_chardev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep,
15231523

15241524
/* Find a KFD GPU device that supports the get_dmabuf_info query */
15251525
for (i = 0; kfd_topology_enum_kfd_devices(i, &dev) == 0; i++)
1526-
if (dev)
1526+
if (dev && !kfd_devcgroup_check_permission(dev))
15271527
break;
15281528
if (!dev)
15291529
return -EINVAL;
@@ -1545,7 +1545,7 @@ static int kfd_ioctl_get_dmabuf_info(struct file *filep,
15451545
if (xcp_id >= 0)
15461546
args->gpu_id = dmabuf_adev->kfd.dev->nodes[xcp_id]->id;
15471547
else
1548-
args->gpu_id = dmabuf_adev->kfd.dev->nodes[0]->id;
1548+
args->gpu_id = dev->id;
15491549
args->flags = flags;
15501550

15511551
/* Copy metadata buffer to user mode */

drivers/gpu/drm/amd/amdkfd/kfd_int_process_v10.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ static void event_interrupt_wq_v10(struct kfd_node *dev,
339339
break;
340340
}
341341
kfd_signal_event_interrupt(pasid, context_id0 & 0x7fffff, 23);
342-
} else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE) {
342+
} else if (source_id == SOC15_INTSRC_CP_BAD_OPCODE &&
343+
KFD_DBG_EC_TYPE_IS_PACKET(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0))) {
343344
kfd_set_dbg_ev_from_interrupt(dev, pasid,
344345
KFD_DEBUG_DOORBELL_ID(context_id0),
345346
KFD_EC_MASK(KFD_DEBUG_CP_BAD_OP_ECODE(context_id0)),

0 commit comments

Comments
 (0)