summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2010-03-09 05:56:50 +0100
committerLuc Verhaegen <libv@skynet.be>2010-03-09 06:15:40 +0100
commitc7491425379290b04b6b586e1abad5c8427f1dfe (patch)
treedddb731c2a77c69be20089249147f980305c268d
parentf7f68b77ba4b631da64846943f9c6cb2a549faaa (diff)
Import i810 dri driver from mesa 7.7.7.7.17.7.0
-rw-r--r--configure.ac6
-rw-r--r--src/i810context.c5
-rw-r--r--src/i810render.c1
-rw-r--r--src/i810screen.c14
-rw-r--r--src/i810state.c2
-rw-r--r--src/i810tex.c21
-rw-r--r--src/i810tex.h1
-rw-r--r--src/i810texmem.c61
-rw-r--r--src/i810texstate.c3
-rw-r--r--src/i810vb.c1
10 files changed, 48 insertions, 67 deletions
diff --git a/configure.ac b/configure.ac
index 2906d5e..22a768b 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-i810], 7.5.0, [], mesa-dri-i810)
+AC_INIT([mesa-dri-i810], 7.7.1, [], mesa-dri-i810)
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/i810context.c b/src/i810context.c
index 6785655..350c2e3 100644
--- a/src/i810context.c
+++ b/src/i810context.c
@@ -34,10 +34,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/glheader.h"
#include "main/context.h"
-#include "main/matrix.h"
#include "main/simple_list.h"
-#include "main/extensions.h"
-#include "main/framebuffer.h"
#include "main/imports.h"
#include "main/points.h"
@@ -116,7 +113,7 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
/* Extension strings exported by the i810 driver.
*/
-const struct dri_extension card_extensions[] =
+static const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_env_add", NULL },
diff --git a/src/i810render.c b/src/i810render.c
index 1d98e00..b543d4f 100644
--- a/src/i810render.c
+++ b/src/i810render.c
@@ -44,7 +44,6 @@
#include "i810context.h"
#include "i810tris.h"
-#include "i810state.h"
#include "i810vb.h"
#include "i810ioctl.h"
diff --git a/src/i810screen.c b/src/i810screen.c
index 6e49f34..b653958 100644
--- a/src/i810screen.c
+++ b/src/i810screen.c
@@ -36,8 +36,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/imports.h"
#include "main/context.h"
#include "main/framebuffer.h"
-#include "main/fbobject.h"
-#include "main/matrix.h"
#include "main/renderbuffer.h"
#include "main/simple_list.h"
#include "utils.h"
@@ -48,13 +46,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i810state.h"
#include "i810tex.h"
#include "i810span.h"
-#include "i810tris.h"
-#include "i810ioctl.h"
#include "GL/internal/dri_interface.h"
-extern const struct dri_extension card_extensions[];
-
static const __DRIconfig **
i810FillInModes( __DRIscreenPrivate *psp,
unsigned pixel_bits, unsigned depth_bits,
@@ -166,8 +160,6 @@ i810InitScreen(__DRIscreen *sPriv)
return NULL;
}
- driInitExtensions( NULL, card_extensions, GL_TRUE );
-
if (sPriv->devPrivSize != sizeof(I810DRIRec)) {
fprintf(stderr,"\nERROR! sizeof(I810DRIRec) does not match passed size from device driver\n");
return GL_FALSE;
@@ -293,7 +285,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
driScrnPriv->pFB,
screen->cpp,
/*screen->frontOffset*/0, screen->backPitch,
@@ -304,7 +296,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
screen->back.map,
screen->cpp,
screen->backOffset, screen->backPitch,
@@ -315,7 +307,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ = driNewRenderbuffer(MESA_FORMAT_Z16,
screen->depth.map,
screen->cpp,
screen->depthOffset, screen->backPitch,
diff --git a/src/i810state.c b/src/i810state.c
index 1e7a6cf..a4b1477 100644
--- a/src/i810state.c
+++ b/src/i810state.c
@@ -20,8 +20,6 @@
#include "i810context.h"
#include "i810state.h"
#include "i810tex.h"
-#include "i810vb.h"
-#include "i810tris.h"
#include "i810ioctl.h"
diff --git a/src/i810tex.c b/src/i810tex.c
index cd6e1a8..5c53032 100644
--- a/src/i810tex.c
+++ b/src/i810tex.c
@@ -28,13 +28,11 @@
#include "main/simple_list.h"
#include "main/enums.h"
#include "main/texstore.h"
-#include "main/texformat.h"
#include "main/teximage.h"
#include "main/texobj.h"
#include "main/colormac.h"
#include "main/texobj.h"
#include "main/mm.h"
-#include "swrast/swrast.h"
#include "texmem.h"
@@ -43,7 +41,6 @@
#include "i810context.h"
#include "i810tex.h"
-#include "i810state.h"
#include "i810ioctl.h"
@@ -440,7 +437,7 @@ static void i810DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj )
* The i810 only supports 5 texture modes that are useful to Mesa. That
* makes this routine pretty simple.
*/
-static const struct gl_texture_format *
+static gl_format
i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
@@ -458,9 +455,9 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
if ( ((format == GL_BGRA) && (type == GL_UNSIGNED_SHORT_1_5_5_5_REV))
|| ((format == GL_RGBA) && (type == GL_UNSIGNED_SHORT_5_5_5_1))
|| (internalFormat == GL_RGB5_A1) ) {
- return &_mesa_texformat_argb1555;
+ return MESA_FORMAT_ARGB1555;
}
- return &_mesa_texformat_argb4444;
+ return MESA_FORMAT_ARGB4444;
case 3:
case GL_RGB:
@@ -472,7 +469,7 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return &_mesa_texformat_rgb565;
+ return MESA_FORMAT_RGB565;
case GL_ALPHA:
case GL_ALPHA4:
@@ -502,21 +499,21 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_INTENSITY12:
case GL_INTENSITY16:
case GL_COMPRESSED_INTENSITY:
- return &_mesa_texformat_al88;
+ return MESA_FORMAT_AL88;
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;
default:
fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__);
- return NULL;
+ return MESA_FORMAT_NONE;
}
- return NULL; /* never get here */
+ return MESA_FORMAT_NONE; /* never get here */
}
/**
diff --git a/src/i810tex.h b/src/i810tex.h
index d980927..28958dc 100644
--- a/src/i810tex.h
+++ b/src/i810tex.h
@@ -29,7 +29,6 @@
#include "main/mtypes.h"
#include "main/mm.h"
-#include "i810context.h"
#include "i810_3d_reg.h"
#include "texmem.h"
diff --git a/src/i810texmem.c b/src/i810texmem.c
index 5ad66db..bb426a4 100644
--- a/src/i810texmem.c
+++ b/src/i810texmem.c
@@ -30,13 +30,11 @@
#include "main/enums.h"
#include "main/colormac.h"
#include "main/mm.h"
-#include "main/texformat.h"
#include "i810screen.h"
#include "i810_dri.h"
#include "i810context.h"
#include "i810tex.h"
-#include "i810state.h"
#include "i810ioctl.h"
@@ -92,44 +90,47 @@ static void i810UploadTexLevel( i810ContextPtr imesa,
{
const struct gl_texture_image *image = t->image[hwlevel].image;
int j;
+ GLuint texelBytes;
if (!image || !image->Data)
return;
- if (image->Width * image->TexFormat->TexelBytes == t->Pitch) {
+ texelBytes = _mesa_get_format_bytes(image->TexFormat);
+
+ if (image->Width * texelBytes == t->Pitch) {
GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
GLubyte *src = (GLubyte *)image->Data;
memcpy( dst, src, t->Pitch * image->Height );
}
- else switch (image->TexFormat->TexelBytes) {
- case 1:
- {
- GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
- GLubyte *src = (GLubyte *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
- __memcpy(dst, src, image->Width );
- src += image->Width;
- }
+ else {
+ switch (texelBytes) {
+ case 1:
+ {
+ GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset);
+ GLubyte *src = (GLubyte *)image->Data;
+
+ for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) {
+ __memcpy(dst, src, image->Width );
+ src += image->Width;
+ }
+ }
+ break;
+ case 2:
+ {
+ GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset);
+ GLushort *src = (GLushort *)image->Data;
+
+ for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) {
+ __memcpy(dst, src, image->Width * 2 );
+ src += image->Width;
+ }
+ }
+ break;
+ default:
+ fprintf(stderr, "%s: Not supported texel size %d\n",
+ __FUNCTION__, texelBytes);
}
- break;
-
- case 2:
- {
- GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset);
- GLushort *src = (GLushort *)image->Data;
-
- for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) {
- __memcpy(dst, src, image->Width * 2 );
- src += image->Width;
- }
- }
- break;
-
- default:
- fprintf(stderr, "%s: Not supported texel size %d\n",
- __FUNCTION__, image->TexFormat->TexelBytes);
}
}
diff --git a/src/i810texstate.c b/src/i810texstate.c
index 0e09f54..bff28c1 100644
--- a/src/i810texstate.c
+++ b/src/i810texstate.c
@@ -25,7 +25,6 @@
#include "main/glheader.h"
#include "main/macros.h"
#include "main/mtypes.h"
-#include "main/texformat.h"
#include "main/simple_list.h"
#include "main/enums.h"
#include "main/mm.h"
@@ -53,7 +52,7 @@ static void i810SetTexImages( i810ContextPtr imesa,
/* fprintf(stderr, "%s\n", __FUNCTION__); */
t->texelBytes = 2;
- switch (baseImage->TexFormat->MesaFormat) {
+ switch (baseImage->TexFormat) {
case MESA_FORMAT_ARGB1555:
textureFormat = MI1_FMT_16BPP | MI1_PF_16BPP_ARGB1555;
break;
diff --git a/src/i810vb.c b/src/i810vb.c
index 30890dc..09a7722 100644
--- a/src/i810vb.c
+++ b/src/i810vb.c
@@ -38,7 +38,6 @@
#include "i810context.h"
#include "i810vb.h"
#include "i810ioctl.h"
-#include "i810tris.h"
#include "i810state.h"