summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_context.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_tex.c7
-rw-r--r--xc/lib/GL/mesa/src/drv/r128/r128_texstate.c6
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h4
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h10
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_drv.h7
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_state.c2
7 files changed, 35 insertions, 5 deletions
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_context.c b/xc/lib/GL/mesa/src/drv/r128/r128_context.c
index 0f4875f2a..56cc21103 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_context.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_context.c
@@ -38,6 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "simple_list.h"
#include "imports.h"
#include "matrix.h"
+#include "extensions.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -209,6 +210,9 @@ GLboolean r128CreateContext( const __GLcontextModes *glVisual,
_swrast_allow_vertex_fog( ctx, GL_TRUE );
driInitExtensions( ctx, card_extensions, GL_TRUE );
+ if (sPriv->drmMinor >= 4)
+ _mesa_enable_extension( ctx, "GL_MESA_ycbcr_texture" );
+
r128InitVB( ctx );
r128InitTriFuncs( ctx );
r128DDInitDriverFuncs( ctx );
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
index b091d1849..3f771dadc 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_tex.c
@@ -256,6 +256,13 @@ r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_COLOR_INDEX16_EXT:
return &_mesa_texformat_ci8;
+ case GL_YCBCR_MESA:
+ if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
+ type == GL_UNSIGNED_BYTE)
+ return &_mesa_texformat_ycbcr;
+ else
+ return &_mesa_texformat_ycbcr_rev;
+
default:
_mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ );
return NULL;
diff --git a/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c b/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c
index 45c805a19..0ddcaa598 100644
--- a/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c
+++ b/xc/lib/GL/mesa/src/drv/r128/r128_texstate.c
@@ -79,6 +79,12 @@ static void r128SetTexImages( r128ContextPtr rmesa,
case MESA_FORMAT_CI8:
t->textureFormat = R128_DATATYPE_CI8;
break;
+ case MESA_FORMAT_YCBCR:
+ t->textureFormat = R128_DATATYPE_YVYU422;
+ break;
+ case MESA_FORMAT_YCBCR_REV:
+ t->textureFormat = R128_DATATYPE_VYUY422;
+ break;
default:
_mesa_problem(rmesa->glCtx, "Bad texture format in %s", __FUNCTION__);
};
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
index 3968bd579..3e0dc7459 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
+++ b/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_reg.h
@@ -1287,8 +1287,8 @@
# define R128_DATATYPE_Y8 (8 << 16)
# define R128_DATATYPE_RGB8 (9 << 16)
# define R128_DATATYPE_CI16 (10 << 16)
-# define R128_DATATYPE_YUV422 (11 << 16)
-# define R128_DATATYPE_YUV422_2 (12 << 16)
+# define R128_DATATYPE_YVYU422 (11 << 16)
+# define R128_DATATYPE_VYUY422 (12 << 16)
# define R128_DATATYPE_AYUV444 (14 << 16)
# define R128_DATATYPE_ARGB4444 (15 << 16)
# define R128_PALLETE_EITHER (0 << 20)
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h
index f23f46eef..94e43d739 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128.h
@@ -47,13 +47,17 @@
#define DRIVER_NAME "r128"
#define DRIVER_DESC "ATI Rage 128"
-#define DRIVER_DATE "20021029"
+#define DRIVER_DATE "20030526"
#define DRIVER_MAJOR 2
-#define DRIVER_MINOR 3
+#define DRIVER_MINOR 4
#define DRIVER_PATCHLEVEL 0
-
+/* Interface history:
+ *
+ * ?? - ??
+ * 2.4 - Add support for ycbcr textures (no new ioctls)
+ */
#define DRIVER_IOCTLS \
[DRM_IOCTL_NR(DRM_IOCTL_DMA)] = { r128_cce_buffers, 1, 0 }, \
[DRM_IOCTL_NR(DRM_IOCTL_R128_INIT)] = { r128_cce_init, 1, 1 }, \
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_drv.h b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_drv.h
index 3dee2e943..9f96fcd0a 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_drv.h
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_drv.h
@@ -343,13 +343,20 @@ extern int r128_cce_indirect( DRM_IOCTL_ARGS );
#define R128_CCE_VC_CNTL_PRIM_WALK_RING 0x00000030
#define R128_CCE_VC_CNTL_NUM_SHIFT 16
+#define R128_DATATYPE_VQ 0
+#define R128_DATATYPE_CI4 1
#define R128_DATATYPE_CI8 2
#define R128_DATATYPE_ARGB1555 3
#define R128_DATATYPE_RGB565 4
#define R128_DATATYPE_RGB888 5
#define R128_DATATYPE_ARGB8888 6
#define R128_DATATYPE_RGB332 7
+#define R128_DATATYPE_Y8 8
#define R128_DATATYPE_RGB8 9
+#define R128_DATATYPE_CI16 10
+#define R128_DATATYPE_YVYU422 11
+#define R128_DATATYPE_VYUY422 12
+#define R128_DATATYPE_AYUV444 14
#define R128_DATATYPE_ARGB4444 15
/* Constants */
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_state.c b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_state.c
index 8b9e97cff..27720cff1 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_state.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/shared/drm/kernel/r128_state.c
@@ -802,6 +802,8 @@ static int r128_cce_dispatch_blit( DRMFILE filp,
case R128_DATATYPE_ARGB1555:
case R128_DATATYPE_RGB565:
case R128_DATATYPE_ARGB4444:
+ case R128_DATATYPE_YVYU422:
+ case R128_DATATYPE_VYUY422:
dword_shift = 1;
break;
case R128_DATATYPE_CI8: