[Xorg-commit] xc/programs/Xserver/hw/xfree86/drivers/rendition rendition.c,1.1.4.1,1.1.4.2

Kaleb Keithley xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007


Committed by: kaleb

Update of /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/rendition
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/programs/Xserver/hw/xfree86/drivers/rendition

Modified Files:
      Tag: XORG-CURRENT
	rendition.c 
Log Message:
merge most of XFree86 RC3 (4.3.99.903) from vendor branch.
bug #214


Index: rendition.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/rendition.c	26 Nov 2003 22:48:59 -0000	1.1.4.1
+++ b/rendition.c	23 Feb 2004 21:35:41 -0000	1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.58 2003/11/03 05:11:26 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/rendition/rendition.c,v 1.59 2004/01/11 04:03:16 dawes Exp $ */
 /*
  * Copyright (C) 1998 The XFree86 Project, Inc.  All Rights Reserved.
  *
@@ -75,6 +75,22 @@
 #define RENDITION_VERSION_CURRENT ((RENDITION_VERSION_MAJOR << 24) | \
                  (RENDITION_VERSION_MINOR << 16) | RENDITION_PATCHLEVEL)
 
+/*
+ * Constants for the (theoretical) maximum width and height that can
+ * be used to display data on the CRT.  These were calculated from 
+ * the HORZ and VERT macors, respectively, in vmodes.c.
+ */
+static const int MAX_HDISPLAY = 2048;
+static const int MAX_VDISPLAY = 2048;
+
+/*
+ * Constants for the (theoretical) maximum line length of a scan line
+ * and scan lines per screen (including overdraw).  These were 
+ * calculated from the HORZ and VERT macors, respectively, in vmodes.c.
+ */
+static const int MAX_HTOTAL   = 2880;
+static const int MAX_VTOTAL   = 2184;
+
 /* 
  * local function prototypes
  */
@@ -533,15 +549,40 @@
     if (!xf86SetDepthBpp(pScreenInfo, 0, 0, 0, Support32bppFb))
         return FALSE;
 
-    if (pScreenInfo->depth == 15)
-    {
-        if (PCI_CHIP_V1000 != pRendition->PciInfo->chipType) {
-	    xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR,
-		       "Given depth (%d) is not supported by this chipset.\n",
-		       pScreenInfo->depth);
-	    return FALSE;
-	}
-    }
+    /* Verify that the color depth is supported. */
+    switch( pScreenInfo->depth ) {
+
+        case 8:
+        case 16:
+        case 24:
+        {
+            break;
+        }
+
+        case 15:
+        {
+            if (PCI_CHIP_V1000 != pRendition->PciInfo->chipType) {
+                xf86DrvMsg( pScreenInfo->scrnIndex, X_ERROR,
+                        "Given depth (%d) is not supported by this chipset.\n",
+                        pScreenInfo->depth);
+                return FALSE;
+            }
+        }
+
+        default:
+        {
+            xf86DrvMsg( pScreenInfo->scrnIndex, X_ERROR,
+                    "Given depth (%d) is not supported by this driver\n",
+                    pScreenInfo->depth );
+            return FALSE;
+        }
+
+    } /* End of switch( pScreenInfo->depth ) {*/
+
+
+    /* Print the color depth and frame buffer bits per pixel. */
+    xf86PrintDepthBpp( pScreenInfo );
+
 
     /* collect all of the options flags and process them */
 
@@ -788,12 +829,13 @@
      * Validate the modes.  Note that the limits passed to
      * xf86ValidateModes() are VGA CRTC architectural limits.
      */
-    pScreenInfo->maxHValue = 2080;
-    pScreenInfo->maxVValue = 1025;
+    pScreenInfo->maxHValue = MAX_HTOTAL;
+    pScreenInfo->maxVValue = MAX_VTOTAL;
     nModes = xf86ValidateModes(pScreenInfo,
             pScreenInfo->monitor->Modes, pScreenInfo->display->modes,
-            &renditionClockRange, NULL, 8, 2040, Rounding, 1, 1024,
-            pScreenInfo->display->virtualX, pScreenInfo->display->virtualY,
+            &renditionClockRange, NULL, 8, MAX_HDISPLAY, Rounding,
+            1, MAX_VDISPLAY, pScreenInfo->display->virtualX,
+            pScreenInfo->display->virtualY,
             0x10000, LOOKUP_CLOSEST_CLOCK | LOOKUP_CLKDIV2);
 
     if (nModes < 0)
@@ -1039,17 +1081,17 @@
     if (prenditionPriv->board.accel)
 	RENDITIONAccelNone(pScreenInfo);
 
+    if (pScreenInfo->vtSema)
+	renditionLeaveGraphics(pScreenInfo);
+
+    pScreenInfo->vtSema = FALSE;
+
     if (prenditionPriv 
 	&& (pScreen->CloseScreen = prenditionPriv->CloseScreen)) {
         prenditionPriv->CloseScreen = NULL;
         Closed = (*pScreen->CloseScreen)(scrnIndex, pScreen);
     }
     
-    if (pScreenInfo->vtSema)
-	renditionLeaveGraphics(pScreenInfo);
-
-    pScreenInfo->vtSema = FALSE;
-
 #ifdef DEBUG
     ErrorF("Closescreen OK...!!!!\n");
     sleep(1);
@@ -1104,6 +1146,8 @@
 
     verite_save(pScreenInfo);
 
+    pScreenInfo->vtSema = TRUE;
+
     if (!renditionSetMode(pScreenInfo, pScreenInfo->currentMode))
         return FALSE;
 
@@ -1225,7 +1269,6 @@
     if (pScreenInfo->depth > 1)
 	if (!xf86HandleColormaps(pScreen, 256, pScreenInfo->rgbBits,
 				 renditionLoadPalette, NULL,
-				 CMAP_LOAD_EVEN_IF_OFFSCREEN|
 				 CMAP_RELOAD_ON_MODE_SWITCH)) {
 	    xf86DrvMsg(pScreenInfo->scrnIndex, X_ERROR, 
 		       "Colormap initialization failed\n");





More information about the xorg-commit mailing list