Fixes for x86_64 Unichrome.
authorThomas Hellström <thomas@tungstengraphics.com>
Wed, 16 Nov 2005 19:24:00 +0000 (19:24 +0000)
committerThomas Hellström <thomas@tungstengraphics.com>
Wed, 16 Nov 2005 19:24:00 +0000 (19:24 +0000)
src/mesa/drivers/dri/unichrome/via_context.c
src/mesa/drivers/dri/unichrome/via_context.h
src/mesa/drivers/dri/unichrome/via_fb.c
src/mesa/drivers/dri/unichrome/via_screen.c
src/mesa/drivers/dri/unichrome/via_screen.h

index 3ff79c06cd6329063b3211dfc997130ee98f212e..62498fb874564ebf7a49fade0ae3bc60b2e062b8 100644 (file)
@@ -675,13 +675,14 @@ viaCreateContext(const __GLcontextModes *visual,
     (*dri_interface->getUST)( &vmesa->swap_ust );
 
 
-    vmesa->regMMIOBase = (GLuint *)((GLuint)viaScreen->reg);
-    vmesa->pnGEMode = (GLuint *)((GLuint)viaScreen->reg + 0x4);
-    vmesa->regEngineStatus = (GLuint *)((GLuint)viaScreen->reg + 0x400);
-    vmesa->regTranSet = (GLuint *)((GLuint)viaScreen->reg + 0x43C);
-    vmesa->regTranSpace = (GLuint *)((GLuint)viaScreen->reg + 0x440);
+    vmesa->regMMIOBase = (GLuint *)((unsigned long)viaScreen->reg);
+    vmesa->pnGEMode = (GLuint *)((unsigned long)viaScreen->reg + 0x4);
+    vmesa->regEngineStatus = (GLuint *)((unsigned long)viaScreen->reg + 0x400);
+    vmesa->regTranSet = (GLuint *)((unsigned long)viaScreen->reg + 0x43C);
+    vmesa->regTranSpace = (GLuint *)((unsigned long)viaScreen->reg + 0x440);
     vmesa->agpBase = viaScreen->agpBase;
 
+
     return GL_TRUE;
 }
 
@@ -797,9 +798,9 @@ viaMakeCurrent(__DRIcontextPrivate *driContextPriv,
                __DRIdrawablePrivate *driReadPriv)
 {
     if (VIA_DEBUG & DEBUG_DRI) {
-       fprintf(stderr, "driContextPriv = %08x\n", (GLuint)driContextPriv);
-       fprintf(stderr, "driDrawPriv = %08x\n", (GLuint)driDrawPriv);    
-       fprintf(stderr, "driReadPriv = %08x\n", (GLuint)driReadPriv);
+       fprintf(stderr, "driContextPriv = %016lx\n", (unsigned long)driContextPriv);
+       fprintf(stderr, "driDrawPriv = %016lx\n", (unsigned long)driDrawPriv);    
+       fprintf(stderr, "driReadPriv = %016lx\n", (unsigned long)driReadPriv);
     }  
 
     if (driContextPriv) {
index 59311eab362204a02d40cc81774db5e00baf1838..9d7a0e6cb64a0bd0f9b19efb375df13882d37fd6 100644 (file)
@@ -89,8 +89,8 @@ struct via_renderbuffer {
    struct gl_renderbuffer Base;  /* must be first! */
    drm_handle_t handle;
    drmSize size;
-   GLuint offset;
-   GLuint index;
+   unsigned long offset;
+   unsigned long index;
    GLuint pitch;
    GLuint bpp;
    char *map;
@@ -106,8 +106,8 @@ struct via_renderbuffer {
 struct via_tex_buffer {
    struct via_tex_buffer *next, *prev;
    struct via_texture_image *image;
-   GLuint index;
-   GLuint offset;
+   unsigned long index;
+   unsigned long offset;
    GLuint size;
    GLuint memType;    
    unsigned char *bufAddr;
@@ -303,7 +303,7 @@ struct via_context {
    volatile GLuint* regEngineStatus;
    volatile GLuint* regTranSet;
    volatile GLuint* regTranSpace;
-   GLuint* agpBase;
+   GLuint agpBase;
    GLuint drawType;
 
    GLuint nDoneFirstFlip;
index 5b6ed9bb302cfb0e0e9445a13b59607f3ef57cb7..48c7ed4caa5c2741411da48e2203abe65b0de37b 100644 (file)
@@ -142,12 +142,12 @@ via_alloc_texture(struct via_context *vmesa,
       t->index = fb.index;
       
       if (t->memType == VIA_MEM_AGP) {
-        t->bufAddr = (GLubyte *)((GLuint)vmesa->viaScreen->agpLinearStart +
+        t->bufAddr = (GLubyte *)((unsigned long)vmesa->viaScreen->agpLinearStart +
                                  fb.offset);   
-        t->texBase = (GLuint)vmesa->agpBase + fb.offset;
+        t->texBase = vmesa->agpBase + fb.offset;
       }
       else {
-        t->bufAddr = (GLubyte *)(fb.offset + (GLuint)vmesa->driScreen->pFB);
+        t->bufAddr = (GLubyte *)((unsigned long)vmesa->driScreen->pFB + fb.offset);
         t->texBase = fb.offset;
       }
 
index 424a037a0ab0311f15be76cf3cf74d62a7b79ca3..24c62198ac6e89fe2f258fc75f23af701fd57bb1 100644 (file)
@@ -168,8 +168,14 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
            sPriv->private = NULL;
            __driUtilMessage("viaInitDriver: drmMap agp failed");
            return GL_FALSE;
-       }           
-       viaScreen->agpBase = (GLuint *)gDRIPriv->agp.handle;
+       }
+           
+       /*
+        * FIXME: This is an invalid assumption that works until handle is
+        * changed to mean something else than the 32-bit physical AGP address.
+        */
+
+       viaScreen->agpBase = gDRIPriv->agp.handle;
     } else
        viaScreen->agpLinearStart = 0;
 
index 8239960a632b1b5ac54afc17996755b99bef167b..84aa5aef88e0f0e4d221b38829a212325b29f789 100644 (file)
@@ -59,7 +59,7 @@ typedef struct {
     
     drmAddress reg;
     drmAddress agpLinearStart;
-    GLuint* agpBase;
+    GLuint agpBase;
 
     __DRIscreenPrivate *driScrnPriv;
     drmBufMapPtr bufs;