From patchwork Tue Dec 1 13:32:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 63951 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 nB1DXKEU002797 for ; Tue, 1 Dec 2009 13:33:20 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED3F29EFCB; Tue, 1 Dec 2009 05:33:19 -0800 (PST) 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 8C3EC9EFA6 for ; Tue, 1 Dec 2009 05:33:16 -0800 (PST) Received: by mail.ffwll.ch (Postfix, from userid 1000) id 71FA168010; Tue, 1 Dec 2009 14:33:15 +0100 (CET) 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.965-+--H*Ad:U*daniel.vetter, 0.963-+--H*m:ffwll, 0.950-+--H*r:mail.ffwll.ch Received: from biene (unknown [192.168.23.129]) by mail.ffwll.ch (Postfix) with ESMTP id 0586B6800A; Tue, 1 Dec 2009 14:32:57 +0100 (CET) Received: from daniel by biene with local (Exim 4.69) (envelope-from ) id 1NFSqf-0000nR-Cd; Tue, 01 Dec 2009 14:32:57 +0100 From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Tue, 1 Dec 2009 14:32:31 +0100 Message-Id: <9e93c26b48c028b85cb87b19fc8214b61f6430bb.1259673868.git.daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <5daa18610a07c32f5b03d2a06f0837d1d8794d35.1259673868.git.daniel.vetter@ffwll.ch> References: <6b93d5c17f0fb97e8018db344c234e19e36f3120.1259673868.git.daniel.vetter@ffwll.ch> <5daa18610a07c32f5b03d2a06f0837d1d8794d35.1259673868.git.daniel.vetter@ffwll.ch> In-Reply-To: References: Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 4/7] Xv: move users of x1, x2, y1, y2 to PutImage 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 diff --git a/src/i830_video.c b/src/i830_video.c index bab8687..1f47ccf 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -1439,12 +1439,11 @@ i830_dst_pitch_and_size(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, s static Bool i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, short width, short height, int *dstPitch, int *dstPitch2, - INT32 x1, INT32 y1, INT32 x2, INT32 y2, + int top, int left, int npixels, int nlines, int id, unsigned char *buf) { - intel_screen_private *intel = intel_get_screen_private(scrn); int srcPitch = 0, srcPitch2 = 0; - int top, left, npixels, nlines, size; + int size; if (is_planar_fourcc(id)) { srcPitch = (width + 0x3) & ~0x3; @@ -1486,20 +1485,13 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, #endif /* copy data */ - top = y1 >> 16; - left = (x1 >> 16) & ~1; - npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; - if (is_planar_fourcc(id)) { if (!xvmc_passthrough(id)) { - top &= ~1; - nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2, *dstPitch, height, top, left, nlines, npixels, id); } } else { - nlines = ((y2 + 0xffff) >> 16) - top; I830CopyPackedData(adaptor_priv, buf, srcPitch, *dstPitch, top, left, nlines, npixels); } @@ -1539,6 +1531,7 @@ I830PutImageTextured(ScrnInfoPtr scrn, int dstPitch2 = 0; BoxRec dstBox; xf86CrtcPtr crtc; + int top, left, npixels, nlines; #if 0 ErrorF("I830PutImage: src: (%d,%d)(%d,%d), dst: (%d,%d)(%d,%d)\n" @@ -1564,9 +1557,18 @@ I830PutImageTextured(ScrnInfoPtr scrn, width, height)) return Success; + top = y1 >> 16; + left = (x1 >> 16) & ~1; + npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; + if (is_planar_fourcc(id)) { + top &= ~1; + nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; + } else + nlines = ((y2 + 0xffff) >> 16) - top; + if (!i830_copy_video_data(scrn, adaptor_priv, width, height, &dstPitch, &dstPitch2, - x1, y1, x2, y2, id, buf)) + top, left, npixels, nlines, id, buf)) return BadAlloc; if (crtc && adaptor_priv->SyncToVblank != 0) { @@ -1609,6 +1611,7 @@ I830PutImageOverlay(ScrnInfoPtr scrn, int dstPitch2 = 0; BoxRec dstBox; xf86CrtcPtr crtc; + int top, left, npixels, nlines; #if 0 ErrorF("I830PutImage: src: (%d,%d)(%d,%d), dst: (%d,%d)(%d,%d)\n" @@ -1652,9 +1655,18 @@ I830PutImageOverlay(ScrnInfoPtr scrn, return Success; } + top = y1 >> 16; + left = (x1 >> 16) & ~1; + npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; + if (is_planar_fourcc(id)) { + top &= ~1; + nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; + } else + nlines = ((y2 + 0xffff) >> 16) - top; + if (!i830_copy_video_data(scrn, adaptor_priv, width, height, &dstPitch, &dstPitch2, - x1, y1, x2, y2, id, buf)) + top, left, npixels, nlines, id, buf)) return BadAlloc; if (!i830_display_overlay