summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/trident
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/trident')
-rw-r--r--src/mesa/drivers/dri/trident/trident_context.c90
-rw-r--r--src/mesa/drivers/dri/trident/trident_context.h10
-rw-r--r--src/mesa/drivers/dri/trident/trident_dd.c4
-rw-r--r--src/mesa/drivers/dri/trident/trident_state.c8
-rw-r--r--src/mesa/drivers/dri/trident/trident_vb.c8
5 files changed, 55 insertions, 65 deletions
diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c
index 8dc7f0dc78..e134cfcf8e 100644
--- a/src/mesa/drivers/dri/trident/trident_context.c
+++ b/src/mesa/drivers/dri/trident/trident_context.c
@@ -35,17 +35,17 @@
#include "tnl/tnl.h"
#include "tnl/t_pipeline.h"
-#include "context.h"
-#include "simple_list.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/matrix.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
#if defined(USE_X86_ASM)
#include "x86/common_x86_asm.h"
#endif
-#include "simple_list.h"
-#include "mm.h"
+#include "main/simple_list.h"
+#include "main/mm.h"
#include "drirenderbuffer.h"
#include "drivers/common/driverfuncs.h"
@@ -417,56 +417,46 @@ tridentInitDriver(__DRIscreenPrivate *sPriv)
return GL_TRUE;
}
-static struct __DriverAPIRec tridentAPI = {
- tridentInitDriver,
- tridentDestroyScreen,
- tridentCreateContext,
- tridentDestroyContext,
- tridentCreateBuffer,
- tridentDestroyBuffer,
- tridentSwapBuffers,
- tridentMakeCurrent,
- tridentUnbindContext,
-};
-
-
-PUBLIC void *__driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
- __DRIscreen *psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes )
+/**
+ * This is the driver specific part of the createNewScreen entry point.
+ *
+ * \todo maybe fold this into intelInitDriver
+ *
+ * \return the __GLcontextModes supported by this driver
+ */
+const __DRIconfig **tridentInitScreen(__DRIscreenPrivate *psp)
{
- __DRIscreenPrivate *psp;
static const __DRIversion ddx_expected = { 4, 0, 0 };
static const __DRIversion dri_expected = { 3, 1, 0 };
static const __DRIversion drm_expected = { 1, 0, 0 };
-
- dri_interface = interface;
-
+
if ( ! driCheckDriDdxDrmVersions2( "Trident",
- dri_version, & dri_expected,
- ddx_version, & ddx_expected,
- drm_version, & drm_expected ) ) {
+ &psp->dri_version, & dri_expected,
+ &psp->ddx_version, & ddx_expected,
+ &psp->drm_version, & drm_expected ) )
return NULL;
- }
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &tridentAPI);
+ if (!tridentInitDriver(psp))
+ return NULL;
- if ( psp != NULL ) {
+ /* Wait... what? This driver doesn't report any modes... */
#if 0
- TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv;
- *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8,
- GL_TRUE );
+ TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv;
+ *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8,
+ GL_TRUE );
#endif
- }
- return (void *) psp;
+
+ return NULL;
}
+
+const struct __DriverAPIRec driDriverAPI = {
+ tridentInitScreen,
+ tridentDestroyScreen,
+ tridentCreateContext,
+ tridentDestroyContext,
+ tridentCreateBuffer,
+ tridentDestroyBuffer,
+ tridentSwapBuffers,
+ tridentMakeCurrent,
+ tridentUnbindContext,
+};
diff --git a/src/mesa/drivers/dri/trident/trident_context.h b/src/mesa/drivers/dri/trident/trident_context.h
index 1d3ca84400..fbbb4a96e7 100644
--- a/src/mesa/drivers/dri/trident/trident_context.h
+++ b/src/mesa/drivers/dri/trident/trident_context.h
@@ -28,10 +28,10 @@
#define _TRIDENT_CONTEXT_H_
#include "dri_util.h"
-#include "macros.h"
-#include "mtypes.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "drm.h"
-#include "mm.h"
+#include "main/mm.h"
#define SUBPIXEL_X (0.0F)
#define SUBPIXEL_Y (0.125F)
@@ -54,14 +54,14 @@
#undef TAG
/* these require that base be dword-aligned */
-static inline void MMIO_OUT32(unsigned char *base, unsigned int offset,
+static INLINE void MMIO_OUT32(unsigned char *base, unsigned int offset,
unsigned int val)
{
unsigned int *addr = (unsigned int *)(base + offset);
*addr = val;
}
-static inline unsigned int MMIO_IN32(unsigned char *base, unsigned int offset)
+static INLINE unsigned int MMIO_IN32(unsigned char *base, unsigned int offset)
{
unsigned int *addr = (unsigned int *)(base + offset);
return *addr;
diff --git a/src/mesa/drivers/dri/trident/trident_dd.c b/src/mesa/drivers/dri/trident/trident_dd.c
index 4639b3a15e..faa40c36a2 100644
--- a/src/mesa/drivers/dri/trident/trident_dd.c
+++ b/src/mesa/drivers/dri/trident/trident_dd.c
@@ -31,8 +31,8 @@
#endif
#include "swrast/swrast.h"
-#include "context.h"
-#include "framebuffer.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
#define TRIDENT_DATE "20041223"
diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c
index 5303bd422e..e68d3a73c6 100644
--- a/src/mesa/drivers/dri/trident/trident_state.c
+++ b/src/mesa/drivers/dri/trident/trident_state.c
@@ -30,7 +30,7 @@
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
-#include "framebuffer.h"
+#include "main/framebuffer.h"
#define TRIDENTPACKCOLOR332(r, g, b) \
(((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6))
@@ -51,9 +51,9 @@
#define TRIDENTPACKCOLOR4444(r, g, b, a) \
((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4))
-static __inline__ GLuint tridentPackColor( GLuint cpp,
- GLubyte r, GLubyte g,
- GLubyte b, GLubyte a )
+static INLINE GLuint tridentPackColor( GLuint cpp,
+ GLubyte r, GLubyte g,
+ GLubyte b, GLubyte a )
{
switch ( cpp ) {
case 2:
diff --git a/src/mesa/drivers/dri/trident/trident_vb.c b/src/mesa/drivers/dri/trident/trident_vb.c
index 77e4d9b76e..b231f5ef15 100644
--- a/src/mesa/drivers/dri/trident/trident_vb.c
+++ b/src/mesa/drivers/dri/trident/trident_vb.c
@@ -24,10 +24,10 @@
* Trident CyberBladeXP driver.
*
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "swrast_setup/swrast_setup.h"
#include "swrast/swrast.h"