summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i810
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2007-05-14 16:58:37 -0400
committerKristian Høgsberg <[email protected]>2007-10-10 18:36:14 -0400
commit64106d0d9aeefa6974317042b6bc3e5eaabac5a2 (patch)
treed681b4562be269dea70b2d7727f7a263dacf699d /src/mesa/drivers/dri/i810
parentefd03a278ae55b454509e9659c42899133983ebd (diff)
Pull createNewScreen entry point into dri_util.c.
This pulls the top level createNewScreen entry point out of the drivers and rewrites __driUtilCreateNewScreen in dri_util.c to be the new entry point. The change moves more logic into the common/ layer and changes the createNewScreen entry point to only be defined in one place.
Diffstat (limited to 'src/mesa/drivers/dri/i810')
-rw-r--r--src/mesa/drivers/dri/i810/i810screen.c50
1 files changed, 14 insertions, 36 deletions
diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c
index b04bc383270..3c7ec96ff3d 100644
--- a/src/mesa/drivers/dri/i810/i810screen.c
+++ b/src/mesa/drivers/dri/i810/i810screen.c
@@ -403,7 +403,6 @@ i810DestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
static const struct __DriverAPIRec i810API = {
- .InitDriver = i810InitDriver,
.DestroyScreen = i810DestroyScreen,
.CreateContext = i810CreateContext,
.DestroyContext = i810DestroyContext,
@@ -421,51 +420,30 @@ static const struct __DriverAPIRec i810API = {
/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
+ * This is the driver specific part of the createNewScreen entry point.
+ *
+ * \todo maybe fold this into intelInitDriver
*
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
+ * \return the __GLcontextModes supported by this driver
*/
-PUBLIC
-void *__DRI_CREATE_NEW_SCREEN(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)
+PUBLIC __GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp)
{
- __DRIscreenPrivate *psp;
static const __DRIversion ddx_expected = { 1, 0, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 1, 2, 0 };
- dri_interface = interface;
-
if ( ! driCheckDriDdxDrmVersions2( "i810",
- 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(scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &i810API);
- if ( psp != NULL ) {
- *driver_modes = i810FillInModes( 16,
- 16, 0,
- 1);
- driInitExtensions( NULL, card_extensions, GL_TRUE );
- }
+ psp->DriverAPI = i810API;
+ driInitExtensions( NULL, card_extensions, GL_TRUE );
+
+ if (!i810InitDriver(psp))
+ return NULL;
- return (void *) psp;
+ return i810FillInModes(16, 16, 0, 1);
}