From: Emil Velikov Date: Mon, 16 Jun 2014 22:30:44 +0000 (+0100) Subject: targets/dri: Add __driDriverGetExtensions_nouveau symbol X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b7e43aea89847100b929989c21d23da124d4936;p=mesa.git targets/dri: Add __driDriverGetExtensions_nouveau symbol The symbol is introduced by the mesa megadrivers, and adding gallium support for it will allow us to merge st/dri/drm and st/dri/sw. Resulting in a single dri library across gallium. v2: Rebase on top of gallium dri3. Signed-off-by: Emil Velikov Tested-by: Rob Clark Tested-by: Thomas Helland Acked-by: Tom Stellard --- diff --git a/src/gallium/auxiliary/target-helpers/inline_drm_helper.h b/src/gallium/auxiliary/target-helpers/inline_drm_helper.h index 3b36316f1a2..62c4f8e29a1 100644 --- a/src/gallium/auxiliary/target-helpers/inline_drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/inline_drm_helper.h @@ -83,6 +83,18 @@ pipe_ilo_create_screen(int fd) #endif #if defined(GALLIUM_NOUVEAU) +#if defined(DRI_TARGET) +#include "dri_screen.h" + +const __DRIextension **__driDriverGetExtensions_nouveau(void); + +PUBLIC const __DRIextension **__driDriverGetExtensions_nouveau(void) +{ + globalDriverAPI = &galliumdrm_driver_api; + return galliumdrm_driver_extensions; +} +#endif + static struct pipe_screen * pipe_nouveau_create_screen(int fd) { diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h index 2d07f517db6..106dcc3a711 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.h +++ b/src/gallium/state_trackers/dri/common/dri_screen.h @@ -145,6 +145,8 @@ dri_destroy_screen_helper(struct dri_screen * screen); void dri_destroy_screen(__DRIscreen * sPriv); +extern const struct __DriverAPIRec galliumdrm_driver_api; +extern const __DRIextension *galliumdrm_driver_extensions[]; extern const __DRIconfigOptionsExtension gallium_config_options; #endif diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c index 898fd0ab1f6..1d26522ca96 100644 --- a/src/gallium/state_trackers/dri/drm/dri2.c +++ b/src/gallium/state_trackers/dri/drm/dri2.c @@ -1342,6 +1342,20 @@ const struct __DriverAPIRec driDriverAPI = { .ReleaseBuffer = dri2_release_buffer, }; +const struct __DriverAPIRec galliumdrm_driver_api = { + .InitScreen = dri2_init_screen, + .DestroyScreen = dri_destroy_screen, + .CreateContext = dri_create_context, + .DestroyContext = dri_destroy_context, + .CreateBuffer = dri2_create_buffer, + .DestroyBuffer = dri_destroy_buffer, + .MakeCurrent = dri_make_current, + .UnbindContext = dri_unbind_context, + + .AllocateBuffer = dri2_allocate_buffer, + .ReleaseBuffer = dri2_release_buffer, +}; + /* This is the table of extensions that the loader will dlsym() for. */ PUBLIC const __DRIextension *__driDriverExtensions[] = { &driCoreExtension.base, @@ -1351,4 +1365,12 @@ PUBLIC const __DRIextension *__driDriverExtensions[] = { NULL }; +const __DRIextension *galliumdrm_driver_extensions[] = { + &driCoreExtension.base, + &driImageDriverExtension.base, + &driDRI2Extension.base, + &gallium_config_options.base, + NULL +}; + /* vim: set sw=3 ts=8 sts=3 expandtab: */ diff --git a/src/gallium/targets/dri/Makefile.am b/src/gallium/targets/dri/Makefile.am index cb1206452e4..f9d34828452 100644 --- a/src/gallium/targets/dri/Makefile.am +++ b/src/gallium/targets/dri/Makefile.am @@ -1,6 +1,10 @@ include $(top_srcdir)/src/gallium/Automake.inc AM_CFLAGS = \ + -I$(top_srcdir)/src/mapi \ + -I$(top_srcdir)/src/mesa \ + -I$(top_srcdir)/src/mesa/drivers/dri/common \ + -I$(top_srcdir)/src/gallium/state_trackers/dri/common \ $(GALLIUM_TARGET_CFLAGS) AM_CPPFLAGS = \ @@ -9,6 +13,11 @@ AM_CPPFLAGS = \ -DGALLIUM_RBUG \ -DGALLIUM_TRACE +if HAVE_GALLIUM_NOUVEAU +AM_CPPFLAGS += \ + -DDRI_TARGET +endif + dridir = $(DRI_DRIVER_INSTALL_DIR) dri_LTLIBRARIES = gallium_dri.la diff --git a/src/gallium/targets/dri/dri.sym b/src/gallium/targets/dri/dri.sym index c99aa09b4d9..49a2cc9fcf2 100644 --- a/src/gallium/targets/dri/dri.sym +++ b/src/gallium/targets/dri/dri.sym @@ -1,6 +1,7 @@ { global: __driDriverExtensions; + __driDriverGetExtensions*; nouveau_drm_screen_create; radeon_drm_winsys_create; local: