summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-18 20:10:13 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-18 20:10:13 +0000
commit4cabc8d5e3f593378a0538c0a8b751d9cc1708e1 (patch)
treecd47959120a27660dffa9424a45d65e9af6bc972 /driver
parenta6d89db29afa0835062fd2c80977245812a23440 (diff)
Fix allocation size of shadow framebuffer. Use byes, not bits.
Since the shadowfb is only used for bitsPerPixel >= 8, bitsPerPixel/8 is always the correct amount of bytes. ok miod@.
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-wildcatfb/src/wildcatfb_driver.c4
-rw-r--r--driver/xf86-video-wsfb/src/wsfb_driver.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c b/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c
index f955c9213..de74a92d4 100644
--- a/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c
+++ b/driver/xf86-video-wildcatfb/src/wildcatfb_driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wildcatfb_driver.c,v 1.4 2010/07/18 17:49:46 matthieu Exp $ */
+/* $OpenBSD: wildcatfb_driver.c,v 1.5 2010/07/18 20:10:12 matthieu Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -685,7 +685,7 @@ WildcatFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
fPtr->shadow = xcalloc(1, pScrn->virtualX * pScrn->virtualY *
- pScrn->bitsPerPixel);
+ pScrn->bitsPerPixel/8);
if (!fPtr->shadow) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
diff --git a/driver/xf86-video-wsfb/src/wsfb_driver.c b/driver/xf86-video-wsfb/src/wsfb_driver.c
index d4c8a4d9a..582084c0d 100644
--- a/driver/xf86-video-wsfb/src/wsfb_driver.c
+++ b/driver/xf86-video-wsfb/src/wsfb_driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsfb_driver.c,v 1.21 2010/07/17 17:15:14 matthieu Exp $ */
+/* $OpenBSD: wsfb_driver.c,v 1.22 2010/07/18 20:10:12 matthieu Exp $ */
/*
* Copyright (c) 2001 Matthieu Herrb
* All rights reserved.
@@ -917,7 +917,7 @@ WsfbScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (fPtr->shadowFB) {
fPtr->shadow = xcalloc(1, pScrn->virtualX * pScrn->virtualY *
- pScrn->bitsPerPixel);
+ pScrn->bitsPerPixel/8);
if (!fPtr->shadow) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,