From patchwork Tue Aug 11 14:06:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 40675 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 n7BE7B8w022355 for ; Tue, 11 Aug 2009 14:07:11 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 485649EE20; Tue, 11 Aug 2009 07:07:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.ffwll.ch (cable-static-49-187.intergga.ch [157.161.49.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 572C09EE20 for ; Tue, 11 Aug 2009 07:07:08 -0700 (PDT) Received: by mail.ffwll.ch (Postfix, from userid 1000) id 7C59320C228; Wed, 12 Aug 2009 00:00:36 +0200 (CEST) X-Spam-ASN: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on orange.ffwll.ch X-Spam-Level: X-Spam-Hammy: 0.000-+--signed-off-by, 0.000-+--signedoffby, 0.000-+--100644 X-Spam-Status: No, score=-4.4 required=6.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Spammy: 0.971-+--H*m:ffwll, 0.970-+--H*Ad:U*daniel.vetter, 0.947-+--H*Ad:D*ffwll.ch Received: from biene (unknown [192.168.23.129]) by mail.ffwll.ch (Postfix) with ESMTP id 4E45120C22C; Wed, 12 Aug 2009 00:00:08 +0200 (CEST) Received: from daniel by biene with local (Exim 4.69) (envelope-from ) id 1Mas0B-0003ee-Ga; Tue, 11 Aug 2009 16:06:59 +0200 From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Tue, 11 Aug 2009 16:06:41 +0200 Message-Id: X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <52250eeaf73398c9c1f91ca7b2317f785f8eba56.1249999028.git.daniel.vetter@ffwll.ch> References: <0328734a90544a6cd72d9eaf64015db9d3462921.1249999028.git.daniel.vetter@ffwll.ch> <10614c7dd4ecbb1b4d3dd6a15b949cb389053f1f.1249999028.git.daniel.vetter@ffwll.ch> <891b387c6b31972a3e339508e57bd660b2991a17.1249999028.git.daniel.vetter@ffwll.ch> <2096013512e0099bfbb89439943c1b70cccabc92.1249999028.git.daniel.vetter@ffwll.ch> <8a3ddc0d78dcb40a14f8037b81cf202eaa40c301.1249999028.git.daniel.vetter@ffwll.ch> <3e0435569d2d7f58d58eb2f7c8a6952cc29b6934.1249999028.git.daniel.vetter@ffwll.ch> <52250eeaf73398c9c1f91ca7b2317f785f8eba56.1249999028.git.daniel.vetter@ffwll.ch> In-Reply-To: References: Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 11/18] Xv I830PutImage splitup: extract i830_wait_for scanline 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: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Also scrap the unecessary variable sync in I830PutImage and the accompanying obfuscated logic. Signed-off-by: Daniel Vetter --- src/i830_video.c | 80 +++++++++++++++++++++++++++--------------------------- 1 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/i830_video.c b/src/i830_video.c index b9385f9..6b65e5e 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -2157,6 +2157,44 @@ i830_fill_colorkey (ScreenPtr pScreen, uint32_t key, RegionPtr clipboxes) FreeScratchGC (gc); } +static void +i830_wait_for_scanline(ScrnInfoPtr pScrn, PixmapPtr pPixmap, + xf86CrtcPtr crtc, RegionPtr clipBoxes) +{ + I830Ptr pI830 = I830PTR(pScrn); + BoxPtr box; + pixman_box16_t box_in_crtc_coordinates; + int pipe = -1, event, load_scan_lines_pipe; + + if (pixmap_is_scanout(pPixmap)) + pipe = i830_crtc_to_pipe(crtc); + + if (pipe >= 0) { + if (pipe == 0) { + event = MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW; + load_scan_lines_pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEA; + } else { + event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; + load_scan_lines_pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; + } + + box = REGION_EXTENTS(unused, clipBoxes); + box_in_crtc_coordinates = *box; + if (crtc->transform_in_use) + pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &box_in_crtc_coordinates); + + BEGIN_BATCH(5); + /* The documentation says that the LOAD_SCAN_LINES command + * always comes in pairs. Don't ask me why. */ + OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | load_scan_lines_pipe); + OUT_BATCH((box_in_crtc_coordinates.y1 << 16) | box_in_crtc_coordinates.y2); + OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | load_scan_lines_pipe); + OUT_BATCH((box_in_crtc_coordinates.y1 << 16) | box_in_crtc_coordinates.y2); + OUT_BATCH(MI_WAIT_FOR_EVENT | event); + ADVANCE_BATCH(); + } +} + static Bool i830_setup_video_buffer(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int alloc_size, int id) @@ -2452,46 +2490,8 @@ I830PutImage(ScrnInfoPtr pScrn, i830_fill_colorkey (pScreen, pPriv->colorKey, clipBoxes); } } else { - Bool sync = TRUE; - - if (crtc == NULL) { - sync = FALSE; - } else if (pPriv->SyncToVblank == 0) { - sync = FALSE; - } - - if (sync) { - BoxPtr box; - pixman_box16_t box_in_crtc_coordinates; - int pipe = -1, event, load_scan_lines_pipe; - - if (pixmap_is_scanout(pPixmap)) - pipe = i830_crtc_to_pipe(crtc); - - if (pipe >= 0) { - if (pipe == 0) { - event = MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW; - load_scan_lines_pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEA; - } else { - event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; - load_scan_lines_pipe = MI_LOAD_SCAN_LINES_DISPLAY_PIPEB; - } - - box = REGION_EXTENTS(unused, clipBoxes); - box_in_crtc_coordinates = *box; - if (crtc->transform_in_use) - pixman_f_transform_bounds (&crtc->f_framebuffer_to_crtc, &box_in_crtc_coordinates); - - BEGIN_BATCH(5); - /* The documentation says that the LOAD_SCAN_LINES command - * always comes in pairs. Don't ask me why. */ - OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | load_scan_lines_pipe); - OUT_BATCH((box_in_crtc_coordinates.y1 << 16) | box_in_crtc_coordinates.y2); - OUT_BATCH(MI_LOAD_SCAN_LINES_INCL | load_scan_lines_pipe); - OUT_BATCH((box_in_crtc_coordinates.y1 << 16) | box_in_crtc_coordinates.y2); - OUT_BATCH(MI_WAIT_FOR_EVENT | event); - ADVANCE_BATCH(); - } + if (crtc && pPriv->SyncToVblank != 0) { + i830_wait_for_scanline(pScrn, pPixmap, crtc, clipBoxes); } if (IS_I965G(pI830)) {