From f1f1ba37818bcff0c3a944a4d138f0b71fa863f4 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 2 Sep 2016 17:09:45 +1000 Subject: [PATCH] radeonsi: move sid.h/r600d_common.h to a common place. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Step one to merging radv would be to move some files around. This only adds the include path to r600/radeonsi, because later we want to avoid having to add it to the generic target paths. Acked-by: Marek Olšák Reviewed-by: Nicolai Hähnle --- configure.ac | 1 + src/Makefile.am | 4 ++++ src/amd/Makefile.am | 24 +++++++++++++++++++ src/amd/Makefile.sources | 3 +++ .../radeon => amd/common}/r600d_common.h | 0 .../drivers/radeonsi => amd/common}/sid.h | 0 src/gallium/drivers/r600/Makefile.am | 6 +++-- src/gallium/drivers/radeon/Makefile.sources | 1 - src/gallium/drivers/radeon/r600_cs.h | 2 +- src/gallium/drivers/radeon/r600_perfcounter.c | 2 +- src/gallium/drivers/radeonsi/Makefile.am | 5 ++-- src/gallium/drivers/radeonsi/Makefile.sources | 1 - src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 2 +- 13 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 src/amd/Makefile.am create mode 100644 src/amd/Makefile.sources rename src/{gallium/drivers/radeon => amd/common}/r600d_common.h (100%) rename src/{gallium/drivers/radeonsi => amd/common}/sid.h (100%) diff --git a/configure.ac b/configure.ac index 75b1de4da95..a413a3a5f20 100644 --- a/configure.ac +++ b/configure.ac @@ -2670,6 +2670,7 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS" dnl Substitute the config AC_CONFIG_FILES([Makefile src/Makefile + src/amd/Makefile src/compiler/Makefile src/egl/Makefile src/egl/main/egl.pc diff --git a/src/Makefile.am b/src/Makefile.am index cffb9e8b0a2..91d753aae34 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -50,6 +50,10 @@ SUBDIRS = . gtest util mapi/glapi/gen mapi # include only conditionally ? SUBDIRS += compiler +if HAVE_GALLIUM_RADEON_COMMON +SUBDIRS += amd +endif + if HAVE_INTEL_DRIVERS SUBDIRS += intel endif diff --git a/src/amd/Makefile.am b/src/amd/Makefile.am new file mode 100644 index 00000000000..d9b5a06195d --- /dev/null +++ b/src/amd/Makefile.am @@ -0,0 +1,24 @@ +# Copyright © 2016 Red Hat. +# +# 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 Makefile.sources + +EXTRA_DIST = $(COMMON_HEADER_FILES) diff --git a/src/amd/Makefile.sources b/src/amd/Makefile.sources new file mode 100644 index 00000000000..2849b2a867f --- /dev/null +++ b/src/amd/Makefile.sources @@ -0,0 +1,3 @@ +COMMON_HEADER_FILES = \ + common/sid.h \ + common/r600d_common.h diff --git a/src/gallium/drivers/radeon/r600d_common.h b/src/amd/common/r600d_common.h similarity index 100% rename from src/gallium/drivers/radeon/r600d_common.h rename to src/amd/common/r600d_common.h diff --git a/src/gallium/drivers/radeonsi/sid.h b/src/amd/common/sid.h similarity index 100% rename from src/gallium/drivers/radeonsi/sid.h rename to src/amd/common/sid.h diff --git a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am index f3bb03e54be..3638e00f195 100644 --- a/src/gallium/drivers/r600/Makefile.am +++ b/src/gallium/drivers/r600/Makefile.am @@ -3,11 +3,13 @@ include $(top_srcdir)/src/gallium/Automake.inc AM_CFLAGS = \ $(GALLIUM_DRIVER_CFLAGS) \ - $(RADEON_CFLAGS) + $(RADEON_CFLAGS) \ + -I$(top_srcdir)/src/amd/common AM_CXXFLAGS = \ $(GALLIUM_DRIVER_CXXFLAGS) \ - $(RADEON_CFLAGS) + $(RADEON_CFLAGS) \ + -I$(top_srcdir)/src/amd/common noinst_LTLIBRARIES = libr600.la diff --git a/src/gallium/drivers/radeon/Makefile.sources b/src/gallium/drivers/radeon/Makefile.sources index d6dd786448d..049da60c134 100644 --- a/src/gallium/drivers/radeon/Makefile.sources +++ b/src/gallium/drivers/radeon/Makefile.sources @@ -2,7 +2,6 @@ C_SOURCES := \ cayman_msaa.c \ r600_buffer_common.c \ r600_cs.h \ - r600d_common.h \ r600_gpu_load.c \ r600_perfcounter.c \ r600_pipe_common.c \ diff --git a/src/gallium/drivers/radeon/r600_cs.h b/src/gallium/drivers/radeon/r600_cs.h index e97769b293d..6c15df88807 100644 --- a/src/gallium/drivers/radeon/r600_cs.h +++ b/src/gallium/drivers/radeon/r600_cs.h @@ -31,7 +31,7 @@ #define R600_CS_H #include "r600_pipe_common.h" -#include "r600d_common.h" +#include "amd/common/r600d_common.h" /** * Return true if there is enough memory in VRAM and GTT for the buffers diff --git a/src/gallium/drivers/radeon/r600_perfcounter.c b/src/gallium/drivers/radeon/r600_perfcounter.c index 471c1dc58ca..f8dfda08927 100644 --- a/src/gallium/drivers/radeon/r600_perfcounter.c +++ b/src/gallium/drivers/radeon/r600_perfcounter.c @@ -28,7 +28,7 @@ #include "util/u_memory.h" #include "r600_query.h" #include "r600_pipe_common.h" -#include "r600d_common.h" +#include "amd/common/r600d_common.h" /* Max counters per HW block */ #define R600_QUERY_MAX_COUNTERS 16 diff --git a/src/gallium/drivers/radeonsi/Makefile.am b/src/gallium/drivers/radeonsi/Makefile.am index c506666e3c8..0ed955db22c 100644 --- a/src/gallium/drivers/radeonsi/Makefile.am +++ b/src/gallium/drivers/radeonsi/Makefile.am @@ -25,6 +25,7 @@ include $(top_srcdir)/src/gallium/Automake.inc AM_CFLAGS = \ $(GALLIUM_DRIVER_CFLAGS) \ + -I$(top_srcdir)/src/amd/common \ $(RADEON_CFLAGS) \ $(LLVM_CFLAGS) @@ -32,8 +33,8 @@ noinst_LTLIBRARIES = libradeonsi.la libradeonsi_la_SOURCES = $(C_SOURCES) $(GENERATED_SOURCES) -sid_tables.h: $(srcdir)/sid_tables.py $(srcdir)/sid.h - $(AM_V_GEN) $(PYTHON2) $(srcdir)/sid_tables.py $(srcdir)/sid.h > $@ +sid_tables.h: $(srcdir)/sid_tables.py $(top_srcdir)/src/amd/common/sid.h + $(AM_V_GEN) $(PYTHON2) $(srcdir)/sid_tables.py $(top_srcdir)/src/amd/common/sid.h > $@ EXTRA_DIST = \ sid_tables.py diff --git a/src/gallium/drivers/radeonsi/Makefile.sources b/src/gallium/drivers/radeonsi/Makefile.sources index 53404ab0e58..96b8839bf48 100644 --- a/src/gallium/drivers/radeonsi/Makefile.sources +++ b/src/gallium/drivers/radeonsi/Makefile.sources @@ -5,7 +5,6 @@ C_SOURCES := \ si_cp_dma.c \ si_debug.c \ si_descriptors.c \ - sid.h \ si_dma.c \ si_hw_context.c \ si_pipe.c \ diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index e246f81aa9d..73c8a9739ae 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -35,7 +35,7 @@ #include #include -#include "../../../drivers/radeonsi/sid.h" +#include "amd/common/sid.h" /* FENCES */ -- 2.30.2