-Wall fixes. Support off-screen pixmaps

This commit is contained in:
Keith Packard 2003-10-14 05:05:53 +00:00
parent 777f31cd0b
commit cdf3377f6d
6 changed files with 126 additions and 106 deletions

View File

@ -1,6 +1,7 @@
INCLUDES = \ INCLUDES = \
-I$(top_srcdir)/fb \ -I$(top_srcdir)/fb \
-I$(top_srcdir)/hw/kdrive/src \ -I$(top_srcdir)/hw/kdrive/src \
-I$(top_srcdir)/hw/kdrive/linux \
-I$(top_srcdir)/hw/kdrive/vesa \ -I$(top_srcdir)/hw/kdrive/vesa \
-I$(top_srcdir)/mi \ -I$(top_srcdir)/mi \
-I$(top_srcdir)/miext/layer \ -I$(top_srcdir)/miext/layer \

View File

@ -88,25 +88,10 @@ mach64ScreenInit (KdScreenInfo *screen)
} }
memory = mach64s->vesa.fb_size; memory = mach64s->vesa.fb_size;
screen_size = screen->fb[0].byteStride * screen->height; screen_size = screen->fb[0].byteStride * screen->height;
if (mach64s->screen && memory >= screen_size + 2048)
{
memory -= 2048;
mach64s->cursor_base = mach64s->screen + memory - 2048;
}
else
mach64s->cursor_base = 0;
screen->softCursor = TRUE; /* XXX for now */
memory -= screen_size; memory -= screen_size;
if (memory > screen->fb[0].byteStride) screen->softCursor = TRUE;
{ screen->off_screen_base = screen_size;
mach64s->off_screen = mach64s->screen + screen_size; screen->off_screen_size = memory;
mach64s->off_screen_size = memory;
}
else
{
mach64s->off_screen = 0;
mach64s->off_screen_size = 0;
}
screen->driver = mach64s; screen->driver = mach64s;
return TRUE; return TRUE;
} }
@ -124,13 +109,12 @@ mach64InitScreen (ScreenPtr pScreen)
} }
#ifdef RANDR #ifdef RANDR
Bool
mach64RandRSetConfig (ScreenPtr pScreen, mach64RandRSetConfig (ScreenPtr pScreen,
Rotation rotation, Rotation rotation,
int rate, int rate,
RRScreenSizePtr pSize) RRScreenSizePtr pSize)
{ {
KdScreenPriv(pScreen);
KdCheckSync (pScreen); KdCheckSync (pScreen);
if (!vesaRandRSetConfig (pScreen, rotation, rate, pSize)) if (!vesaRandRSetConfig (pScreen, rotation, rate, pSize))
@ -281,8 +265,8 @@ const CARD8 mach64DPMSModes[4] = {
0x8c, /* KD_DPMS_STANDBY */ 0x8c, /* KD_DPMS_STANDBY */
0x8c, /* KD_DPMS_STANDBY */ 0x8c, /* KD_DPMS_STANDBY */
0x8c, /* KD_DPMS_STANDBY */ 0x8c, /* KD_DPMS_STANDBY */
/* 0xb0, /* KD_DPMS_SUSPEND */ /* 0xb0, KD_DPMS_SUSPEND */
/* 0xbc, /* KD_DPMS_POWERDOWN */ /* 0xbc, KD_DPMS_POWERDOWN */
}; };
#define PWR_MGT_ON (1 << 0) #define PWR_MGT_ON (1 << 0)
@ -320,7 +304,7 @@ mach64DPMS (ScreenPtr pScreen, int mode)
{ {
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
Mach64CardInfo *mach64c = pScreenPriv->card->driver; Mach64CardInfo *mach64c = pScreenPriv->card->driver;
int hsync_off, vsync_off, blank; int hsync_off = 0, vsync_off = 0, blank = 0;
CARD32 CRTC_GEN_CNTL; CARD32 CRTC_GEN_CNTL;
CARD32 LCD_GEN_CTRL; CARD32 LCD_GEN_CTRL;
Reg *reg = mach64c->reg; Reg *reg = mach64c->reg;

View File

@ -553,19 +553,16 @@ typedef struct _mach64PortPriv {
Time freeTime; Time freeTime;
CARD32 size; CARD32 size;
CARD32 offset; CARD32 offset;
KdOffscreenArea *off_screen;
} Mach64PortPrivRec, *Mach64PortPrivPtr; } Mach64PortPrivRec, *Mach64PortPrivPtr;
Bool mach64InitVideo(ScreenPtr pScreen); Bool mach64InitVideo(ScreenPtr pScreen);
typedef struct _mach64ScreenInfo { typedef struct _mach64ScreenInfo {
VesaScreenPrivRec vesa; VesaScreenPrivRec vesa;
CARD8 *cursor_base;
CARD8 *screen; CARD8 *screen;
CARD8 *off_screen;
int off_screen_size;
CARD32 DP_PIX_WIDTH; CARD32 DP_PIX_WIDTH;
CARD32 DP_SET_GUI_ENGINE; CARD32 DP_SET_GUI_ENGINE;
CARD32 USR1_DST_OFF_PITCH;
Bool bpp24; Bool bpp24;
Mach64Cursor cursor; Mach64Cursor cursor;
CARD32 colorKey; CARD32 colorKey;
@ -602,6 +599,9 @@ mach64Enable (ScreenPtr pScreen);
void void
mach64Disable (ScreenPtr pScreen); mach64Disable (ScreenPtr pScreen);
Bool
mach64DPMS (ScreenPtr pScreen, int mode);
void void
mach64WaitAvail(Reg *reg, int n); mach64WaitAvail(Reg *reg, int n);

View File

@ -65,10 +65,8 @@ CARD8 mach64Rop[16] = {
#define MACH64_DRAW_COMBO_COPY 0x8 #define MACH64_DRAW_COMBO_COPY 0x8
static Reg *reg; static Reg *reg;
static CARD32 cmd;
static CARD32 avail; static CARD32 avail;
static CARD32 triple; static CARD32 triple;
static CARD32 combo;
#define IDX(reg,n) (&(reg)->n - &(reg)->CRTC_H_TOTAL_DISP) #define IDX(reg,n) (&(reg)->n - &(reg)->CRTC_H_TOTAL_DISP)
@ -91,32 +89,58 @@ mach64WaitIdle (Reg *reg)
} }
static Bool static Bool
mach64Setup (ScreenPtr pScreen, CARD32 combo, int wait) mach64Setup (PixmapPtr pDst, PixmapPtr pSrc, CARD32 combo, int wait)
{ {
ScreenPtr pScreen = pDst->drawable.pScreen;
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
mach64ScreenInfo(pScreenPriv); mach64ScreenInfo(pScreenPriv);
mach64CardInfo(pScreenPriv); mach64CardInfo(pScreenPriv);
CARD32 DST_PITCH;
CARD32 DST_OFFSET;
CARD32 SRC_PITCH;
CARD32 SRC_OFFSET;
avail = 0;
reg = mach64c->reg; reg = mach64c->reg;
triple = mach64s->bpp24; triple = mach64s->bpp24;
if (!reg) if (!reg)
return FALSE; return FALSE;
mach64WaitAvail(reg, wait + 3); /* pixels / 8 = ((bytes * 8) / bpp) / 8 = bytes / bpp */
reg->DP_PIX_WIDTH = mach64s->DP_PIX_WIDTH; DST_PITCH = pDst->devKind / pDst->drawable.bitsPerPixel;
reg->USR1_DST_OFF_PITCH = mach64s->USR1_DST_OFF_PITCH; if (triple)
DST_PITCH *= 3;
/* bytes / 8 */
DST_OFFSET = ((CARD8 *) pDst->devPrivate.ptr - mach64s->screen) >> 3;
mach64WaitAvail(reg, wait + (pSrc ? 5 : 4));
reg->DP_SET_GUI_ENGINE = mach64s->DP_SET_GUI_ENGINE | (combo << 20); reg->DP_SET_GUI_ENGINE = mach64s->DP_SET_GUI_ENGINE | (combo << 20);
reg->DP_PIX_WIDTH = mach64s->DP_PIX_WIDTH;
reg->DST_OFF_PITCH = ((DST_OFFSET << 0) | /* USR1_DST_OFFSET */
(DST_PITCH << 22) | /* USR1_DST_PITCH */
0);
if (pSrc)
{
/* pixels / 8 = ((bytes * 8) / bpp) / 8 = bytes / bpp */
SRC_PITCH = pSrc->devKind / pSrc->drawable.bitsPerPixel;
if (triple)
SRC_PITCH *= 3;
/* bytes / 8 */
SRC_OFFSET = ((CARD8 *) pSrc->devPrivate.ptr - mach64s->screen) >> 3;
reg->SRC_OFF_PITCH = ((SRC_OFFSET << 0) |
(SRC_PITCH << 22) |
0);
}
return TRUE; return TRUE;
} }
Bool Bool
mach64PrepareSolid (DrawablePtr pDrawable, mach64PrepareSolid (PixmapPtr pPixmap,
int alu, int alu,
Pixel pm, Pixel pm,
Pixel fg) Pixel fg)
{ {
if (!mach64Setup (pDrawable->pScreen, 1, 3)) if (!mach64Setup (pPixmap, 0, 1, 3))
return FALSE; return FALSE;
reg->DP_MIX = (mach64Rop[alu] << 16) | 0; reg->DP_MIX = (mach64Rop[alu] << 16) | 0;
reg->DP_WRITE_MSK = pm; reg->DP_WRITE_MSK = pm;
@ -153,22 +177,33 @@ mach64DoneSolid (void)
static int copyDx; static int copyDx;
static int copyDy; static int copyDy;
static CARD32 copyCombo;
Bool Bool
mach64PrepareCopy (DrawablePtr pSrcDrawable, mach64PrepareCopy (PixmapPtr pSrcPixmap,
DrawablePtr pDstDrawable, PixmapPtr pDstPixmap,
int dx, int dx,
int dy, int dy,
int alu, int alu,
Pixel pm) Pixel pm)
{ {
CARD32 combo = 8; copyCombo = 8 | 2 | 1;
copyDx = dx;
copyDy = dy;
if ((copyDx = dx) > 0) /*
combo |= 1; * Avoid going backwards when copying pixmaps to the screen.
if ((copyDy = dy) > 0) * This should reduce tearing somewhat
combo |= 2; */
if (!mach64Setup (pDstDrawable->pScreen, combo, 2)) if (pSrcPixmap == pDstPixmap)
{
if (dx <= 0)
copyCombo &= ~1;
if (dy <= 0)
copyCombo &= ~2;
}
if (!mach64Setup (pDstPixmap, pSrcPixmap, copyCombo, 2))
return FALSE; return FALSE;
reg->DP_MIX = (mach64Rop[alu] << 16) | 0; reg->DP_MIX = (mach64Rop[alu] << 16) | 0;
@ -194,20 +229,20 @@ mach64Copy (int srcX,
traj = DST_24_ROT_EN | DST_24_ROT((dstX / 4) % 6); traj = DST_24_ROT_EN | DST_24_ROT((dstX / 4) % 6);
if (copyDx > 0) if (copyCombo & 1)
traj |= 1; traj |= 1;
if (copyDy > 0) if (copyCombo & 2)
traj |= 2; traj |= 2;
mach64WaitAvail (reg, 1); mach64WaitAvail (reg, 1);
reg->GUI_TRAJ_CNTL = traj; reg->GUI_TRAJ_CNTL = traj;
} }
if (copyDx <= 0) if ((copyCombo & 1) == 0)
{ {
srcX += w - 1; srcX += w - 1;
dstX += w - 1; dstX += w - 1;
} }
if (copyDy <= 0) if ((copyCombo & 2) == 0)
{ {
srcY += h - 1; srcY += h - 1;
dstY += h - 1; dstY += h - 1;
@ -232,6 +267,10 @@ KaaScreenInfoRec mach64Kaa = {
mach64PrepareCopy, mach64PrepareCopy,
mach64Copy, mach64Copy,
mach64DoneCopy, mach64DoneCopy,
64, /* Offscreen byte alignment */
64, /* Offscreen pitch */
KAA_OFFSCREEN_PIXMAPS, /* Flags */
}; };
Bool Bool
@ -264,12 +303,12 @@ mach64DrawEnable (ScreenPtr pScreen)
{ {
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
mach64ScreenInfo(pScreenPriv); mach64ScreenInfo(pScreenPriv);
CARD32 DP_PIX_WIDTH; CARD32 DP_PIX_WIDTH = 0;
CARD32 DP_SET_GUI_ENGINE; CARD32 SET_DP_DST_PIX_WIDTH = 0;
CARD32 SET_DP_DST_PIX_WIDTH;
CARD32 DST1_PITCH;
avail = 0;
mach64s->bpp24 = FALSE; mach64s->bpp24 = FALSE;
switch (pScreenPriv->screen->fb[0].depth) { switch (pScreenPriv->screen->fb[0].depth) {
case 1: case 1:
DP_PIX_WIDTH = ((PIX_FORMAT_MONO << 0) | /* DP_DST_PIX_WIDTH */ DP_PIX_WIDTH = ((PIX_FORMAT_MONO << 0) | /* DP_DST_PIX_WIDTH */
@ -378,18 +417,12 @@ mach64DrawEnable (ScreenPtr pScreen)
} }
mach64s->DP_PIX_WIDTH = DP_PIX_WIDTH; mach64s->DP_PIX_WIDTH = DP_PIX_WIDTH;
DST1_PITCH = (pScreenPriv->screen->fb[0].pixelStride) >> 3;
if (mach64s->bpp24)
DST1_PITCH *= 3;
mach64s->USR1_DST_OFF_PITCH = ((0 << 0) | /* USR1_DST_OFFSET */
(DST1_PITCH << 22) | /* USR1_DST_PITCH */
0);
mach64s->DP_SET_GUI_ENGINE = ((SET_DP_DST_PIX_WIDTH << 3) | mach64s->DP_SET_GUI_ENGINE = ((SET_DP_DST_PIX_WIDTH << 3) |
(1 << 6) | /* SET_DP_SRC_PIX_WIDTH */ (1 << 6) | /* SET_DP_SRC_PIX_WIDTH */
(0 << 7) | /* SET_DST_OFFSET */ (6 << 7) | /* SET_DST_OFFSET */
(0 << 10) | /* SET_DST_PITCH */ (0 << 10) | /* SET_DST_PITCH */
(0 << 14) | /* SET_DST_PITCH_BY_2 */ (0 << 14) | /* SET_DST_PITCH_BY_2 */
(1 << 15) | /* SET_SRC_OFFPITCH_COPY */ (0 << 15) | /* SET_SRC_OFFPITCH_COPY */
(0 << 16) | /* SET_SRC_HGTWID1_2 */ (0 << 16) | /* SET_SRC_HGTWID1_2 */
(0 << 20) | /* SET_DRAWING_COMBO */ (0 << 20) | /* SET_DRAWING_COMBO */
(1 << 24) | /* SET_BUS_MASTER_OP */ (1 << 24) | /* SET_BUS_MASTER_OP */

View File

@ -28,6 +28,7 @@
#include <config.h> #include <config.h>
#endif #endif
#include "mach64.h" #include "mach64.h"
#include <klinux.h>
void void
InitCard (char *name) InitCard (char *name)

View File

@ -66,6 +66,11 @@ mach64StopVideo(KdScreenInfo *screen, pointer data, Bool exit)
pPortPriv->videoOn = FALSE; pPortPriv->videoOn = FALSE;
mach64WaitIdle (reg); mach64WaitIdle (reg);
} }
if (pPortPriv->off_screen)
{
KdOffscreenFree (pPortPriv->off_screen);
pPortPriv->off_screen = 0;
}
} }
static int static int
@ -74,13 +79,8 @@ mach64SetPortAttribute(KdScreenInfo *screen,
int value, int value,
pointer data) pointer data)
{ {
ScreenPtr pScreen = screen->pScreen;
KdScreenPriv(pScreen);
KdCardInfo *card = pScreenPriv->card;
Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver; Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver;
Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr; Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr;
MediaReg *media = mach64c->media_reg;
if(attribute == xvBrightness) if(attribute == xvBrightness)
{ {
@ -161,14 +161,10 @@ mach64CopyPackedData(KdScreenInfo *screen,
int h, int h,
int w) int w)
{ {
ScreenPtr pScreen = screen->pScreen;
KdScreenPriv(pScreen);
KdCardInfo *card = pScreenPriv->card;
Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver; Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver;
Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr; Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr;
CARD8 *src, *dst; CARD8 *src = buf, *dst;
int srcDown, srcRight, srcNext; int srcDown = srcPitch, srcRight = 2, srcNext;
int p; int p;
switch (randr & RR_Rotate_All) { switch (randr & RR_Rotate_All) {
@ -235,15 +231,12 @@ mach64CopyPlanarData(KdScreenInfo *screen,
int w, int w,
int id) int id)
{ {
ScreenPtr pScreen = screen->pScreen;
KdScreenPriv(pScreen);
KdCardInfo *card = pScreenPriv->card;
Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver; Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver;
Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr; Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr;
int i, j; int i, j;
CARD8 *src1, *src2, *src3, *dst1; CARD8 *src1, *src2, *src3, *dst1;
int srcDown, srcDown2, srcRight, srcRight2, srcNext; int srcDown = srcPitch, srcDown2 = srcPitch2;
int srcRight = 2, srcRight2 = 1, srcNext = 1;
/* compute source data pointers */ /* compute source data pointers */
src1 = buf; src1 = buf;
@ -475,15 +468,8 @@ mach64DisplayVideo(KdScreenInfo *screen,
Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr; Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr;
Reg *reg = mach64c->reg; Reg *reg = mach64c->reg;
MediaReg *media = mach64c->media_reg; MediaReg *media = mach64c->media_reg;
int xscaleInt, xscaleFract, yscaleInt, yscaleFract;
int xscaleIntUV = 0, xscaleFractUV = 0;
int yscaleIntUV = 0, yscaleFractUV = 0;
int randr = mach64s->vesa.randr;
int HORZ_INC, VERT_INC; int HORZ_INC, VERT_INC;
CARD32 SCALER_IN; CARD32 SCALER_IN;
CARD32 OVERLAY_SCALE_CNTL;
int tmp;
int left;
int bright; int bright;
int sat; int sat;
@ -570,6 +556,16 @@ mach64DisplayVideo(KdScreenInfo *screen,
media->OVERLAY_Y_X_START = MACH64_YX (dst_x1, dst_y1); media->OVERLAY_Y_X_START = MACH64_YX (dst_x1, dst_y1);
} }
static void
mach64VideoMoveIn (KdOffscreenArea *area)
{
}
static void
mach64VideoMoveOut (KdOffscreenArea *area)
{
}
static int static int
mach64PutImage(KdScreenInfo *screen, mach64PutImage(KdScreenInfo *screen,
short src_x, short src_x,
@ -592,7 +588,6 @@ mach64PutImage(KdScreenInfo *screen,
Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver; Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver; Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver;
Mach64PortPrivPtr pPortPriv = (Mach64PortPrivPtr)data; Mach64PortPrivPtr pPortPriv = (Mach64PortPrivPtr)data;
Reg *reg = mach64c->reg;
MediaReg *media = mach64c->media_reg; MediaReg *media = mach64c->media_reg;
INT32 x1, x2, y1, y2; INT32 x1, x2, y1, y2;
int randr = mach64s->vesa.randr; int randr = mach64s->vesa.randr;
@ -645,6 +640,7 @@ mach64PutImage(KdScreenInfo *screen,
switch (randr & RR_Rotate_All) { switch (randr & RR_Rotate_All) {
case RR_Rotate_0: case RR_Rotate_0:
default:
dst_x1 = dstBox.x1; dst_x1 = dstBox.x1;
dst_y1 = dstBox.y1; dst_y1 = dstBox.y1;
dst_x2 = dstBox.x2; dst_x2 = dstBox.x2;
@ -700,11 +696,29 @@ mach64PutImage(KdScreenInfo *screen,
default: default:
dstPitch = ((dst_width << 1) + 15) & ~15; dstPitch = ((dst_width << 1) + 15) & ~15;
srcPitch = (width << 1); srcPitch = (width << 1);
srcPitch2 = 0;
size = dstPitch * (int) dst_height; size = dstPitch * (int) dst_height;
break; break;
} }
pPortPriv->offset = mach64s->off_screen - (CARD8 *) mach64s->vesa.fb; if (pPortPriv->off_screen && size != pPortPriv->size)
{
KdOffscreenFree (pPortPriv->off_screen);
pPortPriv->off_screen = 0;
}
if (!pPortPriv->off_screen)
{
pPortPriv->off_screen = KdOffscreenAlloc (screen->pScreen, size * 2, 64,
TRUE, mach64VideoMoveIn,
mach64VideoMoveOut,
pPortPriv);
if (!pPortPriv->off_screen)
return BadAlloc;
}
pPortPriv->offset = pPortPriv->off_screen->offset;
pPortPriv->size = size;
/* fixup pointers */ /* fixup pointers */
pPortPriv->YBuf0Offset = pPortPriv->offset; pPortPriv->YBuf0Offset = pPortPriv->offset;
@ -860,18 +874,6 @@ static KdImageRec Images[NUM_IMAGES] =
static void mach64ResetVideo(KdScreenInfo *screen) static void mach64ResetVideo(KdScreenInfo *screen)
{ {
ScreenPtr pScreen = screen->pScreen;
KdScreenPriv(pScreen);
KdCardInfo *card = pScreenPriv->card;
Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver;
Mach64PortPrivPtr pPortPriv = mach64s->pAdaptor->pPortPrivates[0].ptr;
MediaReg *media = mach64c->media_reg;
/*
* Default to maximum image size in YV12
*/
} }
static int static int
@ -881,10 +883,9 @@ mach64ReputImage (KdScreenInfo *screen,
RegionPtr clipBoxes, RegionPtr clipBoxes,
pointer data) pointer data)
{ {
ScreenPtr pScreen = screen->pScreen;
Mach64PortPrivPtr pPortPriv = (Mach64PortPrivPtr)data; Mach64PortPrivPtr pPortPriv = (Mach64PortPrivPtr)data;
BoxPtr pOldExtents = REGION_EXTENTS (pScreen, &pPortPriv->clip); BoxPtr pOldExtents = REGION_EXTENTS (screen->pScreen, &pPortPriv->clip);
BoxPtr pNewExtents = REGION_EXTENTS (pScreen, clipBoxes); BoxPtr pNewExtents = REGION_EXTENTS (screen->pScreen, clipBoxes);
if (pOldExtents->x1 == pNewExtents->x1 && if (pOldExtents->x1 == pNewExtents->x1 &&
pOldExtents->x2 == pNewExtents->x2 && pOldExtents->x2 == pNewExtents->x2 &&
@ -906,10 +907,8 @@ static KdVideoAdaptorPtr
mach64SetupImageVideo(ScreenPtr pScreen) mach64SetupImageVideo(ScreenPtr pScreen)
{ {
KdScreenPriv(pScreen); KdScreenPriv(pScreen);
mach64CardInfo(pScreenPriv);
mach64ScreenInfo(pScreenPriv); mach64ScreenInfo(pScreenPriv);
KdScreenInfo *screen = pScreenPriv->screen; KdScreenInfo *screen = pScreenPriv->screen;
KdCardInfo *card = pScreenPriv->card;
KdVideoAdaptorPtr adapt; KdVideoAdaptorPtr adapt;
Mach64PortPrivPtr pPortPriv; Mach64PortPrivPtr pPortPriv;
@ -952,6 +951,9 @@ mach64SetupImageVideo(ScreenPtr pScreen)
pPortPriv->brightness = 0; pPortPriv->brightness = 0;
pPortPriv->saturation = 0; pPortPriv->saturation = 0;
pPortPriv->currentBuf = 0; pPortPriv->currentBuf = 0;
pPortPriv->off_screen = 0;
pPortPriv->size = 0;
pPortPriv->offset = 0;
/* gotta uninit this someplace */ /* gotta uninit this someplace */
REGION_INIT(pScreen, &pPortPriv->clip, NullBox, 0); REGION_INIT(pScreen, &pPortPriv->clip, NullBox, 0);
@ -975,7 +977,6 @@ Bool mach64InitVideo(ScreenPtr pScreen)
KdVideoAdaptorPtr newAdaptor = NULL; KdVideoAdaptorPtr newAdaptor = NULL;
int num_adaptors; int num_adaptors;
KdCardInfo *card = pScreenPriv->card; KdCardInfo *card = pScreenPriv->card;
Mach64ScreenInfo *mach64s = (Mach64ScreenInfo *) screen->driver;
Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver; Mach64CardInfo *mach64c = (Mach64CardInfo *) card->driver;
if (!mach64c->media_reg) if (!mach64c->media_reg)