From patchwork Thu Jun 9 19:14:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 866502 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p59JF04P004962 for ; Thu, 9 Jun 2011 19:15:21 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 650819F6D4 for ; Thu, 9 Jun 2011 12:15:00 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) Received: (qmail 7417 invoked by uid 0); 9 Jun 2011 19:14:40 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by oproxy8.bluehost.com with SMTP; 9 Jun 2011 19:14:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=virtuousgeek.org; h=Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:X-Identified-User; b=hxwK5rOFww3UsghHvnp94o9BMCZu16O2KBCGsDZkortklCaKpVYNiMNkYtL1TIp3GvZ2IPZ4asKdsPdiqIfW6mo7LHY7lilwhrdlPD+7TNpgVyafNbmJ+XbhlRL1YfuC; Received: from c-67-161-37-189.hsd1.ca.comcast.net ([67.161.37.189] helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1QUkgh-0001Nk-7n; Thu, 09 Jun 2011 13:14:39 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Thu, 9 Jun 2011 12:14:37 -0700 Message-Id: <1307646877-1979-1-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.7.4.1 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Subject: [Intel-gfx] [PATCH] drm/i915: use BLT ring for flips on IVB X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 09 Jun 2011 19:15:21 +0000 (UTC) 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);