clean up arguments to i830_allocate_framebuffer since zaphod removal.

Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Eric Anholt 2009-03-06 14:29:22 -08:00
parent b23f57b310
commit 043a76a040
4 changed files with 14 additions and 31 deletions

View File

@ -632,7 +632,6 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
drmmode_ptr drmmode = drmmode_crtc->drmmode;
I830Ptr pI830 = I830PTR(scrn);
i830_memory *old_front = NULL;
BoxRec mem_box;
Bool tiled, ret;
ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
uint32_t old_fb_id;
@ -659,8 +658,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
scrn->virtualX = width;
scrn->virtualY = height;
scrn->displayWidth = pitch;
pI830->front_buffer =
i830_allocate_framebuffer(scrn, pI830, &mem_box, FALSE);
pI830->front_buffer = i830_allocate_framebuffer(scrn);
if (!pI830->front_buffer)
goto fail;

View File

@ -372,7 +372,6 @@ typedef struct _I830Rec {
unsigned int bufferOffset; /* for I830SelectBuffer */
BoxRec FbMemBox;
BoxRec FbMemBox2;
int CacheLines;
/* These are set in PreInit and never changed. */
@ -900,8 +899,7 @@ Bool I830BindAGPMemory(ScrnInfoPtr pScrn);
Bool I830UnbindAGPMemory(ScrnInfoPtr pScrn);
i830_memory *
i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
Bool secondary);
i830_allocate_framebuffer(ScrnInfoPtr pScrn);
/* i830_modes.c */
DisplayModePtr i830_ddc_get_modes(xf86OutputPtr output);

View File

@ -1132,7 +1132,6 @@ i830_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
if (i830->can_resize && i830->front_buffer)
{
i830_memory *new_front, *old_front;
BoxRec mem_box;
Bool tiled;
ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
@ -1142,7 +1141,7 @@ i830_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
width, height, scrn->displayWidth);
I830Sync(scrn);
i830WaitForVblank(scrn);
new_front = i830_allocate_framebuffer(scrn, i830, &mem_box, FALSE);
new_front = i830_allocate_framebuffer(scrn);
if (!new_front) {
scrn->virtualX = old_x;
scrn->virtualY = old_y;

View File

@ -1159,30 +1159,22 @@ IsTileable(ScrnInfoPtr pScrn, int pitch)
*
* Used once for each X screen, so once with RandR 1.2 and twice with classic
* dualhead.
*
* \param pScrn ScrnInfoPtr for the screen being allocated
* \param pI830 I830Ptr for the screen being allocated.
* \param FbMemBox
*/
i830_memory *
i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
Bool secondary)
i830_allocate_framebuffer(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
unsigned int pitch = pScrn->displayWidth * pI830->cpp;
unsigned long minspace, avail;
int cacheLines, maxCacheLines;
int align;
long size, fb_height;
char *name;
int flags;
i830_memory *front_buffer = NULL;
enum tile_format tile_format = TILE_NONE;
flags = ALLOW_SHARING;
/* Clear everything first. */
memset(FbMemBox, 0, sizeof(*FbMemBox));
/* We'll allocate the fb such that the root window will fit regardless of
* rotation.
*/
@ -1195,10 +1187,10 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
fb_height = pScrn->virtualY;
}
FbMemBox->x1 = 0;
FbMemBox->x2 = pScrn->displayWidth;
FbMemBox->y1 = 0;
FbMemBox->y2 = fb_height;
pI830->FbMemBox.x1 = 0;
pI830->FbMemBox.x2 = pScrn->displayWidth;
pI830->FbMemBox.y1 = 0;
pI830->FbMemBox.y2 = fb_height;
/* Calculate how much framebuffer memory to allocate. For the
* initial allocation, calculate a reasonable minimum. This is
@ -1233,7 +1225,7 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
if (cacheLines > maxCacheLines)
cacheLines = maxCacheLines;
FbMemBox->y2 += cacheLines;
pI830->FbMemBox.y2 += cacheLines;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Allocating %d scanlines for pixmap cache\n",
@ -1248,8 +1240,6 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
size = pitch * (fb_height + cacheLines);
size = ROUND_TO_PAGE(size);
name = secondary ? "secondary front buffer" : "front buffer";
/* Front buffer tiling has to be disabled with G965 XAA because some of the
* acceleration operations (non-XY COLOR_BLT) can't be done to tiled
* buffers.
@ -1279,14 +1269,13 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn, I830Ptr pI830, BoxPtr FbMemBox,
align = KB(512);
} else
align = KB(64);
front_buffer = i830_allocate_memory(pScrn, name, size,
front_buffer = i830_allocate_memory(pScrn, "front buffer", size,
pitch, align, flags,
tile_format);
if (front_buffer == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate "
"%sframebuffer. Is your VideoRAM set too low?\n",
secondary ? "secondary " : "");
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to allocate framebuffer.\n");
return NULL;
}
@ -1473,8 +1462,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
i830_allocate_overlay(pScrn);
#endif
pI830->front_buffer =
i830_allocate_framebuffer(pScrn, pI830, &pI830->FbMemBox, FALSE);
pI830->front_buffer = i830_allocate_framebuffer(pScrn);
if (pI830->front_buffer == NULL)
return FALSE;