Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/netbsd-8]: xsrc/external/mit/xf86-video-wsfb/dist/src Pull up following...
details: https://anonhg.NetBSD.org/xsrc/rev/4875b7fbf88a
branches: netbsd-8
changeset: 10417:4875b7fbf88a
user: martin <martin%NetBSD.org@localhost>
date: Sun Dec 29 09:20:15 2019 +0000
description:
Pull up following revision(s) (requested by tsutsui in ticket #1479):
external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c: revision 1.36
Fix Xorg wsfb server "Rotate" corruption problem. PR xsrc/54167
Confirmed on zaurus SL-C1000, SL-C3000 (CW) and hpcarm WS003SH (CCW).
Should be pulled up to netbsd-8 and netbsd-9.
diffstat:
external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c | 34 ++++++++++++++++++--
1 files changed, 30 insertions(+), 4 deletions(-)
diffs (71 lines):
diff -r 3ca31611b04a -r 4875b7fbf88a external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
--- a/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c Mon Jul 15 08:26:10 2019 +0000
+++ b/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c Sun Dec 29 09:20:15 2019 +0000
@@ -858,6 +858,7 @@
int ret, flags, ncolors;
int wsmode = WSDISPLAYIO_MODE_DUMBFB;
int wstype;
+ int width;
size_t len;
TRACE_ENTER("WsfbScreenInit");
@@ -972,7 +973,17 @@
#endif
if (fPtr->shadowFB) {
- fPtr->shadow = calloc(1, fPtr->fbi.fbi_stride * pScrn->virtualY);
+ if (fPtr->rotate) {
+ /*
+ * Note Rotate and Shadow FB options are valid
+ * only on depth >= 8.
+ */
+ len = pScrn->virtualX * pScrn->virtualY *
+ (pScrn->bitsPerPixel >> 3);
+ } else {
+ len = fPtr->fbi.fbi_stride * pScrn->virtualY;
+ }
+ fPtr->shadow = calloc(1, len);
if (!fPtr->shadow) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -981,13 +992,29 @@
}
}
+ /*
+ * fbScreenInit() seems to require "pixel width of frame buffer"
+ * but it is actually "stride in pixel" of frame buffer,
+ * per xorg/xserver/tree/fb/fbscreen.c.
+ */
+ if (fPtr->rotate) {
+ width = pScrn->displayWidth;
+ } else {
+ if (pScrn->bitsPerPixel > 8) {
+ width =
+ fPtr->fbi.fbi_stride / (pScrn->bitsPerPixel >> 3);
+ } else {
+ width =
+ fPtr->fbi.fbi_stride * (8 / pScrn->bitsPerPixel);
+ }
+ }
switch (pScrn->bitsPerPixel) {
case 1:
ret = fbScreenInit(pScreen,
fPtr->fbstart,
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
- fPtr->fbi.fbi_stride * 8, pScrn->bitsPerPixel);
+ width, pScrn->bitsPerPixel);
break;
case 4:
case 8:
@@ -998,8 +1025,7 @@
fPtr->shadowFB ? fPtr->shadow : fPtr->fbstart,
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
- /* apparently fb wants stride in pixels, not bytes */
- fPtr->fbi.fbi_stride / (pScrn->bitsPerPixel >> 3),
+ width,
pScrn->bitsPerPixel);
break;
default:
Home |
Main Index |
Thread Index |
Old Index