diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2012-04-13 09:35:38 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2012-04-16 15:54:26 +0200 |
commit | d88b9700137ee407c483f263bb55c77cd6f92fef (patch) | |
tree | 04202d50791f6cd06d3582a9cb97194934a4420f /src/radeon_exa_shared.c | |
parent | 66b586b9b9cdaf70f0fcd547b5a04f044d848d44 (diff) |
EXA: Support acceleration of solid pictures on R3xx-R7xx.
Allocate 1x1 scratch pixmaps to hold the solid picture colours.
This works around https://bugs.freedesktop.org/show_bug.cgi?id=47266 and might
improve performance in other cases as well.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/radeon_exa_shared.c')
-rw-r--r-- | src/radeon_exa_shared.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/radeon_exa_shared.c b/src/radeon_exa_shared.c index be1d2faf..28dc3358 100644 --- a/src/radeon_exa_shared.c +++ b/src/radeon_exa_shared.c @@ -126,6 +126,25 @@ Bool RADEONCheckBPP(int bpp) return FALSE; } +PixmapPtr RADEONSolidPixmap(ScreenPtr pScreen, uint32_t solid) +{ + PixmapPtr pPix = pScreen->CreatePixmap(pScreen, 1, 1, 32, 0); + struct radeon_bo *bo; + + exaMoveInPixmap(pPix); + bo = radeon_get_pixmap_bo(pPix); + + if (radeon_bo_map(bo, 1)) { + pScreen->DestroyPixmap(pPix); + return NULL; + } + + memcpy(bo->ptr, &solid, 4); + radeon_bo_unmap(bo); + + return pPix; +} + static Bool radeon_vb_get(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); |