Skip to content

Commit cc8ed4d

Browse files
committed
Merge tag 'drm-fixes-2024-06-01' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "This is the weekly fixes. Lots of small fixes across the board, one BUG_ON fix in shmem seems most important, otherwise amdgpu, i915, xe mostly with small fixes to all the other drivers. shmem: - fix BUG_ON in COW handling - warn when trying to pin imported objects buddy: - fix page size handling dma-buf: - sw-sync: Don't interfere with IRQ handling - fix kthreads-handling error path i915: - fix a race in audio component by registering it later - make DPT object unshrinkable to avoid shrinking when framebuffer has not shrunk - fix CCS id calculation to fix a perf regression - fix selftest caching mode - fix FIELD_PREP compiler warnings - fix indefinite wait for GT wakeref release - revert overeager multi-gt pm reference removal xe: - pcode polling timeout change - fix for deadlocks for faulting VMs - error-path lock imbalance fix amdgpu: - RAS fix - fix colorspace property for MST connectors - fix for PCIe DPM - silence UBSAN warning - GPUVM robustness fix - partition fix - drop deprecated I2C_CLASS_SPD amdkfd: - revert unused changes for certain 11.0.3 devices - simplify APU VRAM handling lima: - fix dma_resv-related deadlock in object pin msm: - remove build-time dependency on Python 3.9 nouveau: - nvif: Fix possible integer overflow panel: - lg-sw43408: Select DP helpers; Declare backlight ops as static - sitronix-st7789v: Various fixes for jt240mhqs_hwt_ek_e3 panel panfrost: - fix dma_resv-related deadlock in object pin" * tag 'drm-fixes-2024-06-01' of https://gitlab.freedesktop.org/drm/kernel: (35 commits) drm/msm: remove python 3.9 dependency for compiling msm drm/panel: sitronix-st7789v: fix display size for jt240mhqs_hwt_ek_e3 panel drm/panel: sitronix-st7789v: tweak timing for jt240mhqs_hwt_ek_e3 panel drm/panel: sitronix-st7789v: fix timing for jt240mhqs_hwt_ek_e3 panel drm/amd/pm: remove deprecated I2C_CLASS_SPD support from newly added SMU_14_0_2 drm/amdgpu: Make CPX mode auto default in NPS4 drm/amdkfd: simplify APU VRAM handling Revert "drm/amdkfd: fix gfx_target_version for certain 11.0.3 devices" drm/amdgpu: fix dereference null return value for the function amdgpu_vm_pt_parent drm/amdgpu: silence UBSAN warning drm/amdgpu: Adjust logic in amdgpu_device_partner_bandwidth() drm/i915: Fix audio component initialization drm/i915/dpt: Make DPT object unshrinkable drm/i915/gt: Fix CCS id's calculation for CCS mode setting drm/panel/lg-sw43408: mark sw43408_backlight_ops as static drm/i915/selftests: Set always_coherent to false when reading from CPU drm/panel/lg-sw43408: select CONFIG_DRM_DISPLAY_DP_HELPER drm/i915/guc: avoid FIELD_PREP warning drm/i915/gt: Disarm breadcrumbs if engines are already idle Revert "drm/i915: Remove extra multi-gt pm-references" ...
2 parents 1b907b8 + a2ce3f7 commit cc8ed4d

39 files changed

+186
-114
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,12 @@ static int race_signal_callback(void *arg)
540540
t[i].before = pass;
541541
t[i].task = kthread_run(thread_signal_callback, &t[i],
542542
"dma-fence:%d", i);
543+
if (IS_ERR(t[i].task)) {
544+
ret = PTR_ERR(t[i].task);
545+
while (--i >= 0)
546+
kthread_stop_put(t[i].task);
547+
return ret;
548+
}
543549
get_task_struct(t[i].task);
544550
}
545551

drivers/dma-buf/sync_debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
110110

111111
seq_printf(s, "%s: %d\n", obj->name, obj->value);
112112

113-
spin_lock_irq(&obj->lock);
113+
spin_lock(&obj->lock); /* Caller already disabled IRQ. */
114114
list_for_each(pos, &obj->pt_list) {
115115
struct sync_pt *pt = container_of(pos, struct sync_pt, link);
116116
sync_print_fence(s, &pt->base, false);
117117
}
118-
spin_unlock_irq(&obj->lock);
118+
spin_unlock(&obj->lock);
119119
}
120120

121121
static void sync_print_sync_file(struct seq_file *s,

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
196196
return -EINVAL;
197197

198198
vram_size = KFD_XCP_MEMORY_SIZE(adev, xcp_id);
199-
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
199+
if (adev->flags & AMD_IS_APU) {
200200
system_mem_needed = size;
201201
ttm_mem_needed = size;
202202
}
@@ -233,7 +233,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
233233
if (adev && xcp_id >= 0) {
234234
adev->kfd.vram_used[xcp_id] += vram_needed;
235235
adev->kfd.vram_used_aligned[xcp_id] +=
236-
(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) ?
236+
(adev->flags & AMD_IS_APU) ?
237237
vram_needed :
238238
ALIGN(vram_needed, VRAM_AVAILABLITY_ALIGN);
239239
}
@@ -261,7 +261,7 @@ void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
261261

262262
if (adev) {
263263
adev->kfd.vram_used[xcp_id] -= size;
264-
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
264+
if (adev->flags & AMD_IS_APU) {
265265
adev->kfd.vram_used_aligned[xcp_id] -= size;
266266
kfd_mem_limit.system_mem_used -= size;
267267
kfd_mem_limit.ttm_mem_used -= size;
@@ -890,7 +890,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,
890890
* if peer device has large BAR. In contrast, access over xGMI is
891891
* allowed for both small and large BAR configurations of peer device
892892
*/
893-
if ((adev != bo_adev && !(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU)) &&
893+
if ((adev != bo_adev && !(adev->flags & AMD_IS_APU)) &&
894894
((mem->domain == AMDGPU_GEM_DOMAIN_VRAM) ||
895895
(mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL) ||
896896
(mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_MMIO_REMAP))) {
@@ -1658,7 +1658,7 @@ size_t amdgpu_amdkfd_get_available_memory(struct amdgpu_device *adev,
16581658
- atomic64_read(&adev->vram_pin_size)
16591659
- reserved_for_pt;
16601660

1661-
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
1661+
if (adev->flags & AMD_IS_APU) {
16621662
system_mem_available = no_system_mem_limit ?
16631663
kfd_mem_limit.max_system_mem_limit :
16641664
kfd_mem_limit.max_system_mem_limit -
@@ -1706,7 +1706,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
17061706
if (flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
17071707
domain = alloc_domain = AMDGPU_GEM_DOMAIN_VRAM;
17081708

1709-
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
1709+
if (adev->flags & AMD_IS_APU) {
17101710
domain = AMDGPU_GEM_DOMAIN_GTT;
17111711
alloc_domain = AMDGPU_GEM_DOMAIN_GTT;
17121712
alloc_flags = 0;
@@ -1953,7 +1953,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
19531953
if (size) {
19541954
if (!is_imported &&
19551955
(mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_VRAM ||
1956-
((adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) &&
1956+
((adev->flags & AMD_IS_APU) &&
19571957
mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT)))
19581958
*size = bo_size;
19591959
else
@@ -2376,7 +2376,7 @@ static int import_obj_create(struct amdgpu_device *adev,
23762376
(*mem)->bo = bo;
23772377
(*mem)->va = va;
23782378
(*mem)->domain = (bo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM) &&
2379-
!(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) ?
2379+
!(adev->flags & AMD_IS_APU) ?
23802380
AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT;
23812381

23822382
(*mem)->mapped_to_gpu_memory = 0;

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5944,13 +5944,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev,
59445944
*speed = PCI_SPEED_UNKNOWN;
59455945
*width = PCIE_LNK_WIDTH_UNKNOWN;
59465946

5947-
while ((parent = pci_upstream_bridge(parent))) {
5948-
/* skip upstream/downstream switches internal to dGPU*/
5949-
if (parent->vendor == PCI_VENDOR_ID_ATI)
5950-
continue;
5951-
*speed = pcie_get_speed_cap(parent);
5952-
*width = pcie_get_width_cap(parent);
5953-
break;
5947+
if (amdgpu_device_pcie_dynamic_switching_supported(adev)) {
5948+
while ((parent = pci_upstream_bridge(parent))) {
5949+
/* skip upstream/downstream switches internal to dGPU*/
5950+
if (parent->vendor == PCI_VENDOR_ID_ATI)
5951+
continue;
5952+
*speed = pcie_get_speed_cap(parent);
5953+
*width = pcie_get_width_cap(parent);
5954+
break;
5955+
}
5956+
} else {
5957+
/* use the current speeds rather than max if switching is not supported */
5958+
pcie_bandwidth_available(adev->pdev, NULL, speed, width);
59545959
}
59555960
}
59565961

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct amdgpu_iv_entry;
4646
#define AMDGPU_RAS_GPU_ERR_HBM_BIST_TEST(x) AMDGPU_GET_REG_FIELD(x, 7, 7)
4747
#define AMDGPU_RAS_GPU_ERR_SOCKET_ID(x) AMDGPU_GET_REG_FIELD(x, 10, 8)
4848
#define AMDGPU_RAS_GPU_ERR_AID_ID(x) AMDGPU_GET_REG_FIELD(x, 12, 11)
49-
#define AMDGPU_RAS_GPU_ERR_HBM_ID(x) AMDGPU_GET_REG_FIELD(x, 13, 13)
49+
#define AMDGPU_RAS_GPU_ERR_HBM_ID(x) AMDGPU_GET_REG_FIELD(x, 14, 13)
5050
#define AMDGPU_RAS_GPU_ERR_BOOT_STATUS(x) AMDGPU_GET_REG_FIELD(x, 31, 31)
5151

5252
#define AMDGPU_RAS_BOOT_STATUS_POLLING_LIMIT 1000

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,15 @@ int amdgpu_vm_pde_update(struct amdgpu_vm_update_params *params,
706706
struct amdgpu_vm_bo_base *entry)
707707
{
708708
struct amdgpu_vm_bo_base *parent = amdgpu_vm_pt_parent(entry);
709-
struct amdgpu_bo *bo = parent->bo, *pbo;
709+
struct amdgpu_bo *bo, *pbo;
710710
struct amdgpu_vm *vm = params->vm;
711711
uint64_t pde, pt, flags;
712712
unsigned int level;
713713

714+
if (WARN_ON(!parent))
715+
return -EINVAL;
716+
717+
bo = parent->bo;
714718
for (level = 0, pbo = bo->parent; pbo; ++level)
715719
pbo = pbo->parent;
716720

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ __aqua_vanjaram_get_auto_mode(struct amdgpu_xcp_mgr *xcp_mgr)
422422

423423
if (adev->gmc.num_mem_partitions == num_xcc / 2)
424424
return (adev->flags & AMD_IS_APU) ? AMDGPU_TPX_PARTITION_MODE :
425-
AMDGPU_QPX_PARTITION_MODE;
425+
AMDGPU_CPX_PARTITION_MODE;
426426

427427
if (adev->gmc.num_mem_partitions == 2 && !(adev->flags & AMD_IS_APU))
428428
return AMDGPU_DPX_PARTITION_MODE;

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,15 +408,8 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf)
408408
f2g = &gfx_v11_kfd2kgd;
409409
break;
410410
case IP_VERSION(11, 0, 3):
411-
if ((adev->pdev->device == 0x7460 &&
412-
adev->pdev->revision == 0x00) ||
413-
(adev->pdev->device == 0x7461 &&
414-
adev->pdev->revision == 0x00))
415-
/* Note: Compiler version is 11.0.5 while HW version is 11.0.3 */
416-
gfx_target_version = 110005;
417-
else
418-
/* Note: Compiler version is 11.0.1 while HW version is 11.0.3 */
419-
gfx_target_version = 110001;
411+
/* Note: Compiler version is 11.0.1 while HW version is 11.0.3 */
412+
gfx_target_version = 110001;
420413
f2g = &gfx_v11_kfd2kgd;
421414
break;
422415
case IP_VERSION(11, 5, 0):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ int kgd2kfd_init_zone_device(struct amdgpu_device *adev)
10231023
if (amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(9, 0, 1))
10241024
return -EINVAL;
10251025

1026-
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU)
1026+
if (adev->flags & AMD_IS_APU)
10271027
return 0;
10281028

10291029
pgmap = &kfddev->pgmap;

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,8 +2619,7 @@ svm_range_best_restore_location(struct svm_range *prange,
26192619
return -1;
26202620
}
26212621

2622-
if (node->adev->gmc.is_app_apu ||
2623-
node->adev->flags & AMD_IS_APU)
2622+
if (node->adev->flags & AMD_IS_APU)
26242623
return 0;
26252624

26262625
if (prange->preferred_loc == gpuid ||
@@ -3338,8 +3337,7 @@ svm_range_best_prefetch_location(struct svm_range *prange)
33383337
goto out;
33393338
}
33403339

3341-
if (bo_node->adev->gmc.is_app_apu ||
3342-
bo_node->adev->flags & AMD_IS_APU) {
3340+
if (bo_node->adev->flags & AMD_IS_APU) {
33433341
best_loc = 0;
33443342
goto out;
33453343
}

0 commit comments

Comments
 (0)