From patchwork Wed Dec 2 20:29:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 64344 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB2KTvqX004956 for ; Wed, 2 Dec 2009 20:29:57 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ABF149F6D2; Wed, 2 Dec 2009 12:29:56 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from outbound-mail-319.bluehost.com (outbound-mail-319.bluehost.com [67.222.54.251]) by gabe.freedesktop.org (Postfix) with SMTP id 93AA89E93B for ; Wed, 2 Dec 2009 12:29:54 -0800 (PST) Received: (qmail 1717 invoked by uid 0); 2 Dec 2009 20:29:53 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by outboundproxy6.bluehost.com with SMTP; 2 Dec 2009 20:29:53 -0000 Received: from [75.111.28.251] (helo=jbarnes-piketon) by box514.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1NFvph-0004zp-6S for intel-gfx@lists.freedesktop.org; Wed, 02 Dec 2009 13:29:53 -0700 Date: Wed, 2 Dec 2009 12:29:28 -0800 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Message-ID: <20091202122928.2653387a@jbarnes-piketon> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.3; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 75.111.28.251 authed with jbarnes@virtuousgeek.org} Subject: [Intel-gfx] [PATCH] DRI2 CopyRegion scanline wait fixes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/src/i830_dri.c b/src/i830_dri.c index 98c1a15..313cc96 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -302,6 +302,7 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, int y1, y2; int pipe = -1, event, load_scan_lines_pipe; xf86CrtcPtr crtc; + Bool full_height = FALSE; box = REGION_EXTENTS(unused, gc->pCompositeClip); crtc = i830_covering_crtc(scrn, box, NULL, &crtcbox); @@ -310,21 +311,34 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion, if (crtc != NULL && !crtc->rotatedData) { pipe = i830_crtc_to_pipe(crtc); + /* Make sure we don't wait for a scanline that will never occur */ + y1 = (crtcbox.y1 <= box->y1) ? box->y1 - crtcbox.y1 : 0; + y2 = (box->y2 <= crtcbox.y2) ? + box->y2 - crtcbox.y1 : crtcbox.y2 - crtcbox.y1; + + if (y1 == 0 && y2 == crtcbox.y2) + full_height = TRUE; + + /* Pre-965 doesn't have SVBLANK, so we need a bit + * of extra time for the blitter to start up and + * do its job for a full height blit */ + if (full_height && !IS_I965G(intel)) + y2 -= 2; + if (pipe == 0) { event = MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW; load_scan_lines_pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEA; + if (full_height && IS_I965G(intel)) + event = MI_WAIT_FOR_PIPEA_SVBLANK; } else { event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; load_scan_lines_pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; + if (full_height && IS_I965G(intel)) + event = MI_WAIT_FOR_PIPEB_SVBLANK; } - /* Make sure we don't wait for a scanline that will never occur */ - y1 = (crtcbox.y1 <= box->y1) ? box->y1 - crtcbox.y1 : 0; - y2 = (box->y2 <= crtcbox.y2) ? - box->y2 - crtcbox.y1 : crtcbox.y2 - crtcbox.y1; - BEGIN_BATCH(5); /* The documentation says that the LOAD_SCAN_LINES command * always comes in pairs. Don't ask me why. */