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

Commit 56fb6f9

Browse files
committed
Merge tag 'drm-next-2024-05-25' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Some fixes for the end of the merge window, mostly amdgpu and panthor, with one nouveau uAPI change that fixes a bad decision we made a few months back. nouveau: - fix bo metadata uAPI for vm bind panthor: - Fixes for panthor's heap logical block. - Reset on unrecoverable fault - Fix VM references. - Reset fix. xlnx: - xlnx compile and doc fixes. amdgpu: - Handle vbios table integrated info v2.3 amdkfd: - Handle duplicate BOs in reserve_bo_and_cond_vms - Handle memory limitations on small APUs dp/mst: - MST null deref fix. bridge: - Don't let next bridge create connector in adv7511 to make probe work" * tag 'drm-next-2024-05-25' of https://gitlab.freedesktop.org/drm/kernel: drm/amdgpu/atomfirmware: add intergrated info v2.3 table drm/mst: Fix NULL pointer dereference at drm_dp_add_payload_part2 drm/amdkfd: Let VRAM allocations go to GTT domain on small APUs drm/amdkfd: handle duplicate BOs in reserve_bo_and_cond_vms drm/bridge: adv7511: Attach next bridge without creating connector drm/buddy: Fix the warn on's during force merge drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations drm/panthor: Call panthor_sched_post_reset() even if the reset failed drm/panthor: Reset the FW VM to NULL on unplug drm/panthor: Keep a ref to the VM at the panthor_kernel_bo level drm/panthor: Force an immediate reset on unrecoverable faults drm/panthor: Document drm_panthor_tiler_heap_destroy::handle validity constraints drm/panthor: Fix an off-by-one in the heap context retrieval logic drm/panthor: Relax the constraints on the tiler chunk size drm/panthor: Make sure the tiler initial/max chunks are consistent drm/panthor: Fix tiler OOM handling to allow incremental rendering drm: xlnx: zynqmp_dpsub: Fix compilation error drm: xlnx: zynqmp_dpsub: Fix few function comments
2 parents 0b32d43 + 32a0bb7 commit 56fb6f9

27 files changed

+215
-98
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ void amdgpu_amdkfd_get_local_mem_info(struct amdgpu_device *adev,
455455
else
456456
mem_info->local_mem_size_private =
457457
KFD_XCP_MEMORY_SIZE(adev, xcp->id);
458+
} else if (adev->flags & AMD_IS_APU) {
459+
mem_info->local_mem_size_public = (ttm_tt_pages_limit() << PAGE_SHIFT);
460+
mem_info->local_mem_size_private = 0;
458461
} else {
459462
mem_info->local_mem_size_public = adev->gmc.visible_vram_size;
460463
mem_info->local_mem_size_private = adev->gmc.real_vram_size -
@@ -824,6 +827,8 @@ u64 amdgpu_amdkfd_xcp_memory_size(struct amdgpu_device *adev, int xcp_id)
824827
}
825828
do_div(tmp, adev->xcp_mgr->num_xcp_per_mem_partition);
826829
return ALIGN_DOWN(tmp, PAGE_SIZE);
830+
} else if (adev->flags & AMD_IS_APU) {
831+
return (ttm_tt_pages_limit() << PAGE_SHIFT);
827832
} else {
828833
return adev->gmc.real_vram_size;
829834
}

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

Lines changed: 13 additions & 10 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) {
199+
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
200200
system_mem_needed = size;
201201
ttm_mem_needed = size;
202202
}
@@ -232,7 +232,8 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
232232
"adev reference can't be null when vram is used");
233233
if (adev && xcp_id >= 0) {
234234
adev->kfd.vram_used[xcp_id] += vram_needed;
235-
adev->kfd.vram_used_aligned[xcp_id] += adev->gmc.is_app_apu ?
235+
adev->kfd.vram_used_aligned[xcp_id] +=
236+
(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) ?
236237
vram_needed :
237238
ALIGN(vram_needed, VRAM_AVAILABLITY_ALIGN);
238239
}
@@ -260,7 +261,7 @@ void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
260261

261262
if (adev) {
262263
adev->kfd.vram_used[xcp_id] -= size;
263-
if (adev->gmc.is_app_apu) {
264+
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
264265
adev->kfd.vram_used_aligned[xcp_id] -= size;
265266
kfd_mem_limit.system_mem_used -= size;
266267
kfd_mem_limit.ttm_mem_used -= size;
@@ -889,7 +890,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,
889890
* if peer device has large BAR. In contrast, access over xGMI is
890891
* allowed for both small and large BAR configurations of peer device
891892
*/
892-
if ((adev != bo_adev && !adev->gmc.is_app_apu) &&
893+
if ((adev != bo_adev && !(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU)) &&
893894
((mem->domain == AMDGPU_GEM_DOMAIN_VRAM) ||
894895
(mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL) ||
895896
(mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_MMIO_REMAP))) {
@@ -1188,7 +1189,8 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
11881189
int ret;
11891190

11901191
ctx->sync = &mem->sync;
1191-
drm_exec_init(&ctx->exec, DRM_EXEC_INTERRUPTIBLE_WAIT, 0);
1192+
drm_exec_init(&ctx->exec, DRM_EXEC_INTERRUPTIBLE_WAIT |
1193+
DRM_EXEC_IGNORE_DUPLICATES, 0);
11921194
drm_exec_until_all_locked(&ctx->exec) {
11931195
ctx->n_vms = 0;
11941196
list_for_each_entry(entry, &mem->attachments, list) {
@@ -1656,7 +1658,7 @@ size_t amdgpu_amdkfd_get_available_memory(struct amdgpu_device *adev,
16561658
- atomic64_read(&adev->vram_pin_size)
16571659
- reserved_for_pt;
16581660

1659-
if (adev->gmc.is_app_apu) {
1661+
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
16601662
system_mem_available = no_system_mem_limit ?
16611663
kfd_mem_limit.max_system_mem_limit :
16621664
kfd_mem_limit.max_system_mem_limit -
@@ -1704,7 +1706,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
17041706
if (flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
17051707
domain = alloc_domain = AMDGPU_GEM_DOMAIN_VRAM;
17061708

1707-
if (adev->gmc.is_app_apu) {
1709+
if (adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) {
17081710
domain = AMDGPU_GEM_DOMAIN_GTT;
17091711
alloc_domain = AMDGPU_GEM_DOMAIN_GTT;
17101712
alloc_flags = 0;
@@ -1951,7 +1953,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
19511953
if (size) {
19521954
if (!is_imported &&
19531955
(mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_VRAM ||
1954-
(adev->gmc.is_app_apu &&
1956+
((adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) &&
19551957
mem->bo->preferred_domains == AMDGPU_GEM_DOMAIN_GTT)))
19561958
*size = bo_size;
19571959
else
@@ -2373,8 +2375,9 @@ static int import_obj_create(struct amdgpu_device *adev,
23732375
(*mem)->dmabuf = dma_buf;
23742376
(*mem)->bo = bo;
23752377
(*mem)->va = va;
2376-
(*mem)->domain = (bo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM) && !adev->gmc.is_app_apu ?
2377-
AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT;
2378+
(*mem)->domain = (bo->preferred_domains & AMDGPU_GEM_DOMAIN_VRAM) &&
2379+
!(adev->gmc.is_app_apu || adev->flags & AMD_IS_APU) ?
2380+
AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT;
23782381

23792382
(*mem)->mapped_to_gpu_memory = 0;
23802383
(*mem)->process_info = avm->process_info;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ union igp_info {
212212
struct atom_integrated_system_info_v1_11 v11;
213213
struct atom_integrated_system_info_v1_12 v12;
214214
struct atom_integrated_system_info_v2_1 v21;
215+
struct atom_integrated_system_info_v2_3 v23;
215216
};
216217

217218
union umc_info {
@@ -360,6 +361,20 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
360361
if (vram_type)
361362
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
362363
break;
364+
case 3:
365+
mem_channel_number = igp_info->v23.umachannelnumber;
366+
if (!mem_channel_number)
367+
mem_channel_number = 1;
368+
mem_type = igp_info->v23.memorytype;
369+
if (mem_type == LpDdr5MemType)
370+
mem_channel_width = 32;
371+
else
372+
mem_channel_width = 64;
373+
if (vram_width)
374+
*vram_width = mem_channel_number * mem_channel_width;
375+
if (vram_type)
376+
*vram_type = convert_atom_mem_type_to_vram_type(adev, mem_type);
377+
break;
363378
default:
364379
return -EINVAL;
365380
}

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

10291029
pgmap = &kfddev->pgmap;

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

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

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

26252626
if (prange->preferred_loc == gpuid ||
@@ -3337,7 +3338,8 @@ svm_range_best_prefetch_location(struct svm_range *prange)
33373338
goto out;
33383339
}
33393340

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

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ void svm_range_list_lock_and_flush_work(struct svm_range_list *svms, struct mm_s
201201
* is initialized to not 0 when page migration register device memory.
202202
*/
203203
#define KFD_IS_SVM_API_SUPPORTED(adev) ((adev)->kfd.pgmap.type != 0 ||\
204-
(adev)->gmc.is_app_apu)
204+
(adev)->gmc.is_app_apu ||\
205+
((adev)->flags & AMD_IS_APU))
205206

206207
void svm_range_bo_unref_async(struct svm_range_bo *svm_bo);
207208

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void dm_helpers_dp_mst_send_payload_allocation(
363363
mst_state = to_drm_dp_mst_topology_state(mst_mgr->base.state);
364364
new_payload = drm_atomic_get_mst_payload_state(mst_state, aconnector->mst_output_port);
365365

366-
ret = drm_dp_add_payload_part2(mst_mgr, mst_state->base.state, new_payload);
366+
ret = drm_dp_add_payload_part2(mst_mgr, new_payload);
367367

368368
if (ret) {
369369
amdgpu_dm_set_mst_status(&aconnector->mst_status,

drivers/gpu/drm/amd/include/atomfirmware.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1657,6 +1657,49 @@ struct atom_integrated_system_info_v2_2
16571657
uint32_t reserved4[189];
16581658
};
16591659

1660+
struct uma_carveout_option {
1661+
char optionName[29]; //max length of string is 28chars + '\0'. Current design is for "minimum", "Medium", "High". This makes entire struct size 64bits
1662+
uint8_t memoryCarvedGb; //memory carved out with setting
1663+
uint8_t memoryRemainingGb; //memory remaining on system
1664+
union {
1665+
struct _flags {
1666+
uint8_t Auto : 1;
1667+
uint8_t Custom : 1;
1668+
uint8_t Reserved : 6;
1669+
} flags;
1670+
uint8_t all8;
1671+
} uma_carveout_option_flags;
1672+
};
1673+
1674+
struct atom_integrated_system_info_v2_3 {
1675+
struct atom_common_table_header table_header;
1676+
uint32_t vbios_misc; // enum of atom_system_vbiosmisc_def
1677+
uint32_t gpucapinfo; // enum of atom_system_gpucapinf_def
1678+
uint32_t system_config;
1679+
uint32_t cpucapinfo;
1680+
uint16_t gpuclk_ss_percentage; // unit of 0.001%, 1000 mean 1%
1681+
uint16_t gpuclk_ss_type;
1682+
uint16_t dpphy_override; // bit vector, enum of atom_sysinfo_dpphy_override_def
1683+
uint8_t memorytype; // enum of atom_dmi_t17_mem_type_def, APU memory type indication.
1684+
uint8_t umachannelnumber; // number of memory channels
1685+
uint8_t htc_hyst_limit;
1686+
uint8_t htc_tmp_limit;
1687+
uint8_t reserved1; // dp_ss_control
1688+
uint8_t gpu_package_id;
1689+
struct edp_info_table edp1_info;
1690+
struct edp_info_table edp2_info;
1691+
uint32_t reserved2[8];
1692+
struct atom_external_display_connection_info extdispconninfo;
1693+
uint8_t UMACarveoutVersion;
1694+
uint8_t UMACarveoutIndexMax;
1695+
uint8_t UMACarveoutTypeDefault;
1696+
uint8_t UMACarveoutIndexDefault;
1697+
uint8_t UMACarveoutType; //Auto or Custom
1698+
uint8_t UMACarveoutIndex;
1699+
struct uma_carveout_option UMASizeControlOption[20];
1700+
uint8_t reserved3[110];
1701+
};
1702+
16601703
// system_config
16611704
enum atom_system_vbiosmisc_def{
16621705
INTEGRATED_SYSTEM_INFO__GET_EDID_CALLBACK_FUNC_SUPPORT = 0x01,

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,8 @@ static int adv7511_bridge_attach(struct drm_bridge *bridge,
953953
int ret = 0;
954954

955955
if (adv->next_bridge) {
956-
ret = drm_bridge_attach(bridge->encoder, adv->next_bridge, bridge, flags);
956+
ret = drm_bridge_attach(bridge->encoder, adv->next_bridge, bridge,
957+
flags | DRM_BRIDGE_ATTACH_NO_CONNECTOR);
957958
if (ret)
958959
return ret;
959960
}

drivers/gpu/drm/display/drm_dp_mst_topology.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3421,7 +3421,6 @@ EXPORT_SYMBOL(drm_dp_remove_payload_part2);
34213421
/**
34223422
* drm_dp_add_payload_part2() - Execute payload update part 2
34233423
* @mgr: Manager to use.
3424-
* @state: The global atomic state
34253424
* @payload: The payload to update
34263425
*
34273426
* If @payload was successfully assigned a starting time slot by drm_dp_add_payload_part1(), this
@@ -3430,14 +3429,13 @@ EXPORT_SYMBOL(drm_dp_remove_payload_part2);
34303429
* Returns: 0 on success, negative error code on failure.
34313430
*/
34323431
int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr,
3433-
struct drm_atomic_state *state,
34343432
struct drm_dp_mst_atomic_payload *payload)
34353433
{
34363434
int ret = 0;
34373435

34383436
/* Skip failed payloads */
34393437
if (payload->payload_allocation_status != DRM_DP_MST_PAYLOAD_ALLOCATION_DFP) {
3440-
drm_dbg_kms(state->dev, "Part 1 of payload creation for %s failed, skipping part 2\n",
3438+
drm_dbg_kms(mgr->dev, "Part 1 of payload creation for %s failed, skipping part 2\n",
34413439
payload->port->connector->name);
34423440
return -EIO;
34433441
}

0 commit comments

Comments
 (0)