Skip to content

Commit 31cc088

Browse files
committed
Merge tag 'drm-next-2019-07-19' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Daniel Vetter: "Dave is back in shape, but now family got it so I'm doing the pull. Two things worthy of note: - nouveau feature pull was way too late, Dave&me decided to not take that, so Ben spun up a pull with just the fixes. - after some chatting with the arm display maintainers we decided to change a bit how that's maintained, for more oversight/review and cross vendor collab. More details below: nouveau: - bugfixes - TU116 enabling (minor iteration) :w amdgpu: - large pile of fixes for new hw support this release (navi, vega20) - audio hotplug fix - bunch of corner cases and small fixes all over for amdgpu/kfd komeda: - back out some new properties (from this merge window) that needs more pondering. bochs: - fb pitch setup core: - a new panel quirk - misc fixes" * tag 'drm-next-2019-07-19' of git://anongit.freedesktop.org/drm/drm: (73 commits) drm/nouveau/secboot/gp102-: remove WAR for SEC2 RTOS start bug drm/nouveau/flcn/gp102-: improve implementation of bind_context() on SEC2/GSP drm/nouveau: fix memory leak in nouveau_conn_reset() drm/nouveau/dmem: missing mutex_lock in error path drm/nouveau/hwmon: return EINVAL if the GPU is powered down for sensors reads drm/nouveau: fix bogus GPL-2 license header drm/nouveau: fix bogus GPL-2 license header drm/nouveau/i2c: Enable i2c pads & busses during preinit drm/nouveau/disp/tu102-: wire up scdc parameter setter drm/nouveau/core: recognise TU116 chipset drm/nouveau/kms: disallow dual-link harder if hdmi connection detected drm/nouveau/disp/nv50-: fix center/aspect-corrected scaling drm/nouveau/disp/nv50-: force scaler for any non-default LVDS/eDP modes drm/nouveau/mcp89/mmu: Use mcp77_mmu_new instead of g84_mmu_new on MCP89. drm/amd/display: init res_pool dccg_ref, dchub_ref with xtalin_freq drm/amdgpu/pm: remove check for pp funcs in freq sysfs handlers drm/amd/display: Force uclk to max for every state drm/amdkfd: Remove GWS from process during uninit drm/amd/amdgpu: Fix offset for vmid selection in debugfs interface drm/amd/powerplay: update vega20 driver if to fit latest SMU firmware ...
2 parents dd4542d + 8ee7956 commit 31cc088

File tree

412 files changed

+1253
-904
lines changed

Some content is hidden

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

412 files changed

+1253
-904
lines changed

MAINTAINERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ M: James (Qian) Wang <[email protected]>
12361236
M: Liviu Dudau <[email protected]>
12371237
L: Mali DP Maintainers <[email protected]>
12381238
S: Supported
1239-
T: git git://linux-arm.org/linux-ld.git for-upstream/mali-dp
1239+
T: git git://anongit.freedesktop.org/drm/drm-misc
12401240
F: drivers/gpu/drm/arm/display/include/
12411241
F: drivers/gpu/drm/arm/display/komeda/
12421242
F: Documentation/devicetree/bindings/display/arm,komeda.txt
@@ -1247,7 +1247,7 @@ M: Liviu Dudau <[email protected]>
12471247
M: Brian Starkey <[email protected]>
12481248
L: Mali DP Maintainers <[email protected]>
12491249
S: Supported
1250-
T: git git://linux-arm.org/linux-ld.git for-upstream/mali-dp
1250+
T: git git://anongit.freedesktop.org/drm/drm-misc
12511251
F: drivers/gpu/drm/arm/
12521252
F: Documentation/devicetree/bindings/display/arm,malidp.txt
12531253
F: Documentation/gpu/afbc.rst

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ extern int amdgpu_async_gfx_ring;
164164
extern int amdgpu_mcbp;
165165
extern int amdgpu_discovery;
166166
extern int amdgpu_mes;
167+
extern int amdgpu_noretry;
167168

168169
#ifdef CONFIG_DRM_AMDGPU_SI
169170
extern int amdgpu_si_support;

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
106106
ssize_t result = 0;
107107
int r;
108108
bool pm_pg_lock, use_bank, use_ring;
109-
unsigned instance_bank, sh_bank, se_bank, me, pipe, queue;
109+
unsigned instance_bank, sh_bank, se_bank, me, pipe, queue, vmid;
110110

111111
pm_pg_lock = use_bank = use_ring = false;
112-
instance_bank = sh_bank = se_bank = me = pipe = queue = 0;
112+
instance_bank = sh_bank = se_bank = me = pipe = queue = vmid = 0;
113113

114114
if (size & 0x3 || *pos & 0x3 ||
115115
((*pos & (1ULL << 62)) && (*pos & (1ULL << 61))))
@@ -135,6 +135,7 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
135135
me = (*pos & GENMASK_ULL(33, 24)) >> 24;
136136
pipe = (*pos & GENMASK_ULL(43, 34)) >> 34;
137137
queue = (*pos & GENMASK_ULL(53, 44)) >> 44;
138+
vmid = (*pos & GENMASK_ULL(58, 54)) >> 54;
138139

139140
use_ring = 1;
140141
} else {
@@ -152,7 +153,7 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
152153
sh_bank, instance_bank);
153154
} else if (use_ring) {
154155
mutex_lock(&adev->srbm_mutex);
155-
amdgpu_gfx_select_me_pipe_q(adev, me, pipe, queue);
156+
amdgpu_gfx_select_me_pipe_q(adev, me, pipe, queue, vmid);
156157
}
157158

158159
if (pm_pg_lock)
@@ -185,7 +186,7 @@ static int amdgpu_debugfs_process_reg_op(bool read, struct file *f,
185186
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
186187
mutex_unlock(&adev->grbm_idx_mutex);
187188
} else if (use_ring) {
188-
amdgpu_gfx_select_me_pipe_q(adev, 0, 0, 0);
189+
amdgpu_gfx_select_me_pipe_q(adev, 0, 0, 0, 0);
189190
mutex_unlock(&adev->srbm_mutex);
190191
}
191192

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,6 +2537,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
25372537
hash_init(adev->mn_hash);
25382538
mutex_init(&adev->lock_reset);
25392539
mutex_init(&adev->virt.dpm_mutex);
2540+
mutex_init(&adev->psp.mutex);
25402541

25412542
r = amdgpu_device_check_arguments(adev);
25422543
if (r)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static int hw_id_map[MAX_HWIP] = {
123123
[UVD_HWIP] = UVD_HWID,
124124
[VCE_HWIP] = VCE_HWID,
125125
[DF_HWIP] = DF_HWID,
126-
[DCE_HWIP] = DCEAZ_HWID,
126+
[DCE_HWIP] = DMU_HWID,
127127
[OSSSYS_HWIP] = OSSSYS_HWID,
128128
[SMUIO_HWIP] = SMUIO_HWID,
129129
[PWR_HWIP] = PWR_HWID,

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

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,9 @@ uint amdgpu_smu_memory_pool_size = 0;
140140
uint amdgpu_dc_feature_mask = 0;
141141
int amdgpu_async_gfx_ring = 1;
142142
int amdgpu_mcbp = 0;
143-
int amdgpu_discovery = 0;
143+
int amdgpu_discovery = -1;
144144
int amdgpu_mes = 0;
145+
int amdgpu_noretry;
145146

146147
struct amdgpu_mgpu_info mgpu_info = {
147148
.mutex = __MUTEX_INITIALIZER(mgpu_info.mutex),
@@ -593,6 +594,7 @@ module_param_named(mcbp, amdgpu_mcbp, int, 0444);
593594
/**
594595
* DOC: discovery (int)
595596
* Allow driver to discover hardware IP information from IP Discovery table at the top of VRAM.
597+
* (-1 = auto (default), 0 = disabled, 1 = enabled)
596598
*/
597599
MODULE_PARM_DESC(discovery,
598600
"Allow driver to discover hardware IPs from IP Discovery table at the top of VRAM");
@@ -607,6 +609,10 @@ MODULE_PARM_DESC(mes,
607609
"Enable Micro Engine Scheduler (0 = disabled (default), 1 = enabled)");
608610
module_param_named(mes, amdgpu_mes, int, 0444);
609611

612+
MODULE_PARM_DESC(noretry,
613+
"Disable retry faults (0 = retry enabled (default), 1 = retry disabled)");
614+
module_param_named(noretry, amdgpu_noretry, int, 0644);
615+
610616
#ifdef CONFIG_HSA_AMD
611617
/**
612618
* DOC: sched_policy (int)
@@ -682,17 +688,6 @@ module_param(ignore_crat, int, 0444);
682688
MODULE_PARM_DESC(ignore_crat,
683689
"Ignore CRAT table during KFD initialization (0 = use CRAT (default), 1 = ignore CRAT)");
684690

685-
/**
686-
* DOC: noretry (int)
687-
* This parameter sets sh_mem_config.retry_disable. Default value, 0, enables retry.
688-
* Setting 1 disables retry.
689-
* Retry is needed for recoverable page faults.
690-
*/
691-
int noretry;
692-
module_param(noretry, int, 0644);
693-
MODULE_PARM_DESC(noretry,
694-
"Set sh_mem_config.retry_disable on Vega10 (0 = retry enabled (default), 1 = retry disabled)");
695-
696691
/**
697692
* DOC: halt_if_hws_hang (int)
698693
* Halt if HWS hang is detected. Default value, 0, disables the halt on hang.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ struct amdgpu_gfx_funcs {
195195
uint32_t wave, uint32_t start, uint32_t size,
196196
uint32_t *dst);
197197
void (*select_me_pipe_q)(struct amdgpu_device *adev, u32 me, u32 pipe,
198-
u32 queue);
198+
u32 queue, u32 vmid);
199199
};
200200

201201
struct amdgpu_ngg_buf {
@@ -327,7 +327,7 @@ struct amdgpu_gfx {
327327

328328
#define amdgpu_gfx_get_gpu_clock_counter(adev) (adev)->gfx.funcs->get_gpu_clock_counter((adev))
329329
#define amdgpu_gfx_select_se_sh(adev, se, sh, instance) (adev)->gfx.funcs->select_se_sh((adev), (se), (sh), (instance))
330-
#define amdgpu_gfx_select_me_pipe_q(adev, me, pipe, q) (adev)->gfx.funcs->select_me_pipe_q((adev), (me), (pipe), (q))
330+
#define amdgpu_gfx_select_me_pipe_q(adev, me, pipe, q, vmid) (adev)->gfx.funcs->select_me_pipe_q((adev), (me), (pipe), (q), (vmid))
331331

332332
/**
333333
* amdgpu_gfx_create_bitmask - create a bitmask

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,11 +2077,6 @@ static ssize_t amdgpu_hwmon_show_sclk(struct device *dev,
20772077
(ddev->switch_power_state != DRM_SWITCH_POWER_ON))
20782078
return -EINVAL;
20792079

2080-
/* sanity check PP is enabled */
2081-
if (!(adev->powerplay.pp_funcs &&
2082-
adev->powerplay.pp_funcs->read_sensor))
2083-
return -EINVAL;
2084-
20852080
/* get the sclk */
20862081
r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_SCLK,
20872082
(void *)&sclk, &size);
@@ -2112,11 +2107,6 @@ static ssize_t amdgpu_hwmon_show_mclk(struct device *dev,
21122107
(ddev->switch_power_state != DRM_SWITCH_POWER_ON))
21132108
return -EINVAL;
21142109

2115-
/* sanity check PP is enabled */
2116-
if (!(adev->powerplay.pp_funcs &&
2117-
adev->powerplay.pp_funcs->read_sensor))
2118-
return -EINVAL;
2119-
21202110
/* get the sclk */
21212111
r = amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GFX_MCLK,
21222112
(void *)&mclk, &size);
@@ -2996,13 +2986,10 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev)
29962986
}
29972987

29982988
if (is_support_sw_smu(adev)) {
2999-
struct smu_context *smu = &adev->smu;
30002989
struct smu_dpm_context *smu_dpm = &adev->smu.smu_dpm;
3001-
mutex_lock(&(smu->mutex));
30022990
smu_handle_task(&adev->smu,
30032991
smu_dpm->dpm_level,
30042992
AMD_PP_TASK_DISPLAY_CONFIG_CHANGE);
3005-
mutex_unlock(&(smu->mutex));
30062993
} else {
30072994
if (adev->powerplay.pp_funcs->dispatch_tasks) {
30082995
if (!amdgpu_device_has_dc_support(adev)) {

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ psp_cmd_submit_buf(struct psp_context *psp,
130130
int index;
131131
int timeout = 2000;
132132

133+
mutex_lock(&psp->mutex);
134+
133135
memset(psp->cmd_buf_mem, 0, PSP_CMD_BUFFER_SIZE);
134136

135137
memcpy(psp->cmd_buf_mem, cmd, sizeof(struct psp_gfx_cmd_resp));
@@ -139,6 +141,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
139141
fence_mc_addr, index);
140142
if (ret) {
141143
atomic_dec(&psp->fence_value);
144+
mutex_unlock(&psp->mutex);
142145
return ret;
143146
}
144147

@@ -161,8 +164,10 @@ psp_cmd_submit_buf(struct psp_context *psp,
161164
ucode->ucode_id);
162165
DRM_WARN("psp command failed and response status is (%d)\n",
163166
psp->cmd_buf_mem->resp.status);
164-
if (!timeout)
167+
if (!timeout) {
168+
mutex_unlock(&psp->mutex);
165169
return -EINVAL;
170+
}
166171
}
167172

168173
/* get xGMI session id from response buffer */
@@ -172,6 +177,7 @@ psp_cmd_submit_buf(struct psp_context *psp,
172177
ucode->tmr_mc_addr_lo = psp->cmd_buf_mem->resp.fw_addr_lo;
173178
ucode->tmr_mc_addr_hi = psp->cmd_buf_mem->resp.fw_addr_hi;
174179
}
180+
mutex_unlock(&psp->mutex);
175181

176182
return ret;
177183
}
@@ -763,6 +769,15 @@ static int psp_hw_start(struct psp_context *psp)
763769
int ret;
764770

765771
if (!amdgpu_sriov_vf(adev) || !adev->in_gpu_reset) {
772+
if (psp->kdb_bin_size &&
773+
(psp->funcs->bootloader_load_kdb != NULL)) {
774+
ret = psp_bootloader_load_kdb(psp);
775+
if (ret) {
776+
DRM_ERROR("PSP load kdb failed!\n");
777+
return ret;
778+
}
779+
}
780+
766781
ret = psp_bootloader_load_sysdrv(psp);
767782
if (ret) {
768783
DRM_ERROR("PSP load sysdrv failed!\n");
@@ -1188,10 +1203,16 @@ static int psp_resume(void *handle)
11881203

11891204
int psp_gpu_reset(struct amdgpu_device *adev)
11901205
{
1206+
int ret;
1207+
11911208
if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP)
11921209
return 0;
11931210

1194-
return psp_mode1_reset(&adev->psp);
1211+
mutex_lock(&adev->psp.mutex);
1212+
ret = psp_mode1_reset(&adev->psp);
1213+
mutex_unlock(&adev->psp.mutex);
1214+
1215+
return ret;
11951216
}
11961217

11971218
int psp_rlc_autoload_start(struct psp_context *psp)

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ struct psp_context;
4242
struct psp_xgmi_node_info;
4343
struct psp_xgmi_topology_info;
4444

45+
enum psp_bootloader_cmd {
46+
PSP_BL__LOAD_SYSDRV = 0x10000,
47+
PSP_BL__LOAD_SOSDRV = 0x20000,
48+
PSP_BL__LOAD_KEY_DATABASE = 0x80000,
49+
};
50+
4551
enum psp_ring_type
4652
{
4753
PSP_RING_TYPE__INVALID = 0,
@@ -73,6 +79,7 @@ enum psp_reg_prog_id {
7379
struct psp_funcs
7480
{
7581
int (*init_microcode)(struct psp_context *psp);
82+
int (*bootloader_load_kdb)(struct psp_context *psp);
7683
int (*bootloader_load_sysdrv)(struct psp_context *psp);
7784
int (*bootloader_load_sos)(struct psp_context *psp);
7885
int (*ring_init)(struct psp_context *psp, enum psp_ring_type ring_type);
@@ -156,9 +163,11 @@ struct psp_context
156163
uint32_t sys_bin_size;
157164
uint32_t sos_bin_size;
158165
uint32_t toc_bin_size;
166+
uint32_t kdb_bin_size;
159167
uint8_t *sys_start_addr;
160168
uint8_t *sos_start_addr;
161169
uint8_t *toc_start_addr;
170+
uint8_t *kdb_start_addr;
162171

163172
/* tmr buffer */
164173
struct amdgpu_bo *tmr_bo;
@@ -201,6 +210,7 @@ struct psp_context
201210
uint8_t *ta_ras_start_addr;
202211
struct psp_xgmi_context xgmi_context;
203212
struct psp_ras_context ras;
213+
struct mutex mutex;
204214
};
205215

206216
struct amdgpu_psp_funcs {
@@ -219,6 +229,8 @@ struct amdgpu_psp_funcs {
219229
(psp)->funcs->compare_sram_data((psp), (ucode), (type))
220230
#define psp_init_microcode(psp) \
221231
((psp)->funcs->init_microcode ? (psp)->funcs->init_microcode((psp)) : 0)
232+
#define psp_bootloader_load_kdb(psp) \
233+
((psp)->funcs->bootloader_load_kdb ? (psp)->funcs->bootloader_load_kdb((psp)) : 0)
222234
#define psp_bootloader_load_sysdrv(psp) \
223235
((psp)->funcs->bootloader_load_sysdrv ? (psp)->funcs->bootloader_load_sysdrv((psp)) : 0)
224236
#define psp_bootloader_load_sos(psp) \

0 commit comments

Comments
 (0)