[Intel-gfx] [PATCH] Make driver compile for 1.6 Xserver series again.
Matthias Hopf
mhopf at suse.de
Tue Aug 17 18:05:02 CEST 2010
Signed-off-by: Matthias Hopf <mhopf at suse.de>
---
src/i915_render.c | 4 ++++
src/i965_render.c | 4 ++++
uxa/uxa-accel.c | 2 ++
uxa/uxa-render.c | 8 ++++++++
4 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/i915_render.c b/src/i915_render.c
index f50b5c9..fafdac5 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -82,8 +82,10 @@ static struct formatinfo i915_tex_formats[] = {
{PICT_x8r8g8b8, MAPSURF_32BIT | MT_32BIT_XRGB8888},
{PICT_a8b8g8r8, MAPSURF_32BIT | MT_32BIT_ABGR8888},
{PICT_x8b8g8r8, MAPSURF_32BIT | MT_32BIT_XBGR8888},
+#if XORG_VERSION_CURRENT >= 10699900
{PICT_a2r10g10b10, MAPSURF_32BIT | MT_32BIT_ARGB2101010},
{PICT_a2b10g10r10, MAPSURF_32BIT | MT_32BIT_ABGR2101010},
+#endif
{PICT_r5g6b5, MAPSURF_16BIT | MT_16BIT_RGB565},
{PICT_a1r5g5b5, MAPSURF_16BIT | MT_16BIT_ARGB1555},
{PICT_a4r4g4b4, MAPSURF_16BIT | MT_16BIT_ARGB4444},
@@ -156,10 +158,12 @@ static Bool i915_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
case PICT_x1r5g5b5:
*dst_format = COLR_BUF_ARGB1555;
break;
+#if XORG_VERSION_CURRENT >= 10699900
case PICT_a2r10g10b10:
case PICT_x2r10g10b10:
*dst_format = COLR_BUF_ARGB2AAA;
break;
+#endif
case PICT_a8:
*dst_format = COLR_BUF_8BIT;
break;
diff --git a/src/i965_render.c b/src/i965_render.c
index 37a7ab7..15fbe49 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -117,10 +117,12 @@ static struct formatinfo i965_tex_formats[] = {
{PICT_r8g8b8, BRW_SURFACEFORMAT_R8G8B8_UNORM},
{PICT_r5g6b5, BRW_SURFACEFORMAT_B5G6R5_UNORM},
{PICT_a1r5g5b5, BRW_SURFACEFORMAT_B5G5R5A1_UNORM},
+#if XORG_VERSION_CURRENT >= 10699900
{PICT_a2r10g10b10, BRW_SURFACEFORMAT_B10G10R10A2_UNORM},
{PICT_x2r10g10b10, BRW_SURFACEFORMAT_B10G10R10X2_UNORM},
{PICT_a2b10g10r10, BRW_SURFACEFORMAT_R10G10B10A2_UNORM},
{PICT_x2r10g10b10, BRW_SURFACEFORMAT_B10G10R10X2_UNORM},
+#endif
{PICT_a4r4g4b4, BRW_SURFACEFORMAT_B4G4R4A4_UNORM},
};
@@ -169,10 +171,12 @@ static Bool i965_get_dest_format(PicturePtr dest_picture, uint32_t * dst_format)
case PICT_x8b8g8r8:
*dst_format = BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
break;
+#if XORG_VERSION_CURRENT >= 10699900
case PICT_a2r10g10b10:
case PICT_x2r10g10b10:
*dst_format = BRW_SURFACEFORMAT_B10G10R10A2_UNORM;
break;
+#endif
case PICT_r5g6b5:
*dst_format = BRW_SURFACEFORMAT_B5G6R5_UNORM;
break;
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index a2ad651..a5066c8 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -47,7 +47,9 @@ format_for_depth(int depth)
case 16: return PICT_r5g6b5;
default:
case 24: return PICT_x8r8g8b8;
+#if XORG_VERSION_CURRENT >= 10699900
case 30: return PICT_x2r10g10b10;
+#endif
case 32: return PICT_a8r8g8b8;
}
}
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 3194d23..fd8eb93 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -108,6 +108,7 @@ op_to_string(CARD8 op)
/*
* Operators only available in version 0.2
*/
+#if RENDER_MAJOR >= 1 || RENDER_MINOR >= 2
C(DisjointClear);
C(DisjointSrc);
C(DisjointDst);
@@ -133,10 +134,12 @@ op_to_string(CARD8 op)
C(ConjointAtop);
C(ConjointAtopReverse);
C(ConjointXor);
+#endif
/*
* Operators only available in version 0.11
*/
+#if RENDER_MAJOR >= 1 || RENDER_MINOR >= 11
C(Multiply);
C(Screen);
C(Overlay);
@@ -152,6 +155,7 @@ op_to_string(CARD8 op)
C(HSLSaturation);
C(HSLColor);
C(HSLLuminosity);
+#endif
default: return "garbage";
#undef C
}
@@ -237,11 +241,13 @@ uxa_get_pixel_from_rgba(CARD32 * pixel,
gshift = rbits;
bshift = gshift + gbits;
ashift = bshift + bbits;
+#if XORG_VERSION_CURRENT >= 10699900
} else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) {
ashift = 0;
rshift = abits;
gshift = rshift + rbits;
bshift = gshift + gbits;
+#endif
} else {
return FALSE;
}
@@ -283,6 +289,7 @@ uxa_get_rgba_from_pixel(CARD32 pixel,
gshift = rbits;
bshift = gshift + gbits;
ashift = bshift + bbits;
+#if XORG_VERSION_CURRENT >= 10699900
} else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) {
ashift = 0;
rshift = abits;
@@ -290,6 +297,7 @@ uxa_get_rgba_from_pixel(CARD32 pixel,
rshift = PICT_FORMAT_BPP(format) - (rbits+gbits+bbits);
gshift = rshift + rbits;
bshift = gshift + gbits;
+#endif
} else {
return FALSE;
}
--
1.6.0.2
More information about the Intel-gfx
mailing list