[Mesa-dev] [PATCH mesa 04/16] amd: remove always-true BRAHMA_BUILD define

Marek Olšák maraeo at gmail.com
Tue Nov 28 14:51:48 UTC 2017


Internal addrlib doesn't contain BRAHMA_BUILD, so removing that
definition is safe.

The assert change is also OK. We'll just discard any new addrlib code
that might replace it, because standard C assert is the only think we
need.

Marek

On Tue, Nov 28, 2017 at 12:03 PM, Eric Engestrom
<eric.engestrom at imgtec.com> wrote:
> On Friday, 2017-11-24 19:20:12 +0100, Marek Olšák wrote:
>> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
>>
>> Marek
>>
>> On Fri, Nov 24, 2017 at 7:07 PM, Eric Engestrom
>> <eric.engestrom at imgtec.com> wrote:
>> > Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
>> > ---
>> >  src/amd/Android.addrlib.mk               |  2 --
>> >  src/amd/Makefile.addrlib.am              |  3 +--
>> >  src/amd/addrlib/core/addrcommon.h        | 15 ++-------------
>
> I'll drop all the other addrlib patches, but I hope they get picked up
> internally and land in Mesa eventually, because right now addrlib is
> making the build very noisy :)
>
> For this specific patch, how do you want to handle it? I assume you
> don't want me to touch addrcommon.h, but if I don't and only apply the
> build systems hunks of this patch, this will turn off DEBUG in release
> builds, changing the behaviour you currently had.
>
> I guess the best option is for AMD to internally apply all my patches and
> I do nothing upstream, and next time you guys drop an update of addrlib
> it will all be fixed in one go?
>
>> >  src/amd/addrlib/meson.build              |  2 +-
>> >  src/gallium/winsys/amdgpu/drm/Android.mk |  4 +---
>> >  5 files changed, 5 insertions(+), 21 deletions(-)
>> >
>> > diff --git a/src/amd/Android.addrlib.mk b/src/amd/Android.addrlib.mk
>> > index a29f7c16d1797b5943c4..a37112d7154de568c815 100644
>> > --- a/src/amd/Android.addrlib.mk
>> > +++ b/src/amd/Android.addrlib.mk
>> > @@ -30,8 +30,6 @@ LOCAL_MODULE := libmesa_amdgpu_addrlib
>> >
>> >  LOCAL_SRC_FILES := $(ADDRLIB_FILES)
>> >
>> > -LOCAL_CFLAGS := -DBRAHMA_BUILD=1
>> > -
>> >  LOCAL_C_INCLUDES := \
>> >         $(MESA_TOP)/src \
>> >         $(MESA_TOP)/src/amd/common \
>> > diff --git a/src/amd/Makefile.addrlib.am b/src/amd/Makefile.addrlib.am
>> > index 90dfe9634454218bee82..322a5c86973b9238c74c 100644
>> > --- a/src/amd/Makefile.addrlib.am
>> > +++ b/src/amd/Makefile.addrlib.am
>> > @@ -29,8 +29,7 @@ addrlib_libamdgpu_addrlib_la_CPPFLAGS = \
>> >         -I$(srcdir)/addrlib/inc/chip/gfx9 \
>> >         -I$(srcdir)/addrlib/inc/chip/r800 \
>> >         -I$(srcdir)/addrlib/gfx9/chip \
>> > -       -I$(srcdir)/addrlib/r800/chip \
>> > -       -DBRAHMA_BUILD=1
>> > +       -I$(srcdir)/addrlib/r800/chip
>> >
>> >  addrlib_libamdgpu_addrlib_la_CXXFLAGS = \
>> >         $(VISIBILITY_CXXFLAGS) $(CXX11_CXXFLAGS)
>> > diff --git a/src/amd/addrlib/core/addrcommon.h b/src/amd/addrlib/core/addrcommon.h
>> > index 62f8ac61618e65db6768..99bb62e77f446f912d35 100644
>> > --- a/src/amd/addrlib/core/addrcommon.h
>> > +++ b/src/amd/addrlib/core/addrcommon.h
>> > @@ -40,7 +40,7 @@
>> >  #include <string.h>
>> >  #include <assert.h>
>> >
>> > -#if BRAHMA_BUILD && !defined(DEBUG)
>> > +#if !defined(DEBUG)
>> >  #ifdef NDEBUG
>> >  #define DEBUG 0
>> >  #else
>> > @@ -73,18 +73,7 @@
>> >      #define ADDR_ANALYSIS_ASSUME(expr) do { (void)(expr); } while (0)
>> >  #endif
>> >
>> > -#if BRAHMA_BUILD
>> > -    #define ADDR_ASSERT(__e) assert(__e)
>> > -#elif DEBUG
>> > -    #define ADDR_ASSERT(__e)                                \
>> > -        do {                                                    \
>> > -            ADDR_ANALYSIS_ASSUME(__e);                          \
>> > -            if ( !((__e) ? TRUE : FALSE)) { ADDR_DBG_BREAK(); } \
>> > -        } while (0)
>> > -#else //DEBUG
>> > -    #define ADDR_ASSERT(__e) ADDR_ANALYSIS_ASSUME(__e)
>> > -#endif //DEBUG
>> > -
>> > +#define ADDR_ASSERT(__e) assert(__e)
>> >  #define ADDR_ASSERT_ALWAYS() ADDR_DBG_BREAK()
>> >  #define ADDR_UNHANDLED_CASE() ADDR_ASSERT(!"Unhandled case")
>> >  #define ADDR_NOT_IMPLEMENTED() ADDR_ASSERT(!"Not implemented");
>> > diff --git a/src/amd/addrlib/meson.build b/src/amd/addrlib/meson.build
>> > index 1a7f2fdef5d8e347b5ad..ed0dde6245b3396305fc 100644
>> > --- a/src/amd/addrlib/meson.build
>> > +++ b/src/amd/addrlib/meson.build
>> > @@ -56,5 +56,5 @@ libamdgpu_addrlib = static_library(
>> >    include_directories : include_directories(
>> >      'core', 'inc/chip/gfx9', 'inc/chip/r800', 'gfx9/chip', 'r800/chip',
>> >      '../common', '../../'),
>> > -  cpp_args : [cpp_vis_args, '-DBRAHMA_BUILD=1'],
>> > +  cpp_args : cpp_vis_args,
>> >  )
>> > diff --git a/src/gallium/winsys/amdgpu/drm/Android.mk b/src/gallium/winsys/amdgpu/drm/Android.mk
>> > index a05304ae5dea571e0a67..6e84a0c8de1a8e503ef4 100644
>> > --- a/src/gallium/winsys/amdgpu/drm/Android.mk
>> > +++ b/src/gallium/winsys/amdgpu/drm/Android.mk
>> > @@ -30,9 +30,7 @@ include $(CLEAR_VARS)
>> >
>> >  LOCAL_SRC_FILES := $(C_SOURCES)
>> >
>> > -LOCAL_CFLAGS := \
>> > -       $(AMDGPU_CFLAGS) \
>> > -       -DBRAHMA_BUILD=1
>> > +LOCAL_CFLAGS := $(AMDGPU_CFLAGS)
>> >
>> >  LOCAL_STATIC_LIBRARIES := libmesa_amdgpu_addrlib
>> >
>> > --
>> > Cheers,
>> >   Eric
>> >


More information about the mesa-dev mailing list