diff options
author | Christian König <[email protected]> | 2011-05-15 19:26:53 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2011-05-15 19:26:53 +0200 |
commit | 828540e491d88b9b6217e6568873a78462919ae8 (patch) | |
tree | c952145c1188cdf6b9c56902f8f5c189e090c278 /src/gallium/state_trackers/xorg | |
parent | 3db6514357a7c634045ae7bc7bba7d7dbf9d58c5 (diff) | |
parent | bd5b7a6f7113da38a2c1f07a4a71e9993666a567 (diff) |
Merge remote-tracking branch 'origin/master' into pipe-video
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_exa.c | 87 |
1 files changed, 49 insertions, 38 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 91c206f1872..b072f53aa91 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -49,9 +49,24 @@ #include "util/u_box.h" #include "util/u_surface.h" -#define DEBUG_PRINT 0 #define ROUND_UP_TEXTURES 1 +static INLINE void +exa_debug_printf(const char *format, ...) _util_printf_format(1,2); + +static INLINE void +exa_debug_printf(const char *format, ...) +{ +#if 0 + va_list ap; + va_start(ap, format); + _debug_vprintf(format, ap); + va_end(ap); +#else + (void) format; /* silence warning */ +#endif +} + /* * Helper functions */ @@ -195,10 +210,8 @@ ExaDownloadFromScreen(PixmapPtr pPix, int x, int y, int w, int h, char *dst, if (!transfer) return FALSE; -#if DEBUG_PRINT - debug_printf("------ ExaDownloadFromScreen(%d, %d, %d, %d, %d)\n", + exa_debug_printf("------ ExaDownloadFromScreen(%d, %d, %d, %d, %d)\n", x, y, w, h, dst_pitch); -#endif util_copy_rect((unsigned char*)dst, priv->tex->format, dst_pitch, 0, 0, w, h, exa->pipe->transfer_map(exa->pipe, transfer), @@ -229,10 +242,8 @@ ExaUploadToScreen(PixmapPtr pPix, int x, int y, int w, int h, char *src, if (!transfer) return FALSE; -#if DEBUG_PRINT - debug_printf("++++++ ExaUploadToScreen(%d, %d, %d, %d, %d)\n", + exa_debug_printf("++++++ ExaUploadToScreen(%d, %d, %d, %d, %d)\n", x, y, w, h, src_pitch); -#endif util_copy_rect(exa->pipe->transfer_map(exa->pipe, transfer), priv->tex->format, transfer->stride, 0, 0, w, h, @@ -261,6 +272,8 @@ ExaPrepareAccess(PixmapPtr pPix, int index) if (!priv->tex) return FALSE; + exa_debug_printf("ExaPrepareAccess %d\n", index); + if (priv->map_count == 0) { assert(pPix->drawable.width <= priv->tex->width0); @@ -289,6 +302,8 @@ ExaPrepareAccess(PixmapPtr pPix, int index) priv->map_count++; + exa_debug_printf("ExaPrepareAccess %d prepared\n", index); + return TRUE; } @@ -308,6 +323,8 @@ ExaFinishAccess(PixmapPtr pPix, int index) if (!priv->map_transfer) return; + exa_debug_printf("ExaFinishAccess %d\n", index); + if (--priv->map_count == 0) { assert(priv->map_transfer); exa->pipe->transfer_unmap(exa->pipe, priv->map_transfer); @@ -315,6 +332,8 @@ ExaFinishAccess(PixmapPtr pPix, int index) priv->map_transfer = NULL; pPix->devPrivate.ptr = NULL; } + + exa_debug_printf("ExaFinishAccess %d finished\n", index); } /*********************************************************************** @@ -329,9 +348,8 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap); struct exa_context *exa = ms->exa; -#if DEBUG_PRINT - debug_printf("ExaPrepareSolid(0x%x)\n", fg); -#endif + exa_debug_printf("ExaPrepareSolid(0x%x)\n", fg); + if (!exa->accel) return FALSE; @@ -364,9 +382,7 @@ ExaSolid(PixmapPtr pPixmap, int x0, int y0, int x1, int y1) struct exa_context *exa = ms->exa; struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap); -#if DEBUG_PRINT - debug_printf("\tExaSolid(%d, %d, %d, %d)\n", x0, y0, x1, y1); -#endif + exa_debug_printf("\tExaSolid(%d, %d, %d, %d)\n", x0, y0, x1, y1); if (x0 == 0 && y0 == 0 && x1 == pPixmap->drawable.width && y1 == pPixmap->drawable.height) { @@ -388,8 +404,10 @@ ExaDoneSolid(PixmapPtr pPixmap) if (!priv) return; - + + exa_debug_printf("ExaDoneSolid\n"); xorg_composite_done(exa); + exa_debug_printf("ExaDoneSolid done\n"); } /*********************************************************************** @@ -406,9 +424,7 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDstPixmap); struct exa_pixmap_priv *src_priv = exaGetPixmapDriverPrivate(pSrcPixmap); -#if DEBUG_PRINT - debug_printf("ExaPrepareCopy\n"); -#endif + exa_debug_printf("ExaPrepareCopy\n"); if (!exa->accel) return FALSE; @@ -488,10 +504,8 @@ ExaCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, struct exa_context *exa = ms->exa; struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDstPixmap); -#if DEBUG_PRINT - debug_printf("\tExaCopy(srcx=%d, srcy=%d, dstX=%d, dstY=%d, w=%d, h=%d)\n", + exa_debug_printf("\tExaCopy(srcx=%d, srcy=%d, dstX=%d, dstY=%d, w=%d, h=%d)\n", srcX, srcY, dstX, dstY, width, height); -#endif debug_assert(priv == exa->copy.dst); (void) priv; @@ -527,12 +541,16 @@ ExaDoneCopy(PixmapPtr pPixmap) if (!priv) return; + exa_debug_printf("ExaDoneCopy\n"); + renderer_draw_flush(exa->renderer); exa->copy.src = NULL; exa->copy.dst = NULL; pipe_surface_reference(&exa->copy.dst_surface, NULL); pipe_resource_reference(&exa->copy.src_texture, NULL); + + exa_debug_printf("ExaDoneCopy done\n"); } @@ -584,19 +602,15 @@ ExaCheckComposite(int op, ScrnInfoPtr pScrn = xf86Screens[pDstPicture->pDrawable->pScreen->myNum]; modesettingPtr ms = modesettingPTR(pScrn); struct exa_context *exa = ms->exa; - -#if DEBUG_PRINT - debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n", - op, pSrcPicture, pMaskPicture, pDstPicture, accelerated); -#endif - - if (!exa->accel) - return FALSE; - - return xorg_composite_accelerated(op, + Bool accelerated = exa->accel && xorg_composite_accelerated(op, pSrcPicture, pMaskPicture, pDstPicture); + + exa_debug_printf("ExaCheckComposite(%d, %p, %p, %p) = %d\n", + op, pSrcPicture, pMaskPicture, pDstPicture, accelerated); + + return accelerated; } @@ -613,14 +627,13 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture, if (!exa->accel) return FALSE; -#if DEBUG_PRINT - debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n", + exa_debug_printf("ExaPrepareComposite(%d, src=0x%p, mask=0x%p, dst=0x%p)\n", op, pSrcPicture, pMaskPicture, pDstPicture); - debug_printf("\tFormats: src(%s), mask(%s), dst(%s)\n", + exa_debug_printf("\tFormats: src(%s), mask(%s), dst(%s)\n", pSrcPicture ? render_format_name(pSrcPicture->format) : "none", pMaskPicture ? render_format_name(pMaskPicture->format) : "none", pDstPicture ? render_format_name(pDstPicture->format) : "none"); -#endif + if (!exa->pipe) XORG_FALLBACK("accel not enabled"); @@ -687,12 +700,10 @@ ExaComposite(PixmapPtr pDst, int srcX, int srcY, int maskX, int maskY, struct exa_context *exa = ms->exa; struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pDst); -#if DEBUG_PRINT - debug_printf("\tExaComposite(src[%d,%d], mask=[%d, %d], dst=[%d, %d], dim=[%d, %d])\n", + exa_debug_printf("\tExaComposite(src[%d,%d], mask=[%d, %d], dst=[%d, %d], dim=[%d, %d])\n", srcX, srcY, maskX, maskY, dstX, dstY, width, height); - debug_printf("\t Num bound samplers = %d\n", + exa_debug_printf("\t Num bound samplers = %d\n", exa->num_bound_samplers); -#endif xorg_composite(exa, priv, srcX, srcY, maskX, maskY, dstX, dstY, width, height); |