Eliminate the use of EGL_MESA_image_dma_buf_export for compile time decisions

The define should always be true and the availability of the extension is
already checked at run-time.
Also correct the fourcc fallback code path to fullfill test  expectation.

Closes: #36

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
macos/master
Gert Wollny 6 years ago committed by Jakob Bornecrantz
parent 5a472049a3
commit 8d6054e5d9
  1. 11
      src/virgl_egl_context.c

@ -315,15 +315,13 @@ int virgl_egl_get_fourcc_for_texture(struct virgl_egl *ve, uint32_t tex_id, uint
{ {
int ret = EINVAL; int ret = EINVAL;
#ifndef EGL_MESA_image_dma_buf_export
ret = 0;
goto fallback;
#else
EGLImageKHR image; EGLImageKHR image;
EGLBoolean b; EGLBoolean b;
if (!ve->have_mesa_dma_buf_img_export) if (!ve->have_mesa_dma_buf_img_export) {
ret = 0;
goto fallback; goto fallback;
}
image = eglCreateImageKHR(ve->egl_display, eglGetCurrentContext(), EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(unsigned long)tex_id, NULL); image = eglCreateImageKHR(ve->egl_display, eglGetCurrentContext(), EGL_GL_TEXTURE_2D_KHR, (EGLClientBuffer)(unsigned long)tex_id, NULL);
@ -338,8 +336,6 @@ int virgl_egl_get_fourcc_for_texture(struct virgl_egl *ve, uint32_t tex_id, uint
eglDestroyImageKHR(ve->egl_display, image); eglDestroyImageKHR(ve->egl_display, image);
return ret; return ret;
#endif
fallback: fallback:
*fourcc = virgl_egl_get_gbm_format(format); *fourcc = virgl_egl_get_gbm_format(format);
return ret; return ret;
@ -426,7 +422,6 @@ uint32_t virgl_egl_get_gbm_format(uint32_t format)
{ {
switch (format) { switch (format) {
case VIRGL_FORMAT_B8G8R8X8_UNORM: case VIRGL_FORMAT_B8G8R8X8_UNORM:
return GBM_FORMAT_XRGB8888;
case VIRGL_FORMAT_B8G8R8A8_UNORM: case VIRGL_FORMAT_B8G8R8A8_UNORM:
return GBM_FORMAT_ARGB8888; return GBM_FORMAT_ARGB8888;
default: default:

Loading…
Cancel
Save