Commit Graph

92041 Commits

Author SHA1 Message Date
Rob Herring d31a2b4d49 Android: Add LLVM support for Android O
Android O moves to LLVM 3.9 and also has some differences in header
dependencies as LLVM has moved to blueprint files. It seems libLLVMCore
was only needed for header dependencies, so we can drop that for O.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 26aee6f4d5 Android: rework LLVM build support
Currently, building with "mmma external/mesa3d" which builds all targets
and dependencies is broken for targets that require LLVM. This is due to
the build settings depending on MESA_ENABLE_LLVM. Instead of using a
conditional in the global Android.common.mk, make all the components that
need LLVM explicitly include the necessary build settings.

GALLIVM_CPP_SOURCES doesn't exist anymore, so remove that as well.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring e2ff12e919 Android: rework libelf dependencies
Add libelf as a library dependency rather than explicitly listing its
include paths. This should work for Android M and later which have the
necessary exported directories in libelf.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 06260da16e Android: drop LLVM support on Lollipop
Mesa no longer supports LLVM 3.5 for any targets we support.
Android-x86 adds support for llvmpipe which could work, but android-x86
for L is using mesa 11.0 anyway.

Dropping this support enables clean-up of libelf dependencies.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 4c0c3719dc Android: Add driver "all" option to enable all drivers
Add a driver string "all" so that if BOARD_GPU_DRIVERS is set to "all",
all the drivers are enabled in the build. This makes build testing all
drivers easier to maintain.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 3f097396a1 Android: push driver build details to driver makefiles
src/gallium/targets/dri/Android.mk contains lots of conditional for
individual drivers. Let's move these details into the individual driver
makefiles.

In the process, align the make driver conditionals with automake
(i.e. HAVE_GALLIUM_*).

Signed-off-by: Rob Herring <robh@kernel.org>
[Emil Velikov: add the radeon winsys for radeonsi]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 2a2dabe1c3 Android: remove needless conditional including of child makefiles
It is not necessary to filter driver and winsys directories based on the
list of enabled drivers. Selecting the included driver libraries or not is
sufficient to control what is built.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 88014bc023 Android: Fix swrast only build
A build of only swrast is broken as the Android EGL now depends on
libdrm as does GBM. While we could make EGL conditionally depend on
libdrm, we probably want to enable kms_dri winsys as well and that will
need libdrm enabled. So just always enable libdrm and simplify the
Android makefiles a bit.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
[Emil Velikov: drop related inline comment]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 1ef913aacf Android: amd/common: fix dependency on libmesa_nir
Building libmesa_amd_common fails with:

external/mesa/src/amd/common/ac_shader_info.c:23:10: fatal error: 'nir/nir.h' file not found
         ^

external/mesa/src/compiler/nir/nir.h:48:10: fatal error: 'nir_opcodes.h' file not found
         ^

libmesa_amd_common now depends on libmesa_nir, so add it as a dependency
and export the necessary directories.

Fixes: 224cf29 "radv/ac: add initial pre-pass for shader info gathering"
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 1082501979 Android: amd: use exported include dirs instead of explicit includes
Add exported include paths rather than explicitly adding the includes
in each user of the common AMD libs.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:21 +01:00
Rob Herring 4eec1cfa8e Android: remove remaining explicit libcxx includes
Explicitly including libcxx includes is not necessary at least on
Android M and later. It appears that libc++ was made the default in
commit "Make libc++ the default STL." in Android build system post L.
However, if L support is still needed, using "LOCAL_CXX_STL=libc++" is
the preferred way.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:20 +01:00
Mauro Rossi f21454eaa5 Android: define required __STDC* macros as cflags
Necessary to fix the following radeonsi building errors:

In file included from external/mesa/src/gallium/drivers/radeonsi/si_blit.c:24:
In file included from external/mesa/src/gallium/drivers/radeonsi/si_pipe.h:29:
In file included from external/mesa/src/gallium/drivers/radeonsi/si_shader.h:71:
In file included from external/llvm/include/llvm-c/Core.h:18:
In file included from external/llvm/include/llvm-c/ErrorHandling.h:17:
In file included from external/llvm/include/llvm-c/Types.h:17:
external/llvm/include/llvm/Support/DataTypes.h:49:3: error: "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
  ^
external/llvm/include/llvm/Support/DataTypes.h:53:3: error: "Must #define __STDC_CONSTANT_MACROS before "         "#including Support/DataTypes.h"
  ^
2 errors generated.

[Emil Velikov: add inline comment about the defines]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:20 +01:00
Mauro Rossi 7e907d8f7f Android: drop static linking of R600 LLVM libraries
Inspired by Chih-Wei Huang and Zhen Wu similar patches

Linking against llvm with both static and shared may be avoided,
provided that libLLVM shared library for device supports
whole static R600/AMDGPU libraries, necessary for radeonsi/amdgpu.

Complementary changes, limited to android external/llvm project
are necessary to correclty build libLLVM

Tested with marshmallow-x86 and nougat-x86 builds

Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-05-11 13:52:20 +01:00
Philipp Zabel 0b31c3adc1 configure.ac: Fix help string for --disable-pwr8 configure option
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-05-11 09:43:38 +01:00
Timothy Arceri 6d7660cf4b mesa: remove _CurrentFragmentProgram from gl_pipeline_object
This was added in b527dd65c8 as a work around because fixed function
fragment shaders were tracked in ctx->FragmentProgram._Current as
a gl_program rather than gl_shader_program.

However after my refactoring of the program and shader structs
at the end of 2016 which culminated in c505d6d852, we no longer
need gl_shader_program to track the current program making
_CurrentFragmentProgram obsolete.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-05-11 14:46:39 +10:00
Timothy Arceri 276166c45b mesa: add KHR_no_error support for FramebufferTexture*D functions
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri 20cabc2ac0 mesa: add no error version of framebuffer_texture_with_dims()
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri 304058a1fb mesa: add error version of get_texture_for_framebuffer()
This is a step towards KHR_no_error support.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri 69ca1ef683 mesa: pass rb attachment to _mesa_framebuffer_texture()
This change will help us add KHR_no_error support to the caller.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri d90ced445c mesa: add _mesa_get_and_validate_attachment() helper
Will be used to add KHR_no_error support. We make this available
external so it can be called from meta.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri 786b9ad95b mesa: remove _mesa_problem() from a few locations
_mesa_problem() is still useful in some places such as is if a backend
compile fails, but for the majority of cases we should be able to
remove it.

OpenGL test suites are becoming very mature, we should place more
trust in debug builds picking up missed cases.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri 8b00630c4d mesa: make _mesa_get_framebuffer_attachment_parameter() static
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri a754e4ca38 mesa: fix indentation
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Timothy Arceri e618761233 mesa: remove _mesa from static framebuffer object function
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 13:53:39 +10:00
Michel Dänzer 0c67aa8456 gallivm: Fix build against LLVM SVN >= r302589
deregisterEHFrames doesn't take any parameters anymore.

Reviewed-by: Vedran Miletić <vedran@miletic.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-05-11 11:00:42 +09:00
Timothy Arceri bdaff25c20 mesa: small _mesa_UseProgram() tidy up
Makes the code easier to follow.

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 10:56:09 +10:00
Timothy Arceri 244cef1694 mesa: add KHR_no_error support for glBindProgramPipeline()
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 10:56:08 +10:00
Timothy Arceri 0bca4784c2 mesa: add KHR_no_error support for glActiveShaderProgram()
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 10:56:08 +10:00
Timothy Arceri 00c5119a5e mesa: add KHR_no_error support for glUseProgramStages()
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 10:56:08 +10:00
Timothy Arceri ea4c606441 mesa: create use_program_stages() helper
This will be used to create a KHR_no_error version of
glUseProgramStages().

Reviewed-by: Eric Anholt <eric@anholt.net>
2017-05-11 10:56:08 +10:00
Dave Airlie fe6c407a33 radv: handle fragment shader srgb resolve pass better
Bas pointed out the fs key doesn't take srgb into account,
since there is just one srgb variant, just create a separate
pipeline for it. This also uses dest format to be more consistent
on when srgb matters.

Fixes: 69136f4e63 "radv/meta: add resolve pass using fragment/vertex shaders"
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-05-11 10:36:06 +10:00
Kenneth Graunke 32f0dc3a29 i965: Make INTEL_DEBUG=bat decode VS/CLIP/GS/SF/WM/CC_STATE on Gen4-5.
This is something the original decoder did, but I didn't bother with
until now.  I recently had to debug an Ironlake issue, and wanted to
inspect VS_STATE.  So, now it's back.

The other packets in the switch statement are all Gen6/7+, where we
use offsets from dynamic state base address, so we don't need the
gtt_offset subtraction introduced here.  We might want to make a
helper for this hack at some point - perhaps when we introduce the
next occurance.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2017-05-10 11:58:20 -07:00
Kenneth Graunke 0f34b674ed i965: Switch BRW_NEW_CURBE_OFFSETS to BRW_NEW_PUSH_CONSTANT_ALLOCATION.
The BRW_NEW_CURBE_OFFSETS dirty bit is signalled when changing the
partitioning of the Constant Buffer URB section between the various
shader stages, on Gen4-5.

BRW_NEW_PUSH_CONSTANT_ALLOCATION is basically the same thing on Gen7+.

So, save a bit, and use the new name.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-05-10 11:41:58 -07:00
Kenneth Graunke 608a65ebca i965: Drop BRW_NEW_PUSH_CONSTANT_ALLOCATION from Gen6 code.
Gen6 doesn't have a configurable push constant region.  This is only
used on Gen7+.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-05-10 11:41:50 -07:00
Kenneth Graunke 3d70e00c62 i965: Only #if...#endif a single function or related section at a time.
Previously we guarded large swathes of code with #if GEN ... #endif
blocks.  This made it difficult to see which generations include what.

This patch splits up the #if..#endif sections so they surround a small
section of code - usually a single function/atom, or sometimes a group
of related functions.  It should make the code easier to work on.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2017-05-10 11:41:46 -07:00
Kenneth Graunke 774db15aaf i965: Turn brw_get_line_width_float() into brw_get_line_width().
Drop the old brw_get_line_width() helper which return the unsigned
fixed-point encoding of the line width - it's been dead since the
conversion to GENXML (which does the encoding for us).

Then rename brw_get_line_width_float() to the shorter name.

Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2017-05-10 11:41:42 -07:00
Kenneth Graunke 620f12a53f i965: Drop INTEL_DEBUG=stats.
For whatever reason, we had an INTEL_DEBUG=stats option that enabled
various statistics counters on Gen4-5 systems.  It's been around
forever, though I can't think of a single time that it's been useful.

On Gen6+, we enable statistics all the time because they're necessary
to support various query object targets.  Turning them off would break
those queries.

Gen4-5 don't support those queries, so the statistics counters generally
aren't useful; we disabled them by default.  This patch disables them
altogether.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2017-05-10 11:37:19 -07:00
Kenneth Graunke 31abfd2d35 i965: Disable ARB_pipeline_statistics_query on Gen4-5.
We apparently enabled this on all platforms in Mesa 10.6.  However, it
was only ever implemented for Gen6+.  The Gen4-5 query code goes up in
flames with an "Unrecognized query target" unreachable() error if you
even attempt to use any of the new functionality.

This wasn't caught because the Piglit tests require OpenGL 3.0, which
Gen4-5 cannot support.  The extension spec does say 3.0 is required,
though I'm not sure why - it seems like 2.1 would work fine.

We could implement it anyway, but it's a little bit of a pain due to the
lack of hardware contexts (so we have to snapshot around batches).

Given that it's been 100% broken for two years and I haven't seen a bug
report about it, I'm not terribly inclined to care.  So, let it go.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2017-05-10 11:37:19 -07:00
Alex Deucher 2f0450c627 radeonsi: add new vega10 pci ids
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2017-05-10 13:41:38 -04:00
Marek Olšák 49c326420e st/mesa: move the logic of all_varyings_in_vbos into st_update_array
The function was pretty slow. This brings a substantial decrease in draw
call overhead when min/max index bounds are not needed:

Before:  DrawElements (1 VBO) w/ no state change:          5.75 million
After:   DrawElements (1 VBO) w/ no state change:          7.03 million

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák 94506e5642 st/mesa: unify common code in st_draw_vbo functions
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák f60f14bdb3 st/mesa: make st_draw_vbo static
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák 740ef228f7 radeonsi: remove upload code for zero-stride vertex attribs
st/mesa takes care of it now.

Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-05-10 19:29:08 +02:00
Marek Olšák 17f776c27b st/mesa: upload zero-stride vertex attributes here
This is the best place to do it. Now drivers without u_vbuf don't have to
do it.

v2: use correct upload size and optimal alignment

Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák 70dcb7377d gallium: add PIPE_CAP_CAN_BIND_CONST_BUFFER_AS_VERTEX
The next patch will use it. This is really for svga and GL2-level drivers.

Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2017-05-10 19:29:08 +02:00
Marek Olšák 9db1f9bcd1 st/mesa: simplify the signature of get_client_array
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák e8b2274592 st/mesa: remove vpv->num_inputs dereferences in st_update_array
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák 71fde49059 st/mesa: fold error handling into setup_(non_)interleaved_attribs
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák f4d272f6f6 st/mesa: fold cso calls into setup_(non_)interleaved_attribs
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-05-10 19:29:08 +02:00
Marek Olšák c334c7dd75 st/mesa: don't call util_draw_init_info in st_draw_vbo 2017-05-10 19:00:16 +02:00