From: Jesse Barnes Subject: [PATCH] drm/i915: use BLT ring for flips on IVB Date: Thu, 9 Jun 2011 12:14:37 -0700 Message-ID: <1307646877-1979-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy8-pub.bluehost.com (oproxy8-pub.bluehost.com [69.89.22.20]) by gabe.freedesktop.org (Postfix) with SMTP id 3D9D99E776 for ; Thu, 9 Jun 2011 12:14:40 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org Found a couple more problems: 1) MI_DISPLAY_FLIP should take a '1' in the last byte to indicate length on IVB 2) apprently only the BLT ring version of the command actually causes interrupts to be generated With this patch, modetest -v works on my test platform. Clearly it's in need of more splitting though. The case statement should be split into per-chipset flip command generation. Signed-off-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_display.c | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 81a9059..37d0087 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6343,9 +6343,11 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, /* Offset into the new buffer for cases of shared fbs between CRTCs */ offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8; - ret = BEGIN_LP_RING(4); - if (ret) - goto cleanup_objs; + if (!IS_IVYBRIDGE(dev)) { + ret = BEGIN_LP_RING(4); + if (ret) + goto cleanup_objs; + } /* Block clients from rendering to the new back buffer until * the flip occurs and the object is no longer visible. @@ -6390,7 +6392,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, break; case 6: - case 7: OUT_RING(MI_DISPLAY_FLIP | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); OUT_RING(fb->pitch | obj->tiling_mode); @@ -6400,8 +6401,18 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, pipesrc = I915_READ(PIPESRC(pipe)) & 0x0fff0fff; OUT_RING(pf | pipesrc); break; + case 7: + intel_ring_begin(&dev_priv->ring[BCS], 4); + intel_ring_emit(&dev_priv->ring[BCS], (MI_DISPLAY_FLIP_I915 | (intel_crtc->plane << 19))); + intel_ring_emit(&dev_priv->ring[BCS], (fb->pitch | obj->tiling_mode)); + intel_ring_emit(&dev_priv->ring[BCS], (obj->gtt_offset)); + intel_ring_emit(&dev_priv->ring[BCS], (MI_NOOP)); + intel_ring_advance(&dev_priv->ring[BCS]); + break; } - ADVANCE_LP_RING(); + + if (!IS_IVYBRIDGE(dev)) + ADVANCE_LP_RING(); mutex_unlock(&dev->struct_mutex); -- 1.7.4.1