summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2010-03-11 15:51:49 +0100
committerLuc Verhaegen <libv@skynet.be>2010-03-11 15:51:49 +0100
commitaa66b6b994ac11701cb29c8b4294276522f6efd0 (patch)
tree34a4e37d582b9cb9d2839756ef3787f782b1476c
parent0ade12c047521b38d1ac6388f4316b57740b8c2a (diff)
Import unichrome dri driver from debian's mesa 7.7-4.7.7.17.7.0
-rw-r--r--configure.ac6
-rw-r--r--src/Makefile.am2
-rw-r--r--src/via_context.c12
-rw-r--r--src/via_ioctl.c1
-rw-r--r--src/via_render.c1
-rw-r--r--src/via_screen.c32
-rw-r--r--src/via_span.c21
-rw-r--r--src/via_state.c3
-rw-r--r--src/via_tex.c123
-rw-r--r--src/via_texcombine.c1
10 files changed, 79 insertions, 123 deletions
diff --git a/configure.ac b/configure.ac
index 0e3273c..ca551fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script
AC_PREREQ(2.57)
-AC_INIT([mesa-dri-unichrome], 7.6.1, [], mesa-dri-unichrome)
+AC_INIT([mesa-dri-unichrome], 7.7.1, [], mesa-dri-unichrome)
AM_INIT_AUTOMAKE([dist-bzip2])
@@ -16,8 +16,8 @@ AC_PROG_CC
AC_HEADER_STDC
PKG_CHECK_MODULES([DRM], [libdrm >= 2.3.0])
-PKG_CHECK_MODULES([DRI], [libmesadri >= 7.5.0 libmesadri < 7.7.0
- libmesadricommon >= 7.5.0 libmesadricommon < 7.7.0])
+PKG_CHECK_MODULES([DRI], [libmesadri >= 7.7.0 libmesadri < 7.8.0
+ libmesadricommon >= 7.7.0 libmesadricommon < 7.8.0])
AC_OUTPUT([
Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 015d4d5..4984403 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,4 +16,4 @@ unichrome_dri_la_SOURCES = \
via_span.c \
via_state.c \
via_texcombine.c \
- via_tris.c
+ via_tris.c
diff --git a/src/via_context.c b/src/via_context.c
index 6eb19ac..ff666a3 100644
--- a/src/via_context.c
+++ b/src/via_context.c
@@ -32,10 +32,8 @@
#include "main/glheader.h"
#include "main/context.h"
-#include "main/matrix.h"
-#include "main/state.h"
+#include "main/formats.h"
#include "main/simple_list.h"
-#include "main/extensions.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
@@ -65,7 +63,7 @@
#define need_GL_ARB_point_parameters
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
-#include "extension_helper.h"
+#include "main/remap_helper.h"
#define DRIVER_DATE "20060710"
@@ -163,24 +161,28 @@ viaInitRenderbuffer(struct via_renderbuffer *vrb, GLenum format,
if (format == GL_RGBA) {
/* Color */
rb->_BaseFormat = GL_RGBA;
+ rb->Format = MESA_FORMAT_ARGB8888;
rb->DataType = GL_UNSIGNED_BYTE;
}
else if (format == GL_DEPTH_COMPONENT16) {
/* Depth */
rb->_BaseFormat = GL_DEPTH_COMPONENT;
/* we always Get/Put 32-bit Z values */
+ rb->Format = MESA_FORMAT_Z16;
rb->DataType = GL_UNSIGNED_INT;
}
else if (format == GL_DEPTH_COMPONENT24) {
/* Depth */
rb->_BaseFormat = GL_DEPTH_COMPONENT;
/* we always Get/Put 32-bit Z values */
+ rb->Format = MESA_FORMAT_Z32;
rb->DataType = GL_UNSIGNED_INT;
}
else {
/* Stencil */
ASSERT(format == GL_STENCIL_INDEX8_EXT);
rb->_BaseFormat = GL_STENCIL_INDEX;
+ rb->Format = MESA_FORMAT_S8;
rb->DataType = GL_UNSIGNED_BYTE;
}
@@ -362,7 +364,7 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
/* Extension strings exported by the Unichrome driver.
*/
-const struct dri_extension card_extensions[] =
+static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_point_parameters", GL_ARB_point_parameters_functions },
diff --git a/src/via_ioctl.c b/src/via_ioctl.c
index 91c94fa..69eac44 100644
--- a/src/via_ioctl.c
+++ b/src/via_ioctl.c
@@ -34,7 +34,6 @@
#include "via_context.h"
#include "via_tris.h"
#include "via_ioctl.h"
-#include "via_state.h"
#include "via_fb.h"
#include "via_3d_reg.h"
diff --git a/src/via_render.c b/src/via_render.c
index f676cc1..896c43d 100644
--- a/src/via_render.c
+++ b/src/via_render.c
@@ -37,7 +37,6 @@
#include "via_context.h"
#include "via_tris.h"
-#include "via_state.h"
#include "via_ioctl.h"
/*
diff --git a/src/via_screen.c b/src/via_screen.c
index 54019fd..115d3fb 100644
--- a/src/via_screen.c
+++ b/src/via_screen.c
@@ -30,17 +30,13 @@
#include "main/context.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
-#include "main/matrix.h"
#include "main/simple_list.h"
#include "vblank.h"
#include "via_state.h"
#include "via_tex.h"
#include "via_span.h"
-#include "via_tris.h"
-#include "via_ioctl.h"
#include "via_screen.h"
-#include "via_fb.h"
#include "via_dri.h"
#include "GL/internal/dri_interface.h"
@@ -62,8 +58,6 @@ DRI_CONF_BEGIN
DRI_CONF_END;
static const GLuint __driNConfigOptions = 3;
-extern const struct dri_extension card_extensions[];
-
static drmBufMapPtr via_create_empty_buffers(void)
{
drmBufMapPtr retval;
@@ -210,7 +204,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap)
{
-#if 000
+#if 0
viaScreenPrivate *screen = (viaScreenPrivate *) driScrnPriv->private;
#endif
@@ -250,7 +244,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
/* XXX check/fix the offset/pitch parameters! */
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA, NULL,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL,
screen->bytesPerPixel,
0, screen->width, driDrawPriv);
viaSetSpanFunctions(frontRb, mesaVis);
@@ -259,7 +253,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA, NULL,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL,
screen->bytesPerPixel,
0, screen->width, driDrawPriv);
viaSetSpanFunctions(backRb, mesaVis);
@@ -268,7 +262,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL,
+ = driNewRenderbuffer(MESA_FORMAT_Z16, NULL,
screen->bytesPerPixel,
0, screen->width, driDrawPriv);
viaSetSpanFunctions(depthRb, mesaVis);
@@ -276,7 +270,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL,
+ = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL,
screen->bytesPerPixel,
0, screen->width, driDrawPriv);
viaSetSpanFunctions(depthRb, mesaVis);
@@ -284,7 +278,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
}
else if (mesaVis->depthBits == 32) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32, NULL,
+ = driNewRenderbuffer(MESA_FORMAT_Z32, NULL,
screen->bytesPerPixel,
0, screen->width, driDrawPriv);
viaSetSpanFunctions(depthRb, mesaVis);
@@ -293,7 +287,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv,
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL,
+ = driNewRenderbuffer(MESA_FORMAT_S8, NULL,
screen->bytesPerPixel,
0, screen->width, driDrawPriv);
viaSetSpanFunctions(stencilRb, mesaVis);
@@ -395,18 +389,6 @@ viaInitScreen(__DRIscreenPrivate *psp)
&psp->drm_version, & drm_expected) )
return NULL;
- /* Calling driInitExtensions here, with a NULL context pointer,
- * does not actually enable the extensions. It just makes sure
- * that all the dispatch offsets for all the extensions that
- * *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create is
- * called, but we can't enable the extensions until we have a
- * context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions( NULL, card_extensions, GL_FALSE );
-
if (!viaInitDriver(psp))
return NULL;
diff --git a/src/via_span.c b/src/via_span.c
index b908f0f..e847164 100644
--- a/src/via_span.c
+++ b/src/via_span.c
@@ -23,6 +23,7 @@
*/
#include "main/glheader.h"
+#include "main/formats.h"
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/colormac.h"
@@ -177,24 +178,22 @@ void viaInitSpanFuncs(GLcontext *ctx)
void
viaSetSpanFunctions(struct via_renderbuffer *vrb, const GLvisual *vis)
{
- if (vrb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- viaInitPointers_565(&vrb->Base);
- }
- else {
- viaInitPointers_8888(&vrb->Base);
- }
+ if (vrb->Base.Format == MESA_FORMAT_RGB565) {
+ viaInitPointers_565(&vrb->Base);
}
- else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
+ else if (vrb->Base.Format == MESA_FORMAT_ARGB8888) {
+ viaInitPointers_8888(&vrb->Base);
+ }
+ else if (vrb->Base.Format == MESA_FORMAT_Z16) {
viaInitDepthPointers_z16(&vrb->Base);
}
- else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
+ else if (vrb->Base.Format == MESA_FORMAT_Z24_S8) {
viaInitDepthPointers_z24_s8(&vrb->Base);
}
- else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT32) {
+ else if (vrb->Base.Format == MESA_FORMAT_Z32) {
viaInitDepthPointers_z32(&vrb->Base);
}
- else if (vrb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
+ else if (vrb->Base.Format == MESA_FORMAT_S8) {
viaInitStencilPointers_z24_s8(&vrb->Base);
}
}
diff --git a/src/via_state.c b/src/via_state.c
index 840e4e4..e65f5fd 100644
--- a/src/via_state.c
+++ b/src/via_state.c
@@ -35,7 +35,6 @@
#include "via_context.h"
#include "via_state.h"
#include "via_tex.h"
-#include "via_tris.h"
#include "via_ioctl.h"
#include "via_3d_reg.h"
@@ -44,8 +43,6 @@
#include "tnl/tnl.h"
#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_pipeline.h"
-
static GLuint ROP[16] = {
HC_HROP_BLACK, /* GL_CLEAR 0 */
diff --git a/src/via_tex.c b/src/via_tex.c
index d2010f0..917f975 100644
--- a/src/via_tex.c
+++ b/src/via_tex.c
@@ -30,25 +30,23 @@
#include "main/macros.h"
#include "main/mtypes.h"
#include "main/enums.h"
+#include "main/formats.h"
#include "main/colortab.h"
#include "main/convolve.h"
#include "main/context.h"
#include "main/mipmap.h"
+#include "main/mm.h"
#include "main/simple_list.h"
-#include "main/texcompress.h"
-#include "main/texformat.h"
#include "main/texobj.h"
#include "main/texstore.h"
-#include "main/mm.h"
#include "via_context.h"
#include "via_fb.h"
#include "via_tex.h"
-#include "via_state.h"
#include "via_ioctl.h"
#include "via_3d_reg.h"
-static const struct gl_texture_format *
+static gl_format
viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
@@ -65,56 +63,56 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
if ( format == GL_BGRA ) {
if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ||
type == GL_UNSIGNED_BYTE ) {
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
}
else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
- return &_mesa_texformat_argb4444;
+ return MESA_FORMAT_ARGB4444;
}
else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) {
- return &_mesa_texformat_argb1555;
+ return MESA_FORMAT_ARGB1555;
}
}
else if ( type == GL_UNSIGNED_BYTE ||
type == GL_UNSIGNED_INT_8_8_8_8_REV ||
type == GL_UNSIGNED_INT_8_8_8_8 ) {
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
}
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
+ return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444;
case 3:
case GL_RGB:
case GL_COMPRESSED_RGB:
if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
- return &_mesa_texformat_rgb565;
+ return MESA_FORMAT_RGB565;
}
else if ( type == GL_UNSIGNED_BYTE ) {
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
}
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
+ return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565;
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
case GL_RGBA4:
case GL_RGBA2:
- return &_mesa_texformat_argb4444;
+ return MESA_FORMAT_ARGB4444;
case GL_RGB5_A1:
- return &_mesa_texformat_argb1555;
+ return MESA_FORMAT_ARGB1555;
case GL_RGB8:
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
case GL_RGB5:
case GL_RGB4:
case GL_R3_G3_B2:
- return &_mesa_texformat_rgb565;
+ return MESA_FORMAT_RGB565;
case GL_ALPHA:
case GL_ALPHA4:
@@ -122,7 +120,7 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
case GL_ALPHA12:
case GL_ALPHA16:
case GL_COMPRESSED_ALPHA:
- return &_mesa_texformat_a8;
+ return MESA_FORMAT_A8;
case 1:
case GL_LUMINANCE:
@@ -131,7 +129,7 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE12:
case GL_LUMINANCE16:
case GL_COMPRESSED_LUMINANCE:
- return &_mesa_texformat_l8;
+ return MESA_FORMAT_L8;
case 2:
case GL_LUMINANCE_ALPHA:
@@ -142,7 +140,7 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
case GL_COMPRESSED_LUMINANCE_ALPHA:
- return &_mesa_texformat_al88;
+ return MESA_FORMAT_AL88;
case GL_INTENSITY:
case GL_INTENSITY4:
@@ -150,35 +148,35 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
case GL_INTENSITY12:
case GL_INTENSITY16:
case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_i8;
+ return MESA_FORMAT_I8;
case GL_YCBCR_MESA:
if (type == GL_UNSIGNED_SHORT_8_8_MESA ||
type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
+ return MESA_FORMAT_YCBCR;
else
- return &_mesa_texformat_ycbcr_rev;
+ return MESA_FORMAT_YCBCR_REV;
case GL_COMPRESSED_RGB_FXT1_3DFX:
- return &_mesa_texformat_rgb_fxt1;
+ return MESA_FORMAT_RGB_FXT1;
case GL_COMPRESSED_RGBA_FXT1_3DFX:
- return &_mesa_texformat_rgba_fxt1;
+ return MESA_FORMAT_RGBA_FXT1;
case GL_RGB_S3TC:
case GL_RGB4_S3TC:
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgb_dxt1;
+ return MESA_FORMAT_RGB_DXT1;
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- return &_mesa_texformat_rgba_dxt1;
+ return MESA_FORMAT_RGBA_DXT1;
case GL_RGBA_S3TC:
case GL_RGBA4_S3TC:
case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
- return &_mesa_texformat_rgba_dxt3;
+ return MESA_FORMAT_RGBA_DXT3;
case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
- return &_mesa_texformat_rgba_dxt5;
+ return MESA_FORMAT_RGBA_DXT5;
case GL_COLOR_INDEX:
case GL_COLOR_INDEX1_EXT:
@@ -187,16 +185,16 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
case GL_COLOR_INDEX8_EXT:
case GL_COLOR_INDEX12_EXT:
case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
+ return MESA_FORMAT_CI8;
default:
fprintf(stderr, "unexpected texture format %s in %s\n",
_mesa_lookup_enum_by_nr(internalFormat),
__FUNCTION__);
- return NULL;
+ return MESA_FORMAT_NONE;
}
- return NULL; /* never get here */
+ return MESA_FORMAT_NONE; /* never get here */
}
static int logbase2(int n)
@@ -457,7 +455,7 @@ static GLboolean viaSetTexImages(GLcontext *ctx,
GLuint widthExp = 0;
GLuint heightExp = 0;
- switch (baseImage->image.TexFormat->MesaFormat) {
+ switch (baseImage->image.TexFormat) {
case MESA_FORMAT_ARGB8888:
texFormat = HC_HTXnFM_ARGB8888;
break;
@@ -689,24 +687,7 @@ static void viaTexImage(GLcontext *ctx,
assert(texImage->TexFormat);
- if (dims == 1) {
- texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D;
- texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df;
- }
- else {
- texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D;
- texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df;
- }
- texelBytes = texImage->TexFormat->TexelBytes;
-
- if (texelBytes == 0) {
- /* compressed format */
- texImage->IsCompressed = GL_TRUE;
- texImage->CompressedSize =
- ctx->Driver.CompressedTextureSize(ctx, texImage->Width,
- texImage->Height, texImage->Depth,
- texImage->TexFormat->MesaFormat);
- }
+ texelBytes = _mesa_get_format_bytes(texImage->TexFormat);
/* Minimum pitch of 32 bytes */
if (postConvWidth * texelBytes < 32) {
@@ -718,8 +699,11 @@ static void viaTexImage(GLcontext *ctx,
viaImage->pitchLog2 = logbase2(postConvWidth * texelBytes);
/* allocate memory */
- if (texImage->IsCompressed)
- sizeInBytes = texImage->CompressedSize;
+ if (_mesa_is_format_compressed(texImage->TexFormat))
+ sizeInBytes = _mesa_format_image_size(texImage->TexFormat,
+ texImage->Width,
+ texImage->Height,
+ texImage->Depth);
else
sizeInBytes = postConvWidth * postConvHeight * texelBytes;
@@ -797,32 +781,27 @@ static void viaTexImage(GLcontext *ctx,
else {
GLint dstRowStride;
GLboolean success;
- if (texImage->IsCompressed) {
- dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width);
+
+ if (_mesa_is_format_compressed(texImage->TexFormat)) {
+ dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width);
}
else {
- dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes;
+ dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat);
}
- ASSERT(texImage->TexFormat->StoreImage);
- success = texImage->TexFormat->StoreImage(ctx, dims,
- texImage->_BaseFormat,
- texImage->TexFormat,
- texImage->Data,
- 0, 0, 0, /* dstX/Y/Zoffset */
- dstRowStride,
- texImage->ImageOffsets,
- width, height, 1,
- format, type, pixels, packing);
+ success = _mesa_texstore(ctx, dims,
+ texImage->_BaseFormat,
+ texImage->TexFormat,
+ texImage->Data,
+ 0, 0, 0, /* dstX/Y/Zoffset */
+ dstRowStride,
+ texImage->ImageOffsets,
+ width, height, 1,
+ format, type, pixels, packing);
if (!success) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
}
}
- /* GL_SGIS_generate_mipmap */
- if (level == texObj->BaseLevel && texObj->GenerateMipmap) {
- _mesa_generate_mipmap(ctx, target, texObj);
- }
-
_mesa_unmap_teximage_pbo(ctx, packing);
}
diff --git a/src/via_texcombine.c b/src/via_texcombine.c
index b646897..f87ba07 100644
--- a/src/via_texcombine.c
+++ b/src/via_texcombine.c
@@ -38,7 +38,6 @@
#include "main/enums.h"
#include "via_context.h"
-#include "via_state.h"
#include "via_tex.h"
#include "via_3d_reg.h"