Jerome Glisse wrote:
> Hi,
>
> Got a question about buffer mapping is it possible to block user space
> from mapping a buffer that was previously allocated. My use case is
> to have user space allocate a buffer put things into it then register
> this buffer (with need for user space to first unmap it) through device
> specific ioctl and in this ioctl forbid all user space to map this buffer.
> Does this sounds possible with current infrastructure (i am looking
> through code but i still don't understand it all :)) ?
>
>
It's not implemented yet, but in principle it wouldn't be too hard to
temporarily block user-space
from accessing a buffer:
1) Call drm_bo_unmap_virtual( bo) to remove all user-space mappings.
2) The next time the buffer is accessed by user-space, it will
page-fault in drm_bo_vm_nopfn,
where the buffer-object is available. Here we could implement an
interruptible wait for buffer_block,
possibly indicated in one of the bo flags. Each buffer object
already has an "event" wait queue that we could use.
When the buffer_block flag is clear, just issue a
wake-on-interruptible on the bo event queue.
> Side question can then i also block user space from unreference the buffer
> as i might also would like to take over buffer management.
>
>
Hmm, not really? What if the user process dies?
/Thomas
> Cheers,
> Jerome Glisse
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> --
> _______________________________________________
> Dri-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/dri-devel
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel