I posted the following message to the DRI-devel lists the day before
yesterday and was told it might be of interest to this discussion. 
Additionally, I have attached some diffs, contrary to what is said as
follows.


I am pleased to report that thanks to the guidance Jens Owens gave in a
previous message, I have made 3D work on two heads simultaneously (IIRC,
the ATI Windows XP drivers didn't do this).  I have not provided a diff
because it is quite a hack and very system specific, at the moment. 
Effectively, I forced the virtual size to be 2048x768, hacked the
RADEONDoAdjustFrame() function to fix views as I wanted them, used the
default cloning stuff to setup the second monitor, and removed all the
conditionals that were preventing dual-head+DRI from working.  I had to
enable Xinerama (even though I have only one screen in the server setup)
in the config file; otherwise, the desktop would end at 1024 instead of
2048.  The problem I mentioned in a previous post -- not enough memory
for direct rendering w/ two screens -- was solved when I set it to 16
bpp.  Does anyone have any ideas for a more elegant implementation of
this functionality, especially where the config file is concerned?  This
is the first real code I have done in the Xserver and any input would be
appreciated.

--Jonathan Thambidurai


p.s. If there is something strange about the diffs, please tell me; it
is the first time I generated any
--- /usr/local/src/XFree86.current/xc/programs/Xserver/GL/dri/dri.c     2002-12-05 
10:26:57.000000000 -0500
+++ dri.c       2003-03-03 18:29:30.000000000 -0500
@@ -137,13 +137,13 @@
 #endif
 
 #if defined(PANORAMIX) || defined(XFree86LOADER)
-    if (xineramaInCore) {
-       if (!noPanoramiXExtension) {
-           DRIDrvMsg(pScreen->myNum, X_WARNING,
-               "Direct rendering is not supported when Xinerama is enabled\n");
-           return FALSE;
-       }
-    }
+/*     if (xineramaInCore) { */
+/*     if (!noPanoramiXExtension) { */
+/*         DRIDrvMsg(pScreen->myNum, X_WARNING, */
+/*             "Direct rendering is not supported when Xinerama is enabled\n"); */
+/*         return FALSE; */
+/*     } */
+/*     } */
 #endif
 
     drmWasAvailable = drmAvailable();
--- 
/usr/local/src/XFree86.current/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c
   2003-02-04 20:48:27.000000000 -0500
+++ radeon_driver.c     2003-03-03 19:16:23.000000000 -0500
@@ -2754,24 +2754,29 @@
     xf86SetCrtcForModes(pScrn, 0);
 
     /* We need to adjust virtual size if the clone modes have larger
-     * display size.
+     * display size. JDTHAX04: hardcoding large virtual area
      */
     if (info->Clone && info->CloneModes) {
        DisplayModePtr  clone_mode = info->CloneModes;
        while (1) {
-           if ((clone_mode->HDisplay > pScrn->virtualX) ||
-               (clone_mode->VDisplay > pScrn->virtualY)) {
-               pScrn->virtualX =
-                   pScrn->display->virtualX = clone_mode->HDisplay; 
-               pScrn->virtualY =
-                   pScrn->display->virtualY = clone_mode->VDisplay; 
-               RADEONSetPitch(pScrn);
-           }
+/*         if ((clone_mode->HDisplay > pScrn->virtualX) || */
+/*             (clone_mode->VDisplay > pScrn->virtualY)) { */
+/*             pScrn->virtualX = */
+/*                 pScrn->display->virtualX = clone_mode->HDisplay;  */
+/*             pScrn->virtualY = */
+/*                 pScrn->display->virtualY = clone_mode->VDisplay;  */
+/*             RADEONSetPitch(pScrn); */
+/*         } */
            if (!clone_mode->next) break;
            clone_mode = clone_mode->next;
        }
     }
 
+    pScrn->virtualX = pScrn->display->virtualX = 2048;
+    pScrn->virtualY = pScrn->display->virtualY = 768;
+    RADEONSetPitch(pScrn);
+    xf86DrvMsg(pScrn->scrnIndex, X_NOTICE,
+              "JDT HACK WORKING\n");
     pScrn->currentMode = pScrn->modes;
     xf86PrintModes(pScrn);
 
@@ -3463,18 +3468,18 @@
                info->directRenderingEnabled = FALSE;
            else {
                /* Xinerama has sync problem with DRI, disable it for now */
-               if (xf86IsEntityShared(pScrn->entityList[0])) {
-                   info->directRenderingEnabled = FALSE;
-                   xf86DrvMsg(scrnIndex, X_WARNING,
-                              "Direct Rendering Disabled -- "
-                              "Dual-head configuration is not working with "
-                              "DRI at present.\n"
-                              "Please use only one Device/Screen "
-                              "section in your XFConfig file.\n");
-               } else {
+/*             if (xf86IsEntityShared(pScrn->entityList[0])) { */
+/*                 info->directRenderingEnabled = FALSE; */
+/*                 xf86DrvMsg(scrnIndex, X_WARNING, */
+/*                            "Direct Rendering Disabled -- " */
+/*                            "Dual-head configuration is not working with " */
+/*                            "DRI at present.\n" */
+/*                            "Please use only one Device/Screen " */
+/*                            "section in your XFConfig file.\n"); */
+/*             } else { */
                    info->directRenderingEnabled =
                        RADEONDRIScreenInit(pScreen);
-               }
+/*             } */
 
                if (xf86IsEntityShared(pScrn->entityList[0])) {
                    DevUnion     *pPriv;
@@ -5492,11 +5497,23 @@
 {
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
-    int            reg, Base = y * info->CurrentLayout.displayWidth + x;
+    int            reg, Base;
+
 #ifdef XF86DRI
     RADEONSAREAPrivPtr pSAREAPriv;
 #endif
 
+    /*JDTHAX04*/
+    if(clone == 0){
+      x=1024;}
+    else{
+      x=0;}
+    Base = y  * info->CurrentLayout.displayWidth + x;
+
+    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+              "RADEONDoAdjustFrame(x=%d, y=%d, clone=%d)\n",
+              x, y, clone);
+
     switch (info->CurrentLayout.pixel_code) {
     case 15:
     case 16: Base *= 2; break;

Reply via email to