[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

X Strike Force X.Org X11 SVN commit: r2476 - trunk/debian/xorg/debian



Author: jurij
Date: 2006-07-19 01:16:26 -0400 (Wed, 19 Jul 2006)
New Revision: 2476

Modified:
   trunk/debian/xorg/debian/changelog
   trunk/debian/xorg/debian/xserver-xorg.config.in
   trunk/debian/xorg/debian/xserver-xorg.postinst.in
Log:
  * Fix the currently broken sparc hardware detection in config and
    postinst scripts:
    - introduce a new discover_sparc_video() function which uses prtconf
      rather than discover to do the hardware detection. discover does not
      support detection of devices attached to UPA and SBUS buses, common
      on sparc, so it's pretty useless there.
    - use this function on sparc by introducing the DISCOVER_PROG and
      DISCOVER_FUNC variables, preserving the old behavior for all other
      arches. Adjust the debugging messages appropriately.
    - set the default sparc driver to 'sunffb'.
    - set default keyboard rules for sparc to 'xorg' instead of obsolete
      'sun'. The keyboard layer in 2.6 kernels have been unified across
      all arches, so 'xorg' is the correct setting now.
    - add 'cfb' and 'cfb32' to the list of modules loaded by default on
      sparc, since the symbols provided by them are required by sunffb
      driver. Closes: #352869, #377809
    - set the default color depth to 8 for the 'cgsix' driver, as it's the
      maximum depth supported by it.



Modified: trunk/debian/xorg/debian/changelog
===================================================================
--- trunk/debian/xorg/debian/changelog	2006-07-18 22:28:52 UTC (rev 2475)
+++ trunk/debian/xorg/debian/changelog	2006-07-19 05:16:26 UTC (rev 2476)
@@ -21,13 +21,31 @@
     - Khmer (auk piseth). Closes: #375063
     - Dzongkha (Jurmey Rabgay).
 
-  [ Michel Dänzer ]
+  [ Michel Dänzer ] 
   * Add debian/scripts/vars.armeb, thanks Lennert Buytenhek. Closes: #367188
 
   [ Jurij Smakov ]
   * Remove xserver-xorg-video-{newport,tga} from XSERVER_XORG_VIDEO_DEPENDS
     on sparc, since these drivers do not built on sparc (sparc is not in
     the arch list). Thanks to Julien Cristau for pointing it out.
+  * Fix the currently broken sparc hardware detection in config and 
+    postinst scripts:
+    - introduce a new discover_sparc_video() function which uses prtconf
+      rather than discover to do the hardware detection. discover does not
+      support detection of devices attached to UPA and SBUS buses, common
+      on sparc, so it's pretty useless there.
+    - use this function on sparc by introducing the DISCOVER_PROG and
+      DISCOVER_FUNC variables, preserving the old behavior for all other
+      arches. Adjust the debugging messages appropriately.
+    - set the default sparc driver to 'sunffb'.
+    - set default keyboard rules for sparc to 'xorg' instead of obsolete
+      'sun'. The keyboard layer in 2.6 kernels have been unified across
+      all arches, so 'xorg' is the correct setting now.
+    - add 'cfb' and 'cfb32' to the list of modules loaded by default on
+      sparc, since the symbols provided by them are required by sunffb
+      driver. Closes: #352869, #377809
+    - set the default color depth to 8 for the 'cgsix' driver, as it's the
+      maximum depth supported by it.
 
  -- Michel Dänzer <daenzer@debian.org>  Sun, 25 Jun 2006 13:29:40 +0200
 

Modified: trunk/debian/xorg/debian/xserver-xorg.config.in
===================================================================
--- trunk/debian/xorg/debian/xserver-xorg.config.in	2006-07-18 22:28:52 UTC (rev 2475)
+++ trunk/debian/xorg/debian/xserver-xorg.config.in	2006-07-19 05:16:26 UTC (rev 2476)
@@ -58,6 +58,85 @@
   debug_echo "$1 exited with status $2"
 }
 
+discover_sparc_video () {
+  # Detect video cards on sparc by parsing prtconf output
+  prtconf -p -v | awk '
+  BEGIN {
+          display_node = 0; 
+          model = ""; 
+          name = ""; 
+  }
+  /Node/ {
+           if(display_node == 1) {
+             printf "model=\"%s\" name=\"%s\"\n", model, name
+             display_node = 0;
+           };
+           model = "";
+           name = ""
+  }
+  /device_type:/ {
+                   if(index($2, "display") != 0) {
+                     display_node = 1
+                   }
+  }
+  /model:/ { l=length($2); model = substr($2, 2, l-2) }
+  /name:/  { l=length($2); name = substr($2, 2, l-2) }
+  END{
+       if(display_node == 1) {
+         printf "model=\"%s\" name=\"%s\"\n", model, name
+       }; 
+  }' | \
+  while read line
+  do
+    eval "${line}"
+#   Match the name and the model to the driver.
+    test -z "${name}" && continue
+#   The model stored in the prom is usually not too
+#   informative, so that we need to provide some
+#   sensible human-readable card identification as well.
+    server='XFree86'
+    case "${name}" in
+      'cgsix' )
+        card='Sun CG6 framebuffer'
+        driver='suncg6' 
+	;;
+      'SUNW,sx' )
+        card='Sun CG14 framebuffer'
+        driver='suncg14'
+        ;;
+      'SUNW,leo' )
+        card='Sun LEO framebuffer'
+        driver='sunleo'
+        ;;
+      'SUNW,tcx' )
+        card='Sun TCX framebuffer' 
+        driver='suntcx'
+	;;
+      'SUNW,m64B' )
+        card='ATI Technologies 3D Rage Pro or similar'
+        driver='ati'
+        ;;
+      'SUNW,ffb' )
+        card='Sun Creator3D framebuffer or similar'
+        driver='sunffb'
+        ;;
+      'SUNW,afb' )
+        card='Sun Elite3D framebuffer or similar'
+        driver='sunffb'
+        ;;
+      * )
+        card='Unknown'
+        server='unknown'
+        driver='unknown'
+        ;;
+    esac
+    if [ -n "${model}" ]; then
+      card="${card} (${model})"
+    fi
+    echo -e "${card}\t${server}\t${driver}"
+  done
+}
+
 discover_video () {
   # wrapper for discover command that can distinguish Discover 1.x and 2.x
 
@@ -550,8 +629,18 @@
 fi
 
 # collect information about installed video card(s), if possible
-if which discover > /dev/null 2>&1; then
-  DISCOVERED_VIDEO=$(discover_video)
+case "$ARCH" in
+  sparc)
+    DISCOVER_PROG='prtconf'
+    DISCOVER_FUNC='discover_sparc_video'
+    ;;
+  *)
+    DISCOVER_PROG='discover'
+    DISCOVER_FUNC='discover_video'
+    ;;
+esac
+if which $DISCOVER_PROG > /dev/null 2>&1; then
+  DISCOVERED_VIDEO=$($DISCOVER_FUNC)
   MULTIHEAD=$(echo "$DISCOVERED_VIDEO" | wc -l)
   DISCOVERED_VIDEO=$(echo "$DISCOVERED_VIDEO" | head -n 1)
   if [ -n "$DISCOVERED_VIDEO" ]; then
@@ -573,7 +662,7 @@
 # set a failsafe default answer for shared/default-x-server
 DEFAULT=$THIS_PACKAGE
 
-if which discover > /dev/null 2>&1; then
+if which $DISCOVER_PROG > /dev/null 2>&1; then
   if [ -n "$FIRSTINST" ] || [ -n "$RECONFIGURE" ]; then
     PRIORITY="medium"
     if [ -n "$RECONFIGURE" ]; then
@@ -621,7 +710,7 @@
     debug_echo "upgrading package; not running autodetection script"
   fi
 else
-  debug_echo "could not autodetect X server: discover not found"
+  debug_echo "could not autodetect X server: $DISCOVER_PROG not found"
 fi
 
 # now the default-x-server question may be asked
@@ -670,6 +759,9 @@
   amd64|hurd-i386|i386)
     DEFAULT_DRIVER=vesa
     ;;
+  sparc)
+    DEFAULT_DRIVER=sunffb
+    ;;
   *)
     DEFAULT_DRIVER=fbdev
     ;;
@@ -683,7 +775,7 @@
 observe "available video driver list set to \"$DRIVER_LIST\""
 
 if [ -n "$FIRSTINST" ] || [ -n "$RECONFIGURE" ]; then
-  if which discover >/dev/null 2>&1; then
+  if which $DISCOVER_PROG >/dev/null 2>&1; then
     if [ "$AUTODETECT_VIDEO_CARD" = "true" ]; then
       if [ $NDRIVERS -eq 0 ]; then
         observe "could not autodetect X server driver: no video card" \
@@ -710,7 +802,7 @@
       observe "user declined video card autodetection (driver)"
     fi
   else
-    observe "could not autodetect X server driver: discover not found"
+    observe "could not autodetect X server driver: $DISCOVER_PROG not found"
   fi
 
   db_subst xserver-xorg/config/device/driver choices "$DRIVER_LIST"
@@ -720,7 +812,7 @@
   # card identifier; try to set a sensible default
   DEFAULT=
   if [ -n "$(echo $NDRIVERS)" ] && [ $NDRIVERS -eq 1 ] && [ $NCARDS -eq 1 ]; then
-    if which discover > /dev/null 2>&1; then
+    if which $DISCOVER_PROG > /dev/null 2>&1; then
       if [ "$AUTODETECT_VIDEO_CARD" = "true" ]; then
         DEFAULT=$(echo "$DISCOVERED_VIDEO" | awk 'BEGIN { FS="\t" } {print $1}')
       fi
@@ -985,11 +1077,7 @@
 # these questions require input validation
 PRIORITY=medium
 
-if [ "$ARCH" = "sparc" ]; then
-  DEFAULT=sun
-else
-  DEFAULT=xorg
-fi
+DEFAULT=xorg
 MAY_BE_NULL= auto_answer validate_string_db_input "$(priority_ceil $PRIORITY)" xserver-xorg/config/inputdevice/keyboard/rules "$DEFAULT"
 
 if [ -z "$XKBMODEL" ]; then
@@ -1117,7 +1205,11 @@
   db_set xserver-xorg/config/modules "$MODULES"
 fi
 
-auto_answer db_input "$(priority_ceil low)" xserver-xorg/config/modules "i2c, bitmap, ddc, dri, extmod, freetype, glx, int10, type1, vbe" || true
+DEFAULT_MODULES='i2c, bitmap, ddc, dri, extmod, freetype, glx, int10, type1, vbe'
+if [ "$ARCH" = 'sparc' ]; then
+  DEFAULT_MODULES="${DEFAULT_MODULES}, cfb, cfb32"
+fi
+auto_answer db_input "$(priority_ceil low)" xserver-xorg/config/modules "${DEFAULT_MODULES}" || true
 db_go
 
 # files and dri sections

Modified: trunk/debian/xorg/debian/xserver-xorg.postinst.in
===================================================================
--- trunk/debian/xorg/debian/xserver-xorg.postinst.in	2006-07-18 22:28:52 UTC (rev 2475)
+++ trunk/debian/xorg/debian/xserver-xorg.postinst.in	2006-07-19 05:16:26 UTC (rev 2476)
@@ -703,6 +703,9 @@
     savage)
       DEFAULT_DEPTH=16
       ;;
+    cgsix)
+      DEFAULT_DEPTH=8
+      ;;
     *)
       DEFAULT_DEPTH=24
       ;;



Reply to: