diff --git a/src/i830.h b/src/i830.h index 834e4dc..e2c39cc 100644 --- a/src/i830.h +++ b/src/i830.h @@ -857,6 +857,17 @@ static inline int i830_fb_compression_supported(I830Ptr pI830) Bool i830_pixmap_tiled(PixmapPtr p); +#define i830_exa_check_pitch_2d(p) do {\ + uint32_t pitch = intel_get_pixmap_pitch(p);\ + if (pitch > KB(32)) return FALSE;\ +} while(0) + +/* For pre-965 chip only, as they have 8KB limit for 3D */ +#define i830_exa_check_pitch_3d(p) do {\ + uint32_t pitch = intel_get_pixmap_pitch(p);\ + if (pitch > KB(8)) return FALSE;\ +} while(0) + /* Batchbuffer compatibility handling */ #define BEGIN_BATCH(n) BEGIN_LP_RING(n) #define ENSURE_BATCH(n) diff --git a/src/i830_driver.c b/src/i830_driver.c index 155e7a9..41c0578 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -3108,7 +3108,7 @@ I830FreeScreen(int scrnIndex, int flags) #ifdef INTEL_XVMC ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; I830Ptr pI830 = I830PTR(pScrn); - if (pI830->XvMCEnabled) + if (pI830 && pI830->XvMCEnabled) intel_xvmc_finish(xf86Screens[scrnIndex]); #endif I830FreeRec(xf86Screens[scrnIndex]); diff --git a/src/i830_exa.c b/src/i830_exa.c index 9b5bb93..2c807c5 100644 --- a/src/i830_exa.c +++ b/src/i830_exa.c @@ -170,6 +170,8 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg) if (pPixmap->drawable.bitsPerPixel == 24) I830FALLBACK("solid 24bpp unsupported!\n"); + i830_exa_check_pitch_2d(pPixmap); + offset = exaGetPixmapOffset(pPixmap); pitch = exaGetPixmapPitch(pPixmap); @@ -255,6 +257,9 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, if (!EXA_PM_IS_SOLID(&pSrcPixmap->drawable, planemask)) I830FALLBACK("planemask is not solid"); + i830_exa_check_pitch_2d(pSrcPixmap); + i830_exa_check_pitch_2d(pDstPixmap); + pI830->pSrcPixmap = pSrcPixmap; pI830->BR[13] = I830CopyROP[alu] << 16; diff --git a/src/i830_lvds.c b/src/i830_lvds.c index a5004b4..1562c21 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -1366,9 +1366,10 @@ i830_lvds_init(ScrnInfoPtr pScrn) /* * Default to filling the whole screen if the mode is less than the - * native size, without breaking aspect ratio. + * native size. (Change default to origin FULL mode, i8xx can only work + * in that mode for now.) */ - dev_priv->fitting_mode = FULL_ASPECT; + dev_priv->fitting_mode = FULL; return; diff --git a/src/i830_render.c b/src/i830_render.c index 195e9a8..3a959e8 100644 --- a/src/i830_render.c +++ b/src/i830_render.c @@ -398,6 +398,11 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture, Bool is_affine_src, is_affine_mask; Bool is_nearest = FALSE; + i830_exa_check_pitch_3d(pSrc); + if (pMask) + i830_exa_check_pitch_3d(pMask); + i830_exa_check_pitch_3d(pDst); + IntelEmitInvarientState(pScrn); *pI830->last_3d = LAST_3D_RENDER; diff --git a/src/i915_render.c b/src/i915_render.c index 2b9ed04..4a02cf5 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -323,6 +323,11 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, Bool is_affine_src, is_affine_mask; Bool is_nearest = FALSE; + i830_exa_check_pitch_3d(pSrc); + if (pMask) + i830_exa_check_pitch_3d(pMask); + i830_exa_check_pitch_3d(pDst); + IntelEmitInvarientState(pScrn); *pI830->last_3d = LAST_3D_RENDER;