[Intel-gfx] [PATCH] Add modesetting pageflip ioctl and corresponding drm event
Jesse Barnes
jbarnes at virtuousgeek.org
Mon May 11 23:32:50 CEST 2009
On Fri, 8 May 2009 17:07:01 -0400
Kristian Høgsberg <krh at bitplanet.net> wrote:
...
> + /*
> + * The mode_set_base call will change the domain on the new
> + * fb, which will force the rendering to finish and block the
> + * ioctl. We need to do this last part from a work queue, to
> + * avoid blocking userspace here.
> + */
> + crtc->fb = obj_to_fb(fb_obj);
> + ret = crtc_funcs->mode_set_base(crtc, 0, 0, NULL);
> + if (ret) {
> + DRM_ERROR("mode_set_base failed: %d\n", ret);
> + goto out_unlock;
> + }
Good stuff. I think this is the last remaining issue with the kernel
side: the call to mode_set_base needs to be async so we don't block
waiting for the GTT transition (and thus rendering) to complete before
returning. I think you've taken care of that in a subsequent patch
though?
The one gotcha with doing that is that mode_set_base needs the struct
mutex to be held while it does the GTT domain transition. execbuf
need struct mutex too though; so I'm worried that we may end up hurting
rendering performance with refresh rate flips (I haven't measured this
at all though, so I don't really know). If it does end up being a
problem we may have to find a way to do the transition outside the
protection of struct mutex...
> -/** No-op. */
> +ssize_t drm_read(struct file *filp, char __user *buffer,
> + size_t count, loff_t *offset)
> +{
I like the event stuff too; I can imagine it being useful for other
GL features as well, like vblank waits.
--
Jesse Barnes, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list