meson: define VIRGL_RENDERER_UNSTABLE_APIS unconditionally

The intention is to warn the users, not to inconvenience ourselves.

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 a06a0b0a9e
commit 491afdc42a
  1. 1
      config.h.meson
  2. 7
      meson.build
  3. 7
      meson_options.txt
  4. 6
      src/virglrenderer.c
  5. 5
      src/vrend_renderer.c

@ -7,4 +7,3 @@
#mesondefine HAVE_FUNC_ATTRIBUTE_VISIBILITY #mesondefine HAVE_FUNC_ATTRIBUTE_VISIBILITY
#mesondefine HAVE_EVENTFD_H #mesondefine HAVE_EVENTFD_H
#mesondefine HAVE_DLFCN_H #mesondefine HAVE_DLFCN_H
#mesondefine VIRGL_RENDERER_UNSTABLE_APIS

@ -46,6 +46,7 @@ cc = meson.get_compiler('c')
add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c') add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
add_project_arguments('-D_GNU_SOURCE=1', language : 'c') add_project_arguments('-D_GNU_SOURCE=1', language : 'c')
add_project_arguments('-DVIRGL_RENDERER_UNSTABLE_APIS', language : 'c')
warnings = [ warnings = [
'-Werror=implicit-function-declaration', '-Werror=implicit-function-declaration',
@ -147,11 +148,6 @@ if with_glx
endif endif
endif endif
with_unstable_apis = get_option('unstable_apis')
if with_unstable_apis
conf_data.set('VIRGL_RENDERER_UNSTABLE_APIS', 1)
endif
if cc.compiles('void __attribute__((hidden)) func() {}') if cc.compiles('void __attribute__((hidden)) func() {}')
conf_data.set('HAVE_FUNC_ATTRIBUTE_VISIBILITY', 1) conf_data.set('HAVE_FUNC_ATTRIBUTE_VISIBILITY', 1)
endif endif
@ -203,7 +199,6 @@ lines += 'minigbm_alloc: ' + (with_minigbm_allocation ? 'yes' : 'no' )
lines += '' lines += ''
lines += 'tests: ' + (with_tests ? 'yes' : 'no' ) lines += 'tests: ' + (with_tests ? 'yes' : 'no' )
lines += 'fuzzer: ' + (with_fuzzer ? 'yes' : 'no' ) lines += 'fuzzer: ' + (with_fuzzer ? 'yes' : 'no' )
lines += 'unstable apis: ' + (with_unstable_apis ? 'yes' : 'no' )
indent = ' ' indent = ' '
summary = indent + ('\n' + indent).join(lines) summary = indent + ('\n' + indent).join(lines)

@ -58,10 +58,3 @@ option(
value : 'false', value : 'false',
description : 'enable running unit tests with valgrind' description : 'enable running unit tests with valgrind'
) )
option(
'unstable_apis',
type : 'boolean',
value : 'false',
description : 'enable unstable apis'
)

@ -538,10 +538,8 @@ int virgl_renderer_init(void *cookie, int flags, struct virgl_renderer_callbacks
if (flags & VIRGL_RENDERER_THREAD_SYNC) if (flags & VIRGL_RENDERER_THREAD_SYNC)
renderer_flags |= VREND_USE_THREAD_SYNC; renderer_flags |= VREND_USE_THREAD_SYNC;
#ifdef VIRGL_RENDERER_UNSTABLE_APIS
if (flags & VIRGL_RENDERER_USE_EXTERNAL_BLOB) if (flags & VIRGL_RENDERER_USE_EXTERNAL_BLOB)
renderer_flags |= VREND_USE_EXTERNAL_BLOB; renderer_flags |= VREND_USE_EXTERNAL_BLOB;
#endif /* VIRGL_RENDERER_UNSTABLE_APIS */
return vrend_renderer_init(&virgl_cbs, renderer_flags); return vrend_renderer_init(&virgl_cbs, renderer_flags);
} }
@ -638,8 +636,6 @@ int virgl_renderer_execute(void *execute_args, uint32_t execute_size)
} }
} }
#ifdef VIRGL_RENDERER_UNSTABLE_APIS
int virgl_renderer_resource_create_blob(const struct virgl_renderer_resource_create_blob_args *args) int virgl_renderer_resource_create_blob(const struct virgl_renderer_resource_create_blob_args *args)
{ {
@ -710,5 +706,3 @@ int virgl_renderer_resource_get_map_info(uint32_t res_handle, uint32_t *map_info
return vrend_renderer_resource_get_map_info(res->pipe_resource, map_info); return vrend_renderer_resource_get_map_info(res->pipe_resource, map_info);
} }
#endif /* VIRGL_RENDERER_UNSTABLE_APIS */

@ -6527,12 +6527,10 @@ static void vrend_resource_gbm_init(struct vrend_resource *gr, uint32_t format)
gr->gbm_bo = bo; gr->gbm_bo = bo;
gr->storage_bits |= VREND_STORAGE_GBM_BUFFER; gr->storage_bits |= VREND_STORAGE_GBM_BUFFER;
/* This is true so far, but maybe gbm_bo_get_caching_type is needed in the future. */ /* This is true so far, but maybe gbm_bo_get_caching_type is needed in the future. */
#ifdef VIRGL_RENDERER_UNSTABLE_APIS
if (!strcmp(gbm_device_get_backend_name(gbm->device), "i915")) if (!strcmp(gbm_device_get_backend_name(gbm->device), "i915"))
gr->map_info = VIRGL_MAP_CACHE_CACHED; gr->map_info = VIRGL_MAP_CACHE_CACHED;
else else
gr->map_info = VIRGL_MAP_CACHE_WC; gr->map_info = VIRGL_MAP_CACHE_WC;
#endif
if (!virgl_gbm_gpu_import_required(gr->base.bind)) if (!virgl_gbm_gpu_import_required(gr->base.bind))
return; return;
@ -10007,7 +10005,6 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c
caps->v2.capability_bits |= VIRGL_CAP_COPY_TRANSFER; caps->v2.capability_bits |= VIRGL_CAP_COPY_TRANSFER;
#ifdef VIRGL_RENDERER_UNSTABLE_APIS
if (has_feature(feat_arb_buffer_storage) && !vrend_state.use_external_blob) { if (has_feature(feat_arb_buffer_storage) && !vrend_state.use_external_blob) {
const char *vendor = (const char *)glGetString(GL_VENDOR); const char *vendor = (const char *)glGetString(GL_VENDOR);
const char *renderer = (const char*)glGetString(GL_RENDERER); const char *renderer = (const char*)glGetString(GL_RENDERER);
@ -10039,8 +10036,6 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c
#ifdef ENABLE_MINIGBM_ALLOCATION #ifdef ENABLE_MINIGBM_ALLOCATION
if (has_feature(feat_memory_object) && has_feature(feat_memory_object_fd)) if (has_feature(feat_memory_object) && has_feature(feat_memory_object_fd))
caps->v2.capability_bits |= VIRGL_CAP_ARB_BUFFER_STORAGE; caps->v2.capability_bits |= VIRGL_CAP_ARB_BUFFER_STORAGE;
#endif
#endif #endif
if (has_feature(feat_blend_equation_advanced)) if (has_feature(feat_blend_equation_advanced))

Loading…
Cancel
Save