From patchwork Wed Jun 1 07:02:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Anholt X-Patchwork-Id: 841372 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p51ITYp1000441 for ; Wed, 1 Jun 2011 18:29:55 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DE1329EB37 for ; Wed, 1 Jun 2011 11:29:33 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from annarchy.freedesktop.org (annarchy.freedesktop.org [131.252.210.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 8740C9E88B; Wed, 1 Jun 2011 11:28:31 -0700 (PDT) Received: from pollan.anholt.net (annarchy.freedesktop.org [127.0.0.1]) by annarchy.freedesktop.org (Postfix) with ESMTP id 44E07130052; Wed, 1 Jun 2011 11:28:31 -0700 (PDT) Received: by pollan.anholt.net (Postfix, from userid 1000) id 8CEE84016C3; Wed, 1 Jun 2011 00:02:57 -0700 (PDT) From: Eric Anholt To: intel-gfx@lists.freedesktop.org Date: Wed, 1 Jun 2011 00:02:55 -0700 Message-Id: <1306911776-18301-3-git-send-email-eric@anholt.net> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1306911776-18301-1-git-send-email-eric@anholt.net> References: <1306911776-18301-1-git-send-email-eric@anholt.net> Subject: [Intel-gfx] [PATCH 2/3] uxa: Simplify Composite solid acceleration for spans by only clipping once. 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]); Wed, 01 Jun 2011 18:29:55 +0000 (UTC) Unlike the previous commit removing this style of code, the code in this one was originally wrong, and would fail to clip in the second pass of clipping when y was > pbox->y2. Bug #37233. --- uxa/uxa-accel.c | 79 ++++++++++++++++-------------------------------------- 1 files changed, 24 insertions(+), 55 deletions(-) diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c index 31c37e8..8f6da63 100644 --- a/uxa/uxa-accel.c +++ b/uxa/uxa-accel.c @@ -63,11 +63,9 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n, uxa_screen_t *uxa_screen = uxa_get_screen(screen); RegionPtr pClip = fbGetCompositeClip(pGC); PixmapPtr dst_pixmap, src_pixmap = NULL; - BoxPtr pextent, pbox; + BoxPtr pbox; int nbox; - int extentX1, extentX2, extentY1, extentY2; - int x1, x2, y, fullX1, fullX2, fullY1; - int partX1, partX2; + int x1, x2, y; int off_x, off_y; xRenderColor color; PictFormatPtr format; @@ -142,62 +140,35 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n, goto solid; } - pextent = REGION_EXTENTS(pGC->screen, pClip); - extentX1 = pextent->x1; - extentY1 = pextent->y1; - extentX2 = pextent->x2; - extentY2 = pextent->y2; while (n--) { - fullX1 = ppt->x; - fullY1 = ppt->y; - fullX2 = fullX1 + (int)*pwidth; + x1 = ppt->x; + y = ppt->y; + x2 = x1 + (int)*pwidth; ppt++; pwidth++; - if (fullY1 < extentY1 || extentY2 <= fullY1) - continue; + nbox = REGION_NUM_RECTS(pClip); + pbox = REGION_RECTS(pClip); + while (nbox--) { + if (pbox->y1 > y || pbox->y2 <= y) + continue; - if (fullX1 < extentX1) - fullX1 = extentX1; + if (x1 < pbox->x1) + x1 = pbox->x1; - if (fullX2 > extentX2) - fullX2 = extentX2; + if (x2 > pbox->x2) + x2 = pbox->x2; - if (fullX1 >= fullX2) - continue; + if (x2 <= x1) + continue; - nbox = REGION_NUM_RECTS(pClip); - if (nbox == 1) { uxa_screen->info->composite(dst_pixmap, - 0, 0, 0, 0, - fullX1 + off_x, - fullY1 + off_y, - fullX2 - fullX1, 1); - } else { - pbox = REGION_RECTS(pClip); - while (nbox--) { - if (pbox->y1 > fullY1) - break; - - if (pbox->y1 <= fullY1) { - partX1 = pbox->x1; - if (partX1 < fullX1) - partX1 = fullX1; - - partX2 = pbox->x2; - if (partX2 > fullX2) - partX2 = fullX2; - - if (partX2 > partX1) { - uxa_screen->info->composite(dst_pixmap, - 0, 0, 0, 0, - partX1 + off_x, - fullY1 + off_y, - partX2 - partX1, 1); - } - } - pbox++; - } + 0, 0, + 0, 0, + x1 + off_x, y + off_y, + x2 - x1, 1); + + pbox++; } } @@ -240,10 +211,8 @@ solid: continue; (*uxa_screen->info->solid) (dst_pixmap, - x1 + off_x, - y + off_y, - x2 + off_x, - y + 1 + off_y); + x1 + off_x, y + off_y, + x2 + off_x, y + 1 + off_y); pbox++; } }