Skip to content

Commit 45d0b75

Browse files
committed
Merge tag 'drm-fixes-2020-02-28' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Just some fixes for this week: amdgpu, radeon and i915. The main i915 one is a regression Gen7 (Ivybridge/Haswell), this moves them back from trying to use the full-ppgtt support to the aliasing version it used to use due to gpu hangs. Otherwise it's pretty quiet. amdgpu: - Drop DRIVER_USE_AGP - Fix memory leak in GPU reset - Resume fix for raven radeon: - Drop DRIVER_USE_AGP i915: - downgrade gen7 back to aliasing-ppgtt to avoid GPU hangs - shrinker fix - pmu leak and double free fixes - gvt user after free and virtual display reset fixes - randconfig build fix" * tag 'drm-fixes-2020-02-28' of git://anongit.freedesktop.org/drm/drm: drm/radeon: Inline drm_get_pci_dev drm/amdgpu: Drop DRIVER_USE_AGP drm/i915: Avoid recursing onto active vma from the shrinker drm/i915/pmu: Avoid using globals for PMU events drm/i915/pmu: Avoid using globals for CPU hotplug state drm/i915/gtt: Downgrade gen7 (ivb, byt, hsw) back to aliasing-ppgtt drm/i915: fix header test with GCOV amdgpu/gmc_v9: save/restore sdpif regs during S3 drm/amdgpu: fix memory leak during TDR test(v2) drm/i915/gvt: Fix orphan vgpu dmabuf_objs' lifetime drm/i915/gvt: Separate display reset from ALL_ENGINES reset
2 parents 7058b83 + f091bf3 commit 45d0b75

File tree

14 files changed

+138
-43
lines changed

14 files changed

+138
-43
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ amdgpu_get_crtc_scanout_position(struct drm_device *dev, unsigned int pipe,
13891389

13901390
static struct drm_driver kms_driver = {
13911391
.driver_features =
1392-
DRIVER_USE_AGP | DRIVER_ATOMIC |
1392+
DRIVER_ATOMIC |
13931393
DRIVER_GEM |
13941394
DRIVER_RENDER | DRIVER_MODESET | DRIVER_SYNCOBJ |
13951395
DRIVER_SYNCOBJ_TIMELINE,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ struct amdgpu_gmc {
195195
uint32_t srbm_soft_reset;
196196
bool prt_warning;
197197
uint64_t stolen_size;
198+
uint32_t sdpif_register;
198199
/* apertures */
199200
u64 shared_aperture_start;
200201
u64 shared_aperture_end;

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

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,19 @@ static void gmc_v9_0_init_golden_registers(struct amdgpu_device *adev)
12711271
}
12721272
}
12731273

1274+
/**
1275+
* gmc_v9_0_restore_registers - restores regs
1276+
*
1277+
* @adev: amdgpu_device pointer
1278+
*
1279+
* This restores register values, saved at suspend.
1280+
*/
1281+
static void gmc_v9_0_restore_registers(struct amdgpu_device *adev)
1282+
{
1283+
if (adev->asic_type == CHIP_RAVEN)
1284+
WREG32(mmDCHUBBUB_SDPIF_MMIO_CNTRL_0, adev->gmc.sdpif_register);
1285+
}
1286+
12741287
/**
12751288
* gmc_v9_0_gart_enable - gart enable
12761289
*
@@ -1376,6 +1389,20 @@ static int gmc_v9_0_hw_init(void *handle)
13761389
return r;
13771390
}
13781391

1392+
/**
1393+
* gmc_v9_0_save_registers - saves regs
1394+
*
1395+
* @adev: amdgpu_device pointer
1396+
*
1397+
* This saves potential register values that should be
1398+
* restored upon resume
1399+
*/
1400+
static void gmc_v9_0_save_registers(struct amdgpu_device *adev)
1401+
{
1402+
if (adev->asic_type == CHIP_RAVEN)
1403+
adev->gmc.sdpif_register = RREG32(mmDCHUBBUB_SDPIF_MMIO_CNTRL_0);
1404+
}
1405+
13791406
/**
13801407
* gmc_v9_0_gart_disable - gart disable
13811408
*
@@ -1412,16 +1439,24 @@ static int gmc_v9_0_hw_fini(void *handle)
14121439

14131440
static int gmc_v9_0_suspend(void *handle)
14141441
{
1442+
int r;
14151443
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
14161444

1417-
return gmc_v9_0_hw_fini(adev);
1445+
r = gmc_v9_0_hw_fini(adev);
1446+
if (r)
1447+
return r;
1448+
1449+
gmc_v9_0_save_registers(adev);
1450+
1451+
return 0;
14181452
}
14191453

14201454
static int gmc_v9_0_resume(void *handle)
14211455
{
14221456
int r;
14231457
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
14241458

1459+
gmc_v9_0_restore_registers(adev);
14251460
r = gmc_v9_0_hw_init(adev);
14261461
if (r)
14271462
return r;

drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_offset.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7376,6 +7376,8 @@
73767376
#define mmCRTC4_CRTC_DRR_CONTROL 0x0f3e
73777377
#define mmCRTC4_CRTC_DRR_CONTROL_BASE_IDX 2
73787378

7379+
#define mmDCHUBBUB_SDPIF_MMIO_CNTRL_0 0x395d
7380+
#define mmDCHUBBUB_SDPIF_MMIO_CNTRL_0_BASE_IDX 2
73797381

73807382
// addressBlock: dce_dc_fmt4_dispdec
73817383
// base address: 0x2000

drivers/gpu/drm/amd/powerplay/smu_v11_0.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,12 @@ int smu_v11_0_init_max_sustainable_clocks(struct smu_context *smu)
978978
struct smu_11_0_max_sustainable_clocks *max_sustainable_clocks;
979979
int ret = 0;
980980

981-
max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
981+
if (!smu->smu_table.max_sustainable_clocks)
982+
max_sustainable_clocks = kzalloc(sizeof(struct smu_11_0_max_sustainable_clocks),
982983
GFP_KERNEL);
984+
else
985+
max_sustainable_clocks = smu->smu_table.max_sustainable_clocks;
986+
983987
smu->smu_table.max_sustainable_clocks = (void *)max_sustainable_clocks;
984988

985989
max_sustainable_clocks->uclock = smu->smu_table.boot_values.uclk / 100;

drivers/gpu/drm/i915/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ extra-$(CONFIG_DRM_I915_WERROR) += \
294294
$(shell cd $(srctree)/$(src) && find * -name '*.h')))
295295

296296
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
297-
cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
297+
cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@
298298

299299
$(obj)/%.hdrtest: $(src)/%.h FORCE
300300
$(call if_changed_dep,hdrtest)

drivers/gpu/drm/i915/gem/i915_gem_shrinker.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *i915)
256256
with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
257257
freed = i915_gem_shrink(i915, -1UL, NULL,
258258
I915_SHRINK_BOUND |
259-
I915_SHRINK_UNBOUND |
260-
I915_SHRINK_ACTIVE);
259+
I915_SHRINK_UNBOUND);
261260
}
262261

263262
return freed;
@@ -336,7 +335,6 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr)
336335
freed_pages = 0;
337336
with_intel_runtime_pm(&i915->runtime_pm, wakeref)
338337
freed_pages += i915_gem_shrink(i915, -1UL, NULL,
339-
I915_SHRINK_ACTIVE |
340338
I915_SHRINK_BOUND |
341339
I915_SHRINK_UNBOUND |
342340
I915_SHRINK_WRITEBACK);

drivers/gpu/drm/i915/gvt/dmabuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ static void dmabuf_gem_object_free(struct kref *kref)
151151
dmabuf_obj = container_of(pos,
152152
struct intel_vgpu_dmabuf_obj, list);
153153
if (dmabuf_obj == obj) {
154+
list_del(pos);
154155
intel_gvt_hypervisor_put_vfio_device(vgpu);
155156
idr_remove(&vgpu->object_idr,
156157
dmabuf_obj->dmabuf_id);
157158
kfree(dmabuf_obj->info);
158159
kfree(dmabuf_obj);
159-
list_del(pos);
160160
break;
161161
}
162162
}

drivers/gpu/drm/i915/gvt/vgpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,9 @@ void intel_gvt_reset_vgpu_locked(struct intel_vgpu *vgpu, bool dmlr,
560560

561561
intel_vgpu_reset_mmio(vgpu, dmlr);
562562
populate_pvinfo_page(vgpu);
563-
intel_vgpu_reset_display(vgpu);
564563

565564
if (dmlr) {
565+
intel_vgpu_reset_display(vgpu);
566566
intel_vgpu_reset_cfg_space(vgpu);
567567
/* only reset the failsafe mode when dmlr reset */
568568
vgpu->failsafe = false;

drivers/gpu/drm/i915/i915_pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static const struct intel_device_info snb_m_gt2_info = {
437437
.has_rc6 = 1, \
438438
.has_rc6p = 1, \
439439
.has_rps = true, \
440-
.ppgtt_type = INTEL_PPGTT_FULL, \
440+
.ppgtt_type = INTEL_PPGTT_ALIASING, \
441441
.ppgtt_size = 31, \
442442
IVB_PIPE_OFFSETS, \
443443
IVB_CURSOR_OFFSETS, \
@@ -494,7 +494,7 @@ static const struct intel_device_info vlv_info = {
494494
.has_rps = true,
495495
.display.has_gmch = 1,
496496
.display.has_hotplug = 1,
497-
.ppgtt_type = INTEL_PPGTT_FULL,
497+
.ppgtt_type = INTEL_PPGTT_ALIASING,
498498
.ppgtt_size = 31,
499499
.has_snoop = true,
500500
.has_coherent_ggtt = false,

0 commit comments

Comments
 (0)