mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
virgl: 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
cf1c3c96ab
commit
2ade6917da
3 changed files with 23 additions and 0 deletions
|
|
@ -1101,6 +1101,18 @@ virgl_get_compiler_options(struct pipe_screen *pscreen,
|
||||||
return &vscreen->compiler_options;
|
return &vscreen->compiler_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
virgl_screen_get_fd(struct pipe_screen *pscreen)
|
||||||
|
{
|
||||||
|
struct virgl_screen *vscreen = virgl_screen(pscreen);
|
||||||
|
struct virgl_winsys *vws = vscreen->vws;
|
||||||
|
|
||||||
|
if (vws->get_fd)
|
||||||
|
return vws->get_fd(vws);
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
struct pipe_screen *
|
struct pipe_screen *
|
||||||
virgl_create_screen(struct virgl_winsys *vws, const struct pipe_screen_config *config)
|
virgl_create_screen(struct virgl_winsys *vws, const struct pipe_screen_config *config)
|
||||||
{
|
{
|
||||||
|
|
@ -1137,6 +1149,7 @@ virgl_create_screen(struct virgl_winsys *vws, const struct pipe_screen_config *c
|
||||||
screen->vws = vws;
|
screen->vws = vws;
|
||||||
screen->base.get_name = virgl_get_name;
|
screen->base.get_name = virgl_get_name;
|
||||||
screen->base.get_vendor = virgl_get_vendor;
|
screen->base.get_vendor = virgl_get_vendor;
|
||||||
|
screen->base.get_screen_fd = virgl_screen_get_fd;
|
||||||
screen->base.get_param = virgl_get_param;
|
screen->base.get_param = virgl_get_param;
|
||||||
screen->base.get_shader_param = virgl_get_shader_param;
|
screen->base.get_shader_param = virgl_get_shader_param;
|
||||||
screen->base.get_video_param = virgl_get_video_param;
|
screen->base.get_video_param = virgl_get_video_param;
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ struct virgl_winsys {
|
||||||
|
|
||||||
void (*destroy)(struct virgl_winsys *vws);
|
void (*destroy)(struct virgl_winsys *vws);
|
||||||
|
|
||||||
|
int (*get_fd)(struct virgl_winsys *vws);
|
||||||
|
|
||||||
int (*transfer_put)(struct virgl_winsys *vws,
|
int (*transfer_put)(struct virgl_winsys *vws,
|
||||||
struct virgl_hw_res *res,
|
struct virgl_hw_res *res,
|
||||||
const struct pipe_box *box,
|
const struct pipe_box *box,
|
||||||
|
|
|
||||||
|
|
@ -1203,6 +1203,14 @@ static int virgl_init_context(int drmFD)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
virgl_drm_winsys_get_fd(struct virgl_winsys *vws)
|
||||||
|
{
|
||||||
|
struct virgl_drm_winsys *vdws = virgl_drm_winsys(vws);
|
||||||
|
|
||||||
|
return vdws->fd;
|
||||||
|
}
|
||||||
|
|
||||||
static struct virgl_winsys *
|
static struct virgl_winsys *
|
||||||
virgl_drm_winsys_create(int drmFD)
|
virgl_drm_winsys_create(int drmFD)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue