Skip to content

Commit f3a1d69

Browse files
committed
Merge tag 'amd-drm-next-6.19-2025-11-14' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.19-2025-11-14: amdgpu: - RAS updates - GC12 DCC P2P fix - Documentation fixes - Power limit code cleanup - Userq updates - VRR fix - SMART OLED support - DSC refactor for DCN 3.5 - Replay updates - DC clockgating updates - HDCP refactor - ISP fix - SMU 13.0.12 updates - JPEG 5.0.1 fix - VCE1 support - Enable DC by default on SI - Refactor CIK and SI enablement - Enable amdgpu by default for CI dGPUs - XGMI fixes - SR-IOV fixes - Memory allocation critical path fixes - Enable amdgpu by default on SI dGPUs amdkfd: - Relax checks on save area overallocations - Fix GPU mappings after prefetch radeon: - Refactor CIK and SI enablement Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20251114192553.442621-1-alexander.deucher@amd.com
2 parents fd1a11e + ccd3b4c commit f3a1d69

79 files changed

Lines changed: 2152 additions & 742 deletions

Some content is hidden

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

drivers/gpu/drm/amd/amdgpu/Kconfig

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,16 @@ config DRM_AMDGPU_SI
4343
bool "Enable amdgpu support for SI parts"
4444
depends on DRM_AMDGPU
4545
help
46-
Choose this option if you want to enable experimental support
46+
Choose this option if you want to enable support
4747
for SI (Southern Islands) asics.
4848

49-
SI is already supported in radeon. Experimental support for SI
50-
in amdgpu will be disabled by default and is still provided by
51-
radeon. Use module options to override this:
49+
SI (Southern Islands) are first generation GCN GPUs,
50+
supported by both drivers: radeon (old) and amdgpu (new).
51+
By default, SI dedicated GPUs are supported by amdgpu.
5252

53-
radeon.si_support=0 amdgpu.si_support=1
53+
Use module options to override this:
54+
To use radeon for SI,
55+
radeon.si_support=1 amdgpu.si_support=0
5456

5557
config DRM_AMDGPU_CIK
5658
bool "Enable amdgpu support for CIK parts"
@@ -59,11 +61,17 @@ config DRM_AMDGPU_CIK
5961
Choose this option if you want to enable support for CIK (Sea
6062
Islands) asics.
6163

62-
CIK is already supported in radeon. Support for CIK in amdgpu
63-
will be disabled by default and is still provided by radeon.
64-
Use module options to override this:
64+
CIK (Sea Islands) are second generation GCN GPUs,
65+
supported by both drivers: radeon (old) and amdgpu (new).
66+
By default,
67+
CIK dedicated GPUs are supported by amdgpu
68+
CIK APUs are supported by radeon
6569

70+
Use module options to override this:
71+
To use amdgpu for CIK,
6672
radeon.cik_support=0 amdgpu.cik_support=1
73+
To use radeon for CIK,
74+
radeon.cik_support=1 amdgpu.cik_support=0
6775

6876
config DRM_AMDGPU_USERPTR
6977
bool "Always enable userptr write support"

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ amdgpu-$(CONFIG_DRM_AMDGPU_CIK)+= cik.o cik_ih.o \
7878
dce_v8_0.o gfx_v7_0.o cik_sdma.o uvd_v4_2.o vce_v2_0.o
7979

8080
amdgpu-$(CONFIG_DRM_AMDGPU_SI)+= si.o gmc_v6_0.o gfx_v6_0.o si_ih.o si_dma.o dce_v6_0.o \
81-
uvd_v3_1.o
81+
uvd_v3_1.o vce_v1_0.o
8282

8383
amdgpu-y += \
8484
vi.o mxgpu_vi.o nbio_v6_1.o soc15.o emu_soc.o mxgpu_ai.o nbio_v7_0.o vega10_reg_init.o \

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "amdgpu_ras.h"
3737
#include "amdgpu_umc.h"
3838
#include "amdgpu_reset.h"
39-
#include "amdgpu_ras_mgr.h"
4039

4140
/* Total memory size in system memory and all GPU VRAM. Used to
4241
* estimate worst case amount of memory to reserve for page tables
@@ -747,20 +746,6 @@ void amdgpu_amdkfd_ras_pasid_poison_consumption_handler(struct amdgpu_device *ad
747746
enum amdgpu_ras_block block, uint16_t pasid,
748747
pasid_notify pasid_fn, void *data, uint32_t reset)
749748
{
750-
751-
if (amdgpu_uniras_enabled(adev)) {
752-
struct ras_ih_info ih_info;
753-
754-
memset(&ih_info, 0, sizeof(ih_info));
755-
ih_info.block = block;
756-
ih_info.pasid = pasid;
757-
ih_info.reset = reset;
758-
ih_info.pasid_fn = pasid_fn;
759-
ih_info.data = data;
760-
amdgpu_ras_mgr_handle_consumer_interrupt(adev, &ih_info);
761-
return;
762-
}
763-
764749
amdgpu_umc_pasid_poison_handler(adev, block, pasid, pasid_fn, data, reset);
765750
}
766751

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static int amdgpu_ctx_init_entity(struct amdgpu_ctx *ctx, u32 hw_ip,
236236
r = amdgpu_xcp_select_scheds(adev, hw_ip, hw_prio, fpriv,
237237
&num_scheds, &scheds);
238238
if (r)
239-
goto cleanup_entity;
239+
goto error_free_entity;
240240
}
241241

242242
/* disable load balance if the hw engine retains context among dependent jobs */

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4249,24 +4249,13 @@ bool amdgpu_device_asic_has_dc_support(struct pci_dev *pdev,
42494249
case CHIP_PITCAIRN:
42504250
case CHIP_VERDE:
42514251
case CHIP_OLAND:
4252-
/*
4253-
* We have systems in the wild with these ASICs that require
4254-
* LVDS and VGA support which is not supported with DC.
4255-
*
4256-
* Fallback to the non-DC driver here by default so as not to
4257-
* cause regressions.
4258-
*/
4259-
#if defined(CONFIG_DRM_AMD_DC_SI)
4260-
return amdgpu_dc > 0;
4261-
#else
4262-
return false;
4263-
#endif
4252+
return amdgpu_dc != 0 && IS_ENABLED(CONFIG_DRM_AMD_DC_SI);
42644253
case CHIP_KAVERI:
42654254
case CHIP_KABINI:
42664255
case CHIP_MULLINS:
42674256
/*
42684257
* We have systems in the wild with these ASICs that require
4269-
* VGA support which is not supported with DC.
4258+
* TRAVIS and NUTMEG support which is not supported with DC.
42704259
*
42714260
* Fallback to the non-DC driver here by default so as not to
42724261
* cause regressions.

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
8383
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
8484
int r;
8585

86+
/*
87+
* Disable peer-to-peer access for DCC-enabled VRAM surfaces on GFX12+.
88+
* Such buffers cannot be safely accessed over P2P due to device-local
89+
* compression metadata. Fallback to system-memory path instead.
90+
* Device supports GFX12 (GC 12.x or newer)
91+
* BO was created with the AMDGPU_GEM_CREATE_GFX12_DCC flag
92+
*
93+
*/
94+
if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(12, 0, 0) &&
95+
bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC)
96+
attach->peer2peer = false;
97+
8698
if (!amdgpu_dmabuf_is_xgmi_accessible(attach_adev, bo) &&
8799
pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
88100
attach->peer2peer = false;

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

Lines changed: 94 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ module_param_named(moverate, amdgpu_moverate, int, 0600);
312312
* DOC: audio (int)
313313
* Set HDMI/DPAudio. Only affects non-DC display handling. The default is -1 (Enabled), set 0 to disabled it.
314314
*/
315-
MODULE_PARM_DESC(audio, "Audio enable (-1 = auto, 0 = disable, 1 = enable)");
315+
MODULE_PARM_DESC(audio, "HDMI/DP Audio enable for non DC displays (-1 = auto, 0 = disable, 1 = enable)");
316316
module_param_named(audio, amdgpu_audio, int, 0444);
317317

318318
/**
@@ -618,39 +618,39 @@ module_param_named(timeout_period, amdgpu_watchdog_timer.period, uint, 0644);
618618

619619
/**
620620
* DOC: si_support (int)
621-
* Set SI support driver. This parameter works after set config CONFIG_DRM_AMDGPU_SI. For SI asic, when radeon driver is enabled,
622-
* set value 0 to use radeon driver, while set value 1 to use amdgpu driver. The default is using radeon driver when it available,
623-
* otherwise using amdgpu driver.
624-
*/
621+
* 1 = enabled, 0 = disabled, -1 = default
622+
*
623+
* SI (Southern Islands) are first generation GCN GPUs, supported by both
624+
* drivers: radeon (old) and amdgpu (new). This parameter controls whether
625+
* amdgpu should support SI.
626+
* By default, SI dedicated GPUs are supported by amdgpu.
627+
* Only relevant when CONFIG_DRM_AMDGPU_SI is enabled to build SI support in amdgpu.
628+
* See also radeon.si_support which should be disabled when amdgpu.si_support is
629+
* enabled, and vice versa.
630+
*/
631+
int amdgpu_si_support = -1;
625632
#ifdef CONFIG_DRM_AMDGPU_SI
626-
627-
#if IS_ENABLED(CONFIG_DRM_RADEON) || IS_ENABLED(CONFIG_DRM_RADEON_MODULE)
628-
int amdgpu_si_support;
629-
MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled (default))");
630-
#else
631-
int amdgpu_si_support = 1;
632-
MODULE_PARM_DESC(si_support, "SI support (1 = enabled (default), 0 = disabled)");
633-
#endif
634-
633+
MODULE_PARM_DESC(si_support, "SI support (1 = enabled, 0 = disabled, -1 = default)");
635634
module_param_named(si_support, amdgpu_si_support, int, 0444);
636635
#endif
637636

638637
/**
639638
* DOC: cik_support (int)
640-
* Set CIK support driver. This parameter works after set config CONFIG_DRM_AMDGPU_CIK. For CIK asic, when radeon driver is enabled,
641-
* set value 0 to use radeon driver, while set value 1 to use amdgpu driver. The default is using radeon driver when it available,
642-
* otherwise using amdgpu driver.
643-
*/
639+
* 1 = enabled, 0 = disabled, -1 = default
640+
*
641+
* CIK (Sea Islands) are second generation GCN GPUs, supported by both
642+
* drivers: radeon (old) and amdgpu (new). This parameter controls whether
643+
* amdgpu should support CIK.
644+
* By default:
645+
* - CIK dedicated GPUs are supported by amdgpu.
646+
* - CIK APUs are supported by radeon (except when radeon is not built).
647+
* Only relevant when CONFIG_DRM_AMDGPU_CIK is enabled to build CIK support in amdgpu.
648+
* See also radeon.cik_support which should be disabled when amdgpu.cik_support is
649+
* enabled, and vice versa.
650+
*/
651+
int amdgpu_cik_support = -1;
644652
#ifdef CONFIG_DRM_AMDGPU_CIK
645-
646-
#if IS_ENABLED(CONFIG_DRM_RADEON) || IS_ENABLED(CONFIG_DRM_RADEON_MODULE)
647-
int amdgpu_cik_support;
648-
MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled (default))");
649-
#else
650-
int amdgpu_cik_support = 1;
651-
MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)");
652-
#endif
653-
653+
MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled, 0 = disabled, -1 = default)");
654654
module_param_named(cik_support, amdgpu_cik_support, int, 0444);
655655
#endif
656656

@@ -2306,6 +2306,72 @@ static unsigned long amdgpu_fix_asic_type(struct pci_dev *pdev, unsigned long fl
23062306
return flags;
23072307
}
23082308

2309+
static bool amdgpu_support_enabled(struct device *dev,
2310+
const enum amd_asic_type family)
2311+
{
2312+
const char *gen;
2313+
const char *param;
2314+
int module_param = -1;
2315+
bool radeon_support_built = IS_ENABLED(CONFIG_DRM_RADEON);
2316+
bool amdgpu_support_built = false;
2317+
bool support_by_default = false;
2318+
2319+
switch (family) {
2320+
case CHIP_TAHITI:
2321+
case CHIP_PITCAIRN:
2322+
case CHIP_VERDE:
2323+
case CHIP_OLAND:
2324+
case CHIP_HAINAN:
2325+
gen = "SI";
2326+
param = "si_support";
2327+
module_param = amdgpu_si_support;
2328+
amdgpu_support_built = IS_ENABLED(CONFIG_DRM_AMDGPU_SI);
2329+
support_by_default = true;
2330+
break;
2331+
2332+
case CHIP_BONAIRE:
2333+
case CHIP_HAWAII:
2334+
support_by_default = true;
2335+
fallthrough;
2336+
case CHIP_KAVERI:
2337+
case CHIP_KABINI:
2338+
case CHIP_MULLINS:
2339+
gen = "CIK";
2340+
param = "cik_support";
2341+
module_param = amdgpu_cik_support;
2342+
amdgpu_support_built = IS_ENABLED(CONFIG_DRM_AMDGPU_CIK);
2343+
break;
2344+
2345+
default:
2346+
/* All other chips are supported by amdgpu only */
2347+
return true;
2348+
}
2349+
2350+
if (!amdgpu_support_built) {
2351+
dev_info(dev, "amdgpu built without %s support\n", gen);
2352+
return false;
2353+
}
2354+
2355+
if ((module_param == -1 && (support_by_default || !radeon_support_built)) ||
2356+
module_param == 1) {
2357+
if (radeon_support_built)
2358+
dev_info(dev, "%s support provided by amdgpu.\n"
2359+
"Use radeon.%s=1 amdgpu.%s=0 to override.\n",
2360+
gen, param, param);
2361+
2362+
return true;
2363+
}
2364+
2365+
if (radeon_support_built)
2366+
dev_info(dev, "%s support provided by radeon.\n"
2367+
"Use radeon.%s=0 amdgpu.%s=1 to override.\n",
2368+
gen, param, param);
2369+
else if (module_param == 0)
2370+
dev_info(dev, "%s support disabled by module param\n", gen);
2371+
2372+
return false;
2373+
}
2374+
23092375
static int amdgpu_pci_probe(struct pci_dev *pdev,
23102376
const struct pci_device_id *ent)
23112377
{
@@ -2353,48 +2419,8 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
23532419
return -ENOTSUPP;
23542420
}
23552421

2356-
switch (flags & AMD_ASIC_MASK) {
2357-
case CHIP_TAHITI:
2358-
case CHIP_PITCAIRN:
2359-
case CHIP_VERDE:
2360-
case CHIP_OLAND:
2361-
case CHIP_HAINAN:
2362-
#ifdef CONFIG_DRM_AMDGPU_SI
2363-
if (!amdgpu_si_support) {
2364-
dev_info(&pdev->dev,
2365-
"SI support provided by radeon.\n");
2366-
dev_info(&pdev->dev,
2367-
"Use radeon.si_support=0 amdgpu.si_support=1 to override.\n"
2368-
);
2369-
return -ENODEV;
2370-
}
2371-
break;
2372-
#else
2373-
dev_info(&pdev->dev, "amdgpu is built without SI support.\n");
2422+
if (!amdgpu_support_enabled(&pdev->dev, flags & AMD_ASIC_MASK))
23742423
return -ENODEV;
2375-
#endif
2376-
case CHIP_KAVERI:
2377-
case CHIP_BONAIRE:
2378-
case CHIP_HAWAII:
2379-
case CHIP_KABINI:
2380-
case CHIP_MULLINS:
2381-
#ifdef CONFIG_DRM_AMDGPU_CIK
2382-
if (!amdgpu_cik_support) {
2383-
dev_info(&pdev->dev,
2384-
"CIK support provided by radeon.\n");
2385-
dev_info(&pdev->dev,
2386-
"Use radeon.cik_support=0 amdgpu.cik_support=1 to override.\n"
2387-
);
2388-
return -ENODEV;
2389-
}
2390-
break;
2391-
#else
2392-
dev_info(&pdev->dev, "amdgpu is built without CIK support.\n");
2393-
return -ENODEV;
2394-
#endif
2395-
default:
2396-
break;
2397-
}
23982424

23992425
adev = devm_drm_dev_alloc(&pdev->dev, &amdgpu_kms_driver, typeof(*adev), ddev);
24002426
if (IS_ERR(adev))

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,42 @@ void amdgpu_gart_map(struct amdgpu_device *adev, uint64_t offset,
367367
drm_dev_exit(idx);
368368
}
369369

370+
/**
371+
* amdgpu_gart_map_vram_range - map VRAM pages into the GART page table
372+
*
373+
* @adev: amdgpu_device pointer
374+
* @pa: physical address of the first page to be mapped
375+
* @start_page: first page to map in the GART aperture
376+
* @num_pages: number of pages to be mapped
377+
* @flags: page table entry flags
378+
* @dst: CPU address of the GART table
379+
*
380+
* Binds a BO that is allocated in VRAM to the GART page table
381+
* (all ASICs).
382+
*
383+
* Useful when a kernel BO is located in VRAM but
384+
* needs to be accessed from the GART address space.
385+
*/
386+
void amdgpu_gart_map_vram_range(struct amdgpu_device *adev, uint64_t pa,
387+
uint64_t start_page, uint64_t num_pages,
388+
uint64_t flags, void *dst)
389+
{
390+
u32 i, idx;
391+
392+
/* The SYSTEM flag indicates the pages aren't in VRAM. */
393+
WARN_ON_ONCE(flags & AMDGPU_PTE_SYSTEM);
394+
395+
if (!drm_dev_enter(adev_to_drm(adev), &idx))
396+
return;
397+
398+
for (i = 0; i < num_pages; ++i) {
399+
amdgpu_gmc_set_pte_pde(adev, adev->gart.ptr,
400+
start_page + i, pa + AMDGPU_GPU_PAGE_SIZE * i, flags);
401+
}
402+
403+
drm_dev_exit(idx);
404+
}
405+
370406
/**
371407
* amdgpu_gart_bind - bind pages into the gart page table
372408
*

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,8 @@ void amdgpu_gart_map(struct amdgpu_device *adev, uint64_t offset,
6464
void *dst);
6565
void amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
6666
int pages, dma_addr_t *dma_addr, uint64_t flags);
67+
void amdgpu_gart_map_vram_range(struct amdgpu_device *adev, uint64_t pa,
68+
uint64_t start_page, uint64_t num_pages,
69+
uint64_t flags, void *dst);
6770
void amdgpu_gart_invalidate_tlb(struct amdgpu_device *adev);
6871
#endif

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ int amdgpu_gtt_mgr_init(struct amdgpu_device *adev, uint64_t gtt_size)
284284
ttm_resource_manager_init(man, &adev->mman.bdev, gtt_size);
285285

286286
start = AMDGPU_GTT_MAX_TRANSFER_SIZE * AMDGPU_GTT_NUM_TRANSFER_WINDOWS;
287+
start += amdgpu_vce_required_gart_pages(adev);
287288
size = (adev->gmc.gart_size >> PAGE_SHIFT) - start;
288289
drm_mm_init(&mgr->mm, start, size);
289290
spin_lock_init(&mgr->lock);

0 commit comments

Comments
 (0)