Skip to content

Commit 71e9f40

Browse files
committed
Merge tag 'amd-drm-next-6.11-2024-06-28' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.11-2024-06-28: amdgpu: - JPEG 5.x fixes - More FW loading cleanups - Misc code cleanups - GC 12.x fixes - ASPM fix - DCN 4.0.1 updates - SR-IOV fixes - HDCP fix - USB4 fixes - Silence UBSAN warnings - MES submission fixes - Update documentation for new products - DCC updates - Initial ISP 4.x plumbing - RAS fixes - Misc small fixes amdkfd: - Fix missing unlock in error path for adding queues Signed-off-by: Daniel Vetter <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 6256274 + 15eb857 commit 71e9f40

File tree

135 files changed

+2408
-738
lines changed

Some content is hidden

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

135 files changed

+2408
-738
lines changed

Documentation/gpu/amdgpu/apu-asic-info-table.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ SteamDeck, VANGOGH, DCN 3.0.1, 10.3.1, VCN 3.1.0, 5.2.1, 11.5.0
77
Ryzen 5000 series / Ryzen 7x30 series, GREEN SARDINE / Cezanne / Barcelo / Barcelo-R, DCN 2.1, 9.3, VCN 2.2, 4.1.1, 12.0.1
88
Ryzen 6000 series / Ryzen 7x35 series / Ryzen 7x36 series, YELLOW CARP / Rembrandt / Rembrandt-R, 3.1.2, 10.3.3, VCN 3.1.1, 5.2.3, 13.0.3
99
Ryzen 7000 series (AM5), Raphael, 3.1.5, 10.3.6, 3.1.2, 5.2.6, 13.0.5
10+
Ryzen 9000 series (AM5), Granite Ridge, 3.1.5, 10.3.6, 3.1.2, 5.2.6, 13.0.5
1011
Ryzen 7x45 series (FL1), Dragon Range, 3.1.5, 10.3.6, 3.1.2, 5.2.6, 13.0.5
1112
Ryzen 7x20 series, Mendocino, 3.1.6, 10.3.7, 3.1.1, 5.2.7, 13.0.8
1213
Ryzen 7x40 series, Phoenix, 3.1.4, 11.0.1 / 11.0.4, 4.0.2, 6.0.1, 13.0.4 / 13.0.11
1314
Ryzen 8x40 series, Hawk Point, 3.1.4, 11.0.1 / 11.0.4, 4.0.2, 6.0.1, 13.0.4 / 13.0.11
15+
Ryzen AI 300 series, Strix Point, 3.5.0, 11.5.0, 4.0.5, 6.1.0, 14.0.0

drivers/gpu/drm/amd/amdgpu/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,17 @@ config DRM_AMDGPU_USERPTR
7171
This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it
7272
isn't already selected to enabled full userptr support.
7373

74+
config DRM_AMD_ISP
75+
bool "Enable AMD Image Signal Processor IP support"
76+
depends on DRM_AMDGPU
77+
select MFD_CORE
78+
select PM_GENERIC_DOMAINS if PM
79+
help
80+
Choose this option to enable ISP IP support for AMD SOCs.
81+
This adds the ISP (Image Signal Processor) IP driver and wires
82+
it up into the amdgpu driver. It is required for cameras
83+
on APUs which utilize mipi cameras.
84+
7485
config DRM_AMDGPU_WERROR
7586
bool "Force the compiler to throw an error instead of a warning when compiling"
7687
depends on DRM_AMDGPU

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,12 @@ amdgpu-y += $(AMD_DISPLAY_FILES)
323323

324324
endif
325325

326+
# add isp block
327+
ifneq ($(CONFIG_DRM_AMD_ISP),)
328+
amdgpu-y += \
329+
amdgpu_isp.o \
330+
isp_v4_1_0.o \
331+
isp_v4_1_1.o
332+
endif
333+
326334
obj-$(CONFIG_DRM_AMDGPU)+= amdgpu.o

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@
112112
#include "amdgpu_xcp.h"
113113
#include "amdgpu_seq64.h"
114114
#include "amdgpu_reg_state.h"
115+
#if defined(CONFIG_DRM_AMD_ISP)
116+
#include "amdgpu_isp.h"
117+
#endif
115118

116119
#define MAX_GPU_INSTANCE 64
117120

@@ -221,7 +224,6 @@ extern int amdgpu_mes;
221224
extern int amdgpu_mes_log_enable;
222225
extern int amdgpu_mes_kiq;
223226
extern int amdgpu_uni_mes;
224-
extern int amdgpu_jpeg_test;
225227
extern int amdgpu_noretry;
226228
extern int amdgpu_force_asic_type;
227229
extern int amdgpu_smartshift_bias;
@@ -721,6 +723,7 @@ enum amd_hw_ip_block_type {
721723
XGMI_HWIP,
722724
DCI_HWIP,
723725
PCIE_HWIP,
726+
ISP_HWIP,
724727
MAX_HWIP
725728
};
726729

@@ -1018,7 +1021,6 @@ struct amdgpu_device {
10181021

10191022
/* jpeg */
10201023
struct amdgpu_jpeg jpeg;
1021-
bool enable_jpeg_test;
10221024

10231025
/* vpe */
10241026
struct amdgpu_vpe vpe;
@@ -1048,6 +1050,11 @@ struct amdgpu_device {
10481050
/* display related functionality */
10491051
struct amdgpu_display_manager dm;
10501052

1053+
#if defined(CONFIG_DRM_AMD_ISP)
1054+
/* isp */
1055+
struct amdgpu_isp isp;
1056+
#endif
1057+
10511058
/* mes */
10521059
bool enable_mes;
10531060
bool enable_mes_kiq;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
433433
mem_channel_number = vram_info->v30.channel_num;
434434
mem_channel_width = vram_info->v30.channel_width;
435435
if (vram_width)
436-
*vram_width = mem_channel_number * (1 << mem_channel_width);
436+
*vram_width = mem_channel_number * 16;
437437
break;
438438
default:
439439
return -EINVAL;

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5069,7 +5069,8 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,
50695069
struct amdgpu_hive_info *hive = NULL;
50705070

50715071
if (test_bit(AMDGPU_HOST_FLR, &reset_context->flags)) {
5072-
amdgpu_virt_ready_to_reset(adev);
5072+
if (!amdgpu_ras_get_fed_status(adev))
5073+
amdgpu_virt_ready_to_reset(adev);
50735074
amdgpu_virt_wait_reset(adev);
50745075
clear_bit(AMDGPU_HOST_FLR, &reset_context->flags);
50755076
r = amdgpu_virt_request_full_gpu(adev, true);
@@ -5837,6 +5838,12 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev,
58375838
/* Actual ASIC resets if needed.*/
58385839
/* Host driver will handle XGMI hive reset for SRIOV */
58395840
if (amdgpu_sriov_vf(adev)) {
5841+
if (amdgpu_ras_get_fed_status(adev) || amdgpu_virt_rcvd_ras_interrupt(adev)) {
5842+
dev_dbg(adev->dev, "Detected RAS error, wait for FLR completion\n");
5843+
amdgpu_ras_set_fed(adev, true);
5844+
set_bit(AMDGPU_HOST_FLR, &reset_context->flags);
5845+
}
5846+
58405847
r = amdgpu_device_reset_sriov(adev, reset_context);
58415848
if (AMDGPU_RETRY_SRIOV_RESET(r) && (retry_limit--) > 0) {
58425849
amdgpu_virt_release_full_gpu(adev, true);

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

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@
106106
#include "jpeg_v5_0_0.h"
107107

108108
#include "amdgpu_vpe.h"
109+
#if defined(CONFIG_DRM_AMD_ISP)
110+
#include "amdgpu_isp.h"
111+
#endif
109112

110113
#define FIRMWARE_IP_DISCOVERY "amdgpu/ip_discovery.bin"
111114
MODULE_FIRMWARE(FIRMWARE_IP_DISCOVERY);
@@ -225,6 +228,7 @@ static int hw_id_map[MAX_HWIP] = {
225228
[DCI_HWIP] = DCI_HWID,
226229
[PCIE_HWIP] = PCIE_HWID,
227230
[VPE_HWIP] = VPE_HWID,
231+
[ISP_HWIP] = ISP_HWID,
228232
};
229233

230234
static int amdgpu_discovery_read_binary_from_sysmem(struct amdgpu_device *adev, uint8_t *binary)
@@ -711,6 +715,12 @@ static void amdgpu_discovery_read_from_harvest_table(struct amdgpu_device *adev,
711715
adev->sdma.sdma_mask &=
712716
~(1U << harvest_info->list[i].number_instance);
713717
break;
718+
#if defined(CONFIG_DRM_AMD_ISP)
719+
case ISP_HWID:
720+
adev->isp.harvest_config |=
721+
~(1U << harvest_info->list[i].number_instance);
722+
break;
723+
#endif
714724
default:
715725
break;
716726
}
@@ -2294,8 +2304,6 @@ static int amdgpu_discovery_set_mm_ip_blocks(struct amdgpu_device *adev)
22942304
case IP_VERSION(5, 0, 0):
22952305
amdgpu_device_ip_block_add(adev, &vcn_v5_0_0_ip_block);
22962306
amdgpu_device_ip_block_add(adev, &jpeg_v5_0_0_ip_block);
2297-
if (amdgpu_jpeg_test)
2298-
adev->enable_jpeg_test = true;
22992307
break;
23002308
default:
23012309
dev_err(adev->dev,
@@ -2378,6 +2386,24 @@ static int amdgpu_discovery_set_umsch_mm_ip_blocks(struct amdgpu_device *adev)
23782386
return 0;
23792387
}
23802388

2389+
static int amdgpu_discovery_set_isp_ip_blocks(struct amdgpu_device *adev)
2390+
{
2391+
#if defined(CONFIG_DRM_AMD_ISP)
2392+
switch (amdgpu_ip_version(adev, ISP_HWIP, 0)) {
2393+
case IP_VERSION(4, 1, 0):
2394+
amdgpu_device_ip_block_add(adev, &isp_v4_1_0_ip_block);
2395+
break;
2396+
case IP_VERSION(4, 1, 1):
2397+
amdgpu_device_ip_block_add(adev, &isp_v4_1_1_ip_block);
2398+
break;
2399+
default:
2400+
break;
2401+
}
2402+
#endif
2403+
2404+
return 0;
2405+
}
2406+
23812407
int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
23822408
{
23832409
int r;
@@ -2904,6 +2930,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
29042930
if (r)
29052931
return r;
29062932

2933+
r = amdgpu_discovery_set_isp_ip_blocks(adev);
2934+
if (r)
2935+
return r;
29072936
return 0;
29082937
}
29092938

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ int amdgpu_force_asic_type = -1;
204204
int amdgpu_tmz = -1; /* auto */
205205
uint amdgpu_freesync_vid_mode;
206206
int amdgpu_reset_method = -1; /* auto */
207-
int amdgpu_jpeg_test;
208207
int amdgpu_num_kcq = -1;
209208
int amdgpu_smartshift_bias;
210209
int amdgpu_use_xgmi_p2p = 1;
@@ -940,9 +939,6 @@ module_param_named(freesync_video, amdgpu_freesync_vid_mode, uint, 0444);
940939
MODULE_PARM_DESC(reset_method, "GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco/bamaco)");
941940
module_param_named(reset_method, amdgpu_reset_method, int, 0644);
942941

943-
MODULE_PARM_DESC(jpeg_test, "jpeg test(0 = disable (default), 1 = enable)");
944-
module_param_named(jpeg_test, amdgpu_jpeg_test, int, 0444);
945-
946942
/**
947943
* DOC: bad_page_threshold (int) Bad page threshold is specifies the
948944
* threshold value of faulty pages detected by RAS ECC, which may

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,6 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
343343
if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
344344
return -EINVAL;
345345

346-
if ((flags & AMDGPU_GEM_CREATE_GFX12_DCC) &&
347-
((amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(12, 0, 0)) ||
348-
!(args->in.domains & AMDGPU_GEM_DOMAIN_VRAM)))
349-
return -EINVAL;
350-
351346
if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
352347
DRM_NOTE_ONCE("Cannot allocate secure buffer since TMZ is disabled\n");
353348
return -EINVAL;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,11 @@ int amdgpu_gmc_flush_gpu_tlb_pasid(struct amdgpu_device *adev, uint16_t pasid,
718718
ndw += kiq->pmf->invalidate_tlbs_size;
719719

720720
spin_lock(&adev->gfx.kiq[inst].ring_lock);
721-
amdgpu_ring_alloc(ring, ndw);
721+
r = amdgpu_ring_alloc(ring, ndw);
722+
if (r) {
723+
spin_unlock(&adev->gfx.kiq[inst].ring_lock);
724+
goto error_unlock_reset;
725+
}
722726
if (adev->gmc.flush_tlb_needs_extra_type_2)
723727
kiq->pmf->kiq_invalidate_tlbs(ring, pasid, 2, all_hub);
724728

0 commit comments

Comments
 (0)