[Mesa-dev] [PATCH 0/2] Adding usage flags for shared resources

Marek Olšák maraeo at gmail.com
Tue Mar 1 21:41:34 UTC 2016


Hi,

This series adds usage flags to pipe_screen::resource_get_handle and resource_from_handle.

The motivation is to give drivers an idea how shared resources are going to be used and choose an optimal codepath accordingly.

The flags are:

PIPE_HANDLE_USAGE_EXPLICIT_FLUSH
- pipe_context::flush_resource will be called before external use

PIPE_HANDLE_USAGE_READ
PIPE_HANDLE_USAGE_WRITE
PIPE_HANDLE_USAGE_READ_WRITE
- How the resource is going to be used by external clients. Right now this is only useful for OpenCL interop that I'm working on.

The corresponding OpenCL flags are CL_MEM_READ_ONLY, CL_MEM_WRITE_ONLY and CL_MEM_READ_WRITE received by clCreateFromGLTexture and similar interop functions.

All of this will allow us to implement OpenGL-OpenCL interop optimally and fix issues with DMABUF sharing for Wayland.

Please review.

Marek


More information about the mesa-dev mailing list