José Fonseca wrote:

On Thu, Feb 27, 2003 at 10:19:46AM +0000, José Fonseca wrote:


In the meanwhile I'm going to look to Utah-GLX Savage4 driver to get a
grasp of what DMA works there so that, een though they just use MMIO
internally, we get the DRM interfaces right from the beginning.



Ok. I've been through the specs, the Utah-GLX Savage3D OpenGL driver, and the XFree86 2D Savage drivers and this are my notes about the Savage chips DMA operation.

1. As usual, at first level you have MMIO, which can access to all
register.

2. Then you have BCI (Burst Command Interface - not BCE, sorry), which
can access to a subset of the registers. Basically it consists a memory
region in the MMIO range where one performs consecutives writes (the
exact address is not important, as long as the writes are consecutive)
which are then sent to the FIFO or, if the FIFO is full, to a circular
buffer on the framebuffer (which can be as big as 1MB). IRQ's can be
generated with the BCI is idle.

This circular buffer is that "command overflow buffer" mentioned in the savage_driver.h, right?
I resolved all FIXMEs concerning the framebuffer now. I did this by examining the radeon and the existing savage code. It was somehow hard to distinguish between the variable names in SavagePtr structure. I am not 100% sure whether I chose always the right one, but I tried to do it with care. I removed a variable which I added in the last patch because I think it was right there but with a slightly different name. The patch is attached and it would be great if someone could review them. If everything is okay then I will proceed with the ringbuffer.


--Andreas Karrenbauer
Index: savage_dri.c
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/savage/Attic/savage_dri.c,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 savage_dri.c
--- savage_dri.c        26 Feb 2003 20:18:00 -0000      1.1.2.2
+++ savage_dri.c        28 Feb 2003 04:36:43 -0000
@@ -576,7 +576,7 @@
 {
                                /* Map registers */
     psav->registerSize = SAVAGE_NEWMMIO_REGSIZE;
-    if (drmAddMap(psav->drmFD, psav->MMIOAddr, psav->registerSize,
+    if (drmAddMap(psav->drmFD, psav->MmioBase, psav->registerSize,
                  DRM_REGISTERS, DRM_READ_ONLY, &psav->registerHandle) < 0) {
        return FALSE;
     }
@@ -620,8 +620,7 @@
     drmInfo.depth_offset        = psav->depthOffset;
     drmInfo.depth_pitch         = psav->depthPitch * cpp;
 
-    /* FIXME: we do not support framebuffer right now */
-    /* drmInfo.fb_offset           = psav->LinearAddr; */
+    drmInfo.fb_offset           = psav->FrameBufferBase;
     drmInfo.mmio_offset         = psav->registerHandle;
     /* FIXME:   drmInfo.ring_offset         = psav->ringHandle; */
     /* FIXME:   drmInfo.ring_rptr_offset    = psav->ringReadPtrHandle; */
@@ -978,12 +977,10 @@
     pDRIInfo->ddxDriverMajorVersion      = SAVAGE_VERSION_MAJOR;
     pDRIInfo->ddxDriverMinorVersion      = SAVAGE_VERSION_MINOR;
     pDRIInfo->ddxDriverPatchVersion      = SAVAGE_VERSION_PATCH;
-    /* FIXME: we do not support framebuffer right now
-    pDRIInfo->frameBufferPhysicalAddress = psav->LinearAddr;
-    pDRIInfo->frameBufferSize            = psav->FbMapSize;
+    pDRIInfo->frameBufferPhysicalAddress = psav->FrameBufferBase;
+    pDRIInfo->frameBufferSize            = psav->videoRambytes;
     pDRIInfo->frameBufferStride          = (pScrn->displayWidth *
-                                           psav->CurrentLayout.pixel_bytes);
-    */
+                                           ( pScrn->bitsPerPixel + 1 ) / 8);
     /* FIXME: this is not used yet
     pDRIInfo->ddxDrawableTableEntry      = SAVAGE_MAX_DRAWABLES;
     pDRIInfo->maxDrawableTableEntry      = (SAREA_MAX_DRAWABLES
Index: savage_driver.h
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_driver.h,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 savage_driver.h
--- savage_driver.h     26 Feb 2003 20:18:01 -0000      1.7.2.2
+++ savage_driver.h     28 Feb 2003 04:36:43 -0000
@@ -261,7 +261,6 @@
   
   /* added by Andreas Karrenbauer to make it compilable */
   Bool noBackBuffer;
-  unsigned long MMIOAddr;
 #endif
     
     /* Support for XVideo */

Reply via email to