diff options
author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2016-09-29 15:36:48 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-10-10 09:06:40 -0400 |
commit | be5c571b2ff3a164d2e14ccc100cb5b2b3d3fb7c (patch) | |
tree | 082fc1b69f8ca05c93a1e32f450d077319fe5862 /drivers/gpu | |
parent | a3fd4c67af3d8a81d241b3d51b3525f36f1d68bb (diff) |
drm/i915/gen9: only add the planes actually affected by ddb changes
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
Fixes: 05a76d3d6ad1 ("drm/i915/skl: Ensure pipes with changed wms get added to the state")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97888
Cc: Mike Lothian <mike@fireburn.co.uk>
Cc: stable@vger.kernel.org
Reported-by: Mike Lothian <mike@fireburn.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Lyude <cpaul@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1475177808-29955-1-git-send-email-paulo.r.zanoni@intel.com
(cherry picked from commit 7f60e200e254cd53ad1bd74a56bdd23e813ac4b7)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index f3d370a764a3..a2f751cd187a 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -3962,6 +3962,41 @@ pipes_modified(struct drm_atomic_state *state) | |||
3962 | return ret; | 3962 | return ret; |
3963 | } | 3963 | } |
3964 | 3964 | ||
3965 | int | ||
3966 | skl_ddb_add_affected_planes(struct intel_crtc_state *cstate) | ||
3967 | { | ||
3968 | struct drm_atomic_state *state = cstate->base.state; | ||
3969 | struct drm_device *dev = state->dev; | ||
3970 | struct drm_crtc *crtc = cstate->base.crtc; | ||
3971 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
3972 | struct drm_i915_private *dev_priv = to_i915(dev); | ||
3973 | struct intel_atomic_state *intel_state = to_intel_atomic_state(state); | ||
3974 | struct skl_ddb_allocation *new_ddb = &intel_state->wm_results.ddb; | ||
3975 | struct skl_ddb_allocation *cur_ddb = &dev_priv->wm.skl_hw.ddb; | ||
3976 | struct drm_plane_state *plane_state; | ||
3977 | struct drm_plane *plane; | ||
3978 | enum pipe pipe = intel_crtc->pipe; | ||
3979 | int id; | ||
3980 | |||
3981 | WARN_ON(!drm_atomic_get_existing_crtc_state(state, crtc)); | ||
3982 | |||
3983 | drm_for_each_plane_mask(plane, dev, crtc->state->plane_mask) { | ||
3984 | id = skl_wm_plane_id(to_intel_plane(plane)); | ||
3985 | |||
3986 | if (skl_ddb_entry_equal(&cur_ddb->plane[pipe][id], | ||
3987 | &new_ddb->plane[pipe][id]) && | ||
3988 | skl_ddb_entry_equal(&cur_ddb->y_plane[pipe][id], | ||
3989 | &new_ddb->y_plane[pipe][id])) | ||
3990 | continue; | ||
3991 | |||
3992 | plane_state = drm_atomic_get_plane_state(state, plane); | ||
3993 | if (IS_ERR(plane_state)) | ||
3994 | return PTR_ERR(plane_state); | ||
3995 | } | ||
3996 | |||
3997 | return 0; | ||
3998 | } | ||
3999 | |||
3965 | static int | 4000 | static int |
3966 | skl_compute_ddb(struct drm_atomic_state *state) | 4001 | skl_compute_ddb(struct drm_atomic_state *state) |
3967 | { | 4002 | { |
@@ -4026,7 +4061,7 @@ skl_compute_ddb(struct drm_atomic_state *state) | |||
4026 | if (ret) | 4061 | if (ret) |
4027 | return ret; | 4062 | return ret; |
4028 | 4063 | ||
4029 | ret = drm_atomic_add_affected_planes(state, &intel_crtc->base); | 4064 | ret = skl_ddb_add_affected_planes(cstate); |
4030 | if (ret) | 4065 | if (ret) |
4031 | return ret; | 4066 | return ret; |
4032 | } | 4067 | } |