I wrote: > mrg@ wrote: > > > i've updated most of xsrc to their latest versions. > > fontconfig and Mesa are remaining. i've tested the > > new code on amd64 and arm64, and built several ports > > to confirm they still build. the biggest change is > > the new xorg-server. > > On 1.21.x, I'm afraid there are two known issue for ancient Tier-II ports. > > > (1) out of bounds problem in xserver/hw/xfree86/modes/xf86Crtc.h > > OpenBSD/luna88k maintainer (Kenji Aoyama) reported the following fix > was neceesary for non-XFree86 driver based dumb server (on luna88k etc.): > https://gist.github.com/ao-kenji/afb0ea5b6dca04975161f84ab41ba32b > https://gist.github.com/ao-kenji/b0fd6b876605ba1b2b43309233566153 > > https://cvsweb.openbsd.org/cgi-bin/cvsweb/xenocara/xserver/hw/xfree86/modes/xf86Crtc.h#rev1.16
I turns out that at least luna68k Xorg server (happens to?) works without this change, but anyway upstream 1.22.x branch already has this fix: https://gitlab.freedesktop.org/xorg/xserver/-/commit/75d70612888f18339703315549db781a22c0cb23 I wonder if we should pull this fix or not for our (1.)21.1.4 tree.. > (2) "-flipPixels" option removal > > "-flipPixels" option (that inverts black and white on 1bpp server) > has been removed since 1.21. > > https://gitlab.freedesktop.org/xorg/xserver/-/commit/d1c00c859c6676fbb540420c9055788bc19cb18f > > As noted in the log the upstream authors claim > "No supported driver supports 1bpp anymore, nor has in a very long time." > > Howeverwe we still have several working servers (xf86-video-wsfb based > servers on mac68k and luna68k, monolithic servers for sun3 and x68) > and at least there was a report that this option was mandatory on SE/30. > So I would like to revert this change. It also turns out that the above changes also remove a menber from ScrnInfoRec structure in hw/xfree86/common/xf86str.h and it breaks ABIs of xf86-video-* drivers. However fortunately the removed member "Bool flipPixels" in the SrcnInfoRec has not been used for -flipPixels options so we can safely pull back -flipPixels support by reverting the changes except xf86str.h. If there is no particular comments I would like to commit the attached (reverting -flipPixels removal) patch. --- Index: external/mit/xorg-server/dist/hw/xfree86/common/xf86.h =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/common/xf86.h,v retrieving revision 1.5 diff -u -p -d -r1.5 xf86.h --- external/mit/xorg-server/dist/hw/xfree86/common/xf86.h 15 Jul 2022 02:18:59 -0000 1.5 +++ external/mit/xorg-server/dist/hw/xfree86/common/xf86.h 24 Jul 2022 14:58:35 -0000 @@ -79,6 +79,14 @@ extern _X_EXPORT Bool xf86DRI2Enabled(vo #define XF86SCRNINFO(p) xf86ScreenToScrn(p) +#define XF86FLIP_PIXELS() \ + do { \ + if (xf86GetFlipPixels()) { \ + pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \ + pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \ + } \ + while (0) + #define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE") /* Compatibility functions for pre-input-thread drivers */ @@ -278,6 +286,8 @@ xf86GetWeight(void); extern _X_EXPORT Gamma xf86GetGamma(void); extern _X_EXPORT Bool +xf86GetFlipPixels(void); +extern _X_EXPORT Bool xf86ServerIsExiting(void); extern _X_EXPORT Bool xf86ServerIsResetting(void); Index: external/mit/xorg-server/dist/hw/xfree86/common/xf86Globals.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/common/xf86Globals.c,v retrieving revision 1.1.1.7 diff -u -p -d -r1.1.1.7 xf86Globals.c --- external/mit/xorg-server/dist/hw/xfree86/common/xf86Globals.c 15 Jul 2022 02:12:51 -0000 1.1.1.7 +++ external/mit/xorg-server/dist/hw/xfree86/common/xf86Globals.c 24 Jul 2022 14:58:35 -0000 @@ -188,6 +188,7 @@ int xf86FbBpp = -1; int xf86Depth = -1; rgb xf86Weight = { 0, 0, 0 }; +Bool xf86FlipPixels = FALSE; Gamma xf86Gamma = { 0.0, 0.0, 0.0 }; Bool xf86AllowMouseOpenFail = FALSE; Index: external/mit/xorg-server/dist/hw/xfree86/common/xf86Helper.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/common/xf86Helper.c,v retrieving revision 1.6 diff -u -p -d -r1.6 xf86Helper.c --- external/mit/xorg-server/dist/hw/xfree86/common/xf86Helper.c 15 Jul 2022 02:18:59 -0000 1.6 +++ external/mit/xorg-server/dist/hw/xfree86/common/xf86Helper.c 24 Jul 2022 14:58:36 -0000 @@ -952,8 +952,14 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int void xf86SetBlackWhitePixels(ScreenPtr pScreen) { - pScreen->whitePixel = 1; - pScreen->blackPixel = 0; + if (xf86FlipPixels) { + pScreen->whitePixel = 0; + pScreen->blackPixel = 1; + } + else { + pScreen->whitePixel = 1; + pScreen->blackPixel = 0; + } } /* @@ -1405,6 +1411,12 @@ xf86GetGamma(void) } Bool +xf86GetFlipPixels(void) +{ + return xf86FlipPixels; +} + +Bool xf86ServerIsExiting(void) { return (dispatchException & DE_TERMINATE) == DE_TERMINATE; Index: external/mit/xorg-server/dist/hw/xfree86/common/xf86Init.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/common/xf86Init.c,v retrieving revision 1.1.1.10 diff -u -p -d -r1.1.1.10 xf86Init.c --- external/mit/xorg-server/dist/hw/xfree86/common/xf86Init.c 15 Jul 2022 02:12:51 -0000 1.1.1.10 +++ external/mit/xorg-server/dist/hw/xfree86/common/xf86Init.c 24 Jul 2022 14:58:36 -0000 @@ -954,6 +954,10 @@ ddxProcessArgument(int argc, char **argv xf86ConfigDir = argv[i + 1]; return 2; } + if (!strcmp(argv[i], "-flipPixels")) { + xf86FlipPixels = TRUE; + return 1; + } #ifdef XF86VIDMODE if (!strcmp(argv[i], "-disableVidMode")) { xf86VidModeDisabled = TRUE; @@ -1233,6 +1237,7 @@ ddxUseMsg(void) ErrorF ("-pointer name specify the core pointer InputDevice name\n"); ErrorF("-nosilk disable Silken Mouse\n"); + ErrorF("-flipPixels swap default black/white Pixel values\n"); #ifdef XF86VIDMODE ErrorF("-disableVidMode disable mode adjustments with xvidtune\n"); ErrorF Index: external/mit/xorg-server/dist/hw/xfree86/common/xf86Priv.h =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/common/xf86Priv.h,v retrieving revision 1.1.1.7 diff -u -p -d -r1.1.1.7 xf86Priv.h --- external/mit/xorg-server/dist/hw/xfree86/common/xf86Priv.h 15 Jul 2022 02:12:51 -0000 1.1.1.7 +++ external/mit/xorg-server/dist/hw/xfree86/common/xf86Priv.h 24 Jul 2022 14:58:36 -0000 @@ -69,6 +69,7 @@ extern _X_EXPORT char *xf86KeyboardName; extern _X_EXPORT int xf86FbBpp; extern _X_EXPORT int xf86Depth; extern _X_EXPORT rgb xf86Weight; +extern _X_EXPORT Bool xf86FlipPixels; extern _X_EXPORT Gamma xf86Gamma; /* Other parameters */ Index: external/mit/xorg-server/dist/hw/xfree86/doc/ddxDesign.xml =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/doc/ddxDesign.xml,v retrieving revision 1.1.1.3 diff -u -p -d -r1.1.1.3 ddxDesign.xml --- external/mit/xorg-server/dist/hw/xfree86/doc/ddxDesign.xml 15 Jul 2022 02:12:52 -0000 1.1.1.3 +++ external/mit/xorg-server/dist/hw/xfree86/doc/ddxDesign.xml 24 Jul 2022 14:58:38 -0000 @@ -1833,6 +1833,7 @@ Some of them are: xf86Depth -depth from the command line xf86Weight -weight from the command line xf86Gamma -{r,g,b,}gamma from the command line + xf86FlipPixels -flippixels from the command line xf86ProbeOnly -probeonly from the command line defaultColorVisualClass -cc from the command line </literallayout> @@ -1893,6 +1894,17 @@ functions: </para></blockquote> + <blockquote><para> + <programlisting> + Bool xf86GetFlipPixels(); + </programlisting> + <blockquote><para> + Returns <constant>TRUE</constant> if <option>-flippixels</option> is + present on the command line, and <constant>FALSE</constant> otherwise. + </para></blockquote> + + </para></blockquote> + </sect2> <sect2> @@ -6004,6 +6016,19 @@ strongly encouraged to improve the consi <blockquote><para> <programlisting> + void xf86SetBlackWhitePixels(ScrnInfoPtr pScrn); + </programlisting> + <blockquote><para> + This functions sets the <structfield>blackPixel</structfield> and + <structfield>whitePixel</structfield> fields of the <structname>ScrnInfoRec</structname> + according to whether or not the <option>-flipPixels</option> command + line options is present. + </para> + + </blockquote></para></blockquote> + + <blockquote><para> + <programlisting> const char *xf86GetVisualName(int visual); </programlisting> <blockquote><para> Index: external/mit/xorg-server/dist/hw/xfree86/man/Xorg.man =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/man/Xorg.man,v retrieving revision 1.1.1.4 diff -u -p -d -r1.1.1.4 Xorg.man --- external/mit/xorg-server/dist/hw/xfree86/man/Xorg.man 15 Jul 2022 02:12:52 -0000 1.1.1.4 +++ external/mit/xorg-server/dist/hw/xfree86/man/Xorg.man 24 Jul 2022 14:58:38 -0000 @@ -171,6 +171,9 @@ bpp framebuffer rather than the (possibl (or vice versa). Legal values are 1, 8, 16, 24, 32. Not all drivers support all values. .TP 8 +.B \-flipPixels +Swap the default values for the black and white pixels. +.TP 8 .BI \-gamma " value" Set the gamma correction. .I value Index: external/mit/xorg-server/dist/hw/xfree86/vgahw/vgaHW.c =================================================================== RCS file: /cvsroot/xsrc/external/mit/xorg-server/dist/hw/xfree86/vgahw/vgaHW.c,v retrieving revision 1.1.1.5 diff -u -p -d -r1.1.1.5 vgaHW.c --- external/mit/xorg-server/dist/hw/xfree86/vgahw/vgaHW.c 15 Jul 2022 02:12:51 -0000 1.1.1.5 +++ external/mit/xorg-server/dist/hw/xfree86/vgahw/vgaHW.c 24 Jul 2022 14:58:39 -0000 @@ -1314,8 +1314,10 @@ vgaHWInit(ScrnInfoPtr scrninfp, DisplayM if (depth == 1) { /* Initialise the Mono map according to which bit-plane gets used */ + Bool flipPixels = xf86GetFlipPixels(); + for (i = 0; i < 16; i++) - if ((i & (1 << BIT_PLANE)) != 0) + if (((i & (1 << BIT_PLANE)) != 0) != flipPixels) regp->Attribute[i] = WHITE_VALUE; else regp->Attribute[i] = BLACK_VALUE; --- Thanks, --- Izumi Tsustui