Source-Changes-HG archive

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

[xsrc/trunk]: xsrc/external/mit/xf86-video-wsfb/dist/src wsfb: fix mmap size ...



details:   https://anonhg.NetBSD.org/xsrc/rev/add966ed8890
branches:  trunk
changeset: 7141:add966ed8890
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue Aug 30 15:08:49 2022 +0000

description:
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@.

diffstat:

 external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c |  10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 6a99a7d6e807 -r add966ed8890 external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c
--- a/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c       Tue Aug 30 15:05:21 2022 +0000
+++ b/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c       Tue Aug 30 15:08:49 2022 +0000
@@ -931,6 +931,16 @@
        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:



Home | Main Index | Thread Index | Old Index