summaryrefslogtreecommitdiff
path: root/src/radeon_exa.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2006-03-09 06:06:25 +0000
committerEric Anholt <anholt@freebsd.org>2006-03-09 06:06:25 +0000
commit890b95a3ddad7634f3aea635cb236b221e902acc (patch)
tree2c074721f3ba3e94d90b9b599c83c32a0a51aa99 /src/radeon_exa.c
parente19ccfa18fee046c54d7a9401e4e0098b2300598 (diff)
Update drivers that support EXA for the new EXA ABI. This consists of
moving all the accel and card members into the driver ptr, filling in the exa_major/ exa_minor fields, and always using LoadSubModule so we can check the module version up front. Only tested on ATI.
Diffstat (limited to 'src/radeon_exa.c')
-rw-r--r--src/radeon_exa.c44
1 files changed, 26 insertions, 18 deletions
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 56927c14..ab6810e3 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -157,10 +157,10 @@ static Bool RADEONGetOffsetPitch(PixmapPtr pPix, int bpp, CARD32 *pitch_offset,
{
RINFO_FROM_SCREEN(pPix->drawable.pScreen);
- if (pitch % info->exa.card.pixmapPitchAlign != 0)
+ if (pitch % info->exa->pixmapPitchAlign != 0)
RADEON_FALLBACK(("Bad pitch 0x%08x\n", pitch));
- if (offset % info->exa.card.pixmapOffsetAlign != 0)
+ if (offset % info->exa->pixmapOffsetAlign != 0)
RADEON_FALLBACK(("Bad offset 0x%08x\n", offset));
pitch = pitch >> 6;
@@ -371,6 +371,14 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen)
int next, screen_size;
int byteStride = pScrn->displayWidth * cpp;
+ if (info->exa != NULL) {
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "Memory map already initialized\n");
+ return FALSE;
+ }
+ info->exa = exaDriverAlloc();
+ if (info->exa == NULL)
+ return FALSE;
+
/* Need to adjust screen size for 16 line tiles, and then make it align to.
* the buffer alignment requirement.
*/
@@ -379,12 +387,12 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen)
else
screen_size = pScrn->virtualY * byteStride;
- info->exa.card.memoryBase = info->FB + pScrn->fbOffset;
- info->exa.card.memorySize = info->FbMapSize - info->FbSecureSize;
- info->exa.card.offScreenBase = screen_size;
+ info->exa->memoryBase = info->FB + pScrn->fbOffset;
+ info->exa->memorySize = info->FbMapSize - info->FbSecureSize;
+ info->exa->offScreenBase = screen_size;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Allocating from a screen of %ld kb\n",
- info->exa.card.memorySize / 1024);
+ info->exa->memorySize / 1024);
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Will use %d kb for front buffer at offset 0x%08x\n",
@@ -412,12 +420,12 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen)
* offscreen locations does.
*/
info->backPitch = pScrn->displayWidth;
- next = RADEON_ALIGN(info->exa.card.offScreenBase, RADEON_BUFFER_ALIGN);
+ next = RADEON_ALIGN(info->exa->offScreenBase, RADEON_BUFFER_ALIGN);
if (!info->noBackBuffer &&
- next + screen_size <= info->exa.card.memorySize)
+ next + screen_size <= info->exa->memorySize)
{
info->backOffset = next;
- info->exa.card.offScreenBase = next + screen_size;
+ info->exa->offScreenBase = next + screen_size;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Will use %d kb for back buffer at offset 0x%08x\n",
screen_size / 1024, info->backOffset);
@@ -428,26 +436,26 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen)
*/
info->depthPitch = RADEON_ALIGN(pScrn->displayWidth, 32);
depth_size = RADEON_ALIGN(pScrn->virtualY, 16) * info->depthPitch * cpp;
- next = RADEON_ALIGN(info->exa.card.offScreenBase, RADEON_BUFFER_ALIGN);
- if (next + depth_size <= info->exa.card.memorySize)
+ next = RADEON_ALIGN(info->exa->offScreenBase, RADEON_BUFFER_ALIGN);
+ if (next + depth_size <= info->exa->memorySize)
{
info->depthOffset = next;
- info->exa.card.offScreenBase = next + depth_size;
+ info->exa->offScreenBase = next + depth_size;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Will use %d kb for depth buffer at offset 0x%08x\n",
depth_size / 1024, info->depthOffset);
}
- info->textureSize *= (info->exa.card.memorySize -
- info->exa.card.offScreenBase) / 100;
+ info->textureSize *= (info->exa->memorySize -
+ info->exa->offScreenBase) / 100;
l = RADEONLog2(info->textureSize / RADEON_NR_TEX_REGIONS);
if (l < RADEON_LOG_TEX_GRANULARITY)
l = RADEON_LOG_TEX_GRANULARITY;
info->textureSize = (info->textureSize >> l) << l;
if (info->textureSize >= 512 * 1024) {
- info->textureOffset = info->exa.card.offScreenBase;
- info->exa.card.offScreenBase += info->textureSize;
+ info->textureOffset = info->exa->offScreenBase;
+ info->exa->offScreenBase += info->textureSize;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Will use %d kb for textures at offset 0x%08x\n",
info->textureSize / 1024, info->textureOffset);
@@ -460,8 +468,8 @@ Bool RADEONSetupMemEXA (ScreenPtr pScreen)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Will use %ld kb for X Server offscreen at offset 0x%08lx\n",
- (info->exa.card.memorySize - info->exa.card.offScreenBase) /
- 1024, info->exa.card.offScreenBase);
+ (info->exa->memorySize - info->exa->offScreenBase) /
+ 1024, info->exa->offScreenBase);
return TRUE;
}