[Intel-gfx] [PATCH] xf86-video-intel: support swapbuffers using page flipping

Eric Anholt eric at anholt.net
Sat Mar 7 01:24:32 CET 2009


On Thu, 2009-02-26 at 13:36 -0800, Jesse Barnes wrote:
> Support the new swapbuffers request using the new page flipping ioctl
> if possible.
> 
> This patch still needs some work; there's a bug in the no-flip case that
> causes us to lose track of pixmaps, and the pipe is still hardcoded to 1,
> but that should be easy to fix.
> 
> The code is pretty ugly too; it seems like getbuffers and swapbuffers could
> probably share more code, but we need to copy all the buffers in swapbuffers
> to return them...

I haven't reviewed the thing, but a comment from other discussion:

...

> +    /* If we're in charge of the front buffer, we can flip */
> +    if (!pI830->shadow_present) {
> +	flip.handle = back_bo->handle;
> +	flip.pipe = 1;
> +	flip.x = pScrn->virtualX;
> +	flip.y = pScrn->virtualY;
> +	flip.flags = 0;	flip.offset = 0;
> +
> +	ret = drmCommandWrite(pI830->drmSubFD, DRM_I915_GEM_PAGE_FLIP, &flip,
> +			      sizeof(flip));
> +	if (ret) {
> +	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Page flip failed: %s\n",
> +		       strerror(errno));
> +	    return FALSE;
> +	}

I think this should be in libdrm, so that the bufmgr can know that the
BO is getting a outside-of-this-client reference to it and avoid putting
it in the BO cache if it gets unreferenced while still being scanned
out.

-- 
Eric Anholt
eric at anholt.net                         eric.anholt at intel.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090306/ede0503f/attachment.sig>


More information about the Intel-gfx mailing list