xf86-video-intel: 2 commits - src/common.h src/i830.h src/i830_render.c src/i830_uxa.c src/i915_render.c src/i965_render.c

Eric Anholt anholt at kemper.freedesktop.org
Thu Nov 5 15:33:29 PST 2009


 src/common.h      |    7 ---
 src/i830.h        |   51 ++++++++++++++++--------
 src/i830_render.c |   75 +++++++++++++++++++++++------------
 src/i830_uxa.c    |   58 ++++++++++++++++++---------
 src/i915_render.c |  113 +++++++++++++++++++++++++++++++++++-------------------
 src/i965_render.c |  107 ++++++++++++++++++++++++++++++++++-----------------
 6 files changed, 271 insertions(+), 140 deletions(-)

New commits:
commit d0e08fe611681fcc840d1b9ee8d49acdf50f7e58
Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Mon Oct 26 13:15:24 2009 +0000

    Kill some more #defines only needed for User-Modesetting
    
    Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
    Signed-off-by: Eric Anholt <eric at anholt.net>

diff --git a/src/common.h b/src/common.h
index 5bc79e5..b9269b5 100644
--- a/src/common.h
+++ b/src/common.h
@@ -366,12 +366,6 @@ extern int I810_DEBUG;
 #define IS_I915(pI810) (IS_I915G(pI810) || IS_I915GM(pI810) || IS_I945G(pI810) || IS_I945GM(pI810) || IS_G33CLASS(pI810))
 
 #define IS_MOBILE(pI810) (IS_I830(pI810) || IS_I85X(pI810) || IS_I915GM(pI810) || IS_I945GM(pI810) || IS_I965GM(pI810) || IS_GM45(pI810) || IS_IGD(pI810) || IS_IGDNG_M(pI810))
-/* mark chipsets for using gfx VM offset for overlay */
-#define OVERLAY_NOPHYSICAL(pI810) (IS_G33CLASS(pI810) || IS_I965G(pI810))
-/* mark chipsets without overlay hw */
-#define OVERLAY_NOEXIST(pI810) (IS_G4X(pI810) || IS_IGDNG(pI810))
-/* dsparb controlled by hw only */
-#define DSPARB_HWCONTROL(pI810) (IS_G4X(pI810) || IS_IGDNG(pI810))
 /* supports Y tiled surfaces (pre-965 Mesa isn't ready yet) */
 #define SUPPORTS_YTILING(pI810) (IS_I965G(intel))
 
@@ -385,7 +379,6 @@ extern int I810_DEBUG;
 #define MAX_SCRATCH_BUFFER_SIZE		KB(64)
 #define HWCURSOR_SIZE			GTT_PAGE_SIZE
 #define HWCURSOR_SIZE_ARGB		GTT_PAGE_SIZE * 4
-#define OVERLAY_SIZE			GTT_PAGE_SIZE
 
 /* Use a 64x64 HW cursor */
 #define I810_CURSOR_X			64
commit 8ff2a6496413e6b12fad9352f4bd9b6736bda56c
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Oct 21 13:30:38 2009 -0700

    Remove flow-control macros for fallbacks in the 2D driver.
    
    It's poor style, and has confused new developers.

diff --git a/src/i830.h b/src/i830.h
index 47f5526..81504fa 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -423,27 +423,46 @@ i830_get_transformed_coordinates_3d(int x, int y, PictTransformPtr transform,
 
 void i830_enter_render(ScrnInfoPtr);
 
-#define I830FALLBACK(s, arg...)				\
-do {							\
-    if (intel_get_screen_private(scrn)->fallback_debug) { \
-	xf86DrvMsg(scrn->scrnIndex, X_INFO,		\
-		   "fallback: " s "\n", ##arg);	\
-    }							\
-    return FALSE;					\
-} while(0)
+static inline void
+intel_debug_fallback(ScrnInfoPtr scrn, char *format, ...)
+{
+	intel_screen_private *intel = intel_get_screen_private(scrn);
+	va_list ap;
+
+	va_start(ap, format);
+	if (intel->fallback_debug) {
+		xf86DrvMsg(scrn->scrnIndex, X_INFO, "fallback: ");
+		LogVMessageVerb(X_INFO, 1, format, ap);
+	}
+	va_end(ap);
+}
 
 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)) I830FALLBACK("pitch exceeds 2d limit 32K\n");\
-} while(0)
+static inline Bool
+intel_check_pitch_2d(PixmapPtr pixmap)
+{
+	uint32_t pitch = intel_get_pixmap_pitch(pixmap);
+	if (pitch > KB(32)) {
+		ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+		intel_debug_fallback(scrn, "pitch exceeds 2d limit 32K\n");
+		return FALSE;
+	}
+	return TRUE;
+}
 
 /* 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)) I830FALLBACK("pitch exceeds 3d limit 8K\n");\
-} while(0)
+static inline Bool
+intel_check_pitch_3d(PixmapPtr pixmap)
+{
+	uint32_t pitch = intel_get_pixmap_pitch(pixmap);
+	if (pitch > KB(8)) {
+		ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+		intel_debug_fallback(scrn, "pitch exceeds 3d limit 8K\n");
+		return FALSE;
+	}
+	return TRUE;
+}
 
 /**
  * Little wrapper around drm_intel_bo_reloc to return the initial value you
diff --git a/src/i830_render.c b/src/i830_render.c
index b141ba4..7fe528e 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -143,6 +143,8 @@ static struct formatinfo i830_tex_formats[] = {
 
 static Bool i830_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 {
+	ScrnInfoPtr scrn;
+
 	switch (dest_picture->format) {
 	case PICT_a8r8g8b8:
 	case PICT_x8r8g8b8:
@@ -163,14 +165,10 @@ static Bool i830_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 		*dst_format = COLR_BUF_ARGB4444;
 		break;
 	default:
-		{
-			ScrnInfoPtr scrn;
-
-			scrn =
-			    xf86Screens[dest_picture->pDrawable->pScreen->myNum];
-			I830FALLBACK("Unsupported dest format 0x%x\n",
+		scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+		intel_debug_fallback(scrn, "Unsupported dest format 0x%x\n",
 				     (int)dest_picture->format);
-		}
+		return FALSE;
 	}
 	*dst_format |= DSTORG_HORT_BIAS(0x8) | DSTORG_VERT_BIAS(0x8);
 	return TRUE;
@@ -225,13 +223,17 @@ static Bool i830_get_blend_cntl(ScrnInfoPtr scrn, int op, PicturePtr mask,
 static Bool i830_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 					 int unit)
 {
-	if (picture->repeatType > RepeatReflect)
-		I830FALLBACK("Unsupported picture repeat %d\n",
+	if (picture->repeatType > RepeatReflect) {
+		intel_debug_fallback(scrn, "Unsupported picture repeat %d\n",
 			     picture->repeatType);
+		return FALSE;
+	}
 
 	if (picture->filter != PictFilterNearest &&
 	    picture->filter != PictFilterBilinear) {
-		I830FALLBACK("Unsupported filter 0x%x\n", picture->filter);
+		intel_debug_fallback(scrn, "Unsupported filter 0x%x\n",
+				     picture->filter);
+		return FALSE;
 	}
 
 	if (picture->pDrawable) {
@@ -239,8 +241,12 @@ static Bool i830_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 
 		w = picture->pDrawable->width;
 		h = picture->pDrawable->height;
-		if ((w > 2048) || (h > 2048))
-			I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
+		if ((w > 2048) || (h > 2048)) {
+			intel_debug_fallback(scrn,
+					     "Picture w/h too large (%dx%d)\n",
+					     w, h);
+			return FALSE;
+		}
 
 		for (i = 0;
 		     i < sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]);
@@ -249,8 +255,12 @@ static Bool i830_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 				break;
 		}
 		if (i == sizeof(i830_tex_formats) / sizeof(i830_tex_formats[0]))
-			I830FALLBACK("Unsupported picture format 0x%x\n",
-				     (int)picture->format);
+		{
+			intel_debug_fallback(scrn, "Unsupported picture format "
+					     "0x%x\n",
+					     (int)picture->format);
+			return FALSE;
+		}
 	}
 
 	return TRUE;
@@ -375,8 +385,11 @@ i830_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
 	uint32_t tmp1;
 
 	/* Check for unsupported compositing operations. */
-	if (op >= sizeof(i830_blend_op) / sizeof(i830_blend_op[0]))
-		I830FALLBACK("Unsupported Composite op 0x%x\n", op);
+	if (op >= sizeof(i830_blend_op) / sizeof(i830_blend_op[0])) {
+		intel_debug_fallback(scrn, "Unsupported Composite op 0x%x\n",
+				     op);
+		return FALSE;
+	}
 
 	if (mask_picture != NULL && mask_picture->componentAlpha &&
 	    PICT_FORMAT_RGB(mask_picture->format)) {
@@ -391,14 +404,20 @@ i830_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
 			     "alpha and source value blending.\n");
 	}
 
-	if (!i830_check_composite_texture(scrn, source_picture, 0))
-		I830FALLBACK("Check Src picture texture\n");
+	if (!i830_check_composite_texture(scrn, source_picture, 0)) {
+		intel_debug_fallback(scrn, "Check Src picture texture\n");
+		return FALSE;
+	}
 	if (mask_picture != NULL
-	    && !i830_check_composite_texture(scrn, mask_picture, 1))
-		I830FALLBACK("Check Mask picture texture\n");
+	    && !i830_check_composite_texture(scrn, mask_picture, 1)) {
+		intel_debug_fallback(scrn, "Check Mask picture texture\n");
+		return FALSE;
+	}
 
-	if (!i830_get_dest_format(dest_picture, &tmp1))
-		I830FALLBACK("Get Color buffer format\n");
+	if (!i830_get_dest_format(dest_picture, &tmp1)) {
+		intel_debug_fallback(scrn, "Get Color buffer format\n");
+		return FALSE;
+	}
 
 	return TRUE;
 }
@@ -418,10 +437,14 @@ i830_prepare_composite(int op, PicturePtr source_picture,
 	intel->render_dest_picture = dest_picture;
 	intel->render_dest = dest;
 
-	i830_exa_check_pitch_3d(source);
-	if (mask)
-		i830_exa_check_pitch_3d(mask);
-	i830_exa_check_pitch_3d(dest);
+	if (!intel_check_pitch_3d(source))
+		return FALSE;
+	if (mask) {
+		if (!intel_check_pitch_3d(mask))
+			return FALSE;
+	}
+	if (!intel_check_pitch_3d(dest))
+		return FALSE;
 
 	if (!i830_get_dest_format(dest_picture, &intel->render_dest_format))
 		return FALSE;
diff --git a/src/i830_uxa.c b/src/i830_uxa.c
index 8c26d09..0cf87c1 100644
--- a/src/i830_uxa.c
+++ b/src/i830_uxa.c
@@ -110,16 +110,21 @@ i830_get_aperture_space(ScrnInfoPtr scrn, drm_intel_bo ** bo_table,
 {
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 
-	if (intel->batch_bo == NULL)
-		I830FALLBACK("VT inactive\n");
+	if (intel->batch_bo == NULL) {
+		intel_debug_fallback(scrn, "VT inactive\n");
+		return FALSE;
+	}
 
 	bo_table[0] = intel->batch_bo;
 	if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) != 0) {
 		intel_batch_flush(scrn, FALSE);
 		bo_table[0] = intel->batch_bo;
 		if (drm_intel_bufmgr_check_aperture_space(bo_table, num_bos) !=
-		    0)
-			I830FALLBACK("Couldn't get aperture space for BOs\n");
+		    0) {
+			intel_debug_fallback(scrn, "Couldn't get aperture "
+					    "space for BOs\n");
+			return FALSE;
+		}
 	}
 	return TRUE;
 }
@@ -152,21 +157,30 @@ i830_uxa_prepare_solid(PixmapPtr pixmap, int alu, Pixel planemask, Pixel fg)
 		i830_get_pixmap_bo(pixmap),
 	};
 
-	if (!UXA_PM_IS_SOLID(&pixmap->drawable, planemask))
-		I830FALLBACK("planemask is not solid");
+	if (!UXA_PM_IS_SOLID(&pixmap->drawable, planemask)) {
+		intel_debug_fallback(scrn, "planemask is not solid\n");
+		return FALSE;
+	}
 
-	if (pixmap->drawable.bitsPerPixel == 24)
-		I830FALLBACK("solid 24bpp unsupported!\n");
+	if (pixmap->drawable.bitsPerPixel == 24) {
+		intel_debug_fallback(scrn, "solid 24bpp unsupported!\n");
+		return FALSE;
+	}
 
-	if (pixmap->drawable.bitsPerPixel < 8)
-		I830FALLBACK("under 8bpp pixmaps unsupported\n");
+	if (pixmap->drawable.bitsPerPixel < 8) {
+		intel_debug_fallback(scrn, "under 8bpp pixmaps unsupported\n");
+		return FALSE;
+	}
 
-	i830_exa_check_pitch_2d(pixmap);
+	if (!intel_check_pitch_2d(pixmap))
+		return FALSE;
 
 	pitch = i830_pixmap_pitch(pixmap);
 
-	if (!i830_pixmap_pitch_is_aligned(pixmap))
-		I830FALLBACK("pixmap pitch not aligned");
+	if (!i830_pixmap_pitch_is_aligned(pixmap)) {
+		intel_debug_fallback(scrn, "pixmap pitch not aligned");
+		return FALSE;
+	}
 
 	if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table)))
 		return FALSE;
@@ -247,17 +261,23 @@ i830_uxa_prepare_copy(PixmapPtr source, PixmapPtr dest, int xdir,
 		i830_get_pixmap_bo(dest),
 	};
 
-	if (!UXA_PM_IS_SOLID(&source->drawable, planemask))
-		I830FALLBACK("planemask is not solid");
+	if (!UXA_PM_IS_SOLID(&source->drawable, planemask)) {
+		intel_debug_fallback(scrn, "planemask is not solid");
+		return FALSE;
+	}
 
-	if (dest->drawable.bitsPerPixel < 8)
-		I830FALLBACK("under 8bpp pixmaps unsupported\n");
+	if (dest->drawable.bitsPerPixel < 8) {
+		intel_debug_fallback(scrn, "under 8bpp pixmaps unsupported\n");
+		return FALSE;
+	}
 
 	if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table)))
 		return FALSE;
 
-	i830_exa_check_pitch_2d(source);
-	i830_exa_check_pitch_2d(dest);
+	if (!intel_check_pitch_2d(source))
+		return FALSE;
+	if (!intel_check_pitch_2d(dest))
+		return FALSE;
 
 	intel->render_source = source;
 
diff --git a/src/i915_render.c b/src/i915_render.c
index 0a9c1e0..6a936be 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -137,6 +137,8 @@ static uint32_t i915_get_blend_cntl(int op, PicturePtr mask,
 
 static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 {
+	ScrnInfoPtr scrn;
+
 	switch (dest_picture->format) {
 	case PICT_a8r8g8b8:
 	case PICT_x8r8g8b8:
@@ -157,14 +159,11 @@ static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 		*dst_format = COLR_BUF_ARGB4444;
 		break;
 	default:
-		{
-			ScrnInfoPtr scrn;
-
-			scrn =
-			    xf86Screens[dest_picture->pDrawable->pScreen->myNum];
-			I830FALLBACK("Unsupported dest format 0x%x\n",
+		scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
+		intel_debug_fallback(scrn,
+				     "Unsupported dest format 0x%x\n",
 				     (int)dest_picture->format);
-		}
+		return FALSE;
 	}
 	return TRUE;
 }
@@ -172,21 +171,30 @@ static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 static Bool i915_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 					 int unit)
 {
-	if (picture->repeatType > RepeatReflect)
-		I830FALLBACK("Unsupported picture repeat %d\n",
+	if (picture->repeatType > RepeatReflect) {
+		intel_debug_fallback(scrn, "Unsupported picture repeat %d\n",
 			     picture->repeatType);
+		return FALSE;
+	}
 
 	if (picture->filter != PictFilterNearest &&
-	    picture->filter != PictFilterBilinear)
-		I830FALLBACK("Unsupported filter 0x%x\n", picture->filter);
+	    picture->filter != PictFilterBilinear) {
+		intel_debug_fallback(scrn, "Unsupported filter 0x%x\n",
+				     picture->filter);
+		return FALSE;
+	}
 
 	if (picture->pDrawable) {
 		int w, h, i;
 
 		w = picture->pDrawable->width;
 		h = picture->pDrawable->height;
-		if ((w > 2048) || (h > 2048))
-			I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
+		if ((w > 2048) || (h > 2048)) {
+			intel_debug_fallback(scrn,
+					     "Picture w/h too large (%dx%d)\n",
+					     w, h);
+			return FALSE;
+		}
 
 		for (i = 0;
 		     i < sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]);
@@ -195,8 +203,12 @@ static Bool i915_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 				break;
 		}
 		if (i == sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]))
-			I830FALLBACK("Unsupported picture format 0x%x\n",
-				     (int)picture->format);
+		{
+			intel_debug_fallback(scrn, "Unsupported picture format "
+					     "0x%x\n",
+					     (int)picture->format);
+			return FALSE;
+		}
 	}
 
 	return TRUE;
@@ -210,8 +222,11 @@ i915_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
 	uint32_t tmp1;
 
 	/* Check for unsupported compositing operations. */
-	if (op >= sizeof(i915_blend_op) / sizeof(i915_blend_op[0]))
-		I830FALLBACK("Unsupported Composite op 0x%x\n", op);
+	if (op >= sizeof(i915_blend_op) / sizeof(i915_blend_op[0])) {
+		intel_debug_fallback(scrn, "Unsupported Composite op 0x%x\n",
+				     op);
+		return FALSE;
+	}
 	if (mask_picture != NULL && mask_picture->componentAlpha &&
 	    PICT_FORMAT_RGB(mask_picture->format)) {
 		/* Check if it's component alpha that relies on a source alpha
@@ -219,20 +234,29 @@ i915_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
 		 * into the single source value that we get to blend with.
 		 */
 		if (i915_blend_op[op].src_alpha &&
-		    (i915_blend_op[op].src_blend != BLENDFACT_ZERO))
-			I830FALLBACK("Component alpha not supported with "
-				     "source alpha and source value "
-				     "blending.\n");
+		    (i915_blend_op[op].src_blend != BLENDFACT_ZERO)) {
+			intel_debug_fallback(scrn,
+					     "Component alpha not supported "
+					     "with source alpha and source "
+					     "value blending.\n");
+			return FALSE;
+		}
 	}
 
-	if (!i915_check_composite_texture(scrn, source_picture, 0))
-		I830FALLBACK("Check Src picture texture\n");
+	if (!i915_check_composite_texture(scrn, source_picture, 0)) {
+		intel_debug_fallback(scrn, "Check Src picture texture\n");
+		return FALSE;
+	}
 	if (mask_picture != NULL
-	    && !i915_check_composite_texture(scrn, mask_picture, 1))
-		I830FALLBACK("Check Mask picture texture\n");
+	    && !i915_check_composite_texture(scrn, mask_picture, 1)) {
+		intel_debug_fallback(scrn, "Check Mask picture texture\n");
+		return FALSE;
+	}
 
-	if (!i915_get_dest_format(dest_picture, &tmp1))
-		I830FALLBACK("Get Color buffer format\n");
+	if (!i915_get_dest_format(dest_picture, &tmp1)) {
+		intel_debug_fallback(scrn, "Get Color buffer format\n");
+		return FALSE;
+	}
 
 	return TRUE;
 }
@@ -256,8 +280,10 @@ static Bool i915_texture_setup(PicturePtr picture, PixmapPtr pixmap, int unit)
 		if (i915_tex_formats[i].fmt == picture->format)
 			break;
 	}
-	if (i == sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]))
-		I830FALLBACK("unknown texture format\n");
+	if (i == sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0])) {
+		intel_debug_fallback(scrn, "unknown texture format\n");
+		return FALSE;
+	}
 	format = i915_tex_formats[i].card_fmt;
 
 	switch (picture->repeatType) {
@@ -288,7 +314,9 @@ static Bool i915_texture_setup(PicturePtr picture, PixmapPtr pixmap, int unit)
 		break;
 	default:
 		filter = 0;
-		I830FALLBACK("Bad filter 0x%x\n", picture->filter);
+		intel_debug_fallback(scrn, "Bad filter 0x%x\n",
+				     picture->filter);
+		return FALSE;
 	}
 
 	/* offset filled in at emit time */
@@ -336,10 +364,14 @@ i915_prepare_composite(int op, PicturePtr source_picture,
 	intel->render_dest_picture = dest_picture;
 	intel->render_dest = dest;
 
-	i830_exa_check_pitch_3d(source);
-	if (mask)
-		i830_exa_check_pitch_3d(mask);
-	i830_exa_check_pitch_3d(dest);
+	if (!intel_check_pitch_3d(source))
+		return FALSE;
+	if (mask) {
+		if (!intel_check_pitch_3d(mask))
+			return FALSE;
+	}
+	if (!intel_check_pitch_3d(dest))
+		return FALSE;
 
 	if (!i915_get_dest_format(dest_picture,
 				  &intel->i915_render_state.dst_format))
@@ -348,8 +380,10 @@ i915_prepare_composite(int op, PicturePtr source_picture,
 	if (!i830_get_aperture_space(scrn, bo_table, ARRAY_SIZE(bo_table)))
 		return FALSE;
 
-	if (!i915_texture_setup(source_picture, source, 0))
-		I830FALLBACK("fail to setup src texture\n");
+	if (!i915_texture_setup(source_picture, source, 0)) {
+		intel_debug_fallback(scrn, "fail to setup src texture\n");
+		return FALSE;
+	}
 
 	intel->dst_coord_adjust = 0;
 	intel->src_coord_adjust = 0;
@@ -357,8 +391,11 @@ i915_prepare_composite(int op, PicturePtr source_picture,
 	if (source_picture->filter == PictFilterNearest)
 		intel->dst_coord_adjust = -0.125;
 	if (mask != NULL) {
-		if (!i915_texture_setup(mask_picture, mask, 1))
-			I830FALLBACK("fail to setup mask texture\n");
+		if (!i915_texture_setup(mask_picture, mask, 1)) {
+			intel_debug_fallback(scrn,
+					     "fail to setup mask texture\n");
+			return FALSE;
+		}
 
 		if (mask_picture->filter == PictFilterNearest)
 			intel->dst_coord_adjust = -0.125;
diff --git a/src/i965_render.c b/src/i965_render.c
index ce9b235..09a71bf 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -175,8 +175,9 @@ static Bool i965_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 		*dst_format = BRW_SURFACEFORMAT_B4G4R4A4_UNORM;
 		break;
 	default:
-		I830FALLBACK("Unsupported dest format 0x%x\n",
-			     (int)dest_picture->format);
+		intel_debug_fallback(scrn, "Unsupported dest format 0x%x\n",
+				     (int)dest_picture->format);
+		return FALSE;
 	}
 
 	return TRUE;
@@ -185,13 +186,18 @@ static Bool i965_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
 static Bool i965_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 					 int unit)
 {
-	if (picture->repeatType > RepeatReflect)
-		I830FALLBACK("extended repeat (%d) not supported\n",
-			     picture->repeatType);
+	if (picture->repeatType > RepeatReflect) {
+		intel_debug_fallback(scrn,
+				     "extended repeat (%d) not supported\n",
+				     picture->repeatType);
+		return FALSE;
+	}
 
 	if (picture->filter != PictFilterNearest &&
 	    picture->filter != PictFilterBilinear) {
-		I830FALLBACK("Unsupported filter 0x%x\n", picture->filter);
+		intel_debug_fallback(scrn, "Unsupported filter 0x%x\n",
+				     picture->filter);
+		return FALSE;
 	}
 
 	if (picture->pDrawable) {
@@ -199,8 +205,12 @@ static Bool i965_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 
 		w = picture->pDrawable->width;
 		h = picture->pDrawable->height;
-		if ((w > 8192) || (h > 8192))
-			I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
+		if ((w > 8192) || (h > 8192)) {
+			intel_debug_fallback(scrn,
+					     "Picture w/h too large (%dx%d)\n",
+					     w, h);
+			return FALSE;
+		}
 
 		for (i = 0;
 		     i < sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]);
@@ -209,8 +219,13 @@ static Bool i965_check_composite_texture(ScrnInfoPtr scrn, PicturePtr picture,
 				break;
 		}
 		if (i == sizeof(i965_tex_formats) / sizeof(i965_tex_formats[0]))
-			I830FALLBACK("Unsupported picture format 0x%x\n",
-				     (int)picture->format);
+		{
+			intel_debug_fallback(scrn,
+					     "Unsupported picture format "
+					     "0x%x\n",
+					     (int)picture->format);
+			return FALSE;
+		}
 	}
 
 	return TRUE;
@@ -224,8 +239,11 @@ i965_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
 	uint32_t tmp1;
 
 	/* Check for unsupported compositing operations. */
-	if (op >= sizeof(i965_blend_op) / sizeof(i965_blend_op[0]))
-		I830FALLBACK("Unsupported Composite op 0x%x\n", op);
+	if (op >= sizeof(i965_blend_op) / sizeof(i965_blend_op[0])) {
+		intel_debug_fallback(scrn,
+				     "Unsupported Composite op 0x%x\n", op);
+		return FALSE;
+	}
 
 	if (mask_picture && mask_picture->componentAlpha &&
 	    PICT_FORMAT_RGB(mask_picture->format)) {
@@ -235,20 +253,28 @@ i965_check_composite(int op, PicturePtr source_picture, PicturePtr mask_picture,
 		 */
 		if (i965_blend_op[op].src_alpha &&
 		    (i965_blend_op[op].src_blend != BRW_BLENDFACTOR_ZERO)) {
-			I830FALLBACK
-			    ("Component alpha not supported with source "
-			     "alpha and source value blending.\n");
+			intel_debug_fallback(scrn,
+					     "Component alpha not supported "
+					     "with source alpha and source "
+					     "value blending.\n");
+			return FALSE;
 		}
 	}
 
-	if (!i965_check_composite_texture(scrn, source_picture, 0))
-		I830FALLBACK("Check Src picture texture\n");
+	if (!i965_check_composite_texture(scrn, source_picture, 0)) {
+		intel_debug_fallback(scrn, "Check Src picture texture\n");
+		return FALSE;
+	}
 	if (mask_picture != NULL
-	    && !i965_check_composite_texture(scrn, mask_picture, 1))
-		I830FALLBACK("Check Mask picture texture\n");
+	    && !i965_check_composite_texture(scrn, mask_picture, 1)) {
+		intel_debug_fallback(scrn, "Check Mask picture texture\n");
+		return FALSE;
+	}
 
-	if (!i965_get_dest_format(dest_picture, &tmp1))
-		I830FALLBACK("Get Color buffer format\n");
+	if (!i965_get_dest_format(dest_picture, &tmp1)) {
+		intel_debug_fallback(scrn, "Get Color buffer format\n");
+		return FALSE;
+	}
 
 	return TRUE;
 
@@ -1440,24 +1466,34 @@ i965_prepare_composite(int op, PicturePtr source_picture,
 	uint32_t *binding_table;
 	drm_intel_bo *binding_table_bo, *surface_state_bo;
 
-	if (composite_op->src_filter < 0)
-		I830FALLBACK("Bad src filter 0x%x\n", source_picture->filter);
+	if (composite_op->src_filter < 0) {
+		intel_debug_fallback(scrn, "Bad src filter 0x%x\n",
+				     source_picture->filter);
+		return FALSE;
+	}
 	composite_op->src_extend =
 	    sampler_state_extend_from_picture(source_picture->repeatType);
-	if (composite_op->src_extend < 0)
-		I830FALLBACK("Bad src repeat 0x%x\n", source_picture->repeatType);
+	if (composite_op->src_extend < 0) {
+		intel_debug_fallback(scrn, "Bad src repeat 0x%x\n",
+				     source_picture->repeatType);
+		return FALSE;
+	}
 
 	if (mask_picture) {
 		composite_op->mask_filter =
 		    sampler_state_filter_from_picture(mask_picture->filter);
-		if (composite_op->mask_filter < 0)
-			I830FALLBACK("Bad mask filter 0x%x\n",
-				     mask_picture->filter);
+		if (composite_op->mask_filter < 0) {
+			intel_debug_fallback(scrn, "Bad mask filter 0x%x\n",
+					     mask_picture->filter);
+			return FALSE;
+		}
 		composite_op->mask_extend =
 		    sampler_state_extend_from_picture(mask_picture->repeatType);
-		if (composite_op->mask_extend < 0)
-			I830FALLBACK("Bad mask repeat 0x%x\n",
-				     mask_picture->repeatType);
+		if (composite_op->mask_extend < 0) {
+			intel_debug_fallback(scrn, "Bad mask repeat 0x%x\n",
+					     mask_picture->repeatType);
+			return FALSE;
+		}
 	} else {
 		composite_op->mask_filter = SAMPLER_STATE_FILTER_NEAREST;
 		composite_op->mask_extend = SAMPLER_STATE_EXTEND_NONE;
@@ -1589,9 +1625,12 @@ i965_prepare_composite(int op, PicturePtr source_picture,
 
 	if (!i965_composite_check_aperture(scrn)) {
 		intel_batch_flush(scrn, FALSE);
-		if (!i965_composite_check_aperture(scrn))
-			I830FALLBACK
-			    ("Couldn't fit render operation in aperture\n");
+		if (!i965_composite_check_aperture(scrn)) {
+			intel_debug_fallback(scrn,
+					     "Couldn't fit render operation "
+					     "in aperture\n");
+			return FALSE;
+		}
 	}
 
 	intel->needs_render_state_emit = TRUE;


More information about the xorg-commit mailing list