diff options
author | Eric Anholt <[email protected]> | 2013-06-26 13:04:51 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-10-24 14:12:58 -0700 |
commit | 1925a9aebd64b2e08574118891394d9d56db25ae (patch) | |
tree | 45bbbf5e0456b9bec210e08c3be349c82fa987c6 /src/mesa/drivers/dri/common/megadriver_stub.c | |
parent | 4e54751624db7cb07cb4d36c3e683d9ed0a30016 (diff) |
i965: Build the driver into a shared mesa_dri_drivers.so .
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)
Note that the X Server requires commit
7ecfab47eb221dbb996ea6c033348b8eceaeb893 to successfully load this driver!
v2: Set a global driverAPI variable so loaders don't have to update to
createNewScreen2() (though they may want to for thread safety).
v3: Drop AM_CPPFLAGS addition (Emil pointed out I'd missed some cflags
that would be necessary, though only if we actually relied on them).
v4: Fix install with DESTDIR set.
Reviewed-by: Matt Turner <[email protected]> (v1)
Reviewed-by: Emil Velikov <[email protected]> (v2)
Diffstat (limited to 'src/mesa/drivers/dri/common/megadriver_stub.c')
-rw-r--r-- | src/mesa/drivers/dri/common/megadriver_stub.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/megadriver_stub.c b/src/mesa/drivers/dri/common/megadriver_stub.c new file mode 100644 index 00000000000..6bf5d73279a --- /dev/null +++ b/src/mesa/drivers/dri/common/megadriver_stub.c @@ -0,0 +1,41 @@ +/* + * Copyright © 2013 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include <stdio.h> +#include "dri_util.h" + +static const +__DRIconfig **stub_error_init_screen(__DRIscreen *psp) +{ + fprintf(stderr, "An updated DRI driver loader (libGL.so or X Server) is " + "required for this Mesa driver.\n"); + return NULL; +} + +/** + * This is a stub driDriverAPI that is referenced by dri_util.c but should + * never be used. + */ +const struct __DriverAPIRec driDriverAPI = { + .InitScreen = stub_error_init_screen, +}; |