Module Name: xsrc
Committed By: tsutsui
Date: Tue Aug 30 15:08:49 UTC 2022
Modified Files:
xsrc/external/mit/xf86-video-wsfb/dist/src: wsfb_driver.c
Log Message:
wsfb: fix mmap size in Afb planar case.
Reviewed on tech-x11@:
https://mail-index.netbsd.org/tech-x11/2022/08/23/msg002311.html
"Looks like good improvement" from jandberg@ and also confirmed by rin@.
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 \
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
diff -u xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.43 xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.44
--- xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c:1.43 Tue Aug 30 15:05:21 2022
+++ xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c Tue Aug 30 15:08:49 2022
@@ -931,6 +931,16 @@ WsfbScreenInit(SCREEN_INIT_ARGS_DECL)
case 4:
case 8:
len = fPtr->fbi.fbi_stride * fPtr->fbi.fbi_height;
+#ifdef HAVE_SHADOW_AFB
+ if (fPtr->planarAfb) {
+ /*
+ * stride is "bytes per line" for each plane so
+ * we need a number of planes to mmap in planar case.
+ */
+ len *= fPtr->fbi.fbi_bitsperpixel;
+ }
+#endif
+
break;
case 15:
case 16: