mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
Merge tag 'amd-drm-fixes-7.0-2026-03-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-7.0-2026-03-19: amdgpu: - Fix gamma 2.2 colorop TFs - BO list fix - LTO fix - DC FP fix - DisplayID handling fix - DCN 2.01 fix - MMHUB boundary fixes - ISP fix - TLB fence fix - Hainan pm fix radeon: - Hainan pm fix Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260319131013.36639-1-alexander.deucher@amd.com
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
|
||||
#define AMDGPU_BO_LIST_MAX_PRIORITY 32u
|
||||
#define AMDGPU_BO_LIST_NUM_BUCKETS (AMDGPU_BO_LIST_MAX_PRIORITY + 1)
|
||||
#define AMDGPU_BO_LIST_MAX_ENTRIES (128 * 1024)
|
||||
|
||||
static void amdgpu_bo_list_free_rcu(struct rcu_head *rcu)
|
||||
{
|
||||
@@ -188,6 +189,9 @@ int amdgpu_bo_create_list_entry_array(struct drm_amdgpu_bo_list_in *in,
|
||||
const uint32_t bo_number = in->bo_number;
|
||||
struct drm_amdgpu_bo_list_entry *info;
|
||||
|
||||
if (bo_number > AMDGPU_BO_LIST_MAX_ENTRIES)
|
||||
return -EINVAL;
|
||||
|
||||
/* copy the handle array from userspace to a kernel buffer */
|
||||
if (likely(info_size == bo_info_size)) {
|
||||
info = vmemdup_array_user(uptr, bo_number, info_size);
|
||||
|
||||
@@ -1069,7 +1069,10 @@ amdgpu_vm_tlb_flush(struct amdgpu_vm_update_params *params,
|
||||
}
|
||||
|
||||
/* Prepare a TLB flush fence to be attached to PTs */
|
||||
if (!params->unlocked) {
|
||||
/* The check for need_tlb_fence should be dropped once we
|
||||
* sort out the issues with KIQ/MES TLB invalidation timeouts.
|
||||
*/
|
||||
if (!params->unlocked && vm->need_tlb_fence) {
|
||||
amdgpu_vm_tlb_fence_create(params->adev, vm, fence);
|
||||
|
||||
/* Makes sure no PD/PT is freed before the flush */
|
||||
@@ -2602,6 +2605,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
|
||||
ttm_lru_bulk_move_init(&vm->lru_bulk_move);
|
||||
|
||||
vm->is_compute_context = false;
|
||||
vm->need_tlb_fence = amdgpu_userq_enabled(&adev->ddev);
|
||||
|
||||
vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode &
|
||||
AMDGPU_VM_USE_CPU_FOR_GFX);
|
||||
@@ -2739,6 +2743,7 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm)
|
||||
dma_fence_put(vm->last_update);
|
||||
vm->last_update = dma_fence_get_stub();
|
||||
vm->is_compute_context = true;
|
||||
vm->need_tlb_fence = true;
|
||||
|
||||
unreserve_bo:
|
||||
amdgpu_bo_unreserve(vm->root.bo);
|
||||
|
||||
@@ -441,6 +441,8 @@ struct amdgpu_vm {
|
||||
struct ttm_lru_bulk_move lru_bulk_move;
|
||||
/* Flag to indicate if VM is used for compute */
|
||||
bool is_compute_context;
|
||||
/* Flag to indicate if VM needs a TLB fence (KFD or KGD) */
|
||||
bool need_tlb_fence;
|
||||
|
||||
/* Memory partition number, -1 means any partition */
|
||||
int8_t mem_id;
|
||||
|
||||
@@ -662,28 +662,35 @@ static int gmc_v9_0_process_interrupt(struct amdgpu_device *adev,
|
||||
} else {
|
||||
switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) {
|
||||
case IP_VERSION(9, 0, 0):
|
||||
mmhub_cid = mmhub_client_ids_vega10[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_vega10) ?
|
||||
mmhub_client_ids_vega10[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(9, 3, 0):
|
||||
mmhub_cid = mmhub_client_ids_vega12[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_vega12) ?
|
||||
mmhub_client_ids_vega12[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(9, 4, 0):
|
||||
mmhub_cid = mmhub_client_ids_vega20[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_vega20) ?
|
||||
mmhub_client_ids_vega20[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(9, 4, 1):
|
||||
mmhub_cid = mmhub_client_ids_arcturus[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_arcturus) ?
|
||||
mmhub_client_ids_arcturus[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(9, 1, 0):
|
||||
case IP_VERSION(9, 2, 0):
|
||||
mmhub_cid = mmhub_client_ids_raven[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_raven) ?
|
||||
mmhub_client_ids_raven[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(1, 5, 0):
|
||||
case IP_VERSION(2, 4, 0):
|
||||
mmhub_cid = mmhub_client_ids_renoir[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_renoir) ?
|
||||
mmhub_client_ids_renoir[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(1, 8, 0):
|
||||
case IP_VERSION(9, 4, 2):
|
||||
mmhub_cid = mmhub_client_ids_aldebaran[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_aldebaran) ?
|
||||
mmhub_client_ids_aldebaran[cid][rw] : NULL;
|
||||
break;
|
||||
default:
|
||||
mmhub_cid = NULL;
|
||||
|
||||
@@ -129,7 +129,7 @@ static int isp_genpd_add_device(struct device *dev, void *data)
|
||||
if (!pdev)
|
||||
return -EINVAL;
|
||||
|
||||
if (!dev->type->name) {
|
||||
if (!dev->type || !dev->type->name) {
|
||||
drm_dbg(&adev->ddev, "Invalid device type to add\n");
|
||||
goto exit;
|
||||
}
|
||||
@@ -165,7 +165,7 @@ static int isp_genpd_remove_device(struct device *dev, void *data)
|
||||
if (!pdev)
|
||||
return -EINVAL;
|
||||
|
||||
if (!dev->type->name) {
|
||||
if (!dev->type || !dev->type->name) {
|
||||
drm_dbg(&adev->ddev, "Invalid device type to remove\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -154,14 +154,17 @@ mmhub_v2_0_print_l2_protection_fault_status(struct amdgpu_device *adev,
|
||||
switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) {
|
||||
case IP_VERSION(2, 0, 0):
|
||||
case IP_VERSION(2, 0, 2):
|
||||
mmhub_cid = mmhub_client_ids_navi1x[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_navi1x) ?
|
||||
mmhub_client_ids_navi1x[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(2, 1, 0):
|
||||
case IP_VERSION(2, 1, 1):
|
||||
mmhub_cid = mmhub_client_ids_sienna_cichlid[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_sienna_cichlid) ?
|
||||
mmhub_client_ids_sienna_cichlid[cid][rw] : NULL;
|
||||
break;
|
||||
case IP_VERSION(2, 1, 2):
|
||||
mmhub_cid = mmhub_client_ids_beige_goby[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_beige_goby) ?
|
||||
mmhub_client_ids_beige_goby[cid][rw] : NULL;
|
||||
break;
|
||||
default:
|
||||
mmhub_cid = NULL;
|
||||
|
||||
@@ -94,7 +94,8 @@ mmhub_v2_3_print_l2_protection_fault_status(struct amdgpu_device *adev,
|
||||
case IP_VERSION(2, 3, 0):
|
||||
case IP_VERSION(2, 4, 0):
|
||||
case IP_VERSION(2, 4, 1):
|
||||
mmhub_cid = mmhub_client_ids_vangogh[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_vangogh) ?
|
||||
mmhub_client_ids_vangogh[cid][rw] : NULL;
|
||||
break;
|
||||
default:
|
||||
mmhub_cid = NULL;
|
||||
|
||||
@@ -110,7 +110,8 @@ mmhub_v3_0_print_l2_protection_fault_status(struct amdgpu_device *adev,
|
||||
switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) {
|
||||
case IP_VERSION(3, 0, 0):
|
||||
case IP_VERSION(3, 0, 1):
|
||||
mmhub_cid = mmhub_client_ids_v3_0_0[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_v3_0_0) ?
|
||||
mmhub_client_ids_v3_0_0[cid][rw] : NULL;
|
||||
break;
|
||||
default:
|
||||
mmhub_cid = NULL;
|
||||
|
||||
@@ -117,7 +117,8 @@ mmhub_v3_0_1_print_l2_protection_fault_status(struct amdgpu_device *adev,
|
||||
|
||||
switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) {
|
||||
case IP_VERSION(3, 0, 1):
|
||||
mmhub_cid = mmhub_client_ids_v3_0_1[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_v3_0_1) ?
|
||||
mmhub_client_ids_v3_0_1[cid][rw] : NULL;
|
||||
break;
|
||||
default:
|
||||
mmhub_cid = NULL;
|
||||
|
||||
@@ -108,7 +108,8 @@ mmhub_v3_0_2_print_l2_protection_fault_status(struct amdgpu_device *adev,
|
||||
"MMVM_L2_PROTECTION_FAULT_STATUS:0x%08X\n",
|
||||
status);
|
||||
|
||||
mmhub_cid = mmhub_client_ids_v3_0_2[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_v3_0_2) ?
|
||||
mmhub_client_ids_v3_0_2[cid][rw] : NULL;
|
||||
dev_err(adev->dev, "\t Faulty UTCL2 client ID: %s (0x%x)\n",
|
||||
mmhub_cid ? mmhub_cid : "unknown", cid);
|
||||
dev_err(adev->dev, "\t MORE_FAULTS: 0x%lx\n",
|
||||
|
||||
@@ -102,7 +102,8 @@ mmhub_v4_1_0_print_l2_protection_fault_status(struct amdgpu_device *adev,
|
||||
status);
|
||||
switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) {
|
||||
case IP_VERSION(4, 1, 0):
|
||||
mmhub_cid = mmhub_client_ids_v4_1_0[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_v4_1_0) ?
|
||||
mmhub_client_ids_v4_1_0[cid][rw] : NULL;
|
||||
break;
|
||||
default:
|
||||
mmhub_cid = NULL;
|
||||
|
||||
@@ -688,7 +688,8 @@ mmhub_v4_2_0_print_l2_protection_fault_status(struct amdgpu_device *adev,
|
||||
status);
|
||||
switch (amdgpu_ip_version(adev, MMHUB_HWIP, 0)) {
|
||||
case IP_VERSION(4, 2, 0):
|
||||
mmhub_cid = mmhub_client_ids_v4_2_0[cid][rw];
|
||||
mmhub_cid = cid < ARRAY_SIZE(mmhub_client_ids_v4_2_0) ?
|
||||
mmhub_client_ids_v4_2_0[cid][rw] : NULL;
|
||||
break;
|
||||
default:
|
||||
mmhub_cid = NULL;
|
||||
|
||||
@@ -2554,7 +2554,7 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev)
|
||||
fw_meta_info_params.fw_inst_const = adev->dm.dmub_fw->data +
|
||||
le32_to_cpu(hdr->header.ucode_array_offset_bytes) +
|
||||
PSP_HEADER_BYTES_256;
|
||||
fw_meta_info_params.fw_bss_data = region_params.bss_data_size ? adev->dm.dmub_fw->data +
|
||||
fw_meta_info_params.fw_bss_data = fw_meta_info_params.bss_data_size ? adev->dm.dmub_fw->data +
|
||||
le32_to_cpu(hdr->header.ucode_array_offset_bytes) +
|
||||
le32_to_cpu(hdr->inst_const_bytes) : NULL;
|
||||
fw_meta_info_params.custom_psp_footer_size = 0;
|
||||
@@ -13119,7 +13119,7 @@ static void parse_edid_displayid_vrr(struct drm_connector *connector,
|
||||
u16 min_vfreq;
|
||||
u16 max_vfreq;
|
||||
|
||||
if (edid == NULL || edid->extensions == 0)
|
||||
if (!edid || !edid->extensions)
|
||||
return;
|
||||
|
||||
/* Find DisplayID extension */
|
||||
@@ -13129,7 +13129,7 @@ static void parse_edid_displayid_vrr(struct drm_connector *connector,
|
||||
break;
|
||||
}
|
||||
|
||||
if (edid_ext == NULL)
|
||||
if (i == edid->extensions)
|
||||
return;
|
||||
|
||||
while (j < EDID_LENGTH) {
|
||||
|
||||
@@ -37,19 +37,19 @@ const u64 amdgpu_dm_supported_degam_tfs =
|
||||
BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_BT2020_INV_OETF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV);
|
||||
BIT(DRM_COLOROP_1D_CURVE_GAMMA22);
|
||||
|
||||
const u64 amdgpu_dm_supported_shaper_tfs =
|
||||
BIT(DRM_COLOROP_1D_CURVE_SRGB_INV_EOTF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_PQ_125_INV_EOTF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_BT2020_OETF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_GAMMA22);
|
||||
BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV);
|
||||
|
||||
const u64 amdgpu_dm_supported_blnd_tfs =
|
||||
BIT(DRM_COLOROP_1D_CURVE_SRGB_EOTF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_PQ_125_EOTF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_BT2020_INV_OETF) |
|
||||
BIT(DRM_COLOROP_1D_CURVE_GAMMA22_INV);
|
||||
BIT(DRM_COLOROP_1D_CURVE_GAMMA22);
|
||||
|
||||
#define MAX_COLOR_PIPELINE_OPS 10
|
||||
|
||||
|
||||
@@ -255,6 +255,10 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p
|
||||
BREAK_TO_DEBUGGER();
|
||||
return NULL;
|
||||
}
|
||||
if (ctx->dce_version == DCN_VERSION_2_01) {
|
||||
dcn201_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
|
||||
return &clk_mgr->base;
|
||||
}
|
||||
if (ASICREV_IS_SIENNA_CICHLID_P(asic_id.hw_internal_rev)) {
|
||||
dcn3_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
|
||||
return &clk_mgr->base;
|
||||
@@ -267,10 +271,6 @@ struct clk_mgr *dc_clk_mgr_create(struct dc_context *ctx, struct pp_smu_funcs *p
|
||||
dcn3_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
|
||||
return &clk_mgr->base;
|
||||
}
|
||||
if (ctx->dce_version == DCN_VERSION_2_01) {
|
||||
dcn201_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
|
||||
return &clk_mgr->base;
|
||||
}
|
||||
dcn20_clk_mgr_construct(ctx, clk_mgr, pp_smu, dccg);
|
||||
return &clk_mgr->base;
|
||||
}
|
||||
|
||||
@@ -1785,7 +1785,10 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, enum dc_valid
|
||||
|
||||
dc->res_pool->funcs->calculate_wm_and_dlg(dc, context, pipes, pipe_cnt, vlevel);
|
||||
|
||||
DC_FP_START();
|
||||
dcn32_override_min_req_memclk(dc, context);
|
||||
DC_FP_END();
|
||||
|
||||
dcn32_override_min_req_dcfclk(dc, context);
|
||||
|
||||
BW_VAL_TRACE_END_WATERMARKS();
|
||||
|
||||
@@ -3454,9 +3454,11 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev,
|
||||
if (adev->asic_type == CHIP_HAINAN) {
|
||||
if ((adev->pdev->revision == 0x81) ||
|
||||
(adev->pdev->revision == 0xC3) ||
|
||||
(adev->pdev->device == 0x6660) ||
|
||||
(adev->pdev->device == 0x6664) ||
|
||||
(adev->pdev->device == 0x6665) ||
|
||||
(adev->pdev->device == 0x6667)) {
|
||||
(adev->pdev->device == 0x6667) ||
|
||||
(adev->pdev->device == 0x666F)) {
|
||||
max_sclk = 75000;
|
||||
}
|
||||
if ((adev->pdev->revision == 0xC3) ||
|
||||
|
||||
@@ -2915,9 +2915,11 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev,
|
||||
if (rdev->family == CHIP_HAINAN) {
|
||||
if ((rdev->pdev->revision == 0x81) ||
|
||||
(rdev->pdev->revision == 0xC3) ||
|
||||
(rdev->pdev->device == 0x6660) ||
|
||||
(rdev->pdev->device == 0x6664) ||
|
||||
(rdev->pdev->device == 0x6665) ||
|
||||
(rdev->pdev->device == 0x6667)) {
|
||||
(rdev->pdev->device == 0x6667) ||
|
||||
(rdev->pdev->device == 0x666F)) {
|
||||
max_sclk = 75000;
|
||||
}
|
||||
if ((rdev->pdev->revision == 0xC3) ||
|
||||
|
||||
Reference in New Issue
Block a user