Skip to content

Commit 25d0d91

Browse files
committed
Merge tag 'drm-fixes-for-4.8-rc4' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "A bunch of fixes covering i915, amdgpu, one tegra and some core DRM ones. Nothing too strange at this point" * tag 'drm-fixes-for-4.8-rc4' of git://people.freedesktop.org/~airlied/linux: (21 commits) drm/atomic: Don't potentially reset color_mgmt_changed on successive property updates. drm: Protect fb_defio in drivers with CONFIG_KMS_FBDEV_EMULATION drm/amdgpu: skip TV/CV in display parsing drm/amdgpu: avoid a possible array overflow drm/amdgpu: fix lru size grouping v2 drm/tegra: dsi: Enhance runtime power management drm/i915: Fix botched merge that downgrades CSR versions. drm/i915/skl: Ensure pipes with changed wms get added to the state drm/i915/gen9: Only copy WM results for changed pipes to skl_hw drm/i915/skl: Add support for the SAGV, fix underrun hangs drm/i915/gen6+: Interpret mailbox error flags drm/i915: Reattach comment, complete type specification drm/i915: Unconditionally flush any chipset buffers before execbuf drm/i915/gen9: Drop invalid WARN() during data rate calculation drm/i915/gen9: Initialize intel_state->active_crtcs during WM sanitization (v2) drm: Reject page_flip for !DRIVER_MODESET drm/amdgpu: fix timeout value check in amd_sched_job_recovery drm/amdgpu: fix sdma_v2_4_ring_test_ib drm/amdgpu: fix amdgpu_move_blit on 32bit systems drm/radeon: fix radeon_move_blit on 32bit systems ...
2 parents 908e373 + add1fa7 commit 25d0d91

File tree

21 files changed

+424
-71
lines changed

21 files changed

+424
-71
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,8 @@ struct amdgpu_mman {
426426

427427
/* custom LRU management */
428428
struct amdgpu_mman_lru log2_size[AMDGPU_TTM_LRU_SIZE];
429+
/* guard for log2_size array, don't add anything in between */
430+
struct amdgpu_mman_lru guard;
429431
};
430432

431433
int amdgpu_copy_buffer(struct amdgpu_ring *ring,

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,19 @@ bool amdgpu_atombios_get_connector_info_from_object_table(struct amdgpu_device *
321321
(le16_to_cpu(path->usConnObjectId) &
322322
OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
323323

324+
/* Skip TV/CV support */
325+
if ((le16_to_cpu(path->usDeviceTag) ==
326+
ATOM_DEVICE_TV1_SUPPORT) ||
327+
(le16_to_cpu(path->usDeviceTag) ==
328+
ATOM_DEVICE_CV_SUPPORT))
329+
continue;
330+
331+
if (con_obj_id >= ARRAY_SIZE(object_connector_convert)) {
332+
DRM_ERROR("invalid con_obj_id %d for device tag 0x%04x\n",
333+
con_obj_id, le16_to_cpu(path->usDeviceTag));
334+
continue;
335+
}
336+
324337
connector_type =
325338
object_connector_convert[con_obj_id];
326339
connector_object_id = con_obj_id;

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ static int amdgpu_move_blit(struct ttm_buffer_object *bo,
251251

252252
adev = amdgpu_get_adev(bo->bdev);
253253
ring = adev->mman.buffer_funcs_ring;
254-
old_start = old_mem->start << PAGE_SHIFT;
255-
new_start = new_mem->start << PAGE_SHIFT;
254+
old_start = (u64)old_mem->start << PAGE_SHIFT;
255+
new_start = (u64)new_mem->start << PAGE_SHIFT;
256256

257257
switch (old_mem->mem_type) {
258258
case TTM_PL_VRAM:
@@ -950,6 +950,8 @@ static struct list_head *amdgpu_ttm_lru_tail(struct ttm_buffer_object *tbo)
950950
struct list_head *res = lru->lru[tbo->mem.mem_type];
951951

952952
lru->lru[tbo->mem.mem_type] = &tbo->lru;
953+
while ((++lru)->lru[tbo->mem.mem_type] == res)
954+
lru->lru[tbo->mem.mem_type] = &tbo->lru;
953955

954956
return res;
955957
}
@@ -960,6 +962,8 @@ static struct list_head *amdgpu_ttm_swap_lru_tail(struct ttm_buffer_object *tbo)
960962
struct list_head *res = lru->swap_lru;
961963

962964
lru->swap_lru = &tbo->swap;
965+
while ((++lru)->swap_lru == res)
966+
lru->swap_lru = &tbo->swap;
963967

964968
return res;
965969
}
@@ -1011,6 +1015,10 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
10111015
lru->swap_lru = &adev->mman.bdev.glob->swap_lru;
10121016
}
10131017

1018+
for (j = 0; j < TTM_NUM_MEM_TYPES; ++j)
1019+
adev->mman.guard.lru[j] = NULL;
1020+
adev->mman.guard.swap_lru = NULL;
1021+
10141022
adev->mman.initialized = true;
10151023
r = ttm_bo_init_mm(&adev->mman.bdev, TTM_PL_VRAM,
10161024
adev->mc.real_vram_size >> PAGE_SHIFT);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ static int sdma_v2_4_ring_test_ib(struct amdgpu_ring *ring, long timeout)
714714
DRM_ERROR("amdgpu: IB test timed out\n");
715715
r = -ETIMEDOUT;
716716
goto err1;
717-
} else if (r) {
717+
} else if (r < 0) {
718718
DRM_ERROR("amdgpu: fence wait failed (%ld).\n", r);
719719
goto err1;
720720
}

drivers/gpu/drm/amd/scheduler/gpu_scheduler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ void amd_sched_job_recovery(struct amd_gpu_scheduler *sched)
405405
spin_lock(&sched->job_list_lock);
406406
s_job = list_first_entry_or_null(&sched->ring_mirror_list,
407407
struct amd_sched_job, node);
408-
if (s_job)
408+
if (s_job && sched->timeout != MAX_SCHEDULE_TIMEOUT)
409409
schedule_delayed_work(&s_job->work_tdr, sched->timeout);
410410

411411
list_for_each_entry_safe(s_job, tmp, &sched->ring_mirror_list, node) {

drivers/gpu/drm/drm_atomic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,23 +475,23 @@ int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
475475
val,
476476
-1,
477477
&replaced);
478-
state->color_mgmt_changed = replaced;
478+
state->color_mgmt_changed |= replaced;
479479
return ret;
480480
} else if (property == config->ctm_property) {
481481
ret = drm_atomic_replace_property_blob_from_id(crtc,
482482
&state->ctm,
483483
val,
484484
sizeof(struct drm_color_ctm),
485485
&replaced);
486-
state->color_mgmt_changed = replaced;
486+
state->color_mgmt_changed |= replaced;
487487
return ret;
488488
} else if (property == config->gamma_lut_property) {
489489
ret = drm_atomic_replace_property_blob_from_id(crtc,
490490
&state->gamma_lut,
491491
val,
492492
-1,
493493
&replaced);
494-
state->color_mgmt_changed = replaced;
494+
state->color_mgmt_changed |= replaced;
495495
return ret;
496496
} else if (crtc->funcs->atomic_set_property)
497497
return crtc->funcs->atomic_set_property(crtc, state, property, val);

drivers/gpu/drm/drm_crtc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5404,6 +5404,9 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
54045404
struct drm_pending_vblank_event *e = NULL;
54055405
int ret = -EINVAL;
54065406

5407+
if (!drm_core_check_feature(dev, DRIVER_MODESET))
5408+
return -EINVAL;
5409+
54075410
if (page_flip->flags & ~DRM_MODE_PAGE_FLIP_FLAGS ||
54085411
page_flip->reserved != 0)
54095412
return -EINVAL;

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,11 +882,12 @@ struct i915_gem_context {
882882

883883
struct i915_ctx_hang_stats hang_stats;
884884

885-
/* Unique identifier for this context, used by the hw for tracking */
886885
unsigned long flags;
887886
#define CONTEXT_NO_ZEROMAP BIT(0)
888887
#define CONTEXT_NO_ERROR_CAPTURE BIT(1)
889-
unsigned hw_id;
888+
889+
/* Unique identifier for this context, used by the hw for tracking */
890+
unsigned int hw_id;
890891
u32 user_handle;
891892

892893
u32 ggtt_alignment;
@@ -1963,6 +1964,13 @@ struct drm_i915_private {
19631964
struct i915_suspend_saved_registers regfile;
19641965
struct vlv_s0ix_state vlv_s0ix_state;
19651966

1967+
enum {
1968+
I915_SKL_SAGV_UNKNOWN = 0,
1969+
I915_SKL_SAGV_DISABLED,
1970+
I915_SKL_SAGV_ENABLED,
1971+
I915_SKL_SAGV_NOT_CONTROLLED
1972+
} skl_sagv_status;
1973+
19661974
struct {
19671975
/*
19681976
* Raw watermark latency values:
@@ -3591,6 +3599,7 @@ int i915_gem_evict_vm(struct i915_address_space *vm, bool do_idle);
35913599
/* belongs in i915_gem_gtt.h */
35923600
static inline void i915_gem_chipset_flush(struct drm_i915_private *dev_priv)
35933601
{
3602+
wmb();
35943603
if (INTEL_GEN(dev_priv) < 6)
35953604
intel_gtt_chipset_flush();
35963605
}

drivers/gpu/drm/i915/i915_gem_execbuffer.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -943,8 +943,6 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
943943
{
944944
const unsigned other_rings = ~intel_engine_flag(req->engine);
945945
struct i915_vma *vma;
946-
uint32_t flush_domains = 0;
947-
bool flush_chipset = false;
948946
int ret;
949947

950948
list_for_each_entry(vma, vmas, exec_list) {
@@ -957,16 +955,11 @@ i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
957955
}
958956

959957
if (obj->base.write_domain & I915_GEM_DOMAIN_CPU)
960-
flush_chipset |= i915_gem_clflush_object(obj, false);
961-
962-
flush_domains |= obj->base.write_domain;
958+
i915_gem_clflush_object(obj, false);
963959
}
964960

965-
if (flush_chipset)
966-
i915_gem_chipset_flush(req->engine->i915);
967-
968-
if (flush_domains & I915_GEM_DOMAIN_GTT)
969-
wmb();
961+
/* Unconditionally flush any chipset caches (for streaming writes). */
962+
i915_gem_chipset_flush(req->engine->i915);
970963

971964
/* Unconditionally invalidate gpu caches and ensure that we do flush
972965
* any residual writes from the previous batch.

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7145,6 +7145,15 @@ enum {
71457145

71467146
#define GEN6_PCODE_MAILBOX _MMIO(0x138124)
71477147
#define GEN6_PCODE_READY (1<<31)
7148+
#define GEN6_PCODE_ERROR_MASK 0xFF
7149+
#define GEN6_PCODE_SUCCESS 0x0
7150+
#define GEN6_PCODE_ILLEGAL_CMD 0x1
7151+
#define GEN6_PCODE_MIN_FREQ_TABLE_GT_RATIO_OUT_OF_RANGE 0x2
7152+
#define GEN6_PCODE_TIMEOUT 0x3
7153+
#define GEN6_PCODE_UNIMPLEMENTED_CMD 0xFF
7154+
#define GEN7_PCODE_TIMEOUT 0x2
7155+
#define GEN7_PCODE_ILLEGAL_DATA 0x3
7156+
#define GEN7_PCODE_MIN_FREQ_TABLE_GT_RATIO_OUT_OF_RANGE 0x10
71487157
#define GEN6_PCODE_WRITE_RC6VIDS 0x4
71497158
#define GEN6_PCODE_READ_RC6VIDS 0x5
71507159
#define GEN6_ENCODE_RC6_VID(mv) (((mv) - 245) / 5)
@@ -7166,6 +7175,10 @@ enum {
71667175
#define HSW_PCODE_DE_WRITE_FREQ_REQ 0x17
71677176
#define DISPLAY_IPS_CONTROL 0x19
71687177
#define HSW_PCODE_DYNAMIC_DUTY_CYCLE_CONTROL 0x1A
7178+
#define GEN9_PCODE_SAGV_CONTROL 0x21
7179+
#define GEN9_SAGV_DISABLE 0x0
7180+
#define GEN9_SAGV_IS_DISABLED 0x1
7181+
#define GEN9_SAGV_ENABLE 0x3
71697182
#define GEN6_PCODE_DATA _MMIO(0x138128)
71707183
#define GEN6_PCODE_FREQ_IA_RATIO_SHIFT 8
71717184
#define GEN6_PCODE_FREQ_RING_RATIO_SHIFT 16

drivers/gpu/drm/i915/intel_csr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
* be moved to FW_FAILED.
4242
*/
4343

44-
#define I915_CSR_KBL "i915/kbl_dmc_ver1.bin"
44+
#define I915_CSR_KBL "i915/kbl_dmc_ver1_01.bin"
4545
MODULE_FIRMWARE(I915_CSR_KBL);
4646
#define KBL_CSR_VERSION_REQUIRED CSR_VERSION(1, 1)
4747

48-
#define I915_CSR_SKL "i915/skl_dmc_ver1.bin"
48+
#define I915_CSR_SKL "i915/skl_dmc_ver1_26.bin"
4949
MODULE_FIRMWARE(I915_CSR_SKL);
50-
#define SKL_CSR_VERSION_REQUIRED CSR_VERSION(1, 23)
50+
#define SKL_CSR_VERSION_REQUIRED CSR_VERSION(1, 26)
5151

52-
#define I915_CSR_BXT "i915/bxt_dmc_ver1.bin"
52+
#define I915_CSR_BXT "i915/bxt_dmc_ver1_07.bin"
5353
MODULE_FIRMWARE(I915_CSR_BXT);
5454
#define BXT_CSR_VERSION_REQUIRED CSR_VERSION(1, 7)
5555

drivers/gpu/drm/i915/intel_display.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13759,6 +13759,13 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
1375913759
intel_state->cdclk_pll_vco != dev_priv->cdclk_pll.vco))
1376013760
dev_priv->display.modeset_commit_cdclk(state);
1376113761

13762+
/*
13763+
* SKL workaround: bspec recommends we disable the SAGV when we
13764+
* have more then one pipe enabled
13765+
*/
13766+
if (IS_SKYLAKE(dev_priv) && !skl_can_enable_sagv(state))
13767+
skl_disable_sagv(dev_priv);
13768+
1376213769
intel_modeset_verify_disabled(dev);
1376313770
}
1376413771

@@ -13832,6 +13839,10 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
1383213839
intel_modeset_verify_crtc(crtc, old_crtc_state, crtc->state);
1383313840
}
1383413841

13842+
if (IS_SKYLAKE(dev_priv) && intel_state->modeset &&
13843+
skl_can_enable_sagv(state))
13844+
skl_enable_sagv(dev_priv);
13845+
1383513846
drm_atomic_helper_commit_hw_done(state);
1383613847

1383713848
if (intel_state->modeset)

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,9 @@ void ilk_wm_get_hw_state(struct drm_device *dev);
17161716
void skl_wm_get_hw_state(struct drm_device *dev);
17171717
void skl_ddb_get_hw_state(struct drm_i915_private *dev_priv,
17181718
struct skl_ddb_allocation *ddb /* out */);
1719+
bool skl_can_enable_sagv(struct drm_atomic_state *state);
1720+
int skl_enable_sagv(struct drm_i915_private *dev_priv);
1721+
int skl_disable_sagv(struct drm_i915_private *dev_priv);
17191722
uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config);
17201723
bool ilk_disable_lp_wm(struct drm_device *dev);
17211724
int sanitize_rc6_option(struct drm_i915_private *dev_priv, int enable_rc6);

0 commit comments

Comments
 (0)