Skip to content

Commit 0d2e90f

Browse files
committed
Merge tag 'amd-drm-fixes-5.10-2020-10-09' of git://people.freedesktop.org/~agd5f/linux into drm-next
amd-drm-fixes-5.10-2020-10-09: amdgpu: - Clean up indirect register access - Navy Flounder fixes - SMU11 AC/DC interrupt fixes - GPUVM alignment fix - Display fixes - Misc other fixes Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 2e49520 + 9c27bc9 commit 0d2e90f

File tree

134 files changed

+2497
-948
lines changed

Some content is hidden

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

134 files changed

+2497
-948
lines changed

Documentation/gpu/amdgpu.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ Interrupt Handling
7070
.. kernel-doc:: drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
7171
:internal:
7272

73+
IP Blocks
74+
------------------
75+
76+
.. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
77+
:doc: IP Blocks
78+
79+
.. kernel-doc:: drivers/gpu/drm/amd/include/amd_shared.h
80+
:identifiers: amd_ip_block_type amd_ip_funcs
81+
7382
AMDGPU XGMI Support
7483
===================
7584

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

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
#include "amdgpu_mes.h"
105105
#include "amdgpu_umc.h"
106106
#include "amdgpu_mmhub.h"
107+
#include "amdgpu_gfxhub.h"
107108
#include "amdgpu_df.h"
108109

109110
#define MAX_GPU_INSTANCE 16
@@ -881,6 +882,9 @@ struct amdgpu_device {
881882
/* mmhub */
882883
struct amdgpu_mmhub mmhub;
883884

885+
/* gfxhub */
886+
struct amdgpu_gfxhub gfxhub;
887+
884888
/* gfx */
885889
struct amdgpu_gfx gfx;
886890

@@ -1016,18 +1020,32 @@ int amdgpu_gpu_wait_for_idle(struct amdgpu_device *adev);
10161020

10171021
void amdgpu_device_vram_access(struct amdgpu_device *adev, loff_t pos,
10181022
uint32_t *buf, size_t size, bool write);
1019-
uint32_t amdgpu_mm_rreg(struct amdgpu_device *adev, uint32_t reg,
1023+
uint32_t amdgpu_device_rreg(struct amdgpu_device *adev,
1024+
uint32_t reg, uint32_t acc_flags);
1025+
void amdgpu_device_wreg(struct amdgpu_device *adev,
1026+
uint32_t reg, uint32_t v,
10201027
uint32_t acc_flags);
1021-
void amdgpu_mm_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v,
1022-
uint32_t acc_flags);
1023-
void amdgpu_mm_wreg_mmio_rlc(struct amdgpu_device *adev, uint32_t reg, uint32_t v,
1024-
uint32_t acc_flags);
1028+
void amdgpu_mm_wreg_mmio_rlc(struct amdgpu_device *adev,
1029+
uint32_t reg, uint32_t v);
10251030
void amdgpu_mm_wreg8(struct amdgpu_device *adev, uint32_t offset, uint8_t value);
10261031
uint8_t amdgpu_mm_rreg8(struct amdgpu_device *adev, uint32_t offset);
10271032

10281033
u32 amdgpu_io_rreg(struct amdgpu_device *adev, u32 reg);
10291034
void amdgpu_io_wreg(struct amdgpu_device *adev, u32 reg, u32 v);
10301035

1036+
u32 amdgpu_device_indirect_rreg(struct amdgpu_device *adev,
1037+
u32 pcie_index, u32 pcie_data,
1038+
u32 reg_addr);
1039+
u64 amdgpu_device_indirect_rreg64(struct amdgpu_device *adev,
1040+
u32 pcie_index, u32 pcie_data,
1041+
u32 reg_addr);
1042+
void amdgpu_device_indirect_wreg(struct amdgpu_device *adev,
1043+
u32 pcie_index, u32 pcie_data,
1044+
u32 reg_addr, u32 reg_data);
1045+
void amdgpu_device_indirect_wreg64(struct amdgpu_device *adev,
1046+
u32 pcie_index, u32 pcie_data,
1047+
u32 reg_addr, u64 reg_data);
1048+
10311049
bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type);
10321050
bool amdgpu_device_has_dc_support(struct amdgpu_device *adev);
10331051

@@ -1038,18 +1056,18 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
10381056
*/
10391057
#define AMDGPU_REGS_NO_KIQ (1<<1)
10401058

1041-
#define RREG32_NO_KIQ(reg) amdgpu_mm_rreg(adev, (reg), AMDGPU_REGS_NO_KIQ)
1042-
#define WREG32_NO_KIQ(reg, v) amdgpu_mm_wreg(adev, (reg), (v), AMDGPU_REGS_NO_KIQ)
1059+
#define RREG32_NO_KIQ(reg) amdgpu_device_rreg(adev, (reg), AMDGPU_REGS_NO_KIQ)
1060+
#define WREG32_NO_KIQ(reg, v) amdgpu_device_wreg(adev, (reg), (v), AMDGPU_REGS_NO_KIQ)
10431061

10441062
#define RREG32_KIQ(reg) amdgpu_kiq_rreg(adev, (reg))
10451063
#define WREG32_KIQ(reg, v) amdgpu_kiq_wreg(adev, (reg), (v))
10461064

10471065
#define RREG8(reg) amdgpu_mm_rreg8(adev, (reg))
10481066
#define WREG8(reg, v) amdgpu_mm_wreg8(adev, (reg), (v))
10491067

1050-
#define RREG32(reg) amdgpu_mm_rreg(adev, (reg), 0)
1051-
#define DREG32(reg) printk(KERN_INFO "REGISTER: " #reg " : 0x%08X\n", amdgpu_mm_rreg(adev, (reg), 0))
1052-
#define WREG32(reg, v) amdgpu_mm_wreg(adev, (reg), (v), 0)
1068+
#define RREG32(reg) amdgpu_device_rreg(adev, (reg), 0)
1069+
#define DREG32(reg) printk(KERN_INFO "REGISTER: " #reg " : 0x%08X\n", amdgpu_device_rreg(adev, (reg), 0))
1070+
#define WREG32(reg, v) amdgpu_device_wreg(adev, (reg), (v), 0)
10531071
#define REG_SET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK)
10541072
#define REG_GET(FIELD, v) (((v) << FIELD##_SHIFT) & FIELD##_MASK)
10551073
#define RREG32_PCIE(reg) adev->pcie_rreg(adev, (reg))
@@ -1095,7 +1113,7 @@ int emu_soc_asic_init(struct amdgpu_device *adev);
10951113
WREG32_SMC(_Reg, tmp); \
10961114
} while (0)
10971115

1098-
#define DREG32_SYS(sqf, adev, reg) seq_printf((sqf), #reg " : 0x%08X\n", amdgpu_mm_rreg((adev), (reg), false))
1116+
#define DREG32_SYS(sqf, adev, reg) seq_printf((sqf), #reg " : 0x%08X\n", amdgpu_device_rreg((adev), (reg), false))
10991117
#define RREG32_IO(reg) amdgpu_io_rreg(adev, (reg))
11001118
#define WREG32_IO(reg, v) amdgpu_io_wreg(adev, (reg), (v))
11011119

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
806806
}
807807
adev->atif = atif;
808808

809-
if (atif->notifications.brightness_change) {
810809
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
810+
if (atif->notifications.brightness_change) {
811811
if (amdgpu_device_has_dc_support(adev)) {
812812
#if defined(CONFIG_DRM_AMD_DC)
813813
struct amdgpu_display_manager *dm = &adev->dm;

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
*/
3737
uint64_t amdgpu_amdkfd_total_mem_size;
3838

39+
static bool kfd_initialized;
40+
3941
int amdgpu_amdkfd_init(void)
4042
{
4143
struct sysinfo si;
@@ -51,19 +53,26 @@ int amdgpu_amdkfd_init(void)
5153
#else
5254
ret = -ENOENT;
5355
#endif
56+
kfd_initialized = !ret;
5457

5558
return ret;
5659
}
5760

5861
void amdgpu_amdkfd_fini(void)
5962
{
60-
kgd2kfd_exit();
63+
if (kfd_initialized) {
64+
kgd2kfd_exit();
65+
kfd_initialized = false;
66+
}
6167
}
6268

6369
void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev)
6470
{
6571
bool vf = amdgpu_sriov_vf(adev);
6672

73+
if (!kfd_initialized)
74+
return;
75+
6776
adev->kfd.dev = kgd2kfd_probe((struct kgd_dev *)adev,
6877
adev->pdev, adev->asic_type, vf);
6978

@@ -572,6 +581,13 @@ uint32_t amdgpu_amdkfd_get_asic_rev_id(struct kgd_dev *kgd)
572581
return adev->rev_id;
573582
}
574583

584+
int amdgpu_amdkfd_get_noretry(struct kgd_dev *kgd)
585+
{
586+
struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
587+
588+
return adev->gmc.noretry;
589+
}
590+
575591
int amdgpu_amdkfd_submit_ib(struct kgd_dev *kgd, enum kgd_engine_type engine,
576592
uint32_t vmid, uint64_t gpu_addr,
577593
uint32_t *ib_cmd, uint32_t ib_len)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ uint64_t amdgpu_amdkfd_get_unique_id(struct kgd_dev *kgd);
181181
uint64_t amdgpu_amdkfd_get_mmio_remap_phys_addr(struct kgd_dev *kgd);
182182
uint32_t amdgpu_amdkfd_get_num_gws(struct kgd_dev *kgd);
183183
uint32_t amdgpu_amdkfd_get_asic_rev_id(struct kgd_dev *kgd);
184+
int amdgpu_amdkfd_get_noretry(struct kgd_dev *kgd);
184185
uint8_t amdgpu_amdkfd_get_xgmi_hops_count(struct kgd_dev *dst, struct kgd_dev *src);
185186

186187
/* Read user wptr from a specified user address space with page fault

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "v10_structs.h"
3333
#include "nv.h"
3434
#include "nvd.h"
35-
#include "gfxhub_v2_0.h"
3635

3736
enum hqd_dequeue_request_type {
3837
NO_ACTION = 0,
@@ -753,7 +752,7 @@ static void set_vm_context_page_table_base(struct kgd_dev *kgd, uint32_t vmid,
753752
}
754753

755754
/* SDMA is on gfxhub as well for Navi1* series */
756-
gfxhub_v2_0_setup_vm_pt_regs(adev, vmid, page_table_base);
755+
adev->gfxhub.funcs->setup_vm_pt_regs(adev, vmid, page_table_base);
757756
}
758757

759758
const struct kfd2kgd_calls gfx_v10_kfd2kgd = {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "v10_structs.h"
3232
#include "nv.h"
3333
#include "nvd.h"
34-
#include "gfxhub_v2_1.h"
3534

3635
enum hqd_dequeue_request_type {
3736
NO_ACTION = 0,
@@ -657,7 +656,7 @@ static void set_vm_context_page_table_base_v10_3(struct kgd_dev *kgd, uint32_t v
657656
struct amdgpu_device *adev = get_amdgpu_device(kgd);
658657

659658
/* SDMA is on gfxhub as well for Navi1* series */
660-
gfxhub_v2_1_setup_vm_pt_regs(adev, vmid, page_table_base);
659+
adev->gfxhub.funcs->setup_vm_pt_regs(adev, vmid, page_table_base);
661660
}
662661

663662
#if 0

0 commit comments

Comments
 (0)