Commit Graph

70869 Commits

Author SHA1 Message Date
Jordan Justen 0d250cc210 i965: Add brw_WAIT to emit wait instruction
This will be used to implement the barrier function.

v2:
 * Rename to brw_WAIT (mattst88)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-12 15:12:40 -07:00
Jordan Justen b925f1a1df i965: Add notification register
This will be used by the wait instruction when implementing the barrier()
function.

v2:
 * Changes suggested by mattst88

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-12 15:12:40 -07:00
Jordan Justen bdbbec33cf i965: Disassemble Gateway SEND messages
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2015-06-12 15:12:40 -07:00
Jordan Justen 69659546a6 i965/inst: Add gateway_notify and gateway_subfuncid fields
These fields will be used when emitting a send for the barrier function.

Reference: IVB PRM Volume 4, Part 2, Section 1.1.1 Message Descriptor

v2:
 * notify => gateway_notify (Ken)
 * define bits for gen4-gen6 (bwidawsk, Ken)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-12 15:12:40 -07:00
Jordan Justen 1b9cc257d4 i965: Add GATEWAY_SFID definitions
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-06-12 15:12:40 -07:00
Jordan Justen 2867f2e8cd nir: Add barrier intrinsic function
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-06-12 15:12:40 -07:00
Chris Forbes 86855365b4 glsl: Add builtin barrier() function
[jordan.l.justen@intel.com: Add CS support]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-12 15:12:39 -07:00
Chris Forbes e7f628c2fc glsl: Add ir node for barrier
v2:
 * Changes suggested by mattst88

[jordan.l.justen@intel.com: Add nir support]
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-06-12 15:12:39 -07:00
Jordan Justen 86b4acb409 i965/cs: Use exec all for CS terminate
This prevents an assertion from being hit with SIMD16:

Assertion `inst->exec_size == dispatch_width() || force_writemask_all' failed.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-06-12 15:12:39 -07:00
Chad Versace cfc175b409 i965/fs: Fix unused variable warning
Annotate offset_components with attribute 'unused'.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-06-12 12:37:25 -07:00
Emil Velikov d15c06b514 vc4: automake: enable subdir-objects
Silence the warnings about the future incompatibility with automake 2.0

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:42:22 +01:00
Erik Faye-Lund 634f200256 mesa: build xmlconfig to a separate static library
As we use the file from both the dri modules and loader, we end up with
multiple definition of the symbols provided in our gallium dri  modules.
Additionally we compile the file twice.

Resolve both issues, effectively enabling the build on toolchains which
don't support -Wl,--allow-multiple-definition.

v2: [Emil Velikov]
 - Fix the Scons/Android build.
 - Resolve libgbm build issues (bring back the missing -lm)

Cc: Julien Isorce <j.isorce@samsung.com>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90310
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90905
Acked-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:32:18 +01:00
Emil Velikov 83b5648a1e targets/nine: link against libnir/libglsl_util
Based on commit 101142c4010(xa: support for drivers which use NIR)

Cc: "10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90466
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:32:18 +01:00
Emil Velikov ba512cc7fa pipe-loader: add libnir and libglsl_util to the link
Based on commit 101142c4010(xa: support for drivers which use NIR)

Cc: Rob Clark <robclark@freedesktop.org>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90466
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:32:18 +01:00
Emil Velikov 1df5a6c71e mesa; add a dummy _mesa_error_no_memory() symbol to libglsl_util
Rather than forcing everyone to provide their own definition of the symbol
provide a common (dummy) one.

This helps us resolve the build of the standalone pipe-drivers (amongst
others), which are missing the symbol.

Cc: Rob Clark <robclark@freedesktop.org>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:32:18 +01:00
Emil Velikov 4722743f4b gallium: use $(top_builddir) when referencing static archives
Just like every other place in gallium.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:32:17 +01:00
Emil Velikov 3f5dc9b94f freedreno: use CXX linker rather than explicit link against libstdc++
Cc: Rob Clark <robclark@freedesktop.org>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:32:17 +01:00
Emil Velikov 0e55db3b8a egl/haiku: coding style fixes
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:53 +01:00
Emil Velikov b0f33e9736 egl/haiku: plug some obvious memory leaks
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:48 +01:00
Emil Velikov e77a32fcae egl/haiku: minor surface management cleanups
Drop the stub/unused function haiku_create_surface() and add some basic implementation for destroy_surface()

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:44 +01:00
Emil Velikov d38a80ba6c egl/haiku: kill off haiku_log()
It's an incomplete copy of the default _eglLog() implementation. Just
use the default logger.

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:40 +01:00
Emil Velikov 667fe2f5e9 egl/haiku: we don't use src/loader, drop all the references to it
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:37 +01:00
Emil Velikov d0af283303 egl/haiku: remove unused variables in struct haiku_egl_driver
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:34 +01:00
Emil Velikov 46f87b2c19 egl/haiku: handle memory allocation failure
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:27 +01:00
Emil Velikov ed9dcdf927 egl/haiku: use CALL/TRACE/ERROR over _eglLog() for haiku specifics
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:24 +01:00
Emil Velikov 0b652fedb5 egl/haiku: remove commented out code
It serves little to no purpose. As the driver gets updated, one can
look at the existing implementation (dri2) for reference rather than
letting the commented functions bitrot.

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:20 +01:00
Emil Velikov c3036f4bb1 egl/haiku: use correct version variable
Earlier commit folded the two separate variables into one, but forgot to
update the haiku driver.

Fixes: 0e4b564ef28(egl: combine VersionMajor and VersionMinor into one
variable)
Cc: Marek Olšák <marek.olsak@amd.com>>
Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-12 15:17:12 +01:00
Jose Fonseca 0dde821bcc trace: Add missing p_compiler.h include.
For boolean.

Trivial.
2015-06-12 12:14:11 +01:00
Francisco Jerez 8d3c48eed2 i965/fs: Remove one more fixed brw_null_reg() from the visitor.
Instead use fs_builder::null_reg_f() which has the correct register
width.  Avoids the assertion failure in fs_builder::emit() hit by the
"ES3-CTS.shaders.loops.for_dynamic_iterations.unconditional_break_fragment"
GLES3 conformance test introduced by 4af4cfba9e.

Reported-and-reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2015-06-12 11:17:25 +03:00
Kenneth Graunke 16658f426d Revert "i965: Advertise a line width of 40.0 on Cherryview and Skylake."
This reverts commit f3b709c0ac.

The "dEQP-GLES3.functional.rasterization.fbo.rbo_multisample_4.
interpolation.lines_wide" test appears to be broken on Cherryview when
we expose line widths greater than 12.0.  I'm not sure why.

For now, just go back to the limits we used on older platforms.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90902
Acked-by: Matt Turner <mattst88@gmail.com>
2015-06-11 16:59:49 -07:00
Kenneth Graunke f4310cdbd0 i965: Re-index SSA definitions before printing NIR code.
This makes the SSA definitions use sequential numbers (0, 1, 2, ...)
instead of seemingly random ones.  There's not much point normally,
but it makes debug output much easier to read.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
2015-06-11 11:17:52 -07:00
Brian Paul 1a6e4f46ed gallium: remove explicit values from PIPE_CAP_ enums
The other PIPE_CAPF_ and PIPE_SHADER_CAP_ enums don't have explicit values.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-06-11 10:27:17 -06:00
Jose Fonseca 9fed4f9bf5 mesa/main: Don't use ONCE_FLAG_INIT as a r-value.
It should only be used as an initializer expression.

Trivial, and fixes Windows builds.

Nevertheless, overwriting an once_flag like this seems dangerous and
should be revised.
2015-06-11 13:35:23 +01:00
Iago Toral Quiroga 0f1fe649b7 i965/gen8: Fix antialiased line rendering with width < 1.5
The same fix Marius implemented for gen6 (commit a9b04d8a) and
gen7 (commit 24ecf37a).

Also, we need the same code to handle special cases of line width
in gen6, gen7 and now gen8, so put that in the helper function
we use to compute the line width.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-11 13:40:15 +02:00
Martin Peres 5b61cb1236 glsl: fix constructing a vector from a matrix
Without this patch, the following constructs (not an extensive list)
would crash mesa:

- mat2 foo = mat2(1); vec4 bar = vec4(foo);
- mat3 foo = mat3(1); vec4 bar = vec4(foo);
- mat3 foo = mat3(1); ivec4 bar = ivec4(foo);

The first case is explicitely allowed by the GLSL spec, as seen on
page 101 of the GLSL 4.40 spec:

	"vec4(mat2) // the vec4 is column 0 followed by column 1"

The other cases are implicitely allowed also.

The actual changes are quite minimal. We first split each column of
the matrix to a list of vectors and then use them to initialize the
vector. An additional check to make sure that we are not trying to
copy 0 elements of a vector fix the (i)vec4(mat3) case as the last
vector (3rd column) is not needed at all.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
2015-06-11 14:04:29 +03:00
Tapani Pälli 83624c141d mesa/es3.1: enable DRAW_INDIRECT_BUFFER_BINDING for gles3.1
(increases ES31-CTS.draw_indirect.basic.* passing tests)

v2: only expose DRAW_INDIRECT_BUFFER_BINDING for GL core + ES3.1

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-06-11 13:39:44 +03:00
Juha-Pekka Heikkila 56e9f3b493 mesa/main: avoid null access in format_array_table_init()
If _mesa_hash_table_create failed we'd get null pointer. Report
error and go away.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-06-11 13:17:11 +03:00
Juha-Pekka Heikkila fd00c738c0 mesa/main: Remove _mesa_HashClone()
I didn't find this being used anywhere.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-06-11 13:17:11 +03:00
Alexander Monakov bd38f91f8d i965: do_blit_drawpixels: decode array formats
Correct a regression introduced by commit 922c0c9fd5 by converting "array
format", if received from _mesa_format_from_format_and_type, to mesa_format.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90839
Signed-off-by: Alexander Monakov <amonakov@gmail.com>
Tested-by: AnAkkk <anakin.cs@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
2015-06-11 00:15:37 -07:00
Iago Toral Quiroga f9a18acb56 i965: do not round line width when multisampling or antialiaing are enabled
In commit fe74fee8fa we rounded the line width to the nearest integer to
match the GLES3 spec requirements stated in section 13.4.2.1, but that seems
to break a dEQP test that renders wide lines in some multisampling scenarios.

Ian noted that the Open 4.4 spec has the following similar text:

    "The actual width of non-antialiased lines is determined by rounding the
    supplied width to the nearest integer, then clamping it to the
    implementation-dependent maximum non-antialiased line width."

and suggested that when ES removed antialiased lines, they removed
"non-antialised" from that paragraph but probably should not have.

Going by that note, this patch restricts the quantization implemented in
fe74fee8fa only to regular aliased lines. This seems to keep the
tests fixed with that commit passing while fixing the broken test.

v2:
  - Drop one of the clamps (Ken, Marius)
  - Add a rule to prevent advertising line widths that when rounded go beyond
    the limits allowed by the hardware (Ken)
  - Update comments in the code accordingly (Ian)
  - Put the code in a utility function (Ian)

Fixes:
dEQP-GLES3.functional.rasterization.fbo.rbo_multisample_max.primitives.lines_wide

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90749

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.6" <mesa-stable@lists.freedesktop.org>
2015-06-11 08:32:07 +02:00
Kenneth Graunke f83b9e58f6 i965: Momentarily pretend to support ARB_texture_stencil8 for blits.
Broadwell's stencil blitting code attempts to bind a renderbuffer as a
texture, using dd->BindRenderbufferTexImage().

This calls _mesa_init_teximage_fields(), which then attempts to set
img->_BaseFormat = _mesa_base_tex_format(ctx, internalFormat), which
assert fails if internalFormat is GL_STENCIL_INDEX8 but
ARB_texture_stencil8 is unsupported.

To work around this, just pretend to support the extension momentarily,
during the blit.  Meta has already munged a variety of other things in
the context (including the API!), so it's not that much worse than what
we're already doing.

Fixes regressions since commit f7aad9da20
(mesa/teximage: use correct extension for accept stencil texture.).

v2: Add an XXX comment explaining the situation (requested by Jason
    Ekstrand and Martin Peres), and an assert that we don't support
    the extension so we remember to remove this hack (requested by
    Neil Roberts).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
2015-06-10 14:24:49 -07:00
Brian Paul 7217faf39f llvmpipe: simplify lp_resource_copy()
Just implement it in terms of util_resource_copy_region().  Both the
original code and util_resource_copy_region() boil down to mapping,
calling util_copy_box() and unmapping.

No piglit regressions.  This will also help to implement GL_ARB_copy_image.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-06-10 08:20:58 -06:00
Tapani Pälli 5b0d6f5c1b mesa: add GL_RED, GL_RG support for floating point textures
Mesa supports EXT_texture_rg and OES_texture_float. This patch adds
support for using unsized enums GL_RED and GL_RG for floating point
targets and writes proper checks for internalformat when format is
GL_RED or GL_RG and type is of GL_FLOAT or GL_HALF_FLOAT.

Later, internalformat will get adjusted by adjust_for_oes_float_texture
after these checks.

v2: simplify to check vs supported enums
v3: follow the style and break out if internalFormat ok (Kenneth)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90748
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-10 13:00:30 +03:00
Tapani Pälli 07e4f12e66 mesa: allow unsized formats GL_RG, GL_RED for GLES 3.0 with half float
v2: && -> ||, we enable on gles3 or if ARB_texture_rg is enabled

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90748
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-06-10 12:59:50 +03:00
Timothy Arceri adee54f826 glsl: remove restriction on unsized arrays in GLSL ES 3.10
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-06-10 18:54:43 +10:00
Dave Airlie 563706c146 st/dri: check pscreen is valid before querying param
we don't check the validity of pscreen until dri_init_screen_helper

hit this trying to init glamor on a device with no driver (udl).

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-10 14:10:33 +10:00
Dave Airlie c6877c9e59 nouveau: set imported buffers to what the kernel gives us
When we import a dma-buf fd from another driver the kernel
gives us the right info, and this trashes it.

Convert the kernel bo flags into the domain flags.

This helps getting reverse prime and glamor working.

Cc: mesa-stable@lists.freedesktop.org
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-06-10 14:10:01 +10:00
Eric Anholt 9dca3beb62 vc4: Drop qir include from vc4_screen.h
We didn't need any of it except for the list header, and qir.h pulls in
nir.h, which is not really interesting to winsys.
2015-06-09 12:25:50 -07:00
Eric Anholt 8d10b2a046 vc4: Drop subdirectory in vc4 build.
Just because we put the source in a subdir, doesn't mean we need helper
libraries in the build.  This will also simplify the Android build setup.
2015-06-09 12:25:50 -07:00
Eric Anholt e67b12eaf8 vc4: Update to current kernel validation code.
After profiling on real hardware, I found a few ways to cut down the
kernel overhead.
2015-06-09 12:25:50 -07:00