[Mesa-dev] [PATCH 09/15] i965: Build the driver into a shared mesa_dri_drivers.so .
Eric Anholt
eric at anholt.net
Wed Oct 23 20:34:51 CEST 2013
Emil Velikov <emil.l.velikov at gmail.com> writes:
> On 12/10/13 02:03, Eric Anholt wrote:
>> Previously, we've split things such that mesa core is in libdricore,
>> exposing the whole Mesa core interface in the global namespace, and the
>> i965_dri.so code all links against that. Along with polluting application
>> namespace terribly, it requires extra PLT indirections and prevents LTO.
>>
>> Instead, we can build all of the driver contents into the same .so with
>> just a few symbols exposed to be referenced from the actual driver .so
>> file, allowing LTO and reducing our exposed symbol count massively.
>>
>> FPS improvement on GLB2.7 with INTEL_NO_HW=1: 2.61061% +/- 1.16957% (n=50)
>> (without LTO, just the PLT reductions from this commit)
>>
>> v2: Set a global driverAPI variable so loaders don't have to update to
>> createNewScreen2() (though they may want to for thread safety).
>>
>> Reviewed-by: Matt Turner <mattst88 at gmail.com> (v1)
>> ---
>> configure.ac | 29 +++++++++++---
>> src/mesa/drivers/dri/Makefile.am | 54 ++++++++++++++++++++++++++-
>> src/mesa/drivers/dri/common/Makefile.am | 3 ++
>> src/mesa/drivers/dri/common/dri_util.c | 19 +++++++++-
>> src/mesa/drivers/dri/common/dri_util.h | 2 +-
>> src/mesa/drivers/dri/common/megadriver_stub.c | 41 ++++++++++++++++++++
>> src/mesa/drivers/dri/i965/Makefile.am | 27 +++-----------
>> src/mesa/drivers/dri/i965/intel_screen.c | 18 +++++++--
>> src/mesa/drivers/dri/i965/intel_screen.h | 2 +
>> 9 files changed, 162 insertions(+), 33 deletions(-)
>> create mode 100644 src/mesa/drivers/dri/common/megadriver_stub.c
>>
> [...]
>> diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am
>> index 48d3685..9d15c43 100644
>> --- a/src/mesa/drivers/dri/Makefile.am
>> +++ b/src/mesa/drivers/dri/Makefile.am
>> @@ -1,4 +1,15 @@
>> +dridir = $(DRI_DRIVER_INSTALL_DIR)
>> +
>> +AM_CPPFLAGS = \
>> + -I$(top_srcdir)/src/mesa/ \
>> + -I$(top_srcdir)/src/mapi/ \
>> + -I$(top_srcdir)/src/mesa/drivers/dri/common \
>> + $(LIBDRM_CFLAGS) \
>> + $()
>> +
> Mixed indent - first two includes use tabs
>
> Have you tried out of tree builds ? I'm assuming that we need
> + -I$(top_builddir)/src/mesa/drivers/dri/common \
OOT build worked fine here -- we're not depending on any built headers
for this afaics.
Actually, this appears to just be an artifact of when I was building
some .c files from this directory, and I can just drop teh AM_CPPFLAGS
entirely.
>> +if NEED_MEGADRIVER
>> +dri_LTLIBRARIES = mesa_dri_drivers.la
>> +
>> +# Add a link to allow setting LD_LIBRARY_PATH/LIBGL_DRIVERS_PATH to /lib of the build tree.
>> +all-local: mesa_dri_drivers.la
>> + $(MKDIR_P) $(top_builddir)/$(LIB_DIR);
>> + $(AM_V_GEN)ln -f .libs/mesa_dri_drivers.so \
>> + $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so;
>> + $(AM_V_GEN)for i in $(MEGADRIVERS); do \
>> + ln -f $(top_builddir)/$(LIB_DIR)/mesa_dri_drivers.so \
>> + $(top_builddir)/$(LIB_DIR)/$$i; \
>> + done;
>> +
>> +# hardlink each megadriver instance, but don't actually have
>> +# mesa_dri_drivers.so in the set of final installed files.
>> +install-data-hook:
>> + for i in $(MEGADRIVERS); do \
> $(AM_V_GEN)for i....
Normal install targets don't use silent build rules, so I don't think
this custom one should.
(Of course, that seems like a pretty silly feature of silent builds to
me -- why can't I get a nice install mode too? Oh well)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131023/4e8b84bd/attachment.pgp>
More information about the mesa-dev
mailing list