Skip to content

Commit c99c4d0

Browse files
committed
Merge tag 'amd-drm-next-5.14-2021-05-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-5.14-2021-05-19: amdgpu: - Aldebaran updates - More LTTPR display work - Vangogh updates - SDMA 5.x GCR fixes - RAS fixes - PCIe ASPM support - Modifier fixes - Enable TMZ on Renoir - Buffer object code cleanup - Display overlay fixes - Initial support for multiple eDP panels - Initial SR-IOV support for Aldebaran - DP link training refactor - Misc code cleanups and bug fixes - SMU regression fixes for variable sized arrays - MAINTAINERS fixes for amdgpu amdkfd: - Initial SR-IOV support for Aldebaran - Topology fixes - Initial HMM SVM support - Misc code cleanups and bug fixes radeon: - Misc code cleanups and bug fixes - SMU regression fixes for variable sized arrays - Flickering fix for Oland with multiple 4K displays UAPI: - amdgpu: Drop AMDGPU_GEM_CREATE_SHADOW flag. This was always a kernel internal flag and userspace use of it has always been blocked. It's no longer needed so remove it. - amdkgd: HMM SVM support Overview: https://patchwork.freedesktop.org/series/85562/ Porposed userspace: https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/tree/fxkamd/hmm-wip Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 2ba0478 + 2bb5b5f commit c99c4d0

File tree

159 files changed

+8897
-1576
lines changed

Some content is hidden

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

159 files changed

+8897
-1576
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ M: Harry Wentland <[email protected]>
878878
M: Leo Li <[email protected]>
879879
880880
S: Supported
881-
T: git git://people.freedesktop.org/~agd5f/linux
881+
T: git https://gitlab.freedesktop.org/agd5f/linux.git
882882
F: drivers/gpu/drm/amd/display/
883883

884884
AMD FAM15H PROCESSOR POWER MONITORING DRIVER
@@ -954,7 +954,7 @@ AMD POWERPLAY
954954
M: Evan Quan <[email protected]>
955955
956956
S: Supported
957-
T: git git://people.freedesktop.org/~agd5f/linux
957+
T: git https://gitlab.freedesktop.org/agd5f/linux.git
958958
F: drivers/gpu/drm/amd/pm/powerplay/
959959

960960
AMD SEATTLE DEVICE TREE SUPPORT

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ amdgpu-y += amdgpu_device.o amdgpu_kms.o \
5656
amdgpu_gmc.o amdgpu_mmhub.o amdgpu_xgmi.o amdgpu_csa.o amdgpu_ras.o amdgpu_vm_cpu.o \
5757
amdgpu_vm_sdma.o amdgpu_discovery.o amdgpu_ras_eeprom.o amdgpu_nbio.o \
5858
amdgpu_umc.o smu_v11_0_i2c.o amdgpu_fru_eeprom.o amdgpu_rap.o \
59-
amdgpu_fw_attestation.o amdgpu_securedisplay.o
59+
amdgpu_fw_attestation.o amdgpu_securedisplay.o amdgpu_hdp.o
6060

6161
amdgpu-$(CONFIG_PROC_FS) += amdgpu_fdinfo.o
6262

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,8 @@ struct amdgpu_device {
10751075

10761076
atomic_t throttling_logging_enabled;
10771077
struct ratelimit_state throttling_logging_rs;
1078-
uint32_t ras_features;
1078+
uint32_t ras_hw_enabled;
1079+
uint32_t ras_enabled;
10791080

10801081
bool in_pci_err_recovery;
10811082
struct pci_saved_state *pci_state;

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct amdgpu_atif {
7676
/**
7777
* amdgpu_atif_call - call an ATIF method
7878
*
79-
* @handle: acpi handle
79+
* @atif: acpi handle
8080
* @function: the ATIF function to execute
8181
* @params: ATIF function params
8282
*
@@ -166,7 +166,6 @@ static void amdgpu_atif_parse_functions(struct amdgpu_atif_functions *f, u32 mas
166166
/**
167167
* amdgpu_atif_verify_interface - verify ATIF
168168
*
169-
* @handle: acpi handle
170169
* @atif: amdgpu atif struct
171170
*
172171
* Execute the ATIF_FUNCTION_VERIFY_INTERFACE ATIF function
@@ -240,8 +239,7 @@ static acpi_handle amdgpu_atif_probe_handle(acpi_handle dhandle)
240239
/**
241240
* amdgpu_atif_get_notification_params - determine notify configuration
242241
*
243-
* @handle: acpi handle
244-
* @n: atif notification configuration struct
242+
* @atif: acpi handle
245243
*
246244
* Execute the ATIF_FUNCTION_GET_SYSTEM_PARAMETERS ATIF function
247245
* to determine if a notifier is used and if so which one
@@ -304,7 +302,7 @@ static int amdgpu_atif_get_notification_params(struct amdgpu_atif *atif)
304302
/**
305303
* amdgpu_atif_query_backlight_caps - get min and max backlight input signal
306304
*
307-
* @handle: acpi handle
305+
* @atif: acpi handle
308306
*
309307
* Execute the QUERY_BRIGHTNESS_TRANSFER_CHARACTERISTICS ATIF function
310308
* to determine the acceptable range of backlight values
@@ -363,7 +361,7 @@ static int amdgpu_atif_query_backlight_caps(struct amdgpu_atif *atif)
363361
/**
364362
* amdgpu_atif_get_sbios_requests - get requested sbios event
365363
*
366-
* @handle: acpi handle
364+
* @atif: acpi handle
367365
* @req: atif sbios request struct
368366
*
369367
* Execute the ATIF_FUNCTION_GET_SYSTEM_BIOS_REQUESTS ATIF function
@@ -899,6 +897,8 @@ void amdgpu_acpi_fini(struct amdgpu_device *adev)
899897
/**
900898
* amdgpu_acpi_is_s0ix_supported
901899
*
900+
* @adev: amdgpu_device_pointer
901+
*
902902
* returns true if supported, false if not.
903903
*/
904904
bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev)

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

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ struct amdgpu_amdkfd_fence {
7575
struct mm_struct *mm;
7676
spinlock_t lock;
7777
char timeline_name[TASK_COMM_LEN];
78+
struct svm_range_bo *svm_bo;
7879
};
7980

8081
struct amdgpu_kfd_dev {
@@ -148,7 +149,8 @@ int amdgpu_queue_mask_bit_to_set_resource_bit(struct amdgpu_device *adev,
148149
int queue_bit);
149150

150151
struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context,
151-
struct mm_struct *mm);
152+
struct mm_struct *mm,
153+
struct svm_range_bo *svm_bo);
152154
#if IS_ENABLED(CONFIG_HSA_AMD)
153155
bool amdkfd_fence_check_mm(struct dma_fence *f, struct mm_struct *mm);
154156
struct amdgpu_amdkfd_fence *to_amdgpu_amdkfd_fence(struct dma_fence *f);
@@ -234,22 +236,27 @@ uint8_t amdgpu_amdkfd_get_xgmi_hops_count(struct kgd_dev *dst, struct kgd_dev *s
234236
})
235237

236238
/* GPUVM API */
239+
#define drm_priv_to_vm(drm_priv) \
240+
(&((struct amdgpu_fpriv *) \
241+
((struct drm_file *)(drm_priv))->driver_priv)->vm)
242+
237243
int amdgpu_amdkfd_gpuvm_acquire_process_vm(struct kgd_dev *kgd,
238244
struct file *filp, u32 pasid,
239-
void **vm, void **process_info,
245+
void **process_info,
240246
struct dma_fence **ef);
241-
void amdgpu_amdkfd_gpuvm_release_process_vm(struct kgd_dev *kgd, void *vm);
242-
uint64_t amdgpu_amdkfd_gpuvm_get_process_page_dir(void *vm);
247+
void amdgpu_amdkfd_gpuvm_release_process_vm(struct kgd_dev *kgd, void *drm_priv);
248+
uint64_t amdgpu_amdkfd_gpuvm_get_process_page_dir(void *drm_priv);
243249
int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
244250
struct kgd_dev *kgd, uint64_t va, uint64_t size,
245-
void *vm, struct kgd_mem **mem,
251+
void *drm_priv, struct kgd_mem **mem,
246252
uint64_t *offset, uint32_t flags);
247253
int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
248-
struct kgd_dev *kgd, struct kgd_mem *mem, uint64_t *size);
254+
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv,
255+
uint64_t *size);
249256
int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
250-
struct kgd_dev *kgd, struct kgd_mem *mem, void *vm);
257+
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv);
251258
int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu(
252-
struct kgd_dev *kgd, struct kgd_mem *mem, void *vm);
259+
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv);
253260
int amdgpu_amdkfd_gpuvm_sync_memory(
254261
struct kgd_dev *kgd, struct kgd_mem *mem, bool intr);
255262
int amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel(struct kgd_dev *kgd,
@@ -260,7 +267,7 @@ int amdgpu_amdkfd_gpuvm_get_vm_fault_info(struct kgd_dev *kgd,
260267
struct kfd_vm_fault_info *info);
261268
int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd,
262269
struct dma_buf *dmabuf,
263-
uint64_t va, void *vm,
270+
uint64_t va, void *drm_priv,
264271
struct kgd_mem **mem, uint64_t *size,
265272
uint64_t *mmap_offset);
266273
int amdgpu_amdkfd_get_tile_config(struct kgd_dev *kgd,
@@ -270,6 +277,7 @@ void amdgpu_amdkfd_gpuvm_init_mem_limits(void);
270277
void amdgpu_amdkfd_gpuvm_destroy_cb(struct amdgpu_device *adev,
271278
struct amdgpu_vm *vm);
272279
void amdgpu_amdkfd_unreserve_memory_limit(struct amdgpu_bo *bo);
280+
void amdgpu_amdkfd_reserve_system_mem(uint64_t size);
273281
#else
274282
static inline
275283
void amdgpu_amdkfd_gpuvm_init_mem_limits(void)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/firmware.h>
2626
#include "amdgpu.h"
2727
#include "amdgpu_amdkfd.h"
28+
#include "amdgpu_amdkfd_arcturus.h"
2829
#include "sdma0/sdma0_4_2_2_offset.h"
2930
#include "sdma0/sdma0_4_2_2_sh_mask.h"
3031
#include "sdma1/sdma1_4_2_2_offset.h"

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/slab.h>
2929
#include <linux/sched/mm.h>
3030
#include "amdgpu_amdkfd.h"
31+
#include "kfd_svm.h"
3132

3233
static const struct dma_fence_ops amdkfd_fence_ops;
3334
static atomic_t fence_seq = ATOMIC_INIT(0);
@@ -60,7 +61,8 @@ static atomic_t fence_seq = ATOMIC_INIT(0);
6061
*/
6162

6263
struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context,
63-
struct mm_struct *mm)
64+
struct mm_struct *mm,
65+
struct svm_range_bo *svm_bo)
6466
{
6567
struct amdgpu_amdkfd_fence *fence;
6668

@@ -73,7 +75,7 @@ struct amdgpu_amdkfd_fence *amdgpu_amdkfd_fence_create(u64 context,
7375
fence->mm = mm;
7476
get_task_comm(fence->timeline_name, current);
7577
spin_lock_init(&fence->lock);
76-
78+
fence->svm_bo = svm_bo;
7779
dma_fence_init(&fence->base, &amdkfd_fence_ops, &fence->lock,
7880
context, atomic_inc_return(&fence_seq));
7981

@@ -111,6 +113,8 @@ static const char *amdkfd_fence_get_timeline_name(struct dma_fence *f)
111113
* a KFD BO and schedules a job to move the BO.
112114
* If fence is already signaled return true.
113115
* If fence is not signaled schedule a evict KFD process work item.
116+
*
117+
* @f: dma_fence
114118
*/
115119
static bool amdkfd_fence_enable_signaling(struct dma_fence *f)
116120
{
@@ -122,16 +126,20 @@ static bool amdkfd_fence_enable_signaling(struct dma_fence *f)
122126
if (dma_fence_is_signaled(f))
123127
return true;
124128

125-
if (!kgd2kfd_schedule_evict_and_restore_process(fence->mm, f))
126-
return true;
127-
129+
if (!fence->svm_bo) {
130+
if (!kgd2kfd_schedule_evict_and_restore_process(fence->mm, f))
131+
return true;
132+
} else {
133+
if (!svm_range_schedule_evict_svm_bo(fence))
134+
return true;
135+
}
128136
return false;
129137
}
130138

131139
/**
132140
* amdkfd_fence_release - callback that fence can be freed
133141
*
134-
* @fence: fence
142+
* @f: dma_fence
135143
*
136144
* This function is called when the reference count becomes zero.
137145
* Drops the mm_struct reference and RCU schedules freeing up the fence.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static void unlock_spi_csq_mutexes(struct amdgpu_device *adev)
719719
}
720720

721721
/**
722-
* @get_wave_count: Read device registers to get number of waves in flight for
722+
* get_wave_count: Read device registers to get number of waves in flight for
723723
* a particular queue. The method also returns the VMID associated with the
724724
* queue.
725725
*
@@ -755,19 +755,19 @@ static void get_wave_count(struct amdgpu_device *adev, int queue_idx,
755755
}
756756

757757
/**
758-
* @kgd_gfx_v9_get_cu_occupancy: Reads relevant registers associated with each
758+
* kgd_gfx_v9_get_cu_occupancy: Reads relevant registers associated with each
759759
* shader engine and aggregates the number of waves that are in flight for the
760760
* process whose pasid is provided as a parameter. The process could have ZERO
761761
* or more queues running and submitting waves to compute units.
762762
*
763763
* @kgd: Handle of device from which to get number of waves in flight
764764
* @pasid: Identifies the process for which this query call is invoked
765-
* @wave_cnt: Output parameter updated with number of waves in flight that
765+
* @pasid_wave_cnt: Output parameter updated with number of waves in flight that
766766
* belong to process with given pasid
767767
* @max_waves_per_cu: Output parameter updated with maximum number of waves
768768
* possible per Compute Unit
769769
*
770-
* @note: It's possible that the device has too many queues (oversubscription)
770+
* Note: It's possible that the device has too many queues (oversubscription)
771771
* in which case a VMID could be remapped to a different PASID. This could lead
772772
* to an iaccurate wave count. Following is a high-level sequence:
773773
* Time T1: vmid = getVmid(); vmid is associated with Pasid P1

0 commit comments

Comments
 (0)