On Tue, 2009-12-01 at 10:01 +0100, Rafał Miłecki wrote: 
> W dniu 1 grudnia 2009 09:59 użytkownik Michel Dänzer
> <mic...@daenzer.net> napisał:
> >> Could you tell me how can I wait for vblank from kernel space, please?
> >> I see there is drm_wait_vblank but this is not yet exported. I tried
> >> export this and use this with _DRM_VBLANK_ABSOLUTE so I hit
> >> > DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ,
> >> but that was busy waiting I think, as my desktop was almost not usable.
> >>
> >> Also Alex believe I should *not* use drm_* for syncing my kernel
> >> module code with vblank.
> >
> > E.g. you could just call drm_vblank_get() before you need vblank
> > interrupts to occur, drm_vblank_put() after you don't need them anymore
> > and handle the rest from the IRQ handler.
> 
> Thanks you! I'll try that today later.
> 
> Could you just explain what is drm_wait_vblank for? I expected it to
> sleep my process and wake it up interruptible on IRQ.

That much is correct.

> But I'm not sure that anymore. Also it expected drm_file parameter
> which AFAIK is never passed from gpu driver, but from drm to gpu
> driver.

As it is, it's intended for handling ioctl calls from userspace and as
such may make assumptions which weren't satisfied in the context you
tried using it from. It might be possible to factor out the core
functionality such that it would be more usable from within the kernel,
but it'll still only be appropriate for a process context which can
afford to sleep for relatively long intervals.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to