OSDN Git Service

i915: Build the driver into the shared mesa_dri_drivers.so.
authorEric Anholt <eric@anholt.net>
Fri, 27 Sep 2013 21:22:59 +0000 (14:22 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 24 Oct 2013 21:13:09 +0000 (14:13 -0700)
commit6665b71b22c265a318ff76178cc27732512791a8
tree0ad17387fb5744a09fd99d43ce40cde294cdd839
parentba10d79cca8d93c9f366f3734bebd79c7a5257c8
i915: Build the driver into the shared mesa_dri_drivers.so.

i915 has symbols for formerly-shared code that conflict with i965, so we
define them away using gen-symbol-redefs.py.  Options considered:

- This option.  Downsides: The symbols in profiling and debugging don't
  match the source.  The symbol list may change in the future and we won't
  notice without manually running the tool again.

- Use objcopy --localize-hidden to automatically demote our symbols to
  locals.  This didn't work on i965 due to c++ weak symbols (which can't
  be localized), but could work on i915.  We could do it on i915 only, but
  it does produce libtool warnings at link time due to libtool not knowing
  if the resulting .o file is safe to link (stupid libtool).  Plus you end
  up with different symbols of the same name, which is confusing for
  debugging too.  On the other hand, no future symbol conflicts long term.

- Write our own libelf tool that handles c++ weak symbols like we want and
  apply it to all drivers.  All the downsides of above, but applies
  uniformly across drivers.

- Edit the files to just rename all the i915 or i965 symbols that
  conflict.  There are on the order of 100 that have a prefix we used to
  share, so it would take a bit of typing.  Fewest downsides, but still
  can have conflicts long term.

Ultimately, this is the least invasive change at the moment, and we can
see if the "more symbol conflicts appear later" thing is a real concern or
not.

Note that the ability to compile a version of i915 without INTEL_DEBUG env
support is dropped.  It's too useful.

v2: drop dridir now that it's unused.
v3: Consistently put spaces around += in the updated Makefile.am block.
v4: 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@gmail.com> (v2)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
configure.ac
src/mesa/drivers/dri/Makefile.am
src/mesa/drivers/dri/i915/Makefile.am
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i915/intel_mipmap_tree.h
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i915/intel_screen.h