Commit 1b368984 authored by Alexander Gottwald's avatar Alexander Gottwald

Pull XORG-6_8_0 to CYGWIN branch

parent 70a54183
......@@ -23,6 +23,7 @@
#include "savage_driver.h"
#include "savage_regs.h"
#include "savage_bci.h"
#include "savage_streams.h"
/* Forward declaration of functions used in the driver */
......@@ -47,7 +48,7 @@ static void SavageSetupForSolidFill(
ScrnInfoPtr pScrn,
int color,
int rop,
unsigned planemask);
unsigned int planemask);
static void SavageSubsequentSolidFillRect(
ScrnInfoPtr pScrn,
......@@ -82,7 +83,7 @@ static void SavageSetupForScreenToScreenColorExpand(
int bg,
int fg,
int rop,
unsigned planemask);
unsigned int planemask);
static void SavageSubsequentScreenToScreenColorExpand(
ScrnInfoPtr pScrn,
......@@ -98,7 +99,7 @@ static void SavageSetupForCPUToScreenColorExpandFill(
int fg,
int bg,
int rop,
unsigned planemask);
unsigned int planemask);
static void SavageSubsequentScanlineCPUToScreenColorExpandFill(
ScrnInfoPtr pScrn,
......@@ -119,7 +120,7 @@ static void SavageSetupForMono8x8PatternFill(
int fg,
int bg,
int rop,
unsigned planemask);
unsigned int planemask);
static void SavageSubsequentMono8x8PatternFillRect(
ScrnInfoPtr pScrn,
......@@ -421,7 +422,10 @@ SavageInitAccel(ScreenPtr pScreen)
#if 1
xaaptr->SetupForScreenToScreenCopy = SavageSetupForScreenToScreenCopy;
xaaptr->SubsequentScreenToScreenCopy = SavageSubsequentScreenToScreenCopy;
xaaptr->ScreenToScreenCopyFlags = NO_TRANSPARENCY | NO_PLANEMASK | ROP_NEEDS_SOURCE;
xaaptr->ScreenToScreenCopyFlags = 0
| NO_TRANSPARENCY
| NO_PLANEMASK
| ROP_NEEDS_SOURCE;
#endif
......@@ -492,7 +496,7 @@ SavageInitAccel(ScreenPtr pScreen)
xaaptr->SubsequentSolidFillTrap = SavageSubsequentSolidFillTrap;
#endif
xaaptr->SolidBresenhamLineErrorTermBits = 14;
xaaptr->SolidBresenhamLineErrorTermBits = 13;
#endif
/* ImageWrite */
......@@ -594,7 +598,7 @@ SavageAccelSync(ScrnInfoPtr pScrn)
*/
static int
SavageHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
SavageHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, unsigned int pm, int *rop)
{
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
int ret = 0;
......@@ -604,7 +608,7 @@ SavageHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
if(pm == infoRec->FullPlanemask) {
if(!NO_SRC_ROP(*rop))
ret |= ROP_PAT;
*rop = XAACopyROP[*rop];
*rop = XAAGetCopyROP(*rop);
} else {
switch(*rop) {
case GXnoop:
......@@ -621,7 +625,7 @@ SavageHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
ret |= ROP_PAT | ROP_SRC;
break;
}
*rop = XAACopyROP_PM[*rop];
*rop = XAAGetCopyROP_PM(*rop);
}
return ret;
......@@ -629,7 +633,7 @@ SavageHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop)
static int
SavageHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
SavageHelpSolidROP(ScrnInfoPtr pScrn, int *fg, unsigned int pm, int *rop)
{
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn);
int ret = 0;
......@@ -639,7 +643,7 @@ SavageHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
if(pm == infoRec->FullPlanemask) {
if(!NO_SRC_ROP(*rop))
ret |= ROP_PAT;
*rop = XAACopyROP[*rop];
*rop = XAAGetCopyROP(*rop);
} else {
switch(*rop) {
case GXnoop:
......@@ -654,7 +658,7 @@ SavageHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop)
ret |= ROP_PAT | ROP_SRC;
break;
}
*rop = XAACopyROP_PM[*rop];
*rop = XAAGetCopyROP_PM(*rop);
}
return ret;
......@@ -682,7 +686,7 @@ SavageSetupForScreenToScreenCopy(
int cmd;
cmd = BCI_CMD_RECT | BCI_CMD_DEST_GBD | BCI_CMD_SRC_GBD;
BCI_CMD_SET_ROP( cmd, XAACopyROP[rop] );
BCI_CMD_SET_ROP( cmd, XAAGetCopyROP(rop) );
if (transparency_color != -1)
cmd |= BCI_CMD_SEND_COLOR | BCI_CMD_SRC_TRANSPARENT;
......@@ -722,7 +726,7 @@ SavageSubsequentScreenToScreenCopy(
psav->WaitQueue(psav,6);
BCI_SEND(psav->SavedBciCmd);
if (psav->SavedBgColor != -1)
if (psav->SavedBgColor != 0xffffffff)
BCI_SEND(psav->SavedBgColor);
BCI_SEND(BCI_X_Y(x1, y1));
BCI_SEND(BCI_X_Y(x2, y2));
......@@ -739,7 +743,7 @@ SavageSetupForSolidFill(
ScrnInfoPtr pScrn,
int color,
int rop,
unsigned planemask)
unsigned int planemask)
{
SavagePtr psav = SAVPTR(pScrn);
XAAInfoRecPtr xaaptr = GET_XAAINFORECPTR_FROM_SCRNINFOPTR( pScrn );
......@@ -756,7 +760,7 @@ SavageSetupForSolidFill(
{
if( color == 0 )
rop = GXclear;
else if( color == xaaptr->FullPlanemask )
else if( (unsigned int)color == xaaptr->FullPlanemask )
rop = GXset;
}
......@@ -802,7 +806,7 @@ SavageSetupForScreenToScreenColorExpand(
int bg,
int fg,
int rop,
unsigned planemask)
unsigned int planemask)
{
/* SavagePtr psav = SAVPTR(pScrn); */
}
......@@ -827,7 +831,7 @@ SavageSetupForCPUToScreenColorExpandFill(
int fg,
int bg,
int rop,
unsigned planemask)
unsigned int planemask)
{
SavagePtr psav = SAVPTR(pScrn);
int cmd;
......@@ -877,7 +881,7 @@ SavageSubsequentScanlineCPUToScreenColorExpandFill(
w = (w + 31) & ~31;
if( psav->SavedBciCmd & BCI_CMD_SEND_COLOR )
BCI_SEND(psav->SavedFgColor);
if( psav->SavedBgColor != -1 )
if( psav->SavedBgColor != 0xffffffff )
BCI_SEND(psav->SavedBgColor);
BCI_SEND(BCI_X_Y(x, y));
BCI_SEND(BCI_W_H(w, 1));
......@@ -929,7 +933,7 @@ SavageSetupForMono8x8PatternFill(
int fg,
int bg,
int rop,
unsigned planemask)
unsigned int planemask)
{
SavagePtr psav = SAVPTR(pScrn);
int cmd;
......@@ -980,7 +984,7 @@ SavageSubsequentMono8x8PatternFillRect(
BCI_SEND(psav->SavedBciCmd);
if( psav->SavedBciCmd & BCI_CMD_SEND_COLOR )
BCI_SEND(psav->SavedFgColor);
if( psav->SavedBgColor != -1 )
if( psav->SavedBgColor != 0xffffffff )
BCI_SEND(psav->SavedBgColor);
BCI_SEND(BCI_X_Y(x, y));
BCI_SEND(BCI_W_H(w, h));
......
......@@ -10,10 +10,10 @@
dword |= (temp & 0xFF0000) >> 8; \
dword |= (temp & 0xFF000000) >> 24; }
#define BCI_GET_PTR volatile unsigned int * bci_ptr = (unsigned int *) psav->BciMem
#define BCI_RESET bci_ptr = (unsigned int *) psav->BciMem
#define BCI_GET_PTR volatile CARD32 * bci_ptr = (CARD32 *) psav->BciMem
#define BCI_RESET bci_ptr = (CARD32 *) psav->BciMem
#define BCI_SEND(dw) (*bci_ptr++ = (unsigned int)(dw))
#define BCI_SEND(dw) (*bci_ptr++ = (CARD32)(dw))
#define BCI_CMD_NOP 0x40000000
#define BCI_CMD_RECT 0x48000000
......
......@@ -81,7 +81,7 @@ SavageHWCursorInit(ScreenPtr pScreen)
HARDWARE_CURSOR_AND_SOURCE_WITH_MASK |
HARDWARE_CURSOR_BIT_ORDER_MSBFIRST |
HARDWARE_CURSOR_INVERT_MASK;
#if 0
/*
* The /MX family is apparently unique among the Savages, in that
* the cursor color is always straight RGB. The rest of the Savages
......@@ -94,7 +94,10 @@ SavageHWCursorInit(ScreenPtr pScreen)
||
S3_SAVAGE_MOBILE_SERIES(psav->Chipset)
)
infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
#endif
/* With streams engine the Cursor seems to be ALWAYS TrueColor */
infoPtr->Flags |= HARDWARE_CURSOR_TRUECOLOR_AT_8BPP;
infoPtr->SetCursorColors = SavageSetCursorColors;
infoPtr->SetCursorPosition = SavageSetCursorPosition;
......@@ -144,8 +147,8 @@ SavageLoadCursorImage(
SavagePtr psav = SAVPTR(pScrn);
/* Set cursor location in frame buffer. */
outCRReg( 0x4d, (0xff & psav->CursorKByte));
outCRReg( 0x4c, (0xff00 & psav->CursorKByte) >> 8);
outCRReg( 0x4d, (0xff & (CARD32)psav->CursorKByte));
outCRReg( 0x4c, (0xff00 & (CARD32)psav->CursorKByte) >> 8);
/* Upload the cursor image to the frame buffer. */
memcpy(psav->FBBase + psav->CursorKByte * 1024, src, 1024);
......@@ -225,11 +228,14 @@ SavageSetCursorColors(
bNeedExtra =
(psav->CursorInfoRec->Flags & HARDWARE_CURSOR_TRUECOLOR_AT_8BPP);
if(
S3_SAVAGE_MOBILE_SERIES(psav->Chipset) ||
(pScrn->depth == 24) ||
((pScrn->depth == 8) && bNeedExtra)
)
/* With the streams engine on HW Cursor seems to be 24bpp ALWAYS */
if( 1
#if 0
|| S3_SAVAGE_MOBILE_SERIES(psav->Chipset) ||
(pScrn->depth == 24) ||
((pScrn->depth == 8) && bNeedExtra)
#endif
)
{
/* Do it straight, full 24 bit color. */
......@@ -247,6 +253,7 @@ SavageSetCursorColors(
outCRReg(0x4b, bg >> 16);
return;
}
#if 0
else if( (pScrn->depth == 15) || (pScrn->depth == 16) )
{
if (pScrn->depth == 15) {
......@@ -296,4 +303,5 @@ SavageSetCursorColors(
outCRReg(0x4b, bg);
outCRReg(0x4b, bg);
}
#endif
}
This diff is collapsed.
/*
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef __SAVAGE_DRI_H__
#define __SAVAGE_DRI_H__
#include "xf86drm.h"
#include "drm.h"
#define SAVAGE_DEFAULT_AGP_MODE 1
#define SAVAGE_MAX_AGP_MODE 4
/* Buffer are aligned on 4096 byte boundaries.
*/
/* this is used for backbuffer, depthbuffer, etc..*/
/* alignment */
#define SAVAGE_BUFFER_ALIGN 0x00000fff
typedef struct{
drm_context_t ctxOwner;
unsigned long agp_offset;
unsigned long agp_handle;
unsigned long map_handle;
int flags;
} savageAgpBuffer , *savageAgpBufferPtr;
typedef struct _server{
int reserved_map_agpstart;
int reserved_map_idx;
#if 0
int buffer_map_idx;
#endif
int sarea_priv_offset;
#if 0
int primary_size;
int warp_ucode_size;
#endif
int chipset;
int sgram; /* seems no use */
unsigned int frontOffset;
unsigned int frontPitch;
unsigned int frontbufferSize;
unsigned int backOffset;
unsigned int backPitch;
unsigned int backbufferSize;
unsigned int depthOffset;
unsigned int depthPitch;
unsigned int depthbufferSize;
unsigned int textureOffset;
int textureSize;
int logTextureGranularity;
drmRegion agp;
/* PCI mappings */
drmRegion aperture;
drmRegion registers;
drmRegion status;
/* AGP mappings */
#if 0
drmRegion warp;
drmRegion primary;
drmRegion buffers;
#endif
drmRegion agpTextures;
int logAgpTextureGranularity;
#if 0
drmBufMapPtr drmBuffers;
#endif
/*for agp*/
int numBuffer;
savageAgpBufferPtr agpBuffer;
} SAVAGEDRIServerPrivateRec, *SAVAGEDRIServerPrivatePtr;
typedef struct {
int chipset;
int width;
int height;
int mem;
int cpp;
int zpp;
int agpMode;
drm_handle_t frontbuffer;
unsigned int frontbufferSize;
unsigned int frontOffset;
unsigned int frontPitch;
unsigned int frontBitmapDesc; /*Bitmap Descriptior*/
unsigned int IsfrontTiled;
drm_handle_t backbuffer;
unsigned int backbufferSize;
unsigned int backOffset;
unsigned int backPitch;
unsigned int backBitmapDesc; /*Bitmap Descriptior*/
drm_handle_t depthbuffer;
unsigned int depthbufferSize;
unsigned int depthOffset;
unsigned int depthPitch;
unsigned int depthBitmapDesc; /*Bitmap Descriptior*/
drm_handle_t textures;
drm_handle_t xvmcSurfHandle;
unsigned int textureOffset;
unsigned int textureSize;
int logTextureGranularity;
/* Allow calculation of setup dma addresses.
*/
unsigned int agpBufferOffset;
unsigned int agpTextureOffset;
unsigned int agpTextureSize;
drmRegion agpTextures;
int logAgpTextureGranularity;
/* unsigned int mAccess;*/
drmRegion aperture;
unsigned int aperturePitch; /* in byte */
drmRegion registers;
drmRegion BCIcmdBuf;
drmRegion status;
#if 0
drmRegion primary;
drmRegion buffers;
#endif
/*For shadow status*/
unsigned long sareaPhysAddr;
unsigned int sarea_priv_offset;
int shadowStatus;
} SAVAGEDRIRec, *SAVAGEDRIPtr;
#endif
/*
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef __SAVAGE_DRIPRIV_H__
#define __SAVAGE_DRIPRIV_H__
#include "GL/glxint.h"
#define SAVAGE_MAX_DRAWABLES 256
extern void GlxSetVisualConfigs( int nconfigs,
__GLXvisualConfig *configs,
void **configprivs );
typedef struct {
/* Nothing here yet */
int dummy;
} SAVAGEConfigPrivRec, *SAVAGEConfigPrivPtr;
typedef struct {
/* Nothing here yet */
int dummy;
} SAVAGEDRIContextRec, *SAVAGEDRIContextPtr;
#endif
This diff is collapsed.
......@@ -3,6 +3,8 @@
#ifndef SAVAGE_VGAHWMMIO_H
#define SAVAGE_VGAHWMMIO_H
#define MODE_24 24
#include "xf86_ansic.h"
#include "compiler.h"
#include "vgaHW.h"
......@@ -15,6 +17,7 @@
#include "mipointer.h"
#include "micmap.h"
#include "fb.h"
#include "fboverlay.h"
#include "xf86cmap.h"
#include "vbe.h"
#include "xaa.h"
......@@ -70,6 +73,10 @@ typedef struct {
unsigned int MMPR0, MMPR1, MMPR2, MMPR3;
} SavageRegRec, *SavageRegPtr;
typedef struct {
CARD32 redMask, greenMask, blueMask;
int redShift, greenShift, blueShift;
} savageOverlayRec;
typedef struct _Savage {
SavageRegRec SavedReg;
......@@ -85,7 +92,7 @@ typedef struct _Savage {
int videoRambytes;
int videoRamKbytes;
int MemOffScreen;
CARD32 CursorKByte;
int CursorKByte;
/* These are physical addresses. */
unsigned long FrameBufferBase;
......@@ -178,8 +185,6 @@ typedef struct _Savage {
unsigned int SavedSbdOffset;
unsigned int SavedSbd;
/* Support for Int10 processing */
xf86Int10InfoPtr pInt10;
SavageModeTablePtr ModeTable;
/* Support for the Savage command overflow buffer. */
......@@ -203,6 +208,11 @@ typedef struct _Savage {
int dwBCIWait2DIdle;
XF86OffscreenImagePtr offscreenImages;
/* Support for Overlays */
unsigned char * FBStart2nd;
savageOverlayRec overlay;
int overlayDepth;
int primStreamBpp;
} SavageRec, *SavagePtr;
/* Video flags. */
......@@ -213,7 +223,6 @@ typedef struct _Savage {
/* Make the names of these externals driver-unique */
#define gpScrn savagegpScrn
#define myOUTREG savageOUTREG
#define readdw savagereaddw
#define readfb savagereadfb
#define writedw savagewritedw
......@@ -272,5 +281,22 @@ unsigned short SavageGetBIOSModes(
void SavageInitVideo( ScreenPtr pScreen );
/* In savage_streams.c */
void SavageStreamsOn(ScrnInfoPtr pScrn);
void SavageStreamsOff(ScrnInfoPtr pScrn);
void SavageInitSecondaryStream(ScrnInfoPtr pScrn);
#if (MODE_24 == 32)
# define BYTES_PP24 4
#else
# define BYTES_PP24 3
#endif
#define DEPTH_BPP(depth) (depth == 24 ? (BYTES_PP24 << 3) : (depth + 7) & ~0x7)
#define DEPTH_2ND(pScrn) (pScrn->depth > 8 ? pScrn->depth\
: SAVPTR(pScrn)->overlayDepth)
#endif /* SAVAGE_VGAHWMMIO_H */
/*
* Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.
* Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sub license,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* VIA, S3 GRAPHICS, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef __SAVAGE_DRM_H__
#define __SAVAGE_DRM_H__
#ifndef __SAVAGE_SAREA_DEFINES__
#define __SAVAGE_SAREA_DEFINES__
#define DRM_SAVAGE_MEM_PAGE (1UL<<12)
#define DRM_SAVAGE_MEM_WORK 32
#define DRM_SAVAGE_MEM_LOCATION_PCI 1
#define DRM_SAVAGE_MEM_LOCATION_AGP 2
#define DRM_SAVAGE_DMA_AGP_SIZE (16*1024*1024)
typedef struct drm_savage_alloc_cont_mem
{
size_t size; /*size of buffer*/
unsigned long type; /*4k page or word*/
unsigned long alignment;
unsigned long location; /*agp or pci*/
unsigned long phyaddress;
unsigned long linear;
} drm_savage_alloc_cont_mem_t;
typedef struct drm_savage_get_physcis_address
{
unsigned long v_address;
unsigned long p_address;
}drm_savage_get_physcis_address_t;
/*ioctl number*/
#define DRM_IOCTL_SAVAGE_ALLOC_CONTINUOUS_MEM \
DRM_IOWR(0x40,drm_savage_alloc_cont_mem_t)
#define DRM_IOCTL_SAVAGE_GET_PHYSICS_ADDRESS \
DRM_IOWR(0x41, drm_savage_get_physcis_address_t)
#define DRM_IOCTL_SAVAGE_FREE_CONTINUOUS_MEM \
DRM_IOWR(0x42, drm_savage_alloc_cont_mem_t)
#define SAVAGE_FRONT 0x1
#define SAVAGE_BACK 0x2
#define SAVAGE_DEPTH 0x4
#define SAVAGE_STENCIL 0x8
/* What needs to be changed for the current vertex dma buffer?
*/
#define SAVAGE_UPLOAD_CTX 0x1
#define SAVAGE_UPLOAD_TEX0 0x2
#define SAVAGE_UPLOAD_TEX1 0x4
#define SAVAGE_UPLOAD_PIPE 0x8 /* <- seems should be removed, Jiayo Hsu */
#define SAVAGE_UPLOAD_TEX0IMAGE 0x10 /* handled client-side */
#define SAVAGE_UPLOAD_TEX1IMAGE 0x20 /* handled client-side */
#define SAVAGE_UPLOAD_2D 0x40
#define SAVAGE_WAIT_AGE 0x80 /* handled client-side */
#define SAVAGE_UPLOAD_CLIPRECTS 0x100 /* handled client-side */
/*frank:add Buffer state 2001/11/15*/
#define SAVAGE_UPLOAD_BUFFERS 0x200
/* original marked off in MGA drivers , Jiayo Hsu Oct.23,2001 */
/* Keep these small for testing.
*/
#define SAVAGE_NR_SAREA_CLIPRECTS 8
/* 2 heaps (1 for card, 1 for agp), each divided into upto 128
* regions, subject to a minimum region size of (1<<16) == 64k.
*
* Clients may subdivide regions internally, but when sharing between
* clients, the region size is the minimum granularity.
*/
#define SAVAGE_CARD_HEAP 0
#define SAVAGE_AGP_HEAP 1
#define SAVAGE_NR_TEX_HEAPS 2
#define SAVAGE_NR_TEX_REGIONS 16 /* num. of global texture manage list element*/
#define SAVAGE_LOG_MIN_TEX_REGION_SIZE 16 /* each region 64K, Jiayo Hsu */
#endif /* __SAVAGE_SAREA_DEFINES__ */
/* drm_tex_region_t define in drm.h */
typedef drm_tex_region_t drm_savage_tex_region_t;
/* Setup registers for 2D, X server
*/
typedef struct {
unsigned int pitch;
} drm_savage_server_regs_t;
typedef struct _drm_savage_sarea {
/* The channel for communication of state information to the kernel
* on firing a vertex dma buffer.
*/
unsigned int setup[28]; /* 3D context registers */
drm_savage_server_regs_t server_state;
unsigned int dirty;
unsigned int vertsize; /* vertext size */
/* The current cliprects, or a subset thereof.
*/
drm_clip_rect_t boxes[SAVAGE_NR_SAREA_CLIPRECTS];
unsigned int nbox;
/* Information about the most recently used 3d drawable. The
* client fills in the req_* fields, the server fills in the
* exported_ fields and puts the cliprects into boxes, above.
*
* The client clears the exported_drawable field before
* clobbering the boxes data.
*/
unsigned int req_drawable; /* the X drawable id */
unsigned int req_draw_buffer; /* SAVAGE_FRONT or SAVAGE_BACK */
unsigned int exported_drawable;
unsigned int exported_index;
unsigned int exported_stamp;
unsigned int exported_buffers;
unsigned int exported_nfront;
unsigned int exported_nback;
int exported_back_x, exported_front_x, exported_w;
int exported_back_y, exported_front_y, exported_h;
drm_clip_rect_t exported_boxes[SAVAGE_NR_SAREA_CLIPRECTS];
/* Counters for aging textures and for client-side throttling.
*/
unsigned int status[4];
/* LRU lists for texture memory in agp space and on the card.
*/
drm_tex_region_t texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS+1];
unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
/* Mechanism to validate card state.
*/
int ctxOwner;
unsigned long shadow_status[64];/*too big?*/
/*agp offset*/
unsigned long agp_offset;
} drm_savage_sarea_t,*drm_savage_sarea_ptr;
/* WARNING: If you change any of these defines, make sure to change the
* defines in the Xserver file (xf86drmMga.h)
*/
typedef struct drm_savage_init {
unsigned long sarea_priv_offset;
int chipset;
int sgram;
unsigned int maccess;
unsigned int fb_cpp;
unsigned int front_offset, front_pitch;