From 29a2bbc7eb90963d9cda1a0e3e5a74db28f6d1d1 Mon Sep 17 00:00:00 2001 From: Luc Verhaegen Date: Tue, 16 Mar 2010 19:16:22 +0100 Subject: Import sis dri driver from mesa 7.8-rc1. --- configure.ac | 4 ++-- src/sis_context.c | 14 +++++++------- src/sis_context.h | 18 +++++++++--------- src/sis_lock.c | 4 ++-- src/sis_screen.c | 27 +++++++++++++++++---------- src/sis_screen.h | 2 +- src/sis_span.c | 4 ++-- src/sis_texstate.c | 8 ++++---- src/sis_tris.c | 6 +++--- 9 files changed, 47 insertions(+), 40 deletions(-) diff --git a/configure.ac b/configure.ac index 9b98709..bbc07c9 100644 --- a/configure.ac +++ b/configure.ac @@ -16,8 +16,8 @@ AC_PROG_CC AC_HEADER_STDC PKG_CHECK_MODULES([DRM], [libdrm >= 2.3.0]) -PKG_CHECK_MODULES([DRI], [libmesadri >= 7.7.0 libmesadri < 7.8.0 - libmesadricommon >= 7.7.0 libmesadricommon < 7.8.0]) +PKG_CHECK_MODULES([DRI], [libmesadri >= 7.8.0 libmesadri < 7.9.0 + libmesadricommon >= 7.8.0 libmesadricommon < 7.9.0]) AC_OUTPUT([ Makefile diff --git a/src/sis_context.c b/src/sis_context.c index b5586b7..400681a 100644 --- a/src/sis_context.c +++ b/src/sis_context.c @@ -159,11 +159,11 @@ void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, GLboolean sisCreateContext( const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, + __DRIcontext *driContextPriv, void *sharedContextPrivate ) { GLcontext *ctx, *shareCtx; - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; + __DRIscreen *sPriv = driContextPriv->driScreenPriv; sisContextPtr smesa; sisScreenPtr sisScreen; int i; @@ -336,7 +336,7 @@ sisCreateContext( const __GLcontextModes *glVisual, } void -sisDestroyContext ( __DRIcontextPrivate *driContextPriv ) +sisDestroyContext ( __DRIcontext *driContextPriv ) { sisContextPtr smesa = (sisContextPtr)driContextPriv->driverPrivate; @@ -364,9 +364,9 @@ sisDestroyContext ( __DRIcontextPrivate *driContextPriv ) } GLboolean -sisMakeCurrent( __DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv ) +sisMakeCurrent( __DRIcontext *driContextPriv, + __DRIdrawable *driDrawPriv, + __DRIdrawable *driReadPriv ) { if ( driContextPriv ) { GET_CURRENT_CONTEXT(ctx); @@ -395,7 +395,7 @@ sisMakeCurrent( __DRIcontextPrivate *driContextPriv, } GLboolean -sisUnbindContext( __DRIcontextPrivate *driContextPriv ) +sisUnbindContext( __DRIcontext *driContextPriv ) { return GL_TRUE; } diff --git a/src/sis_context.h b/src/sis_context.h index bc53cb5..4179ee0 100644 --- a/src/sis_context.h +++ b/src/sis_context.h @@ -359,9 +359,9 @@ struct sis_context /* Mirrors of some DRI state */ - __DRIcontextPrivate *driContext; /* DRI context */ - __DRIscreenPrivate *driScreen; /* DRI screen */ - __DRIdrawablePrivate *driDrawable; /* DRI drawable bound to this ctx */ + __DRIcontext *driContext; /* DRI context */ + __DRIscreen *driScreen; /* DRI screen */ + __DRIdrawable *driDrawable; /* DRI drawable bound to this ctx */ unsigned int lastStamp; /* mirror driDrawable->lastStamp */ @@ -439,18 +439,18 @@ enum _sis_verbose { }; extern GLboolean sisCreateContext( const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, + __DRIcontext *driContextPriv, void *sharedContextPrivate ); -extern void sisDestroyContext( __DRIcontextPrivate * ); +extern void sisDestroyContext( __DRIcontext * ); void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, GLuint width, GLuint height); -extern GLboolean sisMakeCurrent( __DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv ); +extern GLboolean sisMakeCurrent( __DRIcontext *driContextPriv, + __DRIdrawable *driDrawPriv, + __DRIdrawable *driReadPriv ); -extern GLboolean sisUnbindContext( __DRIcontextPrivate *driContextPriv ); +extern GLboolean sisUnbindContext( __DRIcontext *driContextPriv ); void WaitEngIdle (sisContextPtr smesa); void Wait2DEngIdle (sisContextPtr smesa); diff --git a/src/sis_lock.c b/src/sis_lock.c index 806110c..b8ff4e3 100644 --- a/src/sis_lock.c +++ b/src/sis_lock.c @@ -46,8 +46,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void sisGetLock( sisContextPtr smesa, GLuint flags ) { - __DRIdrawablePrivate *dPriv = smesa->driDrawable; - __DRIscreenPrivate *sPriv = smesa->driScreen; + __DRIdrawable *dPriv = smesa->driDrawable; + __DRIscreen *sPriv = smesa->driScreen; SISSAREAPrivPtr sarea = smesa->sarea; drmGetLock( smesa->driFd, smesa->hHWContext, flags ); diff --git a/src/sis_screen.c b/src/sis_screen.c index f0e4e81..80fb455 100644 --- a/src/sis_screen.c +++ b/src/sis_screen.c @@ -64,7 +64,7 @@ static const GLuint __driNConfigOptions = 3; extern const struct dri_extension card_extensions[]; static const __DRIconfig ** -sisFillInModes(__DRIscreenPrivate *psp, int bpp) +sisFillInModes(__DRIscreen *psp, int bpp) { __DRIconfig **configs; unsigned depth_buffer_factor; @@ -103,7 +103,7 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp) configs = driCreateConfigs(fb_format, fb_type, depth_bits_array, stencil_bits_array, depth_buffer_factor, back_buffer_modes, back_buffer_factor, - msaa_samples_array, 1); + msaa_samples_array, 1, GL_TRUE); if (configs == NULL) { fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__); return NULL; @@ -116,7 +116,7 @@ sisFillInModes(__DRIscreenPrivate *psp, int bpp) /* Create the device specific screen private data struct. */ static sisScreenPtr -sisCreateScreen( __DRIscreenPrivate *sPriv ) +sisCreateScreen( __DRIscreen *sPriv ) { sisScreenPtr sisScreen; SISDRIPtr sisDRIPriv = (SISDRIPtr)sPriv->pDevPriv; @@ -171,7 +171,7 @@ sisCreateScreen( __DRIscreenPrivate *sPriv ) /* Destroy the device specific screen private data struct. */ static void -sisDestroyScreen( __DRIscreenPrivate *sPriv ) +sisDestroyScreen( __DRIscreen *sPriv ) { sisScreenPtr sisScreen = (sisScreenPtr)sPriv->private; @@ -191,8 +191,8 @@ sisDestroyScreen( __DRIscreenPrivate *sPriv ) * data. */ static GLboolean -sisCreateBuffer( __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, +sisCreateBuffer( __DRIscreen *driScrnPriv, + __DRIdrawable *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { @@ -218,12 +218,12 @@ sisCreateBuffer( __DRIscreenPrivate *driScrnPriv, static void -sisDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) +sisDestroyBuffer(__DRIdrawable *driDrawPriv) { _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); } -static void sisCopyBuffer( __DRIdrawablePrivate *dPriv ) +static void sisCopyBuffer( __DRIdrawable *dPriv ) { sisContextPtr smesa = (sisContextPtr)dPriv->driContextPriv->driverPrivate; int i; @@ -258,7 +258,7 @@ static void sisCopyBuffer( __DRIdrawablePrivate *dPriv ) /* Copy the back color buffer to the front color buffer */ static void -sisSwapBuffers(__DRIdrawablePrivate *dPriv) +sisSwapBuffers(__DRIdrawable *dPriv) { if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { sisContextPtr smesa = (sisContextPtr) dPriv->driContextPriv->driverPrivate; @@ -283,7 +283,7 @@ sisSwapBuffers(__DRIdrawablePrivate *dPriv) * \return the __GLcontextModes supported by this driver */ static const __DRIconfig ** -sisInitScreen(__DRIscreenPrivate *psp) +sisInitScreen(__DRIscreen *psp) { static const __DRIversion ddx_expected = {0, 8, 0}; static const __DRIversion dri_expected = {4, 0, 0}; @@ -324,3 +324,10 @@ const struct __DriverAPIRec driDriverAPI = { .SwapBuffersMSC = NULL }; + +/* This is the table of extensions that the loader will dlsym() for. */ +PUBLIC const __DRIextension *__driDriverExtensions[] = { + &driCoreExtension.base, + &driLegacyExtension.base, + NULL +}; diff --git a/src/sis_screen.h b/src/sis_screen.h index 07c29cf..8009fec 100644 --- a/src/sis_screen.h +++ b/src/sis_screen.h @@ -50,7 +50,7 @@ typedef struct { int cpp; unsigned int screenX, screenY; - __DRIscreenPrivate *driScreen; + __DRIscreen *driScreen; unsigned int sarea_priv_offset; /* Configuration cache with default values for all contexts */ diff --git a/src/sis_span.c b/src/sis_span.c index cfbb510..008b001 100644 --- a/src/sis_span.c +++ b/src/sis_span.c @@ -42,7 +42,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define LOCAL_VARS \ sisContextPtr smesa = SIS_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = smesa->driDrawable; \ + __DRIdrawable *dPriv = smesa->driDrawable; \ struct sis_renderbuffer *srb = (struct sis_renderbuffer *) rb; \ GLuint pitch = srb->pitch; \ char *buf = srb->map; \ @@ -52,7 +52,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define LOCAL_DEPTH_VARS \ sisContextPtr smesa = SIS_CONTEXT(ctx); \ - __DRIdrawablePrivate *dPriv = smesa->driDrawable; \ + __DRIdrawable *dPriv = smesa->driDrawable; \ struct sis_renderbuffer *srb = (struct sis_renderbuffer *) rb; \ char *buf = srb->map; diff --git a/src/sis_texstate.c b/src/sis_texstate.c index e96a2e8..7b0eebd 100644 --- a/src/sis_texstate.c +++ b/src/sis_texstate.c @@ -456,10 +456,10 @@ sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj, { GLubyte c[4]; - CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->BorderColor[0]); - CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->BorderColor[1]); - CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor[2]); - CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor[3]); + CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->BorderColor.f[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->BorderColor.f[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor.f[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor.f[3]); current->texture[hw_unit].hwTextureBorderColor = PACK_COLOR_8888(c[3], c[0], c[1], c[2]); diff --git a/src/sis_tris.c b/src/sis_tris.c index aaa23db..d109a8c 100644 --- a/src/sis_tris.c +++ b/src/sis_tris.c @@ -375,7 +375,6 @@ static struct { #define DO_POINTS 1 #define DO_FULL_QUAD 1 -#define HAVE_RGBA 1 #define HAVE_SPEC 1 #define HAVE_BACK_COLORS 0 #define HAVE_HW_FLATSHADE 1 @@ -903,14 +902,14 @@ static void sisRenderStart( GLcontext *ctx ) /* projective textures are not supported by the hardware */ if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { - if (VB->TexCoordPtr[0]->size > 2) + if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size > 2) tex_fallback = GL_TRUE; EMIT_ATTR(_TNL_ATTRIB_TEX0, EMIT_2F); AGPParseSet |= SiS_PS_HAS_UV0; } /* Will only hit tex1 on SiS300 */ if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 )) { - if (VB->TexCoordPtr[1]->size > 2) + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size > 2) tex_fallback = GL_TRUE; EMIT_ATTR(_TNL_ATTRIB_TEX1, EMIT_2F); AGPParseSet |= SiS_PS_HAS_UV1; @@ -994,6 +993,7 @@ sisFlushPrimsLocked(sisContextPtr smesa) MMIO(REG_3D_PrimitiveSet, smesa->dwPrimitiveSet); } while (smesa->vb_last < smesa->vb_cur) { + assert(sis_emit_func); sis_emit_func(smesa, (char *)smesa->vb_last); smesa->vb_last += incr; } -- cgit v1.2.3