From patchwork Tue Aug 11 14:06:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 40679 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 n7BE7JXF022383 for ; Tue, 11 Aug 2009 14:07:19 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EF2D69EE14; Tue, 11 Aug 2009 07:07:18 -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 AE8A49EE0C for ; Tue, 11 Aug 2009 07:07:13 -0700 (PDT) Received: by mail.ffwll.ch (Postfix, from userid 1000) id 0C10920C22B; Wed, 12 Aug 2009 00:00:41 +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-+--struct, 0.000-+--signed-off-by, 0.000-+--signedoffby X-Spam-Status: No, score=-4.4 required=6.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Spammy: Received: from biene (unknown [192.168.23.129]) by mail.ffwll.ch (Postfix) with ESMTP id 5D1EF20C22D; Wed, 12 Aug 2009 00:00:08 +0200 (CEST) Received: from daniel by biene with local (Exim 4.69) (envelope-from ) id 1Mas0B-0003ek-MT; Tue, 11 Aug 2009 16:06:59 +0200 From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Tue, 11 Aug 2009 16:06:43 +0200 Message-Id: X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <3a4e39fa527e6f1bec9306a0c9d7b69b222532a6.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> <3a4e39fa527e6f1bec9306a0c9d7b69b222532a6.1249999028.git.daniel.vetter@ffwll.ch> In-Reply-To: References: Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 13/18] Xv: scrap overlay offscreen pixmap support 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 The code looks like it's been bitrotting since being copied over from the i810 driver. Furthermore painting rgb pixmaps with the overlay engine is in these days of modern compositing X an absolute no-go. And textured video doesn't support it neither, so its likely never ever used by applications. Signed-off-by: Daniel Vetter --- src/i830.h | 1 - src/i830_driver.c | 2 - src/i830_video.c | 193 ----------------------------------------------------- 3 files changed, 0 insertions(+), 196 deletions(-) diff --git a/src/i830.h b/src/i830.h index b46eff1..72edaa1 100644 --- a/src/i830.h +++ b/src/i830.h @@ -388,7 +388,6 @@ typedef struct _I830Rec { /* For Xvideo */ i830_memory *overlay_regs; - void *offscreenImages; /**< remembered memory block for release */ #ifdef INTEL_XVMC /* For XvMC */ Bool XvMCEnabled; diff --git a/src/i830_driver.c b/src/i830_driver.c index abff587..15d06d5 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -3121,8 +3121,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen) i830_allocator_fini(pScrn); i965_free_video(pScrn); - free(pI830->offscreenImages); - pI830->offscreenImages = NULL; pScreen->CloseScreen = pI830->CloseScreen; (*pScreen->CloseScreen) (scrnIndex, pScreen); diff --git a/src/i830_video.c b/src/i830_video.c index 5a961f9..5e2db6c 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -86,8 +86,6 @@ #define TIMER_MASK (OFF_TIMER | FREE_TIMER) -static void I830InitOffscreenImages(ScreenPtr); - static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr); static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr); static void I830StopVideo(ScrnInfoPtr, pointer, Bool); @@ -608,7 +606,6 @@ I830InitVideo(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to set up overlay video\n"); } - I830InitOffscreenImages(pScreen); } if (overlayAdaptor && pI830->XvPreferOverlay) @@ -2639,196 +2636,6 @@ I830VideoBlockHandler(int i, pointer blockData, pointer pTimeout, } } -/*************************************************************************** - * Offscreen Images - ***************************************************************************/ - -typedef struct { - Bool isOn; -} OffscreenPrivRec, *OffscreenPrivPtr; - -static int -I830AllocateSurface(ScrnInfoPtr pScrn, - int id, - unsigned short w, - unsigned short h, XF86SurfacePtr surface) -{ - int pitch, fbpitch, size; - OffscreenPrivPtr pPriv; - I830Ptr pI830 = I830PTR(pScrn); - - OVERLAY_DEBUG("I830AllocateSurface\n"); - - if (IS_845G(pI830) || IS_I830(pI830)) { - if ((w > IMAGE_MAX_WIDTH_LEGACY) || (h > IMAGE_MAX_HEIGHT_LEGACY)) - return BadAlloc; - } else { - if ((w > IMAGE_MAX_WIDTH) || (h > IMAGE_MAX_HEIGHT)) - return BadAlloc; - } - - /* What to do when rotated ?? */ - if (pI830->rotation != RR_Rotate_0) - return BadAlloc; - - if (!(surface->pitches = xalloc(sizeof(int)))) - return BadAlloc; - if (!(surface->offsets = xalloc(sizeof(int)))) { - xfree(surface->pitches); - return BadAlloc; - } - if (!(pPriv = xalloc(sizeof(OffscreenPrivRec)))) { - xfree(surface->pitches); - xfree(surface->offsets); - return BadAlloc; - } - - w = (w + 1) & ~1; - pitch = ((w << 1) + 15) & ~15; - fbpitch = pI830->cpp * pScrn->displayWidth; - size = pitch * h; - - surface->width = w; - surface->height = h; - - pPriv->isOn = FALSE; - - surface->pScrn = pScrn; - surface->id = id; - surface->pitches[0] = pitch; - surface->offsets[0] = 0; - surface->devPrivate.ptr = (pointer) pPriv; - - return Success; -} - -static int -I830StopSurface(XF86SurfacePtr surface) -{ - OffscreenPrivPtr pPriv = (OffscreenPrivPtr) surface->devPrivate.ptr; - ScrnInfoPtr pScrn = surface->pScrn; - - if (pPriv->isOn) { - OVERLAY_DEBUG("StopSurface\n"); - - i830_overlay_off (pScrn); - - pPriv->isOn = FALSE; - } - - return Success; -} - -static int -I830FreeSurface(XF86SurfacePtr surface) -{ - I830StopSurface(surface); - xfree(surface->pitches); - xfree(surface->offsets); - xfree(surface->devPrivate.ptr); - - return Success; -} - -static int -I830GetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 * value) -{ - return I830GetPortAttribute(pScrn, attribute, value, NULL); -} - -static int -I830SetSurfaceAttribute(ScrnInfoPtr pScrn, Atom attribute, INT32 value) -{ - return I830SetPortAttributeOverlay(pScrn, attribute, value, NULL); -} - -static int -I830DisplaySurface(XF86SurfacePtr surface, - short src_x, short src_y, - short drw_x, short drw_y, - short src_w, short src_h, - short drw_w, short drw_h, RegionPtr clipBoxes) -{ - OffscreenPrivPtr pPriv = (OffscreenPrivPtr) surface->devPrivate.ptr; - ScrnInfoPtr pScrn = surface->pScrn; - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; - I830PortPrivPtr pI830Priv = GET_PORT_PRIVATE(pScrn); - INT32 x1, y1, x2, y2; - BoxRec dstBox; - xf86CrtcPtr crtc; - - OVERLAY_DEBUG("I830DisplaySurface\n"); - - x1 = src_x; - x2 = src_x + src_w; - y1 = src_y; - y2 = src_y + src_h; - - dstBox.x1 = drw_x; - dstBox.x2 = drw_x + drw_w; - dstBox.y1 = drw_y; - dstBox.y2 = drw_y + drw_h; - - if (!i830_clip_video_helper (pScrn, pI830Priv, &crtc, &dstBox, - &x1, &x2, &y1, &y2, clipBoxes, - surface->width, surface->height)) - return Success; - - /* fixup pointers */ - pI830Priv->YBufOffset = surface->offsets[0]; - - i830_display_overlay(pScrn, crtc, surface->id, surface->width, surface->height, - surface->pitches[0], x1, y1, x2, y2, &dstBox, - src_w, src_h, drw_w, drw_h); - - i830_fill_colorkey (pScreen, pI830Priv->colorKey, clipBoxes); - - pPriv->isOn = TRUE; - /* we've prempted the XvImage stream so set its free timer */ - if (pI830Priv->videoStatus & CLIENT_VIDEO_ON) { - REGION_EMPTY(pScrn->pScreen, &pI830Priv->clip); - UpdateCurrentTime(); - pI830Priv->videoStatus = FREE_TIMER; - pI830Priv->freeTime = currentTime.milliseconds + FREE_DELAY; - } - - return Success; -} - -static void -I830InitOffscreenImages(ScreenPtr pScreen) -{ - XF86OffscreenImagePtr offscreenImages; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - I830Ptr pI830 = I830PTR(pScrn); - - if (!(offscreenImages = xalloc(sizeof(XF86OffscreenImageRec)))) { - return; - } - - pI830->offscreenImages = offscreenImages; - - offscreenImages[0].image = &Images[0]; - offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES /*| VIDEO_CLIP_TO_VIEWPORT*/; - offscreenImages[0].alloc_surface = I830AllocateSurface; - offscreenImages[0].free_surface = I830FreeSurface; - offscreenImages[0].display = I830DisplaySurface; - offscreenImages[0].stop = I830StopSurface; - offscreenImages[0].setAttribute = I830SetSurfaceAttribute; - offscreenImages[0].getAttribute = I830GetSurfaceAttribute; - if (IS_845G(pI830) || IS_I830(pI830)) { - offscreenImages[0].max_width = IMAGE_MAX_WIDTH_LEGACY; - offscreenImages[0].max_height = IMAGE_MAX_HEIGHT_LEGACY; - } else { - offscreenImages[0].max_width = IMAGE_MAX_WIDTH; - offscreenImages[0].max_height = IMAGE_MAX_HEIGHT; - } - offscreenImages[0].num_attributes = 1; - offscreenImages[0].attributes = Attributes; - - xf86XVRegisterOffscreenImages(pScreen, offscreenImages, 1); -} - void i830_crtc_dpms_video(xf86CrtcPtr crtc, Bool on) {