Skip to content

Commit 3d00c59

Browse files
committed
Merge tag 'amd-drm-next-6.6-2023-07-28' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.6-2023-07-28: amdgpu: - Lots of checkpatch cleanups - GFX 9.4.3 updates - Add USB PD and IFWI flashing documentation - GPUVM updates - RAS fixes - DRR fixes - FAMS fixes - Virtual display fixes - Soft IH fixes - SMU13 fixes - Rework PSP firmware loading for other IPs - Kernel doc fixes - DCN 3.0.1 fixes - LTTPR fixes - DP MST fixes - DCN 3.1.6 fixes - SubVP fixes - Display bandwidth calculation fixes - VCN4 secure submission fixes - Allow building DC on RISC-V - Add visible FB info to bo_print_info - HBR3 fixes - Add PSP 14.0 support - GFX9 MCBP fix - GMC10 vmhub index fix - GMC11 vmhub index fix - Create a new doorbell manager - SR-IOV fixes amdkfd: - Cleanup CRIU dma-buf handling - Use KIQ to unmap HIQ - GFX 9.4.3 debugger updates - GFX 9.4.2 debugger fixes - Enable cooperative groups fof gfx11 - SVM fixes radeon: - Lots of checkpatch cleanups Merge conflicts: - drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c The switch to drm eu helpers in 8a20668 ("drm/amdgpu: use drm_exec for GEM and CSA handling v2") clashed with the cosmetic cleanups from 30953c4 ("drm/amdgpu: Fix style issues in amdgpu_gem.c"). I kept the former since the cleanup up code is gone. - drivers/gpu/drm/amd/amdgpu/atom.c. adf64e2 ("drm/amd: Avoid reading the VBIOS part number twice") removed code that 992b8fe ("drm/radeon: Replace all non-returning strlcpy with strscpy") polished. From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] [sima: some merge conflict wrangling as noted] Signed-off-by: Daniel Vetter <[email protected]>
2 parents 5292070 + 7ea1db2 commit 3d00c59

File tree

240 files changed

+4335
-2472
lines changed

Some content is hidden

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

240 files changed

+4335
-2472
lines changed

Documentation/gpu/amdgpu/flashing.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
=======================
2+
dGPU firmware flashing
3+
=======================
4+
5+
IFWI
6+
----
7+
Flashing the dGPU integrated firmware image (IFWI) is supported by GPUs that
8+
use the PSP to orchestrate the update (Navi3x or newer GPUs).
9+
For supported GPUs, `amdgpu` will export a series of sysfs files that can be
10+
used for the flash process.
11+
12+
The IFWI flash process is:
13+
14+
1. Ensure the IFWI image is intended for the dGPU on the system.
15+
2. "Write" the IFWI image to the sysfs file `psp_vbflash`. This will stage the IFWI in memory.
16+
3. "Read" from the `psp_vbflash` sysfs file to initiate the flash process.
17+
4. Poll the `psp_vbflash_status` sysfs file to determine when the flash process completes.
18+
19+
USB-C PD F/W
20+
------------
21+
On GPUs that support flashing an updated USB-C PD firmware image, the process
22+
is done using the `usbc_pd_fw` sysfs file.
23+
24+
* Reading the file will provide the current firmware version.
25+
* Writing the name of a firmware payload stored in `/lib/firmware/amdgpu` to the sysfs file will initiate the flash process.
26+
27+
The firmware payload stored in `/lib/firmware/amdgpu` can be named any name
28+
as long as it doesn't conflict with other existing binaries that are used by
29+
`amdgpu`.
30+
31+
sysfs files
32+
-----------
33+
.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Documentation/gpu/amdgpu/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Next (GCN), Radeon DNA (RDNA), and Compute DNA (CDNA) architectures.
1010
module-parameters
1111
driver-core
1212
display/index
13+
flashing
1314
xgmi
1415
ras
1516
thermal

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ subdir-ccflags-$(CONFIG_DRM_AMDGPU_WERROR) += -Werror
6262
amdgpu-y := amdgpu_drv.o
6363

6464
# add KMS driver
65-
amdgpu-y += amdgpu_device.o amdgpu_kms.o \
65+
amdgpu-y += amdgpu_device.o amdgpu_doorbell_mgr.o amdgpu_kms.o \
6666
amdgpu_atombios.o atombios_crtc.o amdgpu_connectors.o \
6767
atom.o amdgpu_fence.o amdgpu_ttm.o amdgpu_object.o amdgpu_gart.o \
6868
amdgpu_encoders.o amdgpu_display.o amdgpu_i2c.o \
@@ -98,7 +98,7 @@ amdgpu-y += \
9898
vega20_reg_init.o nbio_v7_4.o nbio_v2_3.o nv.o arct_reg_init.o mxgpu_nv.o \
9999
nbio_v7_2.o hdp_v4_0.o hdp_v5_0.o aldebaran_reg_init.o aldebaran.o soc21.o \
100100
sienna_cichlid.o smu_v13_0_10.o nbio_v4_3.o hdp_v6_0.o nbio_v7_7.o hdp_v5_2.o lsdma_v6_0.o \
101-
nbio_v7_9.o aqua_vanjaram_reg_init.o
101+
nbio_v7_9.o aqua_vanjaram.o
102102

103103
# add DF block
104104
amdgpu-y += \

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,6 @@ struct amdgpu_device {
10331033
bool has_pr3;
10341034

10351035
bool ucode_sysfs_en;
1036-
bool psp_sysfs_en;
10371036

10381037
/* Chip product information */
10391038
char product_number[20];
@@ -1128,7 +1127,7 @@ void amdgpu_device_wreg(struct amdgpu_device *adev,
11281127
void amdgpu_device_indirect_wreg_ext(struct amdgpu_device *adev,
11291128
u64 reg_addr, u32 reg_data);
11301129
void amdgpu_mm_wreg_mmio_rlc(struct amdgpu_device *adev,
1131-
uint32_t reg, uint32_t v);
1130+
uint32_t reg, uint32_t v, uint32_t xcc_id);
11321131
void amdgpu_mm_wreg8(struct amdgpu_device *adev, uint32_t offset, uint8_t value);
11331132
uint8_t amdgpu_mm_rreg8(struct amdgpu_device *adev, uint32_t offset);
11341133

@@ -1506,4 +1505,8 @@ static inline bool amdgpu_is_tmz(struct amdgpu_device *adev)
15061505

15071506
int amdgpu_in_reset(struct amdgpu_device *adev);
15081507

1508+
extern const struct attribute_group amdgpu_vram_mgr_attr_group;
1509+
extern const struct attribute_group amdgpu_gtt_mgr_attr_group;
1510+
extern const struct attribute_group amdgpu_flash_attr_group;
1511+
15091512
#endif

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ static struct amdgpu_numa_info *amdgpu_acpi_get_numa_info(uint32_t pxm)
868868
if (!numa_info) {
869869
struct sysinfo info;
870870

871-
numa_info = kzalloc(sizeof *numa_info, GFP_KERNEL);
871+
numa_info = kzalloc(sizeof(*numa_info), GFP_KERNEL);
872872
if (!numa_info)
873873
return NULL;
874874

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,3 +830,53 @@ u64 amdgpu_amdkfd_xcp_memory_size(struct amdgpu_device *adev, int xcp_id)
830830
return adev->gmc.real_vram_size;
831831
}
832832
}
833+
834+
int amdgpu_amdkfd_unmap_hiq(struct amdgpu_device *adev, u32 doorbell_off,
835+
u32 inst)
836+
{
837+
struct amdgpu_kiq *kiq = &adev->gfx.kiq[inst];
838+
struct amdgpu_ring *kiq_ring = &kiq->ring;
839+
struct amdgpu_ring_funcs *ring_funcs;
840+
struct amdgpu_ring *ring;
841+
int r = 0;
842+
843+
if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
844+
return -EINVAL;
845+
846+
ring_funcs = kzalloc(sizeof(*ring_funcs), GFP_KERNEL);
847+
if (!ring_funcs)
848+
return -ENOMEM;
849+
850+
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
851+
if (!ring) {
852+
r = -ENOMEM;
853+
goto free_ring_funcs;
854+
}
855+
856+
ring_funcs->type = AMDGPU_RING_TYPE_COMPUTE;
857+
ring->doorbell_index = doorbell_off;
858+
ring->funcs = ring_funcs;
859+
860+
spin_lock(&kiq->ring_lock);
861+
862+
if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size)) {
863+
spin_unlock(&kiq->ring_lock);
864+
r = -ENOMEM;
865+
goto free_ring;
866+
}
867+
868+
kiq->pmf->kiq_unmap_queues(kiq_ring, ring, RESET_QUEUES, 0, 0);
869+
870+
if (kiq_ring->sched.ready && !adev->job_hang)
871+
r = amdgpu_ring_test_helper(kiq_ring);
872+
873+
spin_unlock(&kiq->ring_lock);
874+
875+
free_ring:
876+
kfree(ring);
877+
878+
free_ring_funcs:
879+
kfree(ring_funcs);
880+
881+
return r;
882+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ int amdgpu_amdkfd_get_xgmi_bandwidth_mbytes(struct amdgpu_device *dst,
251251
int amdgpu_amdkfd_get_pcie_bandwidth_mbytes(struct amdgpu_device *adev, bool is_min);
252252
int amdgpu_amdkfd_send_close_event_drain_irq(struct amdgpu_device *adev,
253253
uint32_t *payload);
254+
int amdgpu_amdkfd_unmap_hiq(struct amdgpu_device *adev, u32 doorbell_off,
255+
u32 inst);
254256

255257
/* Read user wptr from a specified user address space with page fault
256258
* disabled. The memory must be pinned and mapped to the hardware when

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "amdgpu_amdkfd.h"
2424
#include "amdgpu_amdkfd_arcturus.h"
2525
#include "amdgpu_amdkfd_gfx_v9.h"
26+
#include "amdgpu_amdkfd_aldebaran.h"
2627
#include "gc/gc_9_4_2_offset.h"
2728
#include "gc/gc_9_4_2_sh_mask.h"
2829
#include <uapi/linux/kfd_ioctl.h>
@@ -36,7 +37,7 @@
3637
* initialize the debug mode registers after it has disabled GFX off during the
3738
* debug session.
3839
*/
39-
static uint32_t kgd_aldebaran_enable_debug_trap(struct amdgpu_device *adev,
40+
uint32_t kgd_aldebaran_enable_debug_trap(struct amdgpu_device *adev,
4041
bool restore_dbg_registers,
4142
uint32_t vmid)
4243
{
@@ -107,7 +108,7 @@ static uint32_t kgd_aldebaran_set_wave_launch_trap_override(struct amdgpu_device
107108
return data;
108109
}
109110

110-
static uint32_t kgd_aldebaran_set_wave_launch_mode(struct amdgpu_device *adev,
111+
uint32_t kgd_aldebaran_set_wave_launch_mode(struct amdgpu_device *adev,
111112
uint8_t wave_launch_mode,
112113
uint32_t vmid)
113114
{
@@ -125,7 +126,8 @@ static uint32_t kgd_gfx_aldebaran_set_address_watch(
125126
uint32_t watch_address_mask,
126127
uint32_t watch_id,
127128
uint32_t watch_mode,
128-
uint32_t debug_vmid)
129+
uint32_t debug_vmid,
130+
uint32_t inst)
129131
{
130132
uint32_t watch_address_high;
131133
uint32_t watch_address_low;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright 2023 Advanced Micro Devices, Inc.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*/
22+
uint32_t kgd_aldebaran_enable_debug_trap(struct amdgpu_device *adev,
23+
bool restore_dbg_registers,
24+
uint32_t vmid);
25+
uint32_t kgd_aldebaran_set_wave_launch_mode(struct amdgpu_device *adev,
26+
uint8_t wave_launch_mode,
27+
uint32_t vmid);

0 commit comments

Comments
 (0)