xf86-video-ati: Branch 'master' - 2 commits

Dave Airlie airlied at kemper.freedesktop.org
Fri Oct 9 03:10:39 PDT 2009


 src/drmmode_display.c |   83 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/radeon_driver.c   |    9 -----
 src/radeon_kms.c      |    4 +-
 3 files changed, 85 insertions(+), 11 deletions(-)

New commits:
commit 1b25bad2d8ebe481ffb4b0fd3a85ab636bd4fec2
Author: Dave Airlie <airlied at linux.ie>
Date:   Fri Oct 9 20:09:52 2009 +1000

    Revert "radeon: clamp the internal FB map to the aperture size"
    
    This reverts commit 5f846360c46f5a989f5d0fde6d251cdbd61d4968.
    
    Numerous reports of system hangs since this, I'm guessing
    some sort of conflict with the drm memory setup. This code
    has always been fragile between kernel/userspace drivers.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index d5704d3..d039920 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1403,15 +1403,6 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn)
     if (aper_size > mem_size)
 	mem_size = aper_size;
 
-    /* don't map the whole FB in the internal address space.
-     * we don't currently use fb space larger than the aperture
-     * size and on cards with 1 GB of vram, this can overflow
-     * the internal top of gart calculation on some systems.
-     * See fdo bug 24301.
-     */
-    if (mem_size > aper_size)
-	mem_size = aper_size;
-
 #ifdef XF86DRI
     /* Apply memory map limitation if using an old DRI */
     if (info->directRenderingEnabled && !info->dri->newMemoryMap) {
commit a956d478043b44c49aed39c7aa3d576ef32cadc5
Author: Dave Airlie <airlied at linux.ie>
Date:   Fri Oct 9 20:08:31 2009 +1000

    Revert "kms: setup colormap and gamma correctly."
    
    This reverts commit 60d9685abddccec17c1a9a5ec48cbe9c92543e0f.
    
    which breaks colormap on 1.6 X server
    
    Conflicts:
    
    	src/drmmode_display.c

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8310e0b..86adfeb 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1170,4 +1170,87 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode)
 	}
 	return TRUE;
 }
+
+static void drmmode_load_palette(ScrnInfoPtr pScrn, int numColors,
+                                 int *indices, LOCO *colors, VisualPtr pVisual)
+{
+    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+    uint16_t       lut_r[256], lut_g[256], lut_b[256];
+    int index, j, i;
+    int c;
+
+    for (c = 0; c < xf86_config->num_crtc; c++) {
+        xf86CrtcPtr crtc = xf86_config->crtc[c];
+	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+        for (i = 0 ; i < 256; i++) {
+            lut_r[i] = drmmode_crtc->lut_r[i] << 6;
+            lut_g[i] = drmmode_crtc->lut_g[i] << 6;
+            lut_b[i] = drmmode_crtc->lut_b[i] << 6;
+        }
+
+        switch(pScrn->depth) {
+        case 15:
+            for (i = 0; i < numColors; i++) {
+                index = indices[i];
+                for (j = 0; j < 8; j++) {
+                    lut_r[index * 8 + j] = colors[index].red << 6;
+                    lut_g[index * 8 + j] = colors[index].green << 6;
+                    lut_b[index * 8 + j] = colors[index].blue << 6;
+                }
+            }
+         break;
+         case 16:
+             for (i = 0; i < numColors; i++) {
+                 index = indices[i];
+
+                  if (i <= 31) {
+                      for (j = 0; j < 8; j++) {
+                          lut_r[index * 8 + j] = colors[index].red << 6;
+                          lut_b[index * 8 + j] = colors[index].blue << 6;
+                      }
+                  }
+
+                  for (j = 0; j < 4; j++) {
+                      lut_g[index * 4 + j] = colors[index].green << 6;
+                  }
+              }
+	  break;
+          default:
+              for (i = 0; i < numColors; i++) {
+                  index = indices[i];
+                  lut_r[index] = colors[index].red << 6;
+                  lut_g[index] = colors[index].green << 6;
+                  lut_b[index] = colors[index].blue << 6;
+              }
+              break;
+          }
+
+    /* Make the change through RandR */
+#ifdef RANDR_12_INTERFACE
+        if (crtc->randr_crtc)
+            RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b);
+        else
+#endif
+            crtc->funcs->gamma_set(crtc, lut_r, lut_g, lut_b, 256);
+     }
+}
+
+Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
+{
+    xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
+                  "Initializing kms color map\n");
+    if (!miCreateDefColormap(pScreen))
+        return FALSE;
+    /* all radeons support 10 bit CLUTs */
+    if (!xf86HandleColormaps(pScreen, 256, 10,
+                             drmmode_load_palette, NULL,
+                             CMAP_PALETTED_TRUECOLOR
+#if 0 /* This option messes up text mode! (eich at suse.de) */
+                             | CMAP_LOAD_EVEN_IF_OFFSCREEN
+#endif
+                             | CMAP_RELOAD_ON_MODE_SWITCH))
+         return FALSE;
+    return TRUE;
+}
 #endif
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index faa6025..b3fe20c 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -767,8 +767,8 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
 //    info->PointerMoved = pScrn->PointerMoved;
 //    pScrn->PointerMoved = RADEONPointerMoved;
 
-    if (!miCreateDefColormap(pScreen))
-        return FALSE;
+    if (!drmmode_setup_colormap(pScreen, pScrn))
+	return FALSE;
 
    /* Note unused options */
     if (serverGeneration == 1)


More information about the xorg-commit mailing list