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/dist/fb Pull 1bpp server fixes fr...
details: https://anonhg.NetBSD.org/xsrc/rev/bfaa4fb4935c
branches: trunk
changeset: 10502:bfaa4fb4935c
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Sat Jul 18 17:37:08 2020 +0000
description:
Pull 1bpp server fixes from xorg-server.old:
https://mail-index.netbsd.org/source-changes/2020/07/18/msg119488.html
> Fix 1bpp Xservers on "whitePixel=0, blackPixel=1" VRAMs.
>
> - Don't override pScreen->blackPixel and pScreen->whitePixel
> (set in MD server Init functions per -filpPixels option)
> on 1bpp servers in merged fbSetupScreen() (merged one
> from cfbSetupScrenn and mfbSetupScreen() in old xsrc/xfree)
> - Pull mfbCreateColormap() function from old xsrc/xfree tree
> and use it on 1bpp servers
Confirmed on luna68k 1bpp Xorg 1.20 server using xf86-video-wsfb
with "-flipPixels" option.
diffstat:
external/mit/xorg-server/dist/fb/fb.h | 3 ++
external/mit/xorg-server/dist/fb/fbcmap_mi.c | 35 ++++++++++++++++++++++++++++
external/mit/xorg-server/dist/fb/fbscreen.c | 12 +++++++--
3 files changed, 47 insertions(+), 3 deletions(-)
diffs (87 lines):
diff -r f792573051fb -r bfaa4fb4935c external/mit/xorg-server/dist/fb/fb.h
--- a/external/mit/xorg-server/dist/fb/fb.h Sat Jul 18 17:18:09 2020 +0000
+++ b/external/mit/xorg-server/dist/fb/fb.h Sat Jul 18 17:37:08 2020 +0000
@@ -734,6 +734,9 @@
extern _X_EXPORT Bool
fbInitializeColormap(ColormapPtr pmap);
+extern _X_EXPORT Bool
+ mfbCreateColormap(ColormapPtr pmap);
+
extern _X_EXPORT int
fbExpandDirectColors(ColormapPtr pmap,
diff -r f792573051fb -r bfaa4fb4935c external/mit/xorg-server/dist/fb/fbcmap_mi.c
--- a/external/mit/xorg-server/dist/fb/fbcmap_mi.c Sat Jul 18 17:18:09 2020 +0000
+++ b/external/mit/xorg-server/dist/fb/fbcmap_mi.c Sat Jul 18 17:37:08 2020 +0000
@@ -66,6 +66,41 @@
return miInitializeColormap(pmap);
}
+Bool
+mfbCreateColormap(ColormapPtr pmap)
+{
+ ScreenPtr pScreen;
+ unsigned short red0, green0, blue0;
+ unsigned short red1, green1, blue1;
+ Pixel pix;
+
+ pScreen = pmap->pScreen;
+ if (pScreen->whitePixel == 0)
+ {
+ red0 = green0 = blue0 = ~0;
+ red1 = green1 = blue1 = 0;
+ }
+ else
+ {
+ red0 = green0 = blue0 = 0;
+ red1 = green1 = blue1 = ~0;
+ }
+
+ /* this is a monochrome colormap, it only has two entries, just fill
+ * them in by hand. If it were a more complex static map, it would be
+ * worth writing a for loop or three to initialize it */
+
+ /* this will be pixel 0 */
+ pix = 0;
+ if (AllocColor(pmap, &red0, &green0, &blue0, &pix, 0) != Success)
+ return FALSE;
+
+ /* this will be pixel 1 */
+ if (AllocColor(pmap, &red1, &green1, &blue1, &pix, 0) != Success)
+ return FALSE;
+ return TRUE;
+}
+
int
fbExpandDirectColors(ColormapPtr pmap,
int ndef, xColorItem * indefs, xColorItem * outdefs)
diff -r f792573051fb -r bfaa4fb4935c external/mit/xorg-server/dist/fb/fbscreen.c
--- a/external/mit/xorg-server/dist/fb/fbscreen.c Sat Jul 18 17:18:09 2020 +0000
+++ b/external/mit/xorg-server/dist/fb/fbscreen.c Sat Jul 18 17:37:08 2020 +0000
@@ -100,8 +100,10 @@
if (!fbAllocatePrivates(pScreen))
return FALSE;
pScreen->defColormap = FakeClientID(0);
- /* let CreateDefColormap do whatever it wants for pixels */
- pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
+ if (bpp > 1) {
+ /* let CreateDefColormap do whatever it wants for pixels */
+ pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0;
+ }
pScreen->QueryBestSize = fbQueryBestSize;
/* SaveScreen */
pScreen->GetImage = fbGetImage;
@@ -118,7 +120,11 @@
pScreen->RealizeFont = fbRealizeFont;
pScreen->UnrealizeFont = fbUnrealizeFont;
pScreen->CreateGC = fbCreateGC;
- pScreen->CreateColormap = fbInitializeColormap;
+ if (bpp == 1) {
+ pScreen->CreateColormap = mfbCreateColormap;
+ } else {
+ pScreen->CreateColormap = fbInitializeColormap;
+ }
pScreen->DestroyColormap = (void (*)(ColormapPtr)) NoopDDA;
pScreen->InstallColormap = fbInstallColormap;
pScreen->UninstallColormap = fbUninstallColormap;
Home |
Main Index |
Thread Index |
Old Index