virgl: Add driinfo file and tie it into the build
authorGert Wollny <gert.wollny@collabora.com>
Wed, 10 Apr 2019 12:03:00 +0000 (14:03 +0200)
committerGert Wollny <gert.wollny@collabora.com>
Thu, 20 Jun 2019 06:50:37 +0000 (08:50 +0200)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/Android.mk
src/gallium/drivers/virgl/meson.build
src/gallium/drivers/virgl/virgl_driinfo.h.in [new file with mode: 0644]

index 0067dfa702e1e79bb177a4d23ecc042338616bad..577e5eab904df6b80aeeb2d587c32400d137d20b 100644 (file)
@@ -33,6 +33,17 @@ LOCAL_MODULE := libmesa_pipe_virgl
 include $(GALLIUM_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
 
+GEN_DRIINFO_INPUTS := \
+       $(MESA_TOP)/src/gallium/auxiliary/pipe-loader/driinfo_gallium.h \
+       $(LOCAL_PATH)/virgl_driinfo.h.in
+
+MERGE_DRIINFO := $(MESA_TOP)/src/util/merge_driinfo.py
+
+$(intermediates)/virgl/virgl_driinfo.h: $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS)
+       @mkdir -p $(dir $@)
+       @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+       $(hide) $(MESA_PYTHON2) $(MERGE_DRIINFO) $(GEN_DRIINFO_INPUTS) > $@ || ($(RM) $@; false)
+
 ifneq ($(HAVE_GALLIUM_VIRGL),)
 GALLIUM_TARGET_DRIVERS += virtio_gpu
 $(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_virgl libmesa_winsys_virgl_vtest)
index 289203d0459bf8a7189ac4f09a585bb8e6464b74..62e8155b66bbef27fb5f3f3503712f412ff71098 100644 (file)
@@ -31,15 +31,27 @@ files_libvirgl = files(
   'virgl_tgsi.c',
 )
 
+virgl_driinfo_h = custom_target(
+  'virgl_driinfo.h',
+  input : files(
+    '../../../util/merge_driinfo.py',
+    '../../auxiliary/pipe-loader/driinfo_gallium.h', 'virgl_driinfo.h.in'
+  ),
+  output : 'virgl_driinfo.h',
+  command : [prog_python, '@INPUT@'],
+  capture : true,
+)
+
 libvirgl = static_library(
   'virgl',
-  files_libvirgl,
+  [ files_libvirgl, virgl_driinfo_h ],
   c_args : c_vis_args,
   include_directories : inc_common,
-  dependencies : dep_libdrm,
+  dependencies : dep_libdrm
 )
 
 driver_virgl = declare_dependency(
+  sources : virgl_driinfo_h,
   compile_args : '-DGALLIUM_VIRGL',
   link_with : [libvirgl, libvirgldrm, libvirglvtest],
 )
diff --git a/src/gallium/drivers/virgl/virgl_driinfo.h.in b/src/gallium/drivers/virgl/virgl_driinfo.h.in
new file mode 100644 (file)
index 0000000..626e21c
--- /dev/null
@@ -0,0 +1,11 @@
+// DriConf options specific to virgl
+// To add a new tweak:
+//   1. Define the tweak in util/xmlpool/t_options.h and also add
+//      the tweak name as define to virgl_protocol.h
+//   2. Add the tweak here with the appropriated default value
+//   3. Add the code to query the tweak in virgl_create_screen
+//   4. Add the code to send the tweek to the host in virgl_send_tweaks
+//   5. Implement the tweak in virglrenderer
+DRI_CONF_SECTION_MISCELLANEOUS
+DRI_CONF_SECTION_END
+