summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Winischhofer <thomas@winischhofer.net>2004-08-14 15:35:49 +0000
committerThomas Winischhofer <thomas@winischhofer.net>2004-08-14 15:35:49 +0000
commitb94ee52295375ff43d5e12469e2aad86c678328b (patch)
treecfdf4ad6f2ba531e3a1e3f479f92d01ff8e8f6be
parent55215274191df6baedb199e580e2fadf66ebd0c4 (diff)
SiS driver: Additional bytes->pixel conversions for AllocateLinearXORG-6_7_99_902XORG-6_7_99_901
-rw-r--r--src/sis6326_video.c2
-rw-r--r--src/sis_video.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/sis6326_video.c b/src/sis6326_video.c
index 8a3927c..245d291 100644
--- a/src/sis6326_video.c
+++ b/src/sis6326_video.c
@@ -1559,7 +1559,7 @@ SIS6326AllocSurface (
w = (w + 1) & ~1;
pPriv->pitch = ((w << 1) + 63) & ~63; /* Only packed pixel modes supported */
size = h * pPriv->pitch;
- pPriv->linear = SIS6326AllocateOverlayMemory(pScrn, pPriv->linear, size);
+ pPriv->linear = SIS6326AllocateOverlayMemory(pScrn, pPriv->linear, ((size + depth - 1) / depth));
if(!pPriv->linear)
return BadAlloc;
diff --git a/src/sis_video.c b/src/sis_video.c
index 0acfe5f..d3b8dff 100644
--- a/src/sis_video.c
+++ b/src/sis_video.c
@@ -4302,8 +4302,9 @@ SISAllocSurface (
depth = pSiS->CurrentLayout.bitsPerPixel >> 3;
w = (w + 1) & ~1;
pPriv->pitch = ((w << 1) + 63) & ~63; /* Only packed pixel modes supported */
- size = h * pPriv->pitch; /* / depth; - Why? */
- pPriv->linear = SISAllocateOverlayMemory(pScrn, pPriv->linear, size);
+ size = h * pPriv->pitch;
+ pPriv->linear = SISAllocateOverlayMemory(pScrn, pPriv->linear, ((size + depth - 1) / depth));
+
if(!pPriv->linear)
return BadAlloc;
@@ -4771,7 +4772,8 @@ SISPutImageBlit(
}
/* allocate memory (we do doublebuffering) */
- if(!(pPriv->linear[index] = SISAllocateOverlayMemory(pScrn, pPriv->linear[index], totalSize<<1)))
+ if(!(pPriv->linear[index] = SISAllocateOverlayMemory(pScrn, pPriv->linear[index],
+ ((totalSize + depth - 1) / depth) << 1)))
return BadAlloc;
/* fixup pointers */