Patch "drm/i915/gen9: only add the planes actually affected by ddb changes" has been added to the 4.8-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
drm/i915/gen9: only add the planes actually affected by ddb changes
to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-i915-gen9-only-add-the-planes-actually-affected-by-ddb-changes.patch
and it can be found in the queue-4.8 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
be5c571b2ff3a164d2e14ccc100cb5b2b3d3fb7cMon Sep 17 00:00:00 2001
From: Paulo Zanoni <[email protected]>
Date: Thu, 29 Sep 2016 16:36:48 -0300
Subject: drm/i915/gen9: only add the planes actually affected by ddb changes
From: Paulo Zanoni <[email protected]>
commit be5c571b2ff3a164d2e14ccc100cb5b2b3d3fb7c upstream.
We were previously adding all the planes owned by the CRTC even when the ddb partitioning didn't change for them. As a consequence, a lot of functions were being called when we were just moving the cursor around the screen, such as skylake_update_primary_plane().
This was causing flickering on the primary plane when moving the cursor. I'm not 100% sure which operation caused the flickering, but we were writing to a lot of registers, so it could be any of these writes. With this patch, just moving the mouse won't add the primary plane to the commit since it won't trigger a change in DDB partitioning.
v2: Use skl_ddb_entry_equal() (Lyude).
v3: Change Reported-and-bisected-by: to Reported-by: for checkpatch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97888
--- drivers/gpu/drm/i915/intel_pm.c | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +36 -1
@@ -3940,6 +3940,41 @@ pipes_modified(struct drm_atomic_state *return ret; } +int +skl_ddb_add_affected_planes (struct intel_crtc_state *cstate) +{ +struct drm_atomic_state *state = cstate->base.state; +struct drm_device *dev = state->dev; +struct drm_crtc *crtc = cstate->base.crtc; +struct intel_crtc *intel_crtc =to_intel_crtc (crtc); +struct drm_i915_private *dev_priv =to_i915 (dev); +struct intel_atomic_state *intel_state =to_intel_atomic_state (state); +struct skl_ddb_allocation *new_ddb = &intel_state->wm_results.ddb; +struct skl_ddb_allocation *cur_ddb = &dev_priv->wm.skl_hw.ddb; +struct drm_plane_state *plane_state; +struct drm_plane *plane; +enum pipe pipe = intel_crtc->pipe; +int id; + +WARN_ON (!drm_atomic_get_existing_crtc_state (state, crtc)); + +drm_for_each_plane_mask (plane, dev, crtc->state->plane_mask) { + id =skl_wm_plane_id (to_intel_plane (plane)); + +if (skl_ddb_entry_equal (&cur_ddb->plane[pipe][id], + &new_ddb->plane[pipe][id]) && +skl_ddb_entry_equal (&cur_ddb->y_plane[pipe][id], + &new_ddb->y_plane[pipe][id])) +continue ; + + plane_state =drm_atomic_get_plane_state (state, plane); +if (IS_ERR (plane_state)) +return PTR_ERR (plane_state); + } + +return 0 ; +} +static int skl_compute_ddb (struct drm_atomic_state *state) {
@@ -4004,7 +4039,7 @@ skl_compute_ddb(struct drm_atomic_stateif (ret)return ret; - ret =drm_atomic_add_affected_planes (state, &intel_crtc->base); + ret =skl_ddb_add_affected_planes (cstate);if (ret)return ret; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.8/drm-i915-gen9-only-add-the-planes-actually-affected-by-ddb-changes.patch