Add a memory_base variable and use it.
This commit is contained in:
parent
f5916edb17
commit
f4bcd36a38
|
@ -70,7 +70,7 @@ mach64ScreenInit (KdScreenInfo *screen)
|
|||
screen->dumb = TRUE;
|
||||
if (mach64s->vesa.mapping != VESA_LINEAR)
|
||||
screen->dumb = TRUE;
|
||||
mach64s->screen = mach64s->vesa.fb;
|
||||
screen->memory_base = mach64s->vesa.fb;
|
||||
switch (screen->fb[0].depth) {
|
||||
case 8:
|
||||
mach64s->colorKey = 0xff;
|
||||
|
|
|
@ -560,7 +560,6 @@ Bool mach64InitVideo(ScreenPtr pScreen);
|
|||
|
||||
typedef struct _mach64ScreenInfo {
|
||||
VesaScreenPrivRec vesa;
|
||||
CARD8 *screen;
|
||||
CARD32 DP_PIX_WIDTH;
|
||||
CARD32 DP_SET_GUI_ENGINE;
|
||||
Bool bpp24;
|
||||
|
|
|
@ -116,7 +116,7 @@ mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
|
|||
if (triple)
|
||||
DST_PITCH *= 3;
|
||||
/* bytes / 8 */
|
||||
DST_OFFSET = ((CARD8 *) pDst->devPrivate.ptr - mach64s->screen) >> 3;
|
||||
DST_OFFSET = ((CARD8 *) pDst->devPrivate.ptr - pScreenPriv->screen->memory_base) >> 3;
|
||||
|
||||
mach64WaitAvail(reg, wait + (pSrc ? 5 : 4));
|
||||
reg->DP_SET_GUI_ENGINE = mach64s->DP_SET_GUI_ENGINE | (combo << 20);
|
||||
|
@ -131,7 +131,7 @@ mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
|
|||
if (triple)
|
||||
SRC_PITCH *= 3;
|
||||
/* bytes / 8 */
|
||||
SRC_OFFSET = ((CARD8 *) pSrc->devPrivate.ptr - mach64s->screen) >> 3;
|
||||
SRC_OFFSET = ((CARD8 *) pSrc->devPrivate.ptr - pScreenPriv->screen->memory_base) >> 3;
|
||||
|
||||
reg->SRC_OFF_PITCH = ((SRC_OFFSET << 0) |
|
||||
(SRC_PITCH << 22) |
|
||||
|
|
|
@ -74,8 +74,8 @@ mgaScreenInit (KdScreenInfo *screen)
|
|||
screen->dumb = TRUE;
|
||||
|
||||
fprintf (stderr, "vesa mapping is %d\n", mgas->vesa.mapping);
|
||||
#endif
|
||||
mgas->screen = mgas->vesa.fb;
|
||||
#endif
|
||||
screen->memory_base = mgas->vesa.fb;
|
||||
|
||||
memory = mgas->vesa.fb_size;
|
||||
screen_size = screen->fb[0].byteStride * screen->height;
|
||||
|
|
|
@ -96,7 +96,6 @@ typedef struct _mgaCardInfo {
|
|||
|
||||
typedef struct _mgaScreenInfo {
|
||||
VesaScreenPrivRec vesa;
|
||||
CARD8 *screen;
|
||||
|
||||
int pitch;
|
||||
int pw;
|
||||
|
|
|
@ -102,7 +102,7 @@ mgaPrepareSolid (PixmapPtr pPixmap, int alu, Pixel pm, Pixel fg)
|
|||
cmd = MGA_OPCOD_TRAP | MGA_DWGCTL_SOLID | MGA_DWGCTL_ARZERO | MGA_DWGCTL_SGNZERO |
|
||||
MGA_DWGCTL_SHIFTZERO | mgaRop[alu];
|
||||
|
||||
dst_org = (int)pPixmap->devPrivate.ptr - (int)mgas->screen;
|
||||
dst_org = (int)pPixmap->devPrivate.ptr - (int)pScreenPriv->screen->memory_base;
|
||||
|
||||
mgaSetup (pPixmap->drawable.pScreen, 5);
|
||||
|
||||
|
@ -152,8 +152,8 @@ mgaPrepareCopy (PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap,
|
|||
|
||||
mgaSetup (pSrcPixmap->drawable.pScreen, 7);
|
||||
|
||||
MGA_OUT32 (mmio, MGA_REG_SRCORG, ((int)pSrcPixmap->devPrivate.ptr - (int)mgas->screen));
|
||||
MGA_OUT32 (mmio, MGA_REG_DSTORG, ((int)pDstPixmap->devPrivate.ptr - (int)mgas->screen));
|
||||
MGA_OUT32 (mmio, MGA_REG_SRCORG, ((int)pSrcPixmap->devPrivate.ptr - (int)pScreenPriv->screen->memory_base));
|
||||
MGA_OUT32 (mmio, MGA_REG_DSTORG, ((int)pDstPixmap->devPrivate.ptr - (int)pScreenPriv->screen->memory_base));
|
||||
MGA_OUT32 (mmio, MGA_REG_PITCH, pDstPixmap->devKind / (pDstPixmap->drawable.bitsPerPixel >> 3));
|
||||
src_pitch = pSrcPixmap->devKind / (pSrcPixmap->drawable.bitsPerPixel >> 3);
|
||||
|
||||
|
|
|
@ -135,11 +135,11 @@ kaaPixmapAllocArea (PixmapPtr pPixmap)
|
|||
ScreenPtr pScreen = pPixmap->drawable.pScreen;
|
||||
KaaScreenPriv (pScreen);
|
||||
KaaPixmapPriv (pPixmap);
|
||||
KdScreenPriv (pScreen);
|
||||
int bpp = pPixmap->drawable.bitsPerPixel;
|
||||
CARD16 h = pPixmap->drawable.height;
|
||||
CARD16 w = pPixmap->drawable.width;
|
||||
int pitch = KaaPixmapPitch (w);
|
||||
PixmapPtr pScreenPixmap = (*pScreen->GetScreenPixmap)(pScreen);
|
||||
|
||||
pKaaPixmap->devKind = pPixmap->devKind;
|
||||
pKaaPixmap->devPrivate = pPixmap->devPrivate;
|
||||
|
@ -157,7 +157,7 @@ kaaPixmapAllocArea (PixmapPtr pPixmap)
|
|||
pPixmap->drawable.width,
|
||||
pPixmap->drawable.height));
|
||||
pPixmap->devKind = pitch * (bpp >> 3);
|
||||
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pScreenPixmap->devPrivate.ptr + pKaaPixmap->area->offset);
|
||||
pPixmap->devPrivate.ptr = (pointer) ((CARD8 *) pScreenPriv->screen->memory_base + pKaaPixmap->area->offset);
|
||||
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -118,6 +118,7 @@ typedef struct _KdScreenInfo {
|
|||
int mynum;
|
||||
DDXPointRec origin;
|
||||
KdFrameBuffer fb[KD_MAX_FB];
|
||||
CARD8 *memory_base;
|
||||
int off_screen_base;
|
||||
int off_screen_size;
|
||||
pointer off_screen_areas;
|
||||
|
|
Loading…
Reference in New Issue
Block a user