summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/sis
diff options
context:
space:
mode:
authorThomas Hellström <[email protected]>2006-07-10 12:20:24 +0000
committerThomas Hellström <[email protected]>2006-07-10 12:20:24 +0000
commit85b4ae065435c8b4c4696b75e95f897130ee8bdf (patch)
treec677c5e8d73748d7d34cd68ca2b3204199bbb416 /src/mesa/drivers/dri/sis
parentb9920ba7b7fd8ed9a3c45e0cebafd28b419f73e3 (diff)
The SiS and Unichrome drivers assume that the handle to the
AGP map is equivalent to the AGP physical address. Fix this.
Diffstat (limited to 'src/mesa/drivers/dri/sis')
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.c2
-rw-r--r--src/mesa/drivers/dri/sis/sis_dd.c2
-rw-r--r--src/mesa/drivers/dri/sis/sis_screen.c29
-rw-r--r--src/mesa/drivers/dri/sis/sis_screen.h1
4 files changed, 29 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c
index 7e86c1127cb..a300a080ec0 100644
--- a/src/mesa/drivers/dri/sis/sis_context.c
+++ b/src/mesa/drivers/dri/sis/sis_context.c
@@ -272,7 +272,7 @@ sisCreateContext( const __GLcontextModes *glVisual,
/* set AGP */
smesa->AGPSize = sisScreen->agp.size;
smesa->AGPBase = sisScreen->agp.map;
- smesa->AGPAddr = sisScreen->agp.handle;
+ smesa->AGPAddr = sisScreen->agpBaseOffset;
/* Create AGP command buffer */
if (smesa->AGPSize != 0 &&
diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c
index 39c00a18af6..8fc7896b877 100644
--- a/src/mesa/drivers/dri/sis/sis_dd.c
+++ b/src/mesa/drivers/dri/sis/sis_dd.c
@@ -47,7 +47,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "utils.h"
-#define DRIVER_DATE "20051023"
+#define DRIVER_DATE "20060710"
/* Return the width and height of the given buffer.
*/
diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c
index d4395a9cddf..a721a724ac4 100644
--- a/src/mesa/drivers/dri/sis/sis_screen.c
+++ b/src/mesa/drivers/dri/sis/sis_screen.c
@@ -163,6 +163,7 @@ sisCreateScreen( __DRIscreenPrivate *sPriv )
if (sisDRIPriv->agp.size) {
sisScreen->agp.handle = sisDRIPriv->agp.handle;
+ sisScreen->agpBaseOffset = drmAgpBase(sPriv->fd);
sisScreen->agp.size = sisDRIPriv->agp.size;
if ( drmMap( sPriv->fd, sisScreen->agp.handle, sisScreen->agp.size,
&sisScreen->agp.map ) )
@@ -349,15 +350,37 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn,
static const __DRIversion ddx_expected = {0, 8, 0};
static const __DRIversion dri_expected = {4, 0, 0};
static const __DRIversion drm_expected = {1, 0, 0};
-
+ static const __DRIversion drm_compat = {2, 0, 0};
+ static const char *driver_name = "SiS";
dri_interface = interface;
- if (!driCheckDriDdxDrmVersions2("SiS", dri_version, &dri_expected,
+ /*
+ * Check ddx and dri only.
+ */
+
+ if (!driCheckDriDdxDrmVersions2(driver_name, dri_version, &dri_expected,
ddx_version, &ddx_expected,
- drm_version, &drm_expected)) {
+ drm_version, drm_version)) {
+ return NULL;
+ }
+
+ /*
+ * Check drm version with major versioning span.
+ */
+
+ if (((drm_version->major < drm_expected.major) ||
+ (drm_version->major > drm_compat.major)) ||
+ ((drm_version->major == drm_expected.major) &&
+ (drm_version->minor < drm_expected.minor))) {
+
+ fprintf(stderr, "%s DRI driver expected DRM version %d.%d.x - %d.x.x "
+ "but got version %d.%d.%d\n", driver_name,
+ drm_expected.major, drm_expected.minor, drm_compat.major,
+ drm_version->major, drm_version->minor, drm_version->patch);
return NULL;
}
+
psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
ddx_version, dri_version, drm_version,
frame_buffer, pSAREA, fd,
diff --git a/src/mesa/drivers/dri/sis/sis_screen.h b/src/mesa/drivers/dri/sis/sis_screen.h
index c3e9ef48764..d5b2101e980 100644
--- a/src/mesa/drivers/dri/sis/sis_screen.h
+++ b/src/mesa/drivers/dri/sis/sis_screen.h
@@ -41,6 +41,7 @@ typedef struct {
typedef struct {
sisRegionRec2 mmio;
sisRegionRec2 agp;
+ unsigned long agpBaseOffset;
unsigned int AGPCmdBufOffset;
unsigned int AGPCmdBufSize;