From 5d17df15a68a5e2a224679a2394935e2dfb2260e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 1 Apr 2015 15:17:23 +0200 Subject: [PATCH] egl: call virgl_egl_get_fourcc_for_texture only if use_egl_context --- src/virglrenderer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/virglrenderer.c b/src/virglrenderer.c index 98f8fd6..2387057 100644 --- a/src/virglrenderer.c +++ b/src/virglrenderer.c @@ -44,6 +44,8 @@ #include "virgl_egl.h" static struct virgl_egl *egl_info; +static int use_egl_context; + /* new API - just wrap internal API for now */ int virgl_renderer_resource_create(struct virgl_renderer_resource_create_args *args, struct iovec *iov, uint32_t num_iovs) @@ -162,7 +164,7 @@ int virgl_renderer_resource_get_info(int res_handle, { int ret; ret = vrend_renderer_resource_get_info(res_handle, (struct vrend_renderer_resource_info *)info); - if (ret == 0) + if (ret == 0 && use_egl_context) return virgl_egl_get_fourcc_for_texture(egl_info, info->tex_id, info->virgl_format, &info->drm_fourcc); return ret; } @@ -183,7 +185,6 @@ void virgl_renderer_get_rect(int resource_id, struct iovec *iov, unsigned int nu static struct virgl_renderer_callbacks *rcbs; static void *dev_cookie; -static int use_egl_context; static struct vrend_if_cbs virgl_cbs;