Skip to content

Commit 96ffbbf

Browse files
committed
Merge tag 'drm-intel-fixes-2017-11-01' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
Fixes for Stable: - Fix KBL Blank Screen (Jani) - Fix FIFO Underrun on SNB (Maarten) Other fixes: - Fix GPU Hang on i915gm (Chris) - Fix gem_tiled_pread_pwrite IGT case (Chris) - Cancel modeset retry work during modeset clean-up (Manasi) * tag 'drm-intel-fixes-2017-11-01' of git://anongit.freedesktop.org/drm/drm-intel: drm/i915: Check incoming alignment for unfenced buffers (on i915gm) drm/i915: Hold rcu_read_lock when iterating over the radixtree (vma idr) drm/i915: Hold rcu_read_lock when iterating over the radixtree (objects) drm/i915/edp: read edp display control registers unconditionally drm/i915: Do not rely on wm preservation for ILK watermarks drm/i915: Cancel the modeset retry work during modeset cleanup
2 parents 25dd1aa + bb5cf33 commit 96ffbbf

7 files changed

Lines changed: 57 additions & 35 deletions

File tree

drivers/gpu/drm/i915/i915_gem.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,8 +2214,10 @@ static void __i915_gem_object_reset_page_iter(struct drm_i915_gem_object *obj)
22142214
struct radix_tree_iter iter;
22152215
void __rcu **slot;
22162216

2217+
rcu_read_lock();
22172218
radix_tree_for_each_slot(slot, &obj->mm.get_page.radix, &iter, 0)
22182219
radix_tree_delete(&obj->mm.get_page.radix, iter.index);
2220+
rcu_read_unlock();
22192221
}
22202222

22212223
void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj,

drivers/gpu/drm/i915/i915_gem_context.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ static void lut_close(struct i915_gem_context *ctx)
104104
kmem_cache_free(ctx->i915->luts, lut);
105105
}
106106

107+
rcu_read_lock();
107108
radix_tree_for_each_slot(slot, &ctx->handles_vma, &iter, 0) {
108109
struct i915_vma *vma = rcu_dereference_raw(*slot);
109110
struct drm_i915_gem_object *obj = vma->obj;
@@ -115,6 +116,7 @@ static void lut_close(struct i915_gem_context *ctx)
115116

116117
__i915_gem_object_release_unless_active(obj);
117118
}
119+
rcu_read_unlock();
118120
}
119121

120122
static void i915_gem_context_free(struct i915_gem_context *ctx)

drivers/gpu/drm/i915/i915_gem_execbuffer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ eb_vma_misplaced(const struct drm_i915_gem_exec_object2 *entry,
337337
(vma->node.start + vma->node.size - 1) >> 32)
338338
return true;
339339

340+
if (flags & __EXEC_OBJECT_NEEDS_MAP &&
341+
!i915_vma_is_map_and_fenceable(vma))
342+
return true;
343+
340344
return false;
341345
}
342346

drivers/gpu/drm/i915/intel_display.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15227,6 +15227,23 @@ void intel_connector_unregister(struct drm_connector *connector)
1522715227
intel_panel_destroy_backlight(connector);
1522815228
}
1522915229

15230+
static void intel_hpd_poll_fini(struct drm_device *dev)
15231+
{
15232+
struct intel_connector *connector;
15233+
struct drm_connector_list_iter conn_iter;
15234+
15235+
/* First disable polling... */
15236+
drm_kms_helper_poll_fini(dev);
15237+
15238+
/* Then kill the work that may have been queued by hpd. */
15239+
drm_connector_list_iter_begin(dev, &conn_iter);
15240+
for_each_intel_connector_iter(connector, &conn_iter) {
15241+
if (connector->modeset_retry_work.func)
15242+
cancel_work_sync(&connector->modeset_retry_work);
15243+
}
15244+
drm_connector_list_iter_end(&conn_iter);
15245+
}
15246+
1523015247
void intel_modeset_cleanup(struct drm_device *dev)
1523115248
{
1523215249
struct drm_i915_private *dev_priv = to_i915(dev);
@@ -15247,7 +15264,7 @@ void intel_modeset_cleanup(struct drm_device *dev)
1524715264
* Due to the hpd irq storm handling the hotplug work can re-arm the
1524815265
* poll handlers. Hence disable polling after hpd handling is shut down.
1524915266
*/
15250-
drm_kms_helper_poll_fini(dev);
15267+
intel_hpd_poll_fini(dev);
1525115268

1525215269
/* poll work can call into fbdev, hence clean that up afterwards */
1525315270
intel_fbdev_fini(dev_priv);

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3731,9 +3731,16 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp)
37313731

37323732
}
37333733

3734-
/* Read the eDP Display control capabilities registers */
3735-
if ((intel_dp->dpcd[DP_EDP_CONFIGURATION_CAP] & DP_DPCD_DISPLAY_CONTROL_CAPABLE) &&
3736-
drm_dp_dpcd_read(&intel_dp->aux, DP_EDP_DPCD_REV,
3734+
/*
3735+
* Read the eDP display control registers.
3736+
*
3737+
* Do this independent of DP_DPCD_DISPLAY_CONTROL_CAPABLE bit in
3738+
* DP_EDP_CONFIGURATION_CAP, because some buggy displays do not have it
3739+
* set, but require eDP 1.4+ detection (e.g. for supported link rates
3740+
* method). The display control registers should read zero if they're
3741+
* not supported anyway.
3742+
*/
3743+
if (drm_dp_dpcd_read(&intel_dp->aux, DP_EDP_DPCD_REV,
37373744
intel_dp->edp_dpcd, sizeof(intel_dp->edp_dpcd)) ==
37383745
sizeof(intel_dp->edp_dpcd))
37393746
DRM_DEBUG_KMS("EDP DPCD : %*ph\n", (int) sizeof(intel_dp->edp_dpcd),

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ struct intel_crtc_scaler_state {
496496

497497
struct intel_pipe_wm {
498498
struct intel_wm_level wm[5];
499-
struct intel_wm_level raw_wm[5];
500499
uint32_t linetime;
501500
bool fbc_wm_enabled;
502501
bool pipe_enabled;

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,9 +2716,9 @@ static void ilk_compute_wm_level(const struct drm_i915_private *dev_priv,
27162716
const struct intel_crtc *intel_crtc,
27172717
int level,
27182718
struct intel_crtc_state *cstate,
2719-
struct intel_plane_state *pristate,
2720-
struct intel_plane_state *sprstate,
2721-
struct intel_plane_state *curstate,
2719+
const struct intel_plane_state *pristate,
2720+
const struct intel_plane_state *sprstate,
2721+
const struct intel_plane_state *curstate,
27222722
struct intel_wm_level *result)
27232723
{
27242724
uint16_t pri_latency = dev_priv->wm.pri_latency[level];
@@ -3038,28 +3038,24 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
30383038
struct intel_pipe_wm *pipe_wm;
30393039
struct drm_device *dev = state->dev;
30403040
const struct drm_i915_private *dev_priv = to_i915(dev);
3041-
struct intel_plane *intel_plane;
3042-
struct intel_plane_state *pristate = NULL;
3043-
struct intel_plane_state *sprstate = NULL;
3044-
struct intel_plane_state *curstate = NULL;
3041+
struct drm_plane *plane;
3042+
const struct drm_plane_state *plane_state;
3043+
const struct intel_plane_state *pristate = NULL;
3044+
const struct intel_plane_state *sprstate = NULL;
3045+
const struct intel_plane_state *curstate = NULL;
30453046
int level, max_level = ilk_wm_max_level(dev_priv), usable_level;
30463047
struct ilk_wm_maximums max;
30473048

30483049
pipe_wm = &cstate->wm.ilk.optimal;
30493050

3050-
for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) {
3051-
struct intel_plane_state *ps;
3052-
3053-
ps = intel_atomic_get_existing_plane_state(state,
3054-
intel_plane);
3055-
if (!ps)
3056-
continue;
3051+
drm_atomic_crtc_state_for_each_plane_state(plane, plane_state, &cstate->base) {
3052+
const struct intel_plane_state *ps = to_intel_plane_state(plane_state);
30573053

3058-
if (intel_plane->base.type == DRM_PLANE_TYPE_PRIMARY)
3054+
if (plane->type == DRM_PLANE_TYPE_PRIMARY)
30593055
pristate = ps;
3060-
else if (intel_plane->base.type == DRM_PLANE_TYPE_OVERLAY)
3056+
else if (plane->type == DRM_PLANE_TYPE_OVERLAY)
30613057
sprstate = ps;
3062-
else if (intel_plane->base.type == DRM_PLANE_TYPE_CURSOR)
3058+
else if (plane->type == DRM_PLANE_TYPE_CURSOR)
30633059
curstate = ps;
30643060
}
30653061

@@ -3081,11 +3077,9 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
30813077
if (pipe_wm->sprites_scaled)
30823078
usable_level = 0;
30833079

3084-
ilk_compute_wm_level(dev_priv, intel_crtc, 0, cstate,
3085-
pristate, sprstate, curstate, &pipe_wm->raw_wm[0]);
3086-
30873080
memset(&pipe_wm->wm, 0, sizeof(pipe_wm->wm));
3088-
pipe_wm->wm[0] = pipe_wm->raw_wm[0];
3081+
ilk_compute_wm_level(dev_priv, intel_crtc, 0, cstate,
3082+
pristate, sprstate, curstate, &pipe_wm->wm[0]);
30893083

30903084
if (IS_HASWELL(dev_priv) || IS_BROADWELL(dev_priv))
30913085
pipe_wm->linetime = hsw_compute_linetime_wm(cstate);
@@ -3095,8 +3089,8 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
30953089

30963090
ilk_compute_wm_reg_maximums(dev_priv, 1, &max);
30973091

3098-
for (level = 1; level <= max_level; level++) {
3099-
struct intel_wm_level *wm = &pipe_wm->raw_wm[level];
3092+
for (level = 1; level <= usable_level; level++) {
3093+
struct intel_wm_level *wm = &pipe_wm->wm[level];
31003094

31013095
ilk_compute_wm_level(dev_priv, intel_crtc, level, cstate,
31023096
pristate, sprstate, curstate, wm);
@@ -3106,13 +3100,10 @@ static int ilk_compute_pipe_wm(struct intel_crtc_state *cstate)
31063100
* register maximums since such watermarks are
31073101
* always invalid.
31083102
*/
3109-
if (level > usable_level)
3110-
continue;
3111-
3112-
if (ilk_validate_wm_level(level, &max, wm))
3113-
pipe_wm->wm[level] = *wm;
3114-
else
3115-
usable_level = level;
3103+
if (!ilk_validate_wm_level(level, &max, wm)) {
3104+
memset(wm, 0, sizeof(*wm));
3105+
break;
3106+
}
31163107
}
31173108

31183109
return 0;

0 commit comments

Comments
 (0)