From e73553bff74a41f08cba9d52b5fec19f15ab3d48 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 18 Nov 2009 19:51:57 +0000 Subject: st/xorg: Use the correct DRI2BufferPtr struct on 1.6.4 servers --- src/gallium/state_trackers/xorg/xorg_dri2.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index c41a7cd639..adc9531dbd 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -137,6 +137,11 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format) buffer->cpp = 4; buffer->driverPrivate = private; buffer->flags = 0; /* not tiled */ +#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION == 2 + ((DRI2Buffer2Ptr)buffer)->format = 0; +#elif defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 3 + buffer->format = 0; +#endif private->tex = tex; return TRUE; @@ -157,12 +162,12 @@ driDoDestroyBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer) (*pScreen->DestroyPixmap)(private->pPixmap); } -#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2 +#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2 -static DRI2BufferPtr +static DRI2Buffer2Ptr driCreateBuffer(DrawablePtr pDraw, unsigned int attachment, unsigned int format) { - DRI2BufferPtr buffer; + DRI2Buffer2Ptr buffer; BufferPrivatePtr private; buffer = xcalloc(1, sizeof *buffer); @@ -177,7 +182,8 @@ driCreateBuffer(DrawablePtr pDraw, unsigned int attachment, unsigned int format) buffer->attachment = attachment; buffer->driverPrivate = private; - if (driDoCreateBuffer(pDraw, buffer, format)) + /* So far it is safe to downcast a DRI2Buffer2Ptr to DRI2BufferPtr */ + if (driDoCreateBuffer(pDraw, (DRI2BufferPtr)buffer, format)) return buffer; xfree(private); @@ -187,15 +193,16 @@ fail: } static void -driDestroyBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer) +driDestroyBuffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer) { - driDoDestroyBuffer(pDraw, buffer); + /* So far it is safe to downcast a DRI2Buffer2Ptr to DRI2BufferPtr */ + driDoDestroyBuffer(pDraw, (DRI2BufferPtr)buffer); xfree(buffer->driverPrivate); xfree(buffer); } -#else /* DRI2INFOREC_VERSION <= 2 */ +#else /* !defined(DRI2INFOREC_VERSION) || DRI2INFOREC_VERSION < 2 */ static DRI2BufferPtr driCreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) @@ -245,7 +252,7 @@ driDestroyBuffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count) } } -#endif /* DRI2INFOREC_VERSION */ +#endif /* defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2 */ static void driCopyRegion(DrawablePtr pDraw, RegionPtr pRegion, @@ -352,7 +359,7 @@ driScreenInit(ScreenPtr pScreen) dri2info.driverName = pScrn->driverName; dri2info.deviceName = "/dev/dri/card0"; /* FIXME */ -#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2 +#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2 dri2info.CreateBuffer = driCreateBuffer; dri2info.DestroyBuffer = driDestroyBuffer; #else -- cgit v1.2.3 From 9ab3c70f6568d980c3910d7ea8a3032445eaf49f Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 18 Nov 2009 19:56:50 +0000 Subject: st/xorg: Make the #if more easier to read --- src/gallium/state_trackers/xorg/xorg_dri2.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index adc9531dbd..bd4acf7f82 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -42,6 +42,12 @@ #include "util/u_rect.h" +/* Make all the #if cases in the code esier to read */ +/* XXX can it be set to 1? */ +#ifndef DRI2INFOREC_VERSION +#define DRI2INFOREC_VERSION 0 +#endif + typedef struct { PixmapPtr pPixmap; struct pipe_texture *tex; @@ -79,7 +85,7 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format) case DRI2BufferFrontLeft: break; case DRI2BufferStencil: -#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2 +#if DRI2INFOREC_VERSION >= 3 case DRI2BufferDepthStencil: #else /* Works on old X servers because sanity checking is for the weak */ @@ -137,9 +143,9 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format) buffer->cpp = 4; buffer->driverPrivate = private; buffer->flags = 0; /* not tiled */ -#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION == 2 +#if DRI2INFOREC_VERSION == 2 ((DRI2Buffer2Ptr)buffer)->format = 0; -#elif defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 3 +#elif DRI2INFOREC_VERSION >= 3 buffer->format = 0; #endif private->tex = tex; @@ -162,7 +168,7 @@ driDoDestroyBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer) (*pScreen->DestroyPixmap)(private->pPixmap); } -#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2 +#if DRI2INFOREC_VERSION >= 2 static DRI2Buffer2Ptr driCreateBuffer(DrawablePtr pDraw, unsigned int attachment, unsigned int format) @@ -202,7 +208,7 @@ driDestroyBuffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer) xfree(buffer); } -#else /* !defined(DRI2INFOREC_VERSION) || DRI2INFOREC_VERSION < 2 */ +#else /* DRI2INFOREC_VERSION < 2 */ static DRI2BufferPtr driCreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count) @@ -252,7 +258,7 @@ driDestroyBuffers(DrawablePtr pDraw, DRI2BufferPtr buffers, int count) } } -#endif /* defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2 */ +#endif /* DRI2INFOREC_VERSION >= 2 */ static void driCopyRegion(DrawablePtr pDraw, RegionPtr pRegion, @@ -349,7 +355,7 @@ driScreenInit(ScreenPtr pScreen) modesettingPtr ms = modesettingPTR(pScrn); DRI2InfoRec dri2info; -#if defined(DRI2INFOREC_VERSION) +#if DRI2INFORCE_VERSION >= 2 dri2info.version = DRI2INFOREC_VERSION; #else dri2info.version = 1; @@ -359,7 +365,7 @@ driScreenInit(ScreenPtr pScreen) dri2info.driverName = pScrn->driverName; dri2info.deviceName = "/dev/dri/card0"; /* FIXME */ -#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2 +#if DRI2INFOREC_VERSION >= 2 dri2info.CreateBuffer = driCreateBuffer; dri2info.DestroyBuffer = driDestroyBuffer; #else -- cgit v1.2.3 From e12c9a6f3af6ec10cbd2e5cd2a6b90056652a2c0 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 18 Nov 2009 22:50:26 +0000 Subject: st/xorg: Init all functions and fix spelling --- src/gallium/state_trackers/xorg/xorg_dri2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index bd4acf7f82..aca889d6f8 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -355,7 +355,7 @@ driScreenInit(ScreenPtr pScreen) modesettingPtr ms = modesettingPTR(pScrn); DRI2InfoRec dri2info; -#if DRI2INFORCE_VERSION >= 2 +#if DRI2INFOREC_VERSION >= 2 dri2info.version = DRI2INFOREC_VERSION; #else dri2info.version = 1; @@ -368,6 +368,8 @@ driScreenInit(ScreenPtr pScreen) #if DRI2INFOREC_VERSION >= 2 dri2info.CreateBuffer = driCreateBuffer; dri2info.DestroyBuffer = driDestroyBuffer; + dri2info.CreateBuffers = NULL; + dri2info.DestroyBuffers = NULL; #else dri2info.CreateBuffers = driCreateBuffers; dri2info.DestroyBuffers = driDestroyBuffers; -- cgit v1.2.3 From ea114345a6f19331628910745650cb64750b2bda Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 19 Nov 2009 10:38:08 +0100 Subject: st/xorg: Don't initialize non-existing fields. --- src/gallium/state_trackers/xorg/xorg_dri2.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index aca889d6f8..660ea6a1ba 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -368,8 +368,6 @@ driScreenInit(ScreenPtr pScreen) #if DRI2INFOREC_VERSION >= 2 dri2info.CreateBuffer = driCreateBuffer; dri2info.DestroyBuffer = driDestroyBuffer; - dri2info.CreateBuffers = NULL; - dri2info.DestroyBuffers = NULL; #else dri2info.CreateBuffers = driCreateBuffers; dri2info.DestroyBuffers = driDestroyBuffers; -- cgit v1.2.3 From 10dbdee05694489edd03b353dfe133a17e65b469 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 19 Nov 2009 10:54:49 +0100 Subject: st/xorg: Remove superfluous flushes from the EXA WaitMarker hook. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Thomas Hellström for pointing this out. --- src/gallium/state_trackers/xorg/xorg_exa.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 6fa274eb0a..29fc861748 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -170,15 +170,7 @@ xorg_exa_common_done(struct exa_context *exa) static void ExaWaitMarker(ScreenPtr pScreen, int marker) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - modesettingPtr ms = modesettingPTR(pScrn); - struct exa_context *exa = ms->exa; - -#if 0 - xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, NULL); -#else - xorg_exa_finish(exa); -#endif + /* Nothing to do, handled in the PrepareAccess hook */ } static int -- cgit v1.2.3 From 012d0193cc9ad6fdc9829db0a6884a5a590dd4c5 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 19 Nov 2009 17:25:05 +0100 Subject: st/xorg: Don't complain about convolution filter being 'unknown'. Also add a newline to the complaint so it'll be a little less annoying if we actually encounter an unknown filter value again. --- src/gallium/state_trackers/xorg/xorg_composite.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index 733bd53fca..86a52077c3 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -152,7 +152,8 @@ render_filter_to_gallium(int xrender_filter, int *out_filter) *out_filter = PIPE_TEX_FILTER_LINEAR; break; default: - debug_printf("Unkown xrender filter"); + debug_printf("Unkown xrender filter\n"); + case PictFilterConvolution: *out_filter = PIPE_TEX_FILTER_NEAREST; return FALSE; } -- cgit v1.2.3 From 34145fc3b739d21387e7df483ca902c8373ce319 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 19 Nov 2009 17:30:32 +0100 Subject: st/xorg: Try harder to ensure a shared texture has valid contents right away. --- src/gallium/state_trackers/xorg/xorg_dri2.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 660ea6a1ba..9a7c356860 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -127,9 +127,12 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format) } if (!tex) { + /* First call to make sure we have a pixmap private */ exaMoveInPixmap(private->pPixmap); xorg_exa_set_shared_usage(private->pPixmap); pScreen->ModifyPixmapHeader(private->pPixmap, 0, 0, 0, 0, 0, NULL); + /* Second call to make sure texture has valid contents */ + exaMoveInPixmap(private->pPixmap); tex = xorg_exa_get_texture(private->pPixmap); } -- cgit v1.2.3 From 10c67f938194a3b99ce2717318c77d86abc54933 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 19 Nov 2009 17:47:21 +0100 Subject: st/xorg: Miscellaneous XVideo fixes. * Make sure the destination pixmap has a texture to render into. * Fix damage reporting so the EXA migration code can do the right thing. * Fix destination coordinates for redirected windows. --- src/gallium/state_trackers/xorg/xorg_xv.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c index 2b935c0f73..7cc532b1c8 100644 --- a/src/gallium/state_trackers/xorg/xorg_xv.c +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -446,6 +446,11 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id, int x, y, w, h; struct exa_pixmap_priv *dst = exaGetPixmapDriverPrivate(pPixmap); + if (!dst->tex) { + xorg_exa_set_shared_usage(pPixmap); + pScrn->pScreen->ModifyPixmapHeader(pPixmap, 0, 0, 0, 0, 0, NULL); + } + if (!dst || !dst->tex) XORG_FALLBACK("Xv destination %s", !dst ? "!dst" : "!dst->tex"); @@ -469,6 +474,9 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id, setup_vs_video_constants(pPriv->r, dst); setup_fs_video_constants(pPriv->r, hdtv); + exaMoveInPixmap(pPixmap); + DamageDamageRegion(&pPixmap->drawable, dstRegion); + while (nbox--) { int box_x1 = pbox->x1; int box_y1 = pbox->y1; @@ -476,8 +484,8 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id, int box_y2 = pbox->y2; float diff_x = (float)src_w / (float)dst_w; float diff_y = (float)src_h / (float)dst_h; - int offset_x = box_x1 - dstX; - int offset_y = box_y1 - dstY; + int offset_x = box_x1 - dstX + pPixmap->screen_x; + int offset_y = box_y1 - dstY + pPixmap->screen_y; int offset_w; int offset_h; @@ -495,7 +503,7 @@ display_video(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv, int id, pbox++; } - DamageDamageRegion(&pPixmap->drawable, dstRegion); + DamageRegionProcessPending(&pPixmap->drawable); return TRUE; } -- cgit v1.2.3 From 31ea323b4d432b557d7664187f17ccefc6d3947b Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Thu, 19 Nov 2009 17:52:55 +0100 Subject: st/xorg: Replace compile-time acceleration switch with Option "2DAccel". This option can be used to disable 2D acceleration. DRI2 and XVideo blits will still be accelerated, at least to some degree even with compositing. --- src/gallium/state_trackers/xorg/xorg_dri2.c | 4 ++++ src/gallium/state_trackers/xorg/xorg_driver.c | 5 ++++- src/gallium/state_trackers/xorg/xorg_exa.c | 24 ++++++++++++++---------- src/gallium/state_trackers/xorg/xorg_exa.h | 2 ++ src/gallium/state_trackers/xorg/xorg_tracker.h | 2 +- 5 files changed, 25 insertions(+), 12 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 9a7c356860..ca3c712dcd 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -276,6 +276,7 @@ driCopyRegion(DrawablePtr pDraw, RegionPtr pRegion, PixmapPtr dst_pixmap; GCPtr gc; RegionPtr copy_clip; + Bool save_accel; /* * In driCreateBuffers we dewrap windows into the @@ -341,8 +342,11 @@ driCopyRegion(DrawablePtr pDraw, RegionPtr pRegion, } } + save_accel = ms->exa->accel; + ms->exa->accel = TRUE; (*gc->ops->CopyArea)(&src_pixmap->drawable, &dst_pixmap->drawable, gc, 0, 0, pDraw->width, pDraw->height, 0, 0); + ms->exa->accel = save_accel; FreeScratchGC(gc); diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 26cf2dd772..d949167adc 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -75,10 +75,12 @@ static Bool PreInit(ScrnInfoPtr pScrn, int flags); typedef enum { OPTION_SW_CURSOR, + OPTION_2D_ACCEL, } modesettingOpts; static const OptionInfoRec Options[] = { {OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_2D_ACCEL, "2DAccel", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -609,7 +611,8 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) xf86SetBlackWhitePixels(pScreen); - ms->exa = xorg_exa_init(pScrn); + ms->exa = xorg_exa_init(pScrn, xf86ReturnOptValBool(ms->Options, + OPTION_2D_ACCEL, TRUE)); ms->debug_fallback = debug_get_bool_option("XORG_DEBUG_FALLBACK", TRUE); xorg_init_video(pScreen); diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 29fc861748..3a51ad2d59 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -46,7 +46,6 @@ #include "util/u_rect.h" #define DEBUG_PRINT 0 -#define ACCEL_ENABLED TRUE /* * Helper functions @@ -376,7 +375,7 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) XORG_FALLBACK("format %s", pf_name(priv->tex->format)); } - return ACCEL_ENABLED && xorg_solid_bind_state(exa, priv, fg); + return exa->accel && xorg_solid_bind_state(exa, priv, fg); } static void @@ -435,7 +434,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, exa->copy.src = src_priv; exa->copy.dst = priv; - return ACCEL_ENABLED; + return exa->accel; } static void @@ -564,7 +563,7 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture, render_format_name(pMaskPicture->format)); } - return ACCEL_ENABLED && + return exa->accel && xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture, pDstPicture, pSrc ? exaGetPixmapDriverPrivate(pSrc) : NULL, @@ -597,6 +596,9 @@ ExaCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { + ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; + modesettingPtr ms = modesettingPTR(pScrn); + struct exa_context *exa = ms->exa; boolean accelerated = xorg_composite_accelerated(op, pSrcPicture, pMaskPicture, @@ -605,7 +607,7 @@ ExaCheckComposite(int op, debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n", op, pSrcPicture, pMaskPicture, pDstPicture, accelerated); #endif - return ACCEL_ENABLED && accelerated; + return exa->accel && accelerated; } static void * @@ -743,10 +745,11 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, bitsPerPixel, devKind, NULL); /* Deal with screen resize */ - if (!priv->tex || - (priv->tex->width[0] != width || - priv->tex->height[0] != height || - priv->tex_flags != priv->flags)) { + if ((exa->accel || priv->flags) && + (!priv->tex || + (priv->tex->width[0] != width || + priv->tex->height[0] != height || + priv->tex_flags != priv->flags))) { struct pipe_texture *texture = NULL; struct pipe_texture template; @@ -861,7 +864,7 @@ xorg_exa_close(ScrnInfoPtr pScrn) } void * -xorg_exa_init(ScrnInfoPtr pScrn) +xorg_exa_init(ScrnInfoPtr pScrn, Bool accel) { modesettingPtr ms = modesettingPTR(pScrn); struct exa_context *exa; @@ -926,6 +929,7 @@ xorg_exa_init(ScrnInfoPtr pScrn) ms->ctx = exa->pipe; exa->renderer = renderer_create(exa->pipe); + exa->accel = accel; return (void *)exa; diff --git a/src/gallium/state_trackers/xorg/xorg_exa.h b/src/gallium/state_trackers/xorg/xorg_exa.h index 7f4aebb9c3..15cc29d662 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.h +++ b/src/gallium/state_trackers/xorg/xorg_exa.h @@ -24,6 +24,8 @@ struct exa_context float solid_color[4]; boolean has_solid_color; + boolean accel; + /* float[9] projective matrix bound to pictures */ struct { float src[9]; diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index 6130cf6621..20c9259c7b 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -131,7 +131,7 @@ xorg_exa_create_root_texture(ScrnInfoPtr pScrn, int depth, int bpp); void * -xorg_exa_init(ScrnInfoPtr pScrn); +xorg_exa_init(ScrnInfoPtr pScrn, Bool accel); void xorg_exa_close(ScrnInfoPtr pScrn); -- cgit v1.2.3 From 367cfca808e74101689dd0acb247f3ec38fc4c7f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 11:37:50 -0700 Subject: softpipe: add missing check in softpipe_is_texture_referenced() Check if the named texture is referenced by the texture cache. --- src/gallium/drivers/softpipe/sp_context.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index 94d000a5ac..d325499bf8 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -120,7 +120,7 @@ softpipe_destroy( struct pipe_context *pipe ) * if (the texture is being used as a framebuffer surface) * return PIPE_REFERENCED_FOR_WRITE * else if (the texture is a bound texture source) - * return PIPE_REFERENCED_FOR_READ XXX not done yet + * return PIPE_REFERENCED_FOR_READ * else * return PIPE_UNREFERENCED */ @@ -132,6 +132,7 @@ softpipe_is_texture_referenced( struct pipe_context *pipe, struct softpipe_context *softpipe = softpipe_context( pipe ); unsigned i; + /* check if any of the bound drawing surfaces are this texture */ if (softpipe->dirty_render_cache) { for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) { if (softpipe->framebuffer.cbufs[i] && @@ -145,7 +146,12 @@ softpipe_is_texture_referenced( struct pipe_context *pipe, } } - /* FIXME: we also need to do the same for the texture cache */ + /* check if any of the tex_cache textures are this texture */ + for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + if (softpipe->tex_cache[i] && + softpipe->tex_cache[i]->texture == texture) + return PIPE_REFERENCED_FOR_READ; + } return PIPE_UNREFERENCED; } -- cgit v1.2.3 From 3f4016650099642f900fc169c078b1d78128899a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 14:02:06 -0700 Subject: softpipe: whitespace/indentation fixes --- src/gallium/drivers/softpipe/sp_context.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c index d325499bf8..5f60139968 100644 --- a/src/gallium/drivers/softpipe/sp_context.c +++ b/src/gallium/drivers/softpipe/sp_context.c @@ -249,9 +249,9 @@ softpipe_create( struct pipe_screen *screen ) /* setup quad rendering stages */ - softpipe->quad.shade = sp_quad_shade_stage(softpipe); - softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe); - softpipe->quad.blend = sp_quad_blend_stage(softpipe); + softpipe->quad.shade = sp_quad_shade_stage(softpipe); + softpipe->quad.depth_test = sp_quad_depth_test_stage(softpipe); + softpipe->quad.blend = sp_quad_blend_stage(softpipe); /* @@ -281,7 +281,6 @@ softpipe_create( struct pipe_screen *screen ) draw_set_render(softpipe->draw, softpipe->vbuf_backend); - /* plug in AA line/point stages */ draw_install_aaline_stage(softpipe->draw, &softpipe->pipe); draw_install_aapoint_stage(softpipe->draw, &softpipe->pipe); @@ -297,4 +296,3 @@ softpipe_create( struct pipe_screen *screen ) softpipe_destroy(&softpipe->pipe); return NULL; } - -- cgit v1.2.3 From 8b808d50e2f4be57c3a245afea462540dab1484e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 19 Nov 2009 14:38:39 -0800 Subject: st/xorg: Fix infinite loop in copy_packed_data. --- src/gallium/state_trackers/xorg/xorg_xv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c index 7cc532b1c8..a1e74fad59 100644 --- a/src/gallium/state_trackers/xorg/xorg_xv.c +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -256,7 +256,7 @@ copy_packed_data(ScrnInfoPtr pScrn, switch (id) { case FOURCC_YV12: { for (i = 0; i < w; ++i) { - for (j = 0; i < h; ++j) { + for (j = 0; j < h; ++j) { /*XXX use src? */ y1 = buf[j*w + i]; u = buf[(j/2) * (w/2) + i/2 + y_array_size]; -- cgit v1.2.3