Source-Changes-HG archive

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

[xsrc/trunk]: xsrc/external/mit/xorg-server.old/dist/hw/sun Cherry-pick to sy...



details:   https://anonhg.NetBSD.org/xsrc/rev/8d49d144ff02
branches:  trunk
changeset: 10541:8d49d144ff02
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Aug 09 16:01:19 2020 +0000

description:
Cherry-pick to sync with xorg-server:

 Inform detected keyboard type and layout via LogMessage().
 Remove a leftover variable for non-XKB autorepeat.
 Remove redundant command option arg checks.
 Put probed framebuffer info to a log file by default.

diffstat:

 external/mit/xorg-server.old/dist/hw/sun/sun.h     |   3 +-
 external/mit/xorg-server.old/dist/hw/sun/sunCfb.c  |  26 +++++---------
 external/mit/xorg-server.old/dist/hw/sun/sunInit.c |  38 +++++++++++++++------
 external/mit/xorg-server.old/dist/hw/sun/sunIo.c   |   2 +
 4 files changed, 39 insertions(+), 30 deletions(-)

diffs (208 lines):

diff -r 1840e0267a43 -r 8d49d144ff02 external/mit/xorg-server.old/dist/hw/sun/sun.h
--- a/external/mit/xorg-server.old/dist/hw/sun/sun.h    Sun Aug 09 14:55:26 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sun.h    Sun Aug 09 16:01:19 2020 +0000
@@ -295,10 +295,11 @@
 
 /* sunInit.c */
 extern EventList       *sunEvents;
-extern Bool            sunAutoRepeatHandlersInstalled;
 extern sunFbDataRec    sunFbData[];
 extern fbFd            sunFbs[];
 extern Bool            sunSwapLkeys;
+extern Bool            sunForceMono;
+extern Bool            sunDebug;
 extern Bool            sunFlipPixels;
 extern Bool            sunFbInfo;
 extern Bool            sunCG4Frob;
diff -r 1840e0267a43 -r 8d49d144ff02 external/mit/xorg-server.old/dist/hw/sun/sunCfb.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunCfb.c Sun Aug 09 14:55:26 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunCfb.c Sun Aug 09 16:01:19 2020 +0000
@@ -98,7 +98,7 @@
 static void CGRestoreColormap(ScreenPtr);
 static void CGScreenInitCommon(ScreenPtr);
 static void CGScreenInit(ScreenPtr);
-static void checkMono(int, char **);
+static void checkMono(void);
 #ifdef INCLUDE_CG2_HEADER
 static void CG2UpdateColormap(ScreenPtr, int, int, u_char *, u_char *, u_char *);
 static void CG2GetColormap(ScreenPtr, int, int, u_char *, u_char *, u_char *);
@@ -307,13 +307,11 @@
 }
 
 static void
-checkMono(int argc, char** argv)
+checkMono(void)
 {
-    int i;
 
-    for (i = 1; i < argc; i++)
-       if (strcmp (argv[i], "-mono") == 0)
-           ErrorF ("-mono not appropriate for CG3/CG4/CG6\n");
+    if (sunForceMono)
+       ErrorF("-mono not appropriate for CG3/CG4/CG6\n");
 }
 
 /*
@@ -334,7 +332,7 @@
     char         **argv        /* The arguments themselves. Don't change! */
 )
 {
-    checkMono (argc, argv);
+    checkMono();
     sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     return sunInitCommon (screen, pScreen, (off_t) CG3_MMAP_OFFSET,
        sunCfbScreenInit, CGScreenInit,
@@ -349,7 +347,7 @@
     char         **argv        /* The arguments themselves. Don't change! */
 )
 {
-    checkMono (argc, argv);
+    checkMono();
     sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     return sunInitCommon (screen, pScreen, (off_t) 0,
        sunCfbScreenInit, CGScreenInit,
@@ -454,18 +452,12 @@
     char**     argv            /* The arguments themselves. Don't change! */
 )
 {
-    int                i;
     Bool       ret;
-    Bool       mono = FALSE;
-
-    for (i = 1; i < argc; i++)
-       if (strcmp (argv[i], "-mono") == 0)
-           mono = TRUE;
 
     sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     pScreen->SaveScreen = CG2SaveScreen;
 #ifndef LOWMEMFTPT
-    if (mono) {
+    if (sunForceMono) {
        pScreen->whitePixel = 0;
        pScreen->blackPixel = 1;
        sunFbs[screen].info.fb_depth = 1;
@@ -514,7 +506,7 @@
     char**     argv            /* The arguments themselves. Don't change! */
 )
 {
-    checkMono (argc, argv);
+    checkMono();
     if (sunCG4Frob)
        sunFbs[screen].EnterLeave = (void (*)(ScreenPtr, int))NoopDDA;
     else
@@ -539,7 +531,7 @@
 {
     pointer    fb;
 
-    checkMono (argc, argv);
+    checkMono();
     if (!sunScreenAllocate (pScreen))
        return FALSE;
     if (!sunFbs[screen].fb) {
diff -r 1840e0267a43 -r 8d49d144ff02 external/mit/xorg-server.old/dist/hw/sun/sunInit.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunInit.c        Sun Aug 09 14:55:26 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunInit.c        Sun Aug 09 16:01:19 2020 +0000
@@ -130,8 +130,9 @@
 
 EventList *sunEvents = NULL;
 
-Bool sunAutoRepeatHandlersInstalled;   /* FALSE each time InitOutput called */
 Bool sunSwapLkeys = FALSE;
+Bool sunDebug = FALSE;
+Bool sunForceMono = FALSE;
 Bool sunFlipPixels = FALSE;
 Bool sunFbInfo = FALSE;
 Bool sunCG4Frob = FALSE;
@@ -307,6 +308,11 @@
            }
        }
        if (ret) {
+           int verb = 1;
+
+           if (sunFbInfo)
+               verb = -1;
+
            devFbUsed = TRUE;
            if (fbattr) {
                if (fbattr->fbtype.fb_type >= XFBTYPE_LASTPLUSONE) {
@@ -325,16 +331,14 @@
                    if (sunFbData[fbattr->emu_types[_i]].init) {
                        sunFbs[screen].info.fb_type = fbattr->emu_types[_i];
                        ret = TRUE;
-                       if (sunFbInfo)
-                           ErrorF ("%s is emulating a %s\n", device,
-                               sunFbData[fbattr->fbtype.fb_type].name);
+                       LogMessageVerb(X_INFO, verb, "%s is emulating a %s\n",
+                           device, sunFbData[fbattr->fbtype.fb_type].name);
                        break;
                    }
                }
            }
-           if (sunFbInfo)
-               ErrorF ("%s is really a %s\n", device,
-                   sunFbData[fbattr ? fbattr->fbtype.fb_type : sunFbs[screen].info.fb_type].name);
+           LogMessageVerb(X_INFO, verb, "%s is really a %s\n", device,
+               sunFbData[fbattr ? fbattr->fbtype.fb_type : sunFbs[screen].info.fb_type].name);
        }
     }
     if (!ret)
@@ -527,7 +531,13 @@
        if (sunPtrPriv.fd < 0)
            FatalError ("Cannot open /dev/mouse, error %d\n", errno);
        getKbdType ();
-       if (sunKbdPriv.type == KB_SUN4) {
+       switch (sunKbdPriv.type) {
+       case KB_SUN2:
+       case KB_SUN3:
+           LogMessage(X_INFO, "Sun type %d Keyboard\n", sunKbdPriv.type);
+           break;
+       case KB_SUN4:
+#define LAYOUT_US5     33
            (void) ioctl (sunKbdPriv.fd, KIOCLAYOUT, &sunKbdPriv.layout);
            if (sunKbdPriv.layout < 0 ||
                sunKbdPriv.layout > sunMaxLayout ||
@@ -535,6 +545,12 @@
                FatalError ("Unsupported keyboard type 4 layout %d\n",
                            sunKbdPriv.layout);
            sunKeySyms[KB_SUN4].map = sunType4KeyMaps[sunKbdPriv.layout];
+           LogMessage(X_INFO, "Sun type %d Keyboard, layout %d\n",
+               sunKbdPriv.layout >= LAYOUT_US5 ? 5 : 4, sunKbdPriv.layout);
+           break;
+       default:
+           LogMessage(X_INFO, "Unknown keyboard type\n");
+           break;
         }
        inited = 1;
     }
@@ -572,10 +588,8 @@
        monitorResolution = 90;
     if (RunFromSigStopParent)
        nonBlockConsole = 1;
-    for (i = 1; i < argc; i++) {
-       if (!strcmp(argv[i],"-debug"))
-           nonBlockConsole = 0;
-    }
+    if (sunDebug)
+       nonBlockConsole = 0;
 
     /*
      * Writes to /dev/console can block - causing an
diff -r 1840e0267a43 -r 8d49d144ff02 external/mit/xorg-server.old/dist/hw/sun/sunIo.c
--- a/external/mit/xorg-server.old/dist/hw/sun/sunIo.c  Sun Aug 09 14:55:26 2020 +0000
+++ b/external/mit/xorg-server.old/dist/hw/sun/sunIo.c  Sun Aug 09 16:01:19 2020 +0000
@@ -205,6 +205,7 @@
        return 1;
     }
     if (strcmp (argv[i], "-debug") == 0) {     /* -debug */
+       sunDebug = TRUE;
        return 1;
     }
     if (strcmp (argv[i], "-dev") == 0) {       /* -dev /dev/mumble */
@@ -212,6 +213,7 @@
        return 2;
     }
     if (strcmp (argv[i], "-mono") == 0) {      /* -mono */
+       sunForceMono = TRUE;
        return 1;
     }
     if (strcmp (argv[i], "-zaphod") == 0) {    /* -zaphod */



Home | Main Index | Thread Index | Old Index