vrend: add vrend_winsys_get_fd_for_texture*

They are wrappers for virgl_egl_get_fd_for_texture*.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Chia-I Wu 4 years ago
parent 7fc8530bf3
commit afc2775a25
  1. 18
      src/virglrenderer.c
  2. 24
      src/vrend_winsys.c
  3. 2
      src/vrend_winsys.h

@ -530,26 +530,12 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks
int virgl_renderer_get_fd_for_texture(uint32_t tex_id, int *fd)
{
#ifdef HAVE_EPOXY_EGL_H
if (!egl)
return -1;
return virgl_egl_get_fd_for_texture(egl, tex_id, fd);
#else
return -1;
#endif
return vrend_winsys_get_fd_for_texture(tex_id, fd);
}
int virgl_renderer_get_fd_for_texture2(uint32_t tex_id, int *fd, int *stride, int *offset)
{
#ifdef HAVE_EPOXY_EGL_H
if (!egl)
return -1;
return virgl_egl_get_fd_for_texture2(egl, tex_id, fd, stride, offset);
#else
return -1;
#endif
return vrend_winsys_get_fd_for_texture2(tex_id, fd, stride, offset);
}
void virgl_renderer_reset(void)

@ -99,3 +99,27 @@ int vrend_winsys_get_fourcc_for_texture(uint32_t tex_id, uint32_t format, int *f
#endif
return 0;
}
int vrend_winsys_get_fd_for_texture(uint32_t tex_id, int *fd)
{
#ifdef HAVE_EPOXY_EGL_H
if (!egl)
return -1;
return virgl_egl_get_fd_for_texture(egl, tex_id, fd);
#else
return -1;
#endif
}
int vrend_winsys_get_fd_for_texture2(uint32_t tex_id, int *fd, int *stride, int *offset)
{
#ifdef HAVE_EPOXY_EGL_H
if (!egl)
return -1;
return virgl_egl_get_fd_for_texture2(egl, tex_id, fd, stride, offset);
#else
return -1;
#endif
}

@ -64,5 +64,7 @@ int vrend_winsys_make_context_current(virgl_renderer_gl_context ctx);
int vrend_winsys_has_gl_colorspace(void);
int vrend_winsys_get_fourcc_for_texture(uint32_t tex_id, uint32_t format, int *fourcc);
int vrend_winsys_get_fd_for_texture(uint32_t tex_id, int *fd);
int vrend_winsys_get_fd_for_texture2(uint32_t tex_id, int *fd, int *stride, int *offset);
#endif /* VREND_WINSYS_H */

Loading…
Cancel
Save