[Mesa-dev] [PATCH] mesa: Move register_allocate.c to util.

Emil Velikov emil.l.velikov at gmail.com
Mon Sep 22 19:07:24 PDT 2014


On 23/09/14 01:32, Eric Anholt wrote:
> The r300 gallium driver is using it outside of the Mesa tree, and I wanted
> to do so for vc4 as well.  Rather than make the multiple-definitions
> problem even more complicated, just move it to more-shared code.
> ---
>  src/gallium/drivers/r300/Makefile.am               |  14 +-
>  src/gallium/drivers/r300/Makefile.sources          |   3 -
>  .../drivers/r300/compiler/radeon_pair_regalloc.c   |   2 +-
>  src/mesa/Makefile.sources                          |   1 -
>  src/mesa/drivers/dri/i965/brw_fs.cpp               |   2 +-
>  src/mesa/drivers/dri/i965/brw_fs.h                 |   2 +-
>  src/mesa/drivers/dri/i965/brw_fs_visitor.cpp       |   2 +-
>  .../drivers/dri/i965/brw_vec4_reg_allocate.cpp     |   2 +-
>  src/mesa/program/register_allocate.c               | 654 ---------------------
>  src/mesa/program/register_allocate.h               |  79 ---
>  src/util/Makefile.am                               |   3 +
>  src/util/Makefile.sources                          |   2 +
>  src/util/register_allocate.c                       | 654 +++++++++++++++++++++
>  src/util/register_allocate.h                       |  79 +++
>  14 files changed, 745 insertions(+), 754 deletions(-)
>  delete mode 100644 src/mesa/program/register_allocate.c
>  delete mode 100644 src/mesa/program/register_allocate.h
>  create mode 100644 src/util/register_allocate.c
>  create mode 100644 src/util/register_allocate.h
> 
> diff --git a/src/gallium/drivers/r300/Makefile.am b/src/gallium/drivers/r300/Makefile.am
> index 7692bd8..ead7a87 100644
> --- a/src/gallium/drivers/r300/Makefile.am
> +++ b/src/gallium/drivers/r300/Makefile.am
> @@ -13,11 +13,11 @@ AM_CFLAGS = \
>  	$(LLVM_CFLAGS) \
>  	$(RADEON_CFLAGS)
>  
> -noinst_LTLIBRARIES = libr300.la libr300-helper.la
> +noinst_LTLIBRARIES = libr300.la
There are some references of libr300-helper.la in the targets. Can you
remove them as well please.

>  check_PROGRAMS = r300_compiler_tests
>  TESTS = r300_compiler_tests
>  
> -r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
> +r300_compiler_tests_LDADD = libr300.la \
>  	$(top_builddir)/src/gallium/auxiliary/libgallium.la \
>  	$(top_builddir)/src/util/libmesautil.la \
>  	$(GALLIUM_COMMON_LIB_DEPS)
> @@ -28,16 +28,6 @@ r300_compiler_tests_SOURCES = $(COMPILER_TESTS_SOURCES)
>  
>  libr300_la_SOURCES = $(C_SOURCES)
>  
> -# These two files are included in libmesagallium, which is included in the dri
> -# targets. So, they were added directly to r300g the dri-r300 target would have
> -# duplicated symbols, and if they weren't the other *-r300 targets would fail
> -# with undefined symbols.
> -#
> -# Solve this by building them into a separate helper library that can be linked
> -# in place of libmesagallium.
> -libr300_helper_la_CPPFLAGS = -I$(top_srcdir)/src
> -libr300_helper_la_SOURCES = $(HELPER_SOURCES)
> -
>  EXTRA_DIST = Android.mk \
>  	compiler/tests/omod_two_writers.test \
>  	compiler/tests/regalloc_tex_1d_swizzle.test
> diff --git a/src/gallium/drivers/r300/Makefile.sources b/src/gallium/drivers/r300/Makefile.sources
> index ab1c9de..1ba6db0 100644
> --- a/src/gallium/drivers/r300/Makefile.sources
> +++ b/src/gallium/drivers/r300/Makefile.sources
> @@ -108,6 +108,3 @@ COMPILER_TESTS_SOURCES := \
>  	compiler/tests/rc_test_helpers.h \
>  	compiler/tests/unit_test.c \
>  	compiler/tests/unit_test.h
> -
> -HELPER_SOURCES := \
> -	register_allocate.c
git rm the symlink ?

> diff --git a/src/util/register_allocate.c b/src/util/register_allocate.c
> new file mode 100644
> index 0000000..7faf672
> --- /dev/null
> +++ b/src/util/register_allocate.c
[...]
> +#include "util/ralloc.h"
Please drop the utils/ prefix. It makes it move obvious that the header
is in the current directory.

With those fixed the patch is
Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

Thank you for doing this :)
-Emil


More information about the mesa-dev mailing list