mesa.git
10 years agogallium/softpipe,llvmpipe: add automake target 'templates'
Emil Velikov [Sun, 21 Sep 2014 15:46:39 +0000 (16:46 +0100)]
gallium/softpipe,llvmpipe: add automake target 'templates'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agoconfigure: remove NEED_{SOFT,LLVM}PIPE_DRIVER variables
Emil Velikov [Sun, 21 Sep 2014 15:39:25 +0000 (16:39 +0100)]
configure: remove NEED_{SOFT,LLVM}PIPE_DRIVER variables

The respective HAVE_{SOFT,LLVM}PIPE are already descriptive
enough. Additionally the svga modules does not really use either
one, but the auxiliary draw & gallivm modules.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/vc4: add automake target 'templates'
Emil Velikov [Sun, 21 Sep 2014 15:31:14 +0000 (16:31 +0100)]
gallium/vc4: add automake target 'templates'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/r300,r600,radeonsi: add automake target 'templates'
Emil Velikov [Tue, 23 Sep 2014 23:30:45 +0000 (00:30 +0100)]
gallium/r300,r600,radeonsi: add automake target 'templates'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/svga: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:41:51 +0000 (15:41 +0100)]
gallium/svga: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/ilo: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:38:07 +0000 (15:38 +0100)]
gallium/ilo: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/i915: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:34:07 +0000 (15:34 +0100)]
gallium/i915: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/freedreno: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:30:53 +0000 (15:30 +0100)]
gallium/freedreno: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/nouveau: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:20:11 +0000 (15:20 +0100)]
gallium/nouveau: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agotargets/pipe-loader: drop unused authentication
Emil Velikov [Wed, 24 Sep 2014 09:39:20 +0000 (10:39 +0100)]
targets/pipe-loader: drop unused authentication

The dri, vdpau, omx, xvmc and gbm targets don't need any authentication
even the VL ones never used it. Either the respective loader or the
library itself (vl) is doing its auth prior to calling create_screen()

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agotargets/vl: fix hard-links when building shared pipe-drivers
Emil Velikov [Sun, 21 Sep 2014 02:08:47 +0000 (03:08 +0100)]
targets/vl: fix hard-links when building shared pipe-drivers

Make sure that MEGADRIVERS is set in order to create the hardlinks.
The variable name is not the most appropriate and will be sorted
out in upcoming commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agoconfigure: remove unused variable OSMESA_MESA_DEPS
Emil Velikov [Wed, 23 Jul 2014 15:51:19 +0000 (16:51 +0100)]
configure: remove unused variable OSMESA_MESA_DEPS

Leftover from the static Makefiles

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/freedreno: remove unused draw header
Emil Velikov [Sun, 21 Sep 2014 11:59:40 +0000 (12:59 +0100)]
gallium/freedreno: remove unused draw header

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agogallium/r300: remove obsolete declaration
Emil Velikov [Sun, 21 Sep 2014 03:00:07 +0000 (04:00 +0100)]
gallium/r300: remove obsolete declaration

The definition of rc_pair_regalloc_inputs_only() is no longer
around so drop the declaration.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Matt Turner <mattst88@gmail.com>
10 years agovc4: Drop maximum number of varyings down to 8.
Eric Anholt [Wed, 24 Sep 2014 00:25:43 +0000 (17:25 -0700)]
vc4: Drop maximum number of varyings down to 8.

There are only 32 bits in the flatshade flags (which are 1 bit per
component), the simulator crashes when you use more than about this many
varyings, and the original Broadcom code drop only exposed 8 as well.

Fixes 26 piglit tests in the varying-packing group, and makes many others
go from crash to fail (due to not checking their varying counts and
treating link failures as failures).  Regresses ARB_fp/minmax (due to 8
varyings instead of 10).

10 years agovc4: Add support for flat shading.
Eric Anholt [Tue, 23 Sep 2014 22:27:55 +0000 (15:27 -0700)]
vc4: Add support for flat shading.

This is just the GL 1.1 flat shading of colors -- we don't need to support
TGSI constant interpolation bits, because we don't do GLSL 1.30.

Fixes 7 piglit tests.

10 years agovc4: Drop stale comment.
Eric Anholt [Fri, 19 Sep 2014 23:53:16 +0000 (16:53 -0700)]
vc4: Drop stale comment.

This should have been in 001247d230f022fffac68f4578348087a53d3940.

10 years agoutil: fix SCons build
Brian Paul [Tue, 23 Sep 2014 22:31:57 +0000 (16:31 -0600)]
util: fix SCons build

after register_allocate.c was moved to util/ directory.

10 years agovc4: Put dead writes into the NOP register when generating code.
Eric Anholt [Tue, 23 Sep 2014 20:20:29 +0000 (13:20 -0700)]
vc4: Put dead writes into the NOP register when generating code.

They still provide register pressure since I haven't made a special class
for them, but since they're only live for one instruction it probably
doesn't matter.

This improves the readability of QPU assembly.

10 years agovc4: When possible, resolve raddr conflicts by swapping files on specials.
Eric Anholt [Tue, 23 Sep 2014 19:56:54 +0000 (12:56 -0700)]
vc4: When possible, resolve raddr conflicts by swapping files on specials.

Cleans up a bunch of ugliness in perspective interpolation.

10 years agovc4: Fix overzealous raddr conflict resolution.
Eric Anholt [Tue, 23 Sep 2014 19:50:05 +0000 (12:50 -0700)]
vc4: Fix overzealous raddr conflict resolution.

We only need to do the fixup when both args are in the same file, not just
when both are in physical registers.

10 years agovc4: Add support for 8-bit unorm/snorm vertex inputs.
Eric Anholt [Fri, 22 Aug 2014 22:02:52 +0000 (15:02 -0700)]
vc4: Add support for 8-bit unorm/snorm vertex inputs.

10 years agovc4: Add disasm for A-file unpack operations.
Eric Anholt [Fri, 22 Aug 2014 21:16:19 +0000 (14:16 -0700)]
vc4: Add disasm for A-file unpack operations.

The A-file unpack is just like R4 unpack, except that if you don't do a
floating-point operation it won't do float conversion (so int16 gets
scaled up to int32).

10 years agovc4: Switch to using Mesa's register allocator.
Eric Anholt [Mon, 22 Sep 2014 19:16:16 +0000 (12:16 -0700)]
vc4: Switch to using Mesa's register allocator.

This will let me more reliably allocate a-file registers, which are going
to be even more in demand when I start using a-file unpacks.

Also fixes a bug where the reservation of payload registers (FRAG_Z/W) was
off by one but just caused failure to register allocate at all if the
off-by-one was fixed.

10 years agovc4: Make a static list of all the registers.
Eric Anholt [Mon, 22 Sep 2014 18:42:22 +0000 (11:42 -0700)]
vc4: Make a static list of all the registers.

10 years agovc4: Switch the context struct to use ralloc.
Eric Anholt [Mon, 22 Sep 2014 19:38:24 +0000 (12:38 -0700)]
vc4: Switch the context struct to use ralloc.

I wanted to hang the ra_regs off it so I didn't have to free, but it
turned out it wasn't ralloced yet.

10 years agomesa: Move register_allocate.c to util.
Eric Anholt [Mon, 22 Sep 2014 19:24:21 +0000 (12:24 -0700)]
mesa: Move register_allocate.c to util.

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.

v2: Don't forget to delete the symlink in r300 (review by Matt).
    Delete more r300-helper references (review by Emil)
    Don't prefix util/ header inclusion with "util/" (review by Emil)

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v1)
10 years agogallivm: fix idiv
Roland Scheidegger [Tue, 23 Sep 2014 17:29:33 +0000 (19:29 +0200)]
gallivm: fix idiv

ffeb77c7b0552a8624e46e65d6347240ac5ae84d had a typo which turned all signed
integer divisions into unsigned ones. Oops.
This gets us back the 51 little piglits
(all from glsl built-in-functions, fs/vs/gs-op-div-int-ivec2 and similar).

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agoegl: extra null checks for get_xcb_screen() return values
Juha-Pekka Heikkila [Mon, 8 Sep 2014 12:03:35 +0000 (15:03 +0300)]
egl: extra null checks for get_xcb_screen() return values

verify get_xcb_screen() returned pointer before using it.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agometa: Fix error paths in meta_copy_image.c
Juha-Pekka Heikkila [Mon, 8 Sep 2014 10:59:50 +0000 (13:59 +0300)]
meta: Fix error paths in meta_copy_image.c

If _mesa_get_tex_image() return NULL there is already error
set in context. Other error pats free allocated texture.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agometa: Avoid null access on setup_glsl_msaa_blit_shader()
Juha-Pekka Heikkila [Mon, 8 Sep 2014 10:50:08 +0000 (13:50 +0300)]
meta: Avoid null access on setup_glsl_msaa_blit_shader()

On default fallback path there was null access on src_rb

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoi965: Add extra null check in intel_bufferobj_alloc()
Juha-Pekka Heikkila [Fri, 1 Aug 2014 11:38:17 +0000 (14:38 +0300)]
i965: Add extra null check in intel_bufferobj_alloc()

Check calloc returned requested memory.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agomesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()
Juha-Pekka Heikkila [Wed, 2 Jul 2014 17:50:42 +0000 (20:50 +0300)]
mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoglsl: Check realloc return value in ir_function::matching_signature()
Juha-Pekka Heikkila [Fri, 27 Jun 2014 13:16:20 +0000 (16:16 +0300)]
glsl: Check realloc return value in ir_function::matching_signature()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoloader: Check dlsym() did not fail in libudev_get_device_name_for_fd()
Juha-Pekka Heikkila [Fri, 27 Jun 2014 12:22:04 +0000 (15:22 +0300)]
loader: Check dlsym() did not fail in libudev_get_device_name_for_fd()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoglsl: Check calloc return value in link_intrastage_shaders()
Juha-Pekka Heikkila [Wed, 7 May 2014 13:20:12 +0000 (16:20 +0300)]
glsl: Check calloc return value in link_intrastage_shaders()

Check calloc return value while adding build-in functions.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoi965: Avoid null access in intelMakeCurrent()
Juha-Pekka Heikkila [Fri, 25 Apr 2014 12:20:36 +0000 (15:20 +0300)]
i965: Avoid null access in intelMakeCurrent()

separate two null checks connected with && to their own if branches.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agomesa: add null checks in symbol_table.c
Juha-Pekka Heikkila [Tue, 25 Feb 2014 13:24:34 +0000 (15:24 +0200)]
mesa: add null checks in symbol_table.c

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoglsl: add missing null check in tfeedback_decl::init()
Juha-Pekka Heikkila [Wed, 26 Feb 2014 14:32:14 +0000 (16:32 +0200)]
glsl: add missing null check in tfeedback_decl::init()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoi965: in set_read_rb_tex_image() check _mesa_meta_bind_rb_as_tex_image() did succeed
Juha-Pekka Heikkila [Wed, 28 May 2014 10:28:58 +0000 (13:28 +0300)]
i965: in set_read_rb_tex_image() check _mesa_meta_bind_rb_as_tex_image() did succeed

Check if _mesa_meta_bind_rb_as_tex_image() did give the texture.
If no texture was given there is already either
GL_INVALID_VALUE or GL_OUT_OF_MEMORY error set in context.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
10 years agoglsl: Fix memory leak in glsl_lexer.ll
Juha-Pekka Heikkila [Wed, 3 Sep 2014 13:38:31 +0000 (16:38 +0300)]
glsl: Fix memory leak in glsl_lexer.ll

Running fast clear glClear with SNB caused Valgrind to
complain about this.

v2: line 237 fixed glClear from leaking memory, other
strdups are also now changed to ralloc_strdups but I
don't know what effect those have. At least no changes in
my Piglit quick run.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoilo: rework pipeline workarounds
Chia-I Wu [Mon, 22 Sep 2014 15:59:53 +0000 (23:59 +0800)]
ilo: rework pipeline workarounds

Add current_pipe_control_dw1 and deferred_pipe_control_dw1 to track what have
been done since lsat 3DPRIMITIVE and what need to be done before next
3DPRIMITIVE.  Based on them, we can emit WAs more smartly.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: remove handle_invalid_batch_bo()
Chia-I Wu [Mon, 22 Sep 2014 15:32:18 +0000 (23:32 +0800)]
ilo: remove handle_invalid_batch_bo()

It was used to set has_gen6_wa_pipe_control to false when the batch buffer
changed.  When called from emit_flush() and others, it also unset
ILO_3D_PIPELINE_INVALIDATE_BATCH_BO so that the following emit_draw() will not
set has_gen6_wa_pipe_control to false again.  It sounded error-prone and was
just ugly.

We should be able to achieve the same goal by reset has_gen6_wa_pipe_control
in ilo_3d_pipeline_invalidate().  With handle_invalid_batch_bo() gone, the
emit functions can also be inlined.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: make gen6_pipeline_update_max_svbi() static
Chia-I Wu [Mon, 22 Sep 2014 07:13:23 +0000 (15:13 +0800)]
ilo: make gen6_pipeline_update_max_svbi() static

We do not need to call it from GEN7 pipeline anymore since software
PIPE_QUERY_PRIMITIVES_EMITTED is gone.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agofreedreno/ir3: add TXB2 support
Ilia Mirkin [Tue, 16 Sep 2014 23:56:31 +0000 (19:56 -0400)]
freedreno/ir3: add TXB2 support

Handles texture(samplerCubeShadow, bias), part of GLES3 and GL3

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/ir3: add TXQ support
Ilia Mirkin [Tue, 16 Sep 2014 06:09:50 +0000 (02:09 -0400)]
freedreno/ir3: add TXQ support

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/ir3: fix TXB/TXL to actually pull the bias/lod argument
Ilia Mirkin [Tue, 16 Sep 2014 06:09:49 +0000 (02:09 -0400)]
freedreno/ir3: fix TXB/TXL to actually pull the bias/lod argument

Previously we would get a potentially computed post-swizzle coord based
on the texture target info, which would not include the bias/lod in the
last argument.

The second argument does not have to be adjacent, so adjusting the order
array did not make sense.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/ir3: make texture instruction construction more dynamic
Ilia Mirkin [Tue, 16 Sep 2014 06:09:48 +0000 (02:09 -0400)]
freedreno/ir3: make texture instruction construction more dynamic

This will make life a lot easier as we add support for additional
instructions.

v2: shadow reference value is always .z or .w

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoi915: Fix black buffers when importing prime fds
Andreas Pokorny [Wed, 27 Aug 2014 07:36:16 +0000 (09:36 +0200)]
i915: Fix black buffers when importing prime fds

Width and Height of the imported image was never initialized from the
imported bo.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
10 years agoegl/drm: expose KHR_image_pixmap extension
Andreas Pokorny [Wed, 3 Sep 2014 20:43:41 +0000 (22:43 +0200)]
egl/drm: expose KHR_image_pixmap extension

This changes enables EGL_KHR_image_pixmap in the egl drm platform, which is implemented
there but has not been advertised yet.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
10 years agogallium: update comment for enum pipe_format
Brian Paul [Sat, 20 Sep 2014 14:32:39 +0000 (08:32 -0600)]
gallium: update comment for enum pipe_format

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agogallium: replace pipe_type enum with tgsi_return_type enum
Brian Paul [Sat, 20 Sep 2014 14:32:39 +0000 (08:32 -0600)]
gallium: replace pipe_type enum with tgsi_return_type enum

The only place the enum pipe_type was used is for the TGSI sampler
view return type.  So make it a TGSI type.  Note: it appears this
part of TGSI isn't used by anyone so it may be removed in the future.

v2: the new name is tgsi_return_type, not tgsi_type.  This means we
can drop the previously posted tgsi_type -> tgsi_opcode_type patch.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agodraw: use new tgsi_transform inst/decl helpers in pstipple code
Brian Paul [Mon, 22 Sep 2014 15:32:04 +0000 (09:32 -0600)]
draw: use new tgsi_transform inst/decl helpers in pstipple code

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agodraw: use new tgsi_transform inst/decl helpers in aapoint code
Brian Paul [Mon, 22 Sep 2014 15:31:26 +0000 (09:31 -0600)]
draw: use new tgsi_transform inst/decl helpers in aapoint code

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agodraw: use new tgsi_transform inst/decl helpers in aaline code
Brian Paul [Mon, 22 Sep 2014 15:29:29 +0000 (09:29 -0600)]
draw: use new tgsi_transform inst/decl helpers in aaline code

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agotgsi: add inst/decl helpers for tgsi_transform utility
Brian Paul [Mon, 22 Sep 2014 15:29:08 +0000 (09:29 -0600)]
tgsi: add inst/decl helpers for tgsi_transform utility

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agodraw: use tgsi transform prolog callback in polygon stipple code
Brian Paul [Fri, 19 Sep 2014 19:24:20 +0000 (13:24 -0600)]
draw: use tgsi transform prolog callback in polygon stipple code

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agodraw: use tgsi transform prolog/epilog callbacks in AA line code
Brian Paul [Fri, 19 Sep 2014 19:19:21 +0000 (13:19 -0600)]
draw: use tgsi transform prolog/epilog callbacks in AA line code

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agodraw: use tgsi transform prolog/epilog callbacks in AA point code
Brian Paul [Fri, 19 Sep 2014 19:12:59 +0000 (13:12 -0600)]
draw: use tgsi transform prolog/epilog callbacks in AA point code

This simplifies the code and makes it a little easier to understand.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agotgsi: fix tgsi transform's epilog callback
Brian Paul [Fri, 19 Sep 2014 19:11:58 +0000 (13:11 -0600)]
tgsi: fix tgsi transform's epilog callback

We want to call the caller's epilog callback when we find the TGSI
END instruction, not after it.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agotgsi: add prolog() method to tgsi_transform_context
Brian Paul [Fri, 14 Mar 2014 20:49:33 +0000 (14:49 -0600)]
tgsi: add prolog() method to tgsi_transform_context

Called when the user can insert new decls, instructions.
This could be used in a few places in the 'draw' module.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agoglsl: use ptrdiff_t cast to silence g++ sign warning
Brian Paul [Sat, 20 Sep 2014 14:32:39 +0000 (08:32 -0600)]
glsl: use ptrdiff_t cast to silence g++ sign warning

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/fs: Remove direct fs_visitor brw_wm_prog_key dependence
Jordan Justen [Fri, 29 Aug 2014 19:50:46 +0000 (12:50 -0700)]
i965/fs: Remove direct fs_visitor brw_wm_prog_key dependence

Instead we store a void pointer to the key, and cast it to
brw_wm_prog_key for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoi965/fs: Use brw_sampler_prog_key_data instead of brw_wm_prog_key::tex
Jordan Justen [Sat, 6 Sep 2014 18:48:46 +0000 (11:48 -0700)]
i965/fs: Use brw_sampler_prog_key_data instead of brw_wm_prog_key::tex

This helps:
1. Reduce the need to have fs_visitor::key's type be brw_wm_prog_key*
2. Align the code to allow brw_sampler_prog_key_data to be pulled out of other
   prog_key types for different stages.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoi965/fs: Remove direct fs_visitor brw_wm_prog_data dependence
Jordan Justen [Fri, 29 Aug 2014 19:50:46 +0000 (12:50 -0700)]
i965/fs: Remove direct fs_visitor brw_wm_prog_data dependence

Instead we store a brw_stage_prog_data pointer, and cast it to
brw_wm_prog_data for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoclover: Add support to mem objects for multiple destructor callbacks v2
Tom Stellard [Mon, 22 Sep 2014 14:00:39 +0000 (10:00 -0400)]
clover: Add support to mem objects for multiple destructor callbacks v2

The spec says that mem objects should maintain a stack of callbacks
not just one.

v2:
  - Remove stray printf.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
CC: "10.3" <mesa-stable@lists.freedesktop.org>
10 years agost/xa: silence unused variable warning
Brian Paul [Thu, 18 Sep 2014 16:22:20 +0000 (10:22 -0600)]
st/xa: silence unused variable warning

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotarget-helpers: add inline qualifier on configuration_query()
Brian Paul [Thu, 18 Sep 2014 16:21:00 +0000 (10:21 -0600)]
target-helpers: add inline qualifier on configuration_query()

To silence unused function warnings.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoilo: clean up fallback path for primitive restart
Chia-I Wu [Mon, 22 Sep 2014 05:46:13 +0000 (13:46 +0800)]
ilo: clean up fallback path for primitive restart

We should be able to draw with the index buffer mapped.  That simplifies
things a lot.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: handle conditional rendering in the context
Chia-I Wu [Mon, 22 Sep 2014 04:34:05 +0000 (12:34 +0800)]
ilo: handle conditional rendering in the context

Conditional rendering is not limited to draw_vbo().  Move the support to
ilo_context, and replace ilo_3d_pass_render_condition() by
ilo_skip_rendering().

10 years agoilo: create the pipeline from the builder
Chia-I Wu [Mon, 22 Sep 2014 03:41:53 +0000 (11:41 +0800)]
ilo: create the pipeline from the builder

The pipeline needs just the builder to build commands.  It does not need CP.

10 years agoilo: move aperture checks out of pipeline
Chia-I Wu [Mon, 22 Sep 2014 02:46:15 +0000 (10:46 +0800)]
ilo: move aperture checks out of pipeline

They can be done outside of the pipeline.  Move them and let the pipeline
focus on building commands.

10 years agoilo: flush before setting SOL_RESET
Chia-I Wu [Mon, 22 Sep 2014 02:35:59 +0000 (10:35 +0800)]
ilo: flush before setting SOL_RESET

SOL_RESET happens before bo execution.  It should not be observed by the
commands that are already in the bo.

Move the code out of the pipeline now that it submits.

10 years agoilo: move size estimation check out of pipeline
Chia-I Wu [Mon, 22 Sep 2014 02:12:06 +0000 (10:12 +0800)]
ilo: move size estimation check out of pipeline

It can be done outside of the pipeline.  Let's move it.

10 years agofreedreno/a3xx: more texture array fixes
Rob Clark [Sat, 13 Sep 2014 20:14:17 +0000 (16:14 -0400)]
freedreno/a3xx: more texture array fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: add DRM_CONF_SHARE_FD
Rob Clark [Tue, 16 Sep 2014 23:10:23 +0000 (19:10 -0400)]
freedreno: add DRM_CONF_SHARE_FD

And config query and DRM_CONF_SHARE_FD to both mega-driver and
traditional build configs, so that EGL_EXT_image_dma_buf_import
works.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoilo: use a single list for queries
Chia-I Wu [Sun, 21 Sep 2014 15:02:55 +0000 (23:02 +0800)]
ilo: use a single list for queries

We used different lists for different types of queries because we wanted to
update software queries quickly.  Now that there is no software queries, we
are fine with a single list.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: replace software queries by hardware ones
Chia-I Wu [Sun, 21 Sep 2014 14:39:16 +0000 (22:39 +0800)]
ilo: replace software queries by hardware ones

Read PIPE_QUERY_PRIMITIVES_GENERATED and PIPE_QUERY_PRIMITIVES_EMITTED from
hardware registers.  Because all queries now have a bo, remove unnecessary
checks for q->bo.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: support prim queries in ilo_3d_pipeline_emit_query()
Chia-I Wu [Sun, 21 Sep 2014 14:33:50 +0000 (22:33 +0800)]
ilo: support prim queries in ilo_3d_pipeline_emit_query()

Add support for PIPE_QUERY_PRIMITIVES_GENERATED and
PIPE_QUERY_PRIMITIVES_EMITTED in ilo_3d_pipeline_emit_query().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: add ilo_3d_pipeline_emit_query()
Chia-I Wu [Sun, 21 Sep 2014 13:15:39 +0000 (21:15 +0800)]
ilo: add ilo_3d_pipeline_emit_query()

It replaces

  ilo_3d_pipeline_emit_write_timestamp(),
  ilo_3d_pipeline_emit_write_depth_count(), and
  ilo_3d_pipeline_emit_write_statistics().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: rework query support
Chia-I Wu [Sat, 20 Sep 2014 05:23:01 +0000 (13:23 +0800)]
ilo: rework query support

This fixes some corner cases, but more importantly, the new code should be
easier to reason about.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: clarify cp owning/releasing
Chia-I Wu [Sun, 21 Sep 2014 03:25:26 +0000 (11:25 +0800)]
ilo: clarify cp owning/releasing

Make it own()'s responsibility to make room for release() and itself.  To be
able to do that, allow ilo_cp_submit() in own().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
10 years agoilo: add a pointer to builder in ilo_3d_pipeline
Chia-I Wu [Sat, 20 Sep 2014 03:41:01 +0000 (11:41 +0800)]
ilo: add a pointer to builder in ilo_3d_pipeline

It saves quite some typings.

10 years agoilo: add a helper for RECTLIST blitter
Chia-I Wu [Sat, 20 Sep 2014 03:21:20 +0000 (11:21 +0800)]
ilo: add a helper for RECTLIST blitter

Add ilo_3d_draw_rectlist() for use by RECTLIST blitter.

10 years agoilo: no direct ilo_context access in BLT blitter
Chia-I Wu [Sat, 20 Sep 2014 02:55:21 +0000 (10:55 +0800)]
ilo: no direct ilo_context access in BLT blitter

We need ilo_builder for command building and ilo_cp for size check.
ilo_context is not used.

10 years agoilo: fix headers in Makefile.sources
Chia-I Wu [Sat, 20 Sep 2014 03:00:58 +0000 (11:00 +0800)]
ilo: fix headers in Makefile.sources

10 years agoilo: add a new struct for context states
Chia-I Wu [Fri, 19 Sep 2014 16:46:35 +0000 (00:46 +0800)]
ilo: add a new struct for context states

Move pipe states in ilo_context to the new ilo_state_vector.  The motivation
is that ilo_context consists of several loosely related things.  When we need
an ilo_context somewhere, we usually need only one or two of the things in it.
This change makes ilo_state_vector one such thing.

An immediate result is that we no longer need ilo_context in 3D pipelines,
something we have planned for since early days.

10 years agoilo: merge ilo_gpe.h to ilo_state*.h
Chia-I Wu [Fri, 19 Sep 2014 16:34:47 +0000 (00:34 +0800)]
ilo: merge ilo_gpe.h to ilo_state*.h

Move the #define's and struct's to ilo_state.h.  Move the inline functions and
function declarations to ilo_state_gen.h.

10 years agoilo: rename ilo_gpe_gen*.[ch]
Chia-I Wu [Fri, 19 Sep 2014 16:30:52 +0000 (00:30 +0800)]
ilo: rename ilo_gpe_gen*.[ch]

Rename them to ilo_state_gen*.[ch].

10 years agoilo: make ilo_fence opaque
Chia-I Wu [Fri, 19 Sep 2014 16:59:20 +0000 (00:59 +0800)]
ilo: make ilo_fence opaque

It is manipulated only in ilo_screen.c.

10 years agoi965/gen6: Enable GL 3.3 and GLSL 3.30
Chris Forbes [Fri, 19 Sep 2014 22:39:37 +0000 (10:39 +1200)]
i965/gen6: Enable GL 3.3 and GLSL 3.30

Tested on my snb-gt2:

4 tests skip->pass in spec/EXT_texture_array
51 tests skip->pass in spec.glsl-3.30
4 tests skip->pass in spec/!OpenGL 3.3
No regressions; no skip->fail changes.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
10 years agogallivm: add information about different sampler/view units if analyzing shader
Roland Scheidegger [Fri, 19 Sep 2014 17:11:22 +0000 (19:11 +0200)]
gallivm: add information about different sampler/view units if analyzing shader

Useful to know in some cases.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
10 years agodocs: Add 10.3 sha256 sums, news item and link release notes
Emil Velikov [Fri, 19 Sep 2014 19:01:04 +0000 (20:01 +0100)]
docs: Add 10.3 sha256 sums, news item and link release notes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 18571edea8f444fc6b4ed2b38f945f0ac533f384)

Conflicts:
docs/index.html
docs/relnotes.html

10 years agodocs: Update 10.3 release notes
Emil Velikov [Fri, 19 Sep 2014 18:42:09 +0000 (19:42 +0100)]
docs: Update 10.3 release notes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1b12af300dfa77c24088780e88200703653293d3)

10 years agodocs: Add sha256 sums for the 10.2.8 release
Emil Velikov [Fri, 19 Sep 2014 18:01:42 +0000 (19:01 +0100)]
docs: Add sha256 sums for the 10.2.8 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit f95fcb17163a47674a89d2ab58cd5b2547a94720)

10 years agoAdd release notes for the 10.2.8 release
Emil Velikov [Fri, 19 Sep 2014 17:41:57 +0000 (18:41 +0100)]
Add release notes for the 10.2.8 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 1e2b4120f705b8258da8cbc31bdb9fbfcd118603)

10 years agost/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables
Marek Olšák [Wed, 17 Sep 2014 12:08:33 +0000 (14:08 +0200)]
st/dri: remove GALLIUM_MSAA and __GL_FSAA_MODE environment variables

Some users don't understand that these variables can break OpenGL.
The general is rule is that if an app supports MSAA, you mustn't use
GALLIUM_MSAA.

For example, if an app has an 8xMSAA FBO and GALLIUM_MSAA=4
is set, resolving the FBO to the back buffer will be rejected which will look
like this on all gallium drivers:

http://www.phoronix.com/scan.php?page=article&item=amd_radeonsi_msaa

The environment variables also have no effect on modern apps like TF2, but
there is still a performance hit due to wasted bandwidth and VRAM.

In a nutshell, it does more harm than good.

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agovc4: Fix perspective interpolation.
Eric Anholt [Fri, 19 Sep 2014 17:09:55 +0000 (10:09 -0700)]
vc4: Fix perspective interpolation.

Fixes the mesa reflect demo and 6 tests under interpolation/

10 years agovc4: Use the same method as for FRAG_Z to handle fragcoord W.
Eric Anholt [Fri, 19 Sep 2014 17:06:49 +0000 (10:06 -0700)]
vc4: Use the same method as for FRAG_Z to handle fragcoord W.

I need to get the non-reciprocal version of W for interpolation, anyway.

10 years agoutil: don't try to emit half-float intrinsics if avx isn't available
Roland Scheidegger [Fri, 19 Sep 2014 14:56:04 +0000 (16:56 +0200)]
util: don't try to emit half-float intrinsics if avx isn't available

These instructions only have vex encodings, thus they can't be used without
avx. (Technically, one can still use avx-128 if avx isn't available because
the environment doesn't store the ymm registers, however I don't think llvm
can.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>