summaryrefslogtreecommitdiff
path: root/src/i830_exa.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-02-24 20:34:10 -0800
committerEric Anholt <eric@anholt.net>2009-02-26 14:20:42 -0800
commitd7aa330db31100b7cb54d8165f9a4b94329ece32 (patch)
treef9da09e7ec9fbfdfeeb302ee4f6d02a7da2b1081 /src/i830_exa.c
parenta625a07022ea7f6757b288fcc2ffb9e27c7f8341 (diff)
Fix up i915 composite and common solid/copy code to use check_aperture.
This could fix complaints about binding BOs and resulting failure to render.
Diffstat (limited to 'src/i830_exa.c')
-rw-r--r--src/i830_exa.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/i830_exa.c b/src/i830_exa.c
index b8784026..d691f3d8 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -121,6 +121,21 @@ i830_pixmap_tiled(PixmapPtr pPixmap)
return FALSE;
}
+Bool
+i830_get_aperture_space(ScrnInfoPtr pScrn, drm_intel_bo **bo_table, int num_bos)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+
+ bo_table[0] = pI830->batch_bo;
+ if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) != 0) {
+ intel_batch_flush(pScrn, FALSE);
+ bo_table[0] = pI830->batch_bo;
+ if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) != 0)
+ I830FALLBACK("Couldn't get aperture space for BOs\n");
+ }
+ return TRUE;
+}
+
static unsigned long
i830_pixmap_pitch(PixmapPtr pixmap)
{
@@ -178,6 +193,10 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
unsigned long pitch;
+ drm_intel_bo *bo_table[] = {
+ NULL, /* batch_bo */
+ i830_get_pixmap_bo(pPixmap),
+ };
if (!EXA_PM_IS_SOLID(&pPixmap->drawable, planemask))
I830FALLBACK("planemask is not solid");
@@ -195,6 +214,9 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
if (!i830_pixmap_pitch_is_aligned(pPixmap))
I830FALLBACK("pixmap pitch not aligned");
+ if (!i830_get_aperture_space(pScrn, bo_table, ARRAY_SIZE(bo_table)))
+ return FALSE;
+
pI830->BR[13] = (I830PatternROP[alu] & 0xff) << 16 ;
switch (pPixmap->drawable.bitsPerPixel) {
case 8:
@@ -272,6 +294,11 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
{
ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
+ drm_intel_bo *bo_table[] = {
+ NULL, /* batch_bo */
+ i830_get_pixmap_bo(pSrcPixmap),
+ i830_get_pixmap_bo(pDstPixmap),
+ };
if (!EXA_PM_IS_SOLID(&pSrcPixmap->drawable, planemask))
I830FALLBACK("planemask is not solid");
@@ -279,6 +306,9 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
if (pDstPixmap->drawable.bitsPerPixel < 8)
I830FALLBACK("under 8bpp pixmaps unsupported\n");
+ if (!i830_get_aperture_space(pScrn, bo_table, ARRAY_SIZE(bo_table)))
+ return FALSE;
+
i830_exa_check_pitch_2d(pSrcPixmap);
i830_exa_check_pitch_2d(pDstPixmap);