summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Verhaegen <libv@skynet.be>2010-03-11 03:32:49 +0100
committerLuc Verhaegen <libv@skynet.be>2010-03-11 03:32:49 +0100
commit45e20bfa6cc7dc85037322d3f806bdf79cc5cfa9 (patch)
treec9343f59d153757f7cb2792145f074a0ae28f0d7
parentf29703653e163942f44a88e52202620a5a1d7d15 (diff)
Import r128 dri driver from debian's mesa 7.7-4.7.7.17.7.0
-rw-r--r--configure.ac6
-rw-r--r--src/r128_context.c4
-rw-r--r--src/r128_screen.c24
-rw-r--r--src/r128_span.c18
-rw-r--r--src/r128_tex.c9
-rw-r--r--src/r128_texmem.c9
-rw-r--r--src/r128_texstate.c5
7 files changed, 29 insertions, 46 deletions
diff --git a/configure.ac b/configure.ac
index df48b55..4870777 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-r128], 7.6.1, [], mesa-dri-r128)
+AC_INIT([mesa-dri-r128], 7.7.1, [], mesa-dri-r128)
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/r128_context.c b/src/r128_context.c
index f511a67..0b25087 100644
--- a/src/r128_context.c
+++ b/src/r128_context.c
@@ -68,9 +68,9 @@ int R128_DEBUG = 0;
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
-#include "extension_helper.h"
+#include "main/remap_helper.h"
-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/r128_screen.c b/src/r128_screen.c
index f5bcc2f..9da3b5f 100644
--- a/src/r128_screen.c
+++ b/src/r128_screen.c
@@ -74,8 +74,6 @@ static const GLuint __driNConfigOptions = 4;
static const GLuint __driNConfigOptions = 3;
#endif
-extern const struct dri_extension card_extensions[];
-
#if 1
/* Including xf86PciInfo.h introduces a bunch of errors...
*/
@@ -284,7 +282,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv,
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
NULL,
screen->cpp,
screen->frontOffset, screen->frontPitch,
@@ -295,7 +293,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
NULL,
screen->cpp,
screen->backOffset, screen->backPitch,
@@ -306,7 +304,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ = driNewRenderbuffer(MESA_FORMAT_Z16,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
@@ -316,7 +314,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv,
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ = driNewRenderbuffer(MESA_FORMAT_S8_Z24,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
@@ -327,7 +325,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ = driNewRenderbuffer(MESA_FORMAT_S8,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
@@ -493,18 +491,6 @@ r128InitScreen(__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 (!r128InitDriver(psp))
return NULL;
diff --git a/src/r128_span.c b/src/r128_span.c
index dd177e0..d238cc3 100644
--- a/src/r128_span.c
+++ b/src/r128_span.c
@@ -433,21 +433,19 @@ void r128DDInitSpanFuncs( GLcontext *ctx )
void
r128SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- r128InitPointers_RGB565(&drb->Base);
- }
- else {
- r128InitPointers_ARGB8888(&drb->Base);
- }
+ if (drb->Base.Format == MESA_FORMAT_RGB565) {
+ r128InitPointers_RGB565(&drb->Base);
}
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
+ else if (drb->Base.Format == MESA_FORMAT_ARGB8888) {
+ r128InitPointers_ARGB8888(&drb->Base);
+ }
+ else if (drb->Base.Format == MESA_FORMAT_Z16) {
r128InitDepthPointers_z16(&drb->Base);
}
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
+ else if (drb->Base.Format == MESA_FORMAT_S8_Z24) {
r128InitDepthPointers_z24_s8(&drb->Base);
}
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
+ else if (drb->Base.Format == MESA_FORMAT_S8) {
radeonInitStencilPointers_z24_s8(&drb->Base);
}
}
diff --git a/src/r128_tex.c b/src/r128_tex.c
index 0920270..0a1207f 100644
--- a/src/r128_tex.c
+++ b/src/r128_tex.c
@@ -44,7 +44,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#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/imports.h"
@@ -178,7 +177,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj )
/* Called by the _mesa_store_teximage[123]d() functions. */
-static const struct gl_texture_format *
+static gl_format
r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
@@ -282,13 +281,13 @@ r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_YCBCR_MESA:
if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
+ return MESA_FORMAT_YCBCR;
else
- return &_mesa_texformat_ycbcr_rev;
+ return MESA_FORMAT_YCBCR_REV;
default:
_mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ );
- return NULL;
+ return MESA_FORMAT_NONE;
}
}
diff --git a/src/r128_texmem.c b/src/r128_texmem.c
index 111fe1f..4ddcb86 100644
--- a/src/r128_texmem.c
+++ b/src/r128_texmem.c
@@ -41,7 +41,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/context.h"
#include "main/macros.h"
#include "main/simple_list.h"
-#include "main/texformat.h"
#include "main/imports.h"
#define TEX_0 1
@@ -95,7 +94,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
if ( !image )
return;
- switch ( image->TexFormat->TexelBytes ) {
+ switch ( _mesa_get_format_bytes(image->TexFormat) ) {
case 1: texelsPerDword = 4; break;
case 2: texelsPerDword = 2; break;
case 4: texelsPerDword = 1; break;
@@ -215,9 +214,11 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
/* Copy the next chunck of the texture image into the blit buffer */
{
+ const GLuint texelBytes =
+ _mesa_get_format_bytes(image->TexFormat);
const GLubyte *src = (const GLubyte *) image->Data +
- (y * image->Width + x) * image->TexFormat->TexelBytes;
- const GLuint bytes = width * height * image->TexFormat->TexelBytes;
+ (y * image->Width + x) * texelBytes;
+ const GLuint bytes = width * height * texelBytes;
memcpy(dst, src, bytes);
}
diff --git a/src/r128_texstate.c b/src/r128_texstate.c
index a9c9568..cb2b5f9 100644
--- a/src/r128_texstate.c
+++ b/src/r128_texstate.c
@@ -36,7 +36,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/imports.h"
#include "main/context.h"
#include "main/macros.h"
-#include "main/texformat.h"
#include "r128_context.h"
#include "r128_state.h"
@@ -61,7 +60,7 @@ static void r128SetTexImages( r128ContextPtr rmesa,
if ( R128_DEBUG & DEBUG_VERBOSE_API )
fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *) tObj );
- switch (baseImage->TexFormat->MesaFormat) {
+ switch (baseImage->TexFormat) {
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_ARGB8888_REV:
t->textureFormat = R128_DATATYPE_ARGB8888;
@@ -123,7 +122,7 @@ static void r128SetTexImages( r128ContextPtr rmesa,
totalSize += (tObj->Image[0][i]->Height *
tObj->Image[0][i]->Width *
- tObj->Image[0][i]->TexFormat->TexelBytes);
+ _mesa_get_format_bytes(tObj->Image[0][i]->TexFormat));
/* Offsets must be 32-byte aligned for host data blits and tiling */
totalSize = (totalSize + 31) & ~31;