mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 04:00:12 +01:00
i915: Add support for get_screen_fd
Reviewed-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21654>
This commit is contained in:
parent
0f5fdd9ca4
commit
853b4801f2
3 changed files with 22 additions and 0 deletions
|
|
@ -639,6 +639,14 @@ i915_destroy_screen(struct pipe_screen *screen)
|
|||
FREE(is);
|
||||
}
|
||||
|
||||
static int
|
||||
i915_screen_get_fd(struct pipe_screen *screen)
|
||||
{
|
||||
struct i915_screen *is = i915_screen(screen);
|
||||
|
||||
return is->iws->get_fd(is->iws);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new i915_screen object
|
||||
*/
|
||||
|
|
@ -681,6 +689,7 @@ i915_screen_create(struct i915_winsys *iws)
|
|||
is->base.get_name = i915_get_name;
|
||||
is->base.get_vendor = i915_get_vendor;
|
||||
is->base.get_device_vendor = i915_get_device_vendor;
|
||||
is->base.get_screen_fd = i915_screen_get_fd;
|
||||
is->base.get_param = i915_get_param;
|
||||
is->base.get_shader_param = i915_get_shader_param;
|
||||
is->base.get_paramf = i915_get_paramf;
|
||||
|
|
|
|||
|
|
@ -236,6 +236,11 @@ struct i915_winsys {
|
|||
* Destroy the winsys.
|
||||
*/
|
||||
void (*destroy)(struct i915_winsys *iws);
|
||||
|
||||
/**
|
||||
* Get FD if the winsys provides one
|
||||
*/
|
||||
int (*get_fd)(struct i915_winsys *iws);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -44,6 +44,14 @@ i915_drm_winsys_destroy(struct i915_winsys *iws)
|
|||
FREE(idws);
|
||||
}
|
||||
|
||||
static int
|
||||
i915_drm_winsys_get_fd(struct i915_winsys *iws)
|
||||
{
|
||||
struct i915_drm_winsys *idws = i915_drm_winsys(iws);
|
||||
|
||||
return idws->fd;
|
||||
}
|
||||
|
||||
struct i915_winsys *
|
||||
i915_drm_winsys_create(int drmFD)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue