From d2eaff33d0132ef17eb458f04e5369985129ce31 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 29 May 2018 11:17:11 +1000 Subject: [PATCH] gallium: move winsys handle to it's own file. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This will be used in the drisw interface later, which isn't drm specific. Reviewed-by: Marek Olšák --- src/gallium/include/state_tracker/drm_driver.h | 49 +------------------ src/gallium/include/state_tracker/winsys_handle.h | 57 +++++++++++++++++++++++ 2 files changed, 59 insertions(+), 47 deletions(-) create mode 100644 src/gallium/include/state_tracker/winsys_handle.h diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h index f188b5a..19cd19f 100644 --- a/src/gallium/include/state_tracker/drm_driver.h +++ b/src/gallium/include/state_tracker/drm_driver.h @@ -4,58 +4,13 @@ #include "pipe/p_compiler.h" +#include "winsys_handle.h" + struct pipe_screen; struct pipe_screen_config; struct pipe_context; struct pipe_resource; -#define DRM_API_HANDLE_TYPE_SHARED 0 -#define DRM_API_HANDLE_TYPE_KMS 1 -#define DRM_API_HANDLE_TYPE_FD 2 - - -/** - * For use with pipe_screen::{texture_from_handle|texture_get_handle}. - */ -struct winsys_handle -{ - /** - * Input for texture_from_handle, valid values are - * DRM_API_HANDLE_TYPE_SHARED or DRM_API_HANDLE_TYPE_FD. - * Input to texture_get_handle, - * to select handle for kms, flink, or prime. - */ - unsigned type; - /** - * Input for texture_get_handle, allows to export the offset - * of a specific layer of an array texture. - */ - unsigned layer; - /** - * Input to texture_from_handle. - * Output for texture_get_handle. - */ - unsigned handle; - /** - * Input to texture_from_handle. - * Output for texture_get_handle. - */ - unsigned stride; - /** - * Input to texture_from_handle. - * Output for texture_get_handle. - */ - unsigned offset; - - /** - * Input to resource_from_handle. - * Output from resource_get_handle. - */ - uint64_t modifier; -}; - - - /** * Configuration queries. */ diff --git a/src/gallium/include/state_tracker/winsys_handle.h b/src/gallium/include/state_tracker/winsys_handle.h new file mode 100644 index 0000000..9217e4d --- /dev/null +++ b/src/gallium/include/state_tracker/winsys_handle.h @@ -0,0 +1,57 @@ + +#ifndef _WINSYS_HANDLE_H_ +#define _WINSYS_HANDLE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define DRM_API_HANDLE_TYPE_SHARED 0 +#define DRM_API_HANDLE_TYPE_KMS 1 +#define DRM_API_HANDLE_TYPE_FD 2 + +/** + * For use with pipe_screen::{texture_from_handle|texture_get_handle}. + */ +struct winsys_handle +{ + /** + * Input for texture_from_handle, valid values are + * WINSYS_HANDLE_TYPE_SHARED or WINSYS_HANDLE_TYPE_FD. + * Input to texture_get_handle, + * to select handle for kms, flink, or prime. + */ + unsigned type; + /** + * Input for texture_get_handle, allows to export the offset + * of a specific layer of an array texture. + */ + unsigned layer; + /** + * Input to texture_from_handle. + * Output for texture_get_handle. + */ + unsigned handle; + /** + * Input to texture_from_handle. + * Output for texture_get_handle. + */ + unsigned stride; + /** + * Input to texture_from_handle. + * Output for texture_get_handle. + */ + unsigned offset; + + /** + * Input to resource_from_handle. + * Output from resource_get_handle. + */ + uint64_t modifier; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* _WINSYS_HANDLE_H_ */ -- 2.7.4