summaryrefslogtreecommitdiff
path: root/exa/exa_offscreen.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2006-03-09 06:04:07 +0000
committerEric Anholt <anholt@freebsd.org>2006-03-09 06:04:07 +0000
commit2822cbc1fb2271844e7ae10c3629aaa940ae4042 (patch)
tree5ea4d9af188cf9a79e64ce3354574cdd717cea69 /exa/exa_offscreen.c
parent65aa33f9173b1554924437685698f7c5f645a3c4 (diff)
Rearrange EXA driver structures so that there's a hope of maintaining ABI
when extending the driver interface. The card and accel structures are merged into the ExaDriverRec, which is to be allocated using exaDriverAlloc(). The driver structure also grows exa_major and exa_minor, which drivers fill in and have checked by EXA (double-checking that the driver really did check that the EXA version was correct). Removes exaInitCard(), which is replaced by the driver filling in the rec by hand, and the exaGetVersion() and related EXA_*VERSION which are replaced by always using the XFree86 loadable module versioning.
Diffstat (limited to 'exa/exa_offscreen.c')
-rw-r--r--exa/exa_offscreen.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index a8ab37913..f3d9c7d6e 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -39,9 +39,9 @@ ExaOffscreenValidate (ScreenPtr pScreen)
ExaScreenPriv (pScreen);
ExaOffscreenArea *prev = 0, *area;
- assert (pExaScr->info->card.offScreenAreas->base_offset ==
- pExaScr->info->card.offScreenBase);
- for (area = pExaScr->info->card.offScreenAreas; area; area = area->next)
+ assert (pExaScr->info->offScreenAreas->base_offset ==
+ pExaScr->info->offScreenBase);
+ for (area = pExaScr->info->offScreenAreas; area; area = area->next)
{
assert (area->offset >= area->base_offset &&
area->offset < (area->base_offset -> area->size));
@@ -49,7 +49,7 @@ ExaOffscreenValidate (ScreenPtr pScreen)
assert (prev->base_offset + prev->area.size == area->base_offset);
prev = area;
}
- assert (prev->base_offset + prev->size == pExaScr->info->card.memorySize);
+ assert (prev->base_offset + prev->size == pExaScr->info->memorySize);
}
#else
#define ExaOffscreenValidate(s)
@@ -88,16 +88,16 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
}
/* throw out requests that cannot fit */
- if (size > (pExaScr->info->card.memorySize - pExaScr->info->card.offScreenBase))
+ if (size > (pExaScr->info->memorySize - pExaScr->info->offScreenBase))
{
DBG_OFFSCREEN (("Alloc 0x%x vs (0x%lx) -> TOBIG\n", size,
- pExaScr->info->card.memorySize -
- pExaScr->info->card.offScreenBase));
+ pExaScr->info->memorySize -
+ pExaScr->info->offScreenBase));
return NULL;
}
/* Try to find a free space that'll fit. */
- for (area = pExaScr->info->card.offScreenAreas; area; area = area->next)
+ for (area = pExaScr->info->offScreenAreas; area; area = area->next)
{
/* skip allocated areas */
if (area->state != ExaOffscreenAvail)
@@ -125,7 +125,7 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
/* prev points at the first object to boot */
best = NULL;
best_score = INT_MAX;
- for (begin = pExaScr->info->card.offScreenAreas; begin != NULL;
+ for (begin = pExaScr->info->offScreenAreas; begin != NULL;
begin = begin->next)
{
int avail, score;
@@ -237,7 +237,7 @@ ExaOffscreenSwapOut (ScreenPtr pScreen)
/* loop until a single free area spans the space */
for (;;)
{
- ExaOffscreenArea *area = pExaScr->info->card.offScreenAreas;
+ ExaOffscreenArea *area = pExaScr->info->offScreenAreas;
if (!area)
break;
@@ -306,10 +306,10 @@ exaOffscreenFree (ScreenPtr pScreen, ExaOffscreenArea *area)
/*
* Find previous area
*/
- if (area == pExaScr->info->card.offScreenAreas)
+ if (area == pExaScr->info->offScreenAreas)
prev = NULL;
else
- for (prev = pExaScr->info->card.offScreenAreas; prev; prev = prev->next)
+ for (prev = pExaScr->info->offScreenAreas; prev; prev = prev->next)
if (prev->next == area)
break;
@@ -343,7 +343,7 @@ ExaOffscreenMarkUsed (PixmapPtr pPixmap)
pExaPixmap->area->score += 100;
if (++iter == 10) {
ExaOffscreenArea *area;
- for (area = pExaScr->info->card.offScreenAreas; area != NULL;
+ for (area = pExaScr->info->offScreenAreas; area != NULL;
area = area->next)
{
if (area->state == ExaOffscreenRemovable)
@@ -366,9 +366,9 @@ exaOffscreenInit (ScreenPtr pScreen)
area->state = ExaOffscreenAvail;
- area->base_offset = pExaScr->info->card.offScreenBase;
+ area->base_offset = pExaScr->info->offScreenBase;
area->offset = area->base_offset;
- area->size = pExaScr->info->card.memorySize - area->base_offset;
+ area->size = pExaScr->info->memorySize - area->base_offset;
area->save = NULL;
area->next = NULL;
area->score = 0;
@@ -378,7 +378,7 @@ exaOffscreenInit (ScreenPtr pScreen)
#endif
/* Add it to the free areas */
- pExaScr->info->card.offScreenAreas = area;
+ pExaScr->info->offScreenAreas = area;
ExaOffscreenValidate (pScreen);
@@ -392,9 +392,9 @@ ExaOffscreenFini (ScreenPtr pScreen)
ExaOffscreenArea *area;
/* just free all of the area records */
- while ((area = pExaScr->info->card.offScreenAreas))
+ while ((area = pExaScr->info->offScreenAreas))
{
- pExaScr->info->card.offScreenAreas = area->next;
+ pExaScr->info->offScreenAreas = area->next;
xfree (area);
}
}