diff options
-rw-r--r-- | src/i830.h | 2 | ||||
-rw-r--r-- | src/i830_exa.c | 30 | ||||
-rw-r--r-- | src/i915_render.c | 9 |
3 files changed, 41 insertions, 0 deletions
@@ -87,6 +87,8 @@ unsigned long long I830TexOffsetStart(PixmapPtr pPix); Bool i830_uxa_init(ScreenPtr pScreen); void i830_uxa_create_screen_resources(ScreenPtr pScreen); void i830_uxa_block_handler (ScreenPtr pScreen); +Bool i830_get_aperture_space(ScrnInfoPtr pScrn, drm_intel_bo **bo_table, + int num_bos); #endif #if defined(I830_USE_UXA) || defined(I830_USE_EXA) 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); diff --git a/src/i915_render.c b/src/i915_render.c index 5dd97e6e..4190808f 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -315,6 +315,12 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, { ScrnInfoPtr pScrn = xf86Screens[pSrcPicture->pDrawable->pScreen->myNum]; I830Ptr pI830 = I830PTR(pScrn); + drm_intel_bo *bo_table[] = { + NULL, /* batch_bo */ + i830_get_pixmap_bo(pSrc), + pMask ? i830_get_pixmap_bo(pMask) : NULL, + i830_get_pixmap_bo(pDst), + }; i830_exa_check_pitch_3d(pSrc); if (pMask) @@ -325,6 +331,9 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, &pI830->i915_render_state.dst_format)) return FALSE; + if (!i830_get_aperture_space(pScrn, bo_table, ARRAY_SIZE(bo_table))) + return FALSE; + pI830->i915_render_state.is_nearest = FALSE; if (!i915_texture_setup(pSrcPicture, pSrc, 0)) I830FALLBACK("fail to setup src texture\n"); |