Skip to content

Commit 33c3b0d

Browse files
vsyrjalajnikula
authored andcommitted
drm/i915: Wait for vblank after enabling the primary plane on BDW
BDW signals the flip done interrupt immediately after the DSPSURF write when the plane is disabled. This is true even if we've already armed DSPCNTR to enable the plane at the next vblank. This causes major problems for our page flip code which relies on the flip done interrupts happening at vblank time. So what happens is that we enable the plane, and immediately allow userspace to submit a page flip. If the plane is still in the process of being enabled when the page flip is issued, the flip done gets signalled immediately. Our DSPSURFLIVE check catches this to prevent premature flip completion, but it also means that we don't get a flip done interrupt when the plane actually gets enabled, and so the page flip is never completed. Work around this by re-introducing blocking vblank waits on BDW whenever we enable the primary plane. I removed some of the vblank waits here: commit 6304cd9 Author: Ville Syrjälä <ville.syrjala@linux.intel.com> Date: Fri Apr 25 13:30:12 2014 +0300 drm/i915: Drop the excessive vblank waits from modeset codepaths To avoid these blocking vblank waits we should start using the vblank interrupt instead of the flip done interrupt to complete page flips. But that's material for another patch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79354 Tested-by: Guo Jinxian <jinxianx.guo@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent 8525a23 commit 33c3b0d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,7 @@ void intel_flush_primary_plane(struct drm_i915_private *dev_priv,
20872087
static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv,
20882088
enum plane plane, enum pipe pipe)
20892089
{
2090+
struct drm_device *dev = dev_priv->dev;
20902091
struct intel_crtc *intel_crtc =
20912092
to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
20922093
int reg;
@@ -2106,6 +2107,14 @@ static void intel_enable_primary_hw_plane(struct drm_i915_private *dev_priv,
21062107

21072108
I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE);
21082109
intel_flush_primary_plane(dev_priv, plane);
2110+
2111+
/*
2112+
* BDW signals flip done immediately if the plane
2113+
* is disabled, even if the plane enable is already
2114+
* armed to occur at the next vblank :(
2115+
*/
2116+
if (IS_BROADWELL(dev))
2117+
intel_wait_for_vblank(dev, intel_crtc->pipe);
21092118
}
21102119

21112120
/**

drivers/gpu/drm/i915/intel_sprite.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,14 @@ intel_post_enable_primary(struct drm_crtc *crtc)
690690
struct drm_device *dev = crtc->dev;
691691
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
692692

693+
/*
694+
* BDW signals flip done immediately if the plane
695+
* is disabled, even if the plane enable is already
696+
* armed to occur at the next vblank :(
697+
*/
698+
if (IS_BROADWELL(dev))
699+
intel_wait_for_vblank(dev, intel_crtc->pipe);
700+
693701
/*
694702
* FIXME IPS should be fine as long as one plane is
695703
* enabled, but in practice it seems to have problems

0 commit comments

Comments
 (0)