summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/nouveau
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-10-12 19:35:04 -0400
committerKristian Høgsberg <krh@redhat.com>2007-10-12 19:35:04 -0400
commitf9c6dfc4d12451c21f39f38b048758cbee5723cf (patch)
tree5384315d9ec06a779137c63b54d6326dbc12ef81 /src/mesa/drivers/dri/nouveau
parentbf805d3bf5bf191aa669b6155316a78917cf9b0e (diff)
parenta2494462cb7d557a7643452c720e0ab8fa9f4f63 (diff)
Merge branch 'dri2'
Conflicts: src/mesa/drivers/dri/i915/intel_screen.c
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_screen.c96
1 files changed, 38 insertions, 58 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 065aa81746..3e7bab63f3 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -195,7 +195,6 @@ nouveauGetSwapInfo(__DRIdrawablePrivate *dpriv, __DRIswapInfo *sInfo)
}
static const struct __DriverAPIRec nouveauAPI = {
- .InitDriver = nouveauInitDriver,
.DestroyScreen = nouveauDestroyScreen,
.CreateContext = nouveauCreateContext,
.DestroyContext = nouveauDestroyContext,
@@ -285,81 +284,62 @@ nouveauFillInModes( unsigned pixel_bits, unsigned depth_bits,
/**
- * 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.
*
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
+ * \todo maybe fold this into intelInitDriver
+ *
+ * \return the __GLcontextModes supported by this driver
*/
-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)
-
+__GLcontextModes *__driDriverInitScreen(__DRIscreenPrivate *psp)
{
- __DRIscreenPrivate *psp;
static const __DRIversion ddx_expected = { 1, 2, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL };
+ NOUVEAUDRIPtr dri_priv = (NOUVEAUDRIPtr)psp->pDevPriv;
+
#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 10
#error nouveau_drm.h version doesn't match expected version
#endif
- dri_interface = interface;
if (!driCheckDriDdxDrmVersions2("nouveau",
- 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;
- }
// temporary lock step versioning
- if (drm_expected.patch!=drm_version->patch) {
+ if (drm_expected.patch != psp->drm_version.patch) {
__driUtilMessage("%s: wrong DRM version, expected %d, got %d\n",
- __func__,
- drm_expected.patch, drm_version->patch);
+ __func__,
+ drm_expected.patch, psp->drm_version.patch);
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &nouveauAPI);
- if ( psp != NULL ) {
- NOUVEAUDRIPtr dri_priv = (NOUVEAUDRIPtr)psp->pDevPriv;
-
- *driver_modes = nouveauFillInModes(dri_priv->bpp,
- (dri_priv->bpp == 16) ? 16 : 24,
- (dri_priv->bpp == 16) ? 0 : 8,
- 1
- );
-
- /* 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, common_extensions, GL_FALSE );
- driInitExtensions( NULL, nv10_extensions, GL_FALSE );
- driInitExtensions( NULL, nv10_extensions, GL_FALSE );
- driInitExtensions( NULL, nv30_extensions, GL_FALSE );
- driInitExtensions( NULL, nv40_extensions, GL_FALSE );
- driInitExtensions( NULL, nv50_extensions, GL_FALSE );
- }
+ psp->DriverAPI = nouveauAPI;
+
+ /* 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, common_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv10_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv10_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv30_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv40_extensions, GL_FALSE );
+ driInitExtensions( NULL, nv50_extensions, GL_FALSE );
+
+ if (!nouveauInitDriver(psp))
+ return NULL;
- return (void *) psp;
+ return nouveauFillInModes(dri_priv->bpp,
+ (dri_priv->bpp == 16) ? 16 : 24,
+ (dri_priv->bpp == 16) ? 0 : 8,
+ 1);
}