summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/savage
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/savage
parentbf805d3bf5bf191aa669b6155316a78917cf9b0e (diff)
parenta2494462cb7d557a7643452c720e0ab8fa9f4f63 (diff)
Merge branch 'dri2'
Conflicts: src/mesa/drivers/dri/i915/intel_screen.c
Diffstat (limited to 'src/mesa/drivers/dri/savage')
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c94
-rw-r--r--src/mesa/drivers/dri/savage/savagetex.c4
2 files changed, 38 insertions, 60 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index 43422db9a8..013e88216f 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -168,6 +168,10 @@ static const struct tnl_pipeline_stage *savage_pipeline[] = {
};
+static const __DRIextension *savageExtensions[] = {
+ &driReadDrawableExtension,
+};
+
/* this is first function called in dirver*/
static GLboolean
@@ -175,9 +179,6 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
{
savageScreenPrivate *savageScreen;
SAVAGEDRIPtr gDRIPriv = (SAVAGEDRIPtr)sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->getProcAddress("glxEnableExtension"));
-
if (sPriv->devPrivSize != sizeof(SAVAGEDRIRec)) {
fprintf(stderr,"\nERROR! sizeof(SAVAGEDRIRec) does not match passed size from device driver\n");
@@ -265,10 +266,7 @@ savageInitDriver(__DRIscreenPrivate *sPriv)
driParseOptionInfo (&savageScreen->optionCache,
__driConfigOptions, __driNConfigOptions);
- if (glx_enable_extension != NULL) {
- (*glx_enable_extension)(sPriv->psc->screenConfigs,
- "GLX_SGI_make_current_read");
- }
+ sPriv->extensions = savageExtensions;
#if 0
savageDDFastPathInit();
@@ -525,7 +523,7 @@ savageCreateContext( const __GLcontextModes *mesaVis,
"enable_fastpath");
/* DRM versions before 2.1.3 would only render triangle lists. ELTS
* support was added in 2.2.0. */
- if (imesa->enable_fastpath && sPriv->drmMinor < 2) {
+ if (imesa->enable_fastpath && sPriv->drm_version.minor < 2) {
fprintf (stderr,
"*** Disabling fast path because your DRM version is buggy "
"or doesn't\n*** support ELTS. You need at least Savage DRM "
@@ -920,7 +918,6 @@ void savageGetLock( savageContextPtr imesa, GLuint flags )
static const struct __DriverAPIRec savageAPI = {
- savageInitDriver,
savageDestroyScreen,
savageCreateContext,
savageDestroyContext,
@@ -1017,63 +1014,44 @@ savageFillInModes( 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 = { 2, 0, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 2, 1, 0 };
-
- dri_interface = interface;
+ SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv;
if ( ! driCheckDriDdxDrmVersions2( "Savage",
- 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, &savageAPI);
- if ( psp != NULL ) {
- SAVAGEDRIPtr dri_priv = (SAVAGEDRIPtr)psp->pDevPriv;
- *driver_modes = savageFillInModes( dri_priv->cpp*8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8,
- (dri_priv->backOffset != dri_priv->depthOffset) );
-
- /* 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 );
- }
- return (void *) psp;
+ psp->DriverAPI = savageAPI;
+
+ /* 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 (!savageInitDriver(psp))
+ return NULL;
+
+ return savageFillInModes( dri_priv->cpp*8,
+ (dri_priv->cpp == 2) ? 16 : 24,
+ (dri_priv->cpp == 2) ? 0 : 8,
+ (dri_priv->backOffset != dri_priv->depthOffset) );
}
diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c
index 719e50f964..1dcfee291f 100644
--- a/src/mesa/drivers/dri/savage/savagetex.c
+++ b/src/mesa/drivers/dri/savage/savagetex.c
@@ -1016,7 +1016,7 @@ static void savageUploadTexImages( savageContextPtr imesa, savageTexObjPtr t )
/* Heap timestamps are only reliable with Savage DRM 2.3.x or
* later. Earlier versions had only 16 bit time stamps which
* would wrap too frequently. */
- if (imesa->savageScreen->driScrnPriv->drmMinor >= 3) {
+ if (imesa->savageScreen->driScrnPriv->drm_version.minor >= 3) {
unsigned int heap = t->base.heap->heapId;
LOCK_HARDWARE(imesa);
savageWaitEvent (imesa, imesa->textureHeaps[heap]->timestamp);
@@ -1713,7 +1713,7 @@ static void savageTimestampTextures( savageContextPtr imesa )
* Only useful with long-lived 32-bit event tags available
* with Savage DRM 2.3.x or later. */
if ((imesa->CurrentTexObj[0] || imesa->CurrentTexObj[1]) &&
- imesa->savageScreen->driScrnPriv->drmMinor >= 3) {
+ imesa->savageScreen->driScrnPriv->drm_version.minor >= 3) {
unsigned int e;
FLUSH_BATCH(imesa);
e = savageEmitEvent(imesa, SAVAGE_WAIT_3D);