Miscomputing pitch in 24bpp modes because of rounding errors.
This commit is contained in:
parent
b9d920f3dc
commit
cde51fd05b
|
@ -350,7 +350,6 @@ mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
|
||||||
CARD32 DP_SET_GUI_ENGINE;
|
CARD32 DP_SET_GUI_ENGINE;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
KdCheckSync (pScreen);
|
|
||||||
for (i = 0; i < NACCELREG; i++)
|
for (i = 0; i < NACCELREG; i++)
|
||||||
if (mach64AccelReg[i].depth == pDst->drawable.depth &&
|
if (mach64AccelReg[i].depth == pDst->drawable.depth &&
|
||||||
mach64AccelReg[i].bitsPerPixel == pDst->drawable.bitsPerPixel)
|
mach64AccelReg[i].bitsPerPixel == pDst->drawable.bitsPerPixel)
|
||||||
|
@ -361,14 +360,22 @@ mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
|
||||||
DP_SET_GUI_ENGINE = mach64AccelReg[i].DP_SET_GUI_ENGINE;
|
DP_SET_GUI_ENGINE = mach64AccelReg[i].DP_SET_GUI_ENGINE;
|
||||||
|
|
||||||
reg = mach64c->reg;
|
reg = mach64c->reg;
|
||||||
triple = (pDst->drawable.bitsPerPixel == 24);
|
|
||||||
if (!reg)
|
if (!reg)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* pixels / 8 = ((bytes * 8) / bpp) / 8 = bytes / bpp */
|
triple = (pDst->drawable.bitsPerPixel == 24);
|
||||||
DST_PITCH = pDst->devKind / pDst->drawable.bitsPerPixel;
|
|
||||||
if (triple)
|
if (triple)
|
||||||
DST_PITCH *= 3;
|
{
|
||||||
|
/* bytes / 8 = bytes >> 3 */
|
||||||
|
DST_PITCH = pDst->devKind >> 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* pixels / 8 = ((bytes * 8) / bpp) / 8 = bytes / bpp */
|
||||||
|
DST_PITCH = pDst->devKind / pDst->drawable.bitsPerPixel;
|
||||||
|
}
|
||||||
|
|
||||||
/* bytes / 8 */
|
/* bytes / 8 */
|
||||||
DST_OFFSET = ((CARD8 *) pDst->devPrivate.ptr - pScreenPriv->screen->memory_base) >> 3;
|
DST_OFFSET = ((CARD8 *) pDst->devPrivate.ptr - pScreenPriv->screen->memory_base) >> 3;
|
||||||
|
|
||||||
|
@ -380,10 +387,15 @@ mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
|
||||||
0);
|
0);
|
||||||
if (pSrc)
|
if (pSrc)
|
||||||
{
|
{
|
||||||
/* pixels / 8 = ((bytes * 8) / bpp) / 8 = bytes / bpp */
|
|
||||||
SRC_PITCH = pSrc->devKind / pSrc->drawable.bitsPerPixel;
|
|
||||||
if (triple)
|
if (triple)
|
||||||
SRC_PITCH *= 3;
|
{
|
||||||
|
SRC_PITCH = pSrc->devKind >> 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* pixels / 8 = ((bytes * 8) / bpp) / 8 = bytes / bpp */
|
||||||
|
SRC_PITCH = pSrc->devKind / pSrc->drawable.bitsPerPixel;
|
||||||
|
}
|
||||||
/* bytes / 8 */
|
/* bytes / 8 */
|
||||||
SRC_OFFSET = ((CARD8 *) pSrc->devPrivate.ptr - pScreenPriv->screen->memory_base) >> 3;
|
SRC_OFFSET = ((CARD8 *) pSrc->devPrivate.ptr - pScreenPriv->screen->memory_base) >> 3;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue