diff options
author | Jordan Justen <[email protected]> | 2019-08-01 13:30:21 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2019-08-13 01:12:24 -0700 |
commit | 0346b70083311c65a55038d3e3829da551e229cb (patch) | |
tree | adcc8199bb1d2489667061b208b843fba0fa906f /src/gallium/include | |
parent | 2353f7f7ef4b836bc39975e0649094a5d8648ee5 (diff) |
gallium/screen: Add pipe_screen::resource_get_param
This function retrieves individual parameters selected by enum
pipe_resource_param. It can be used as a more direct alternative to
pipe_screen::resource_get_handle.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Acked-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/include')
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 15 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_screen.h | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 86cc9d80ac9..0c79cac5cff 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -1027,6 +1027,21 @@ enum pipe_compute_cap }; /** + * Resource parameters. They can be queried using + * pipe_screen::get_resource_param. + */ +enum pipe_resource_param +{ + PIPE_RESOURCE_PARAM_NPLANES, + PIPE_RESOURCE_PARAM_STRIDE, + PIPE_RESOURCE_PARAM_OFFSET, + PIPE_RESOURCE_PARAM_MODIFIER, + PIPE_RESOURCE_PARAM_HANDLE_TYPE_SHARED, + PIPE_RESOURCE_PARAM_HANDLE_TYPE_KMS, + PIPE_RESOURCE_PARAM_HANDLE_TYPE_FD, +}; + +/** * Types of parameters for pipe_context::set_context_param. */ enum pipe_context_param diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 9bd24772299..ac2087921d7 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -263,6 +263,16 @@ struct pipe_screen { unsigned usage); /** + * Get info for the given pipe resource without the need to get a + * winsys_handle. + */ + bool (*resource_get_param)(struct pipe_screen *screen, + struct pipe_resource *resource, + unsigned int plane, + enum pipe_resource_param param, + uint64_t *value); + + /** * Get stride and offset for the given pipe resource without the need to get * a winsys_handle. */ |