mesa.git
9 years agodri/common: Drop unused mmio.h.
Matt Turner [Sun, 7 Dec 2014 05:02:05 +0000 (21:02 -0800)]
dri/common: Drop unused mmio.h.

Unused since commit 7550a24f.

9 years agoglapi/gen: Add KHR_context_flush_control.xml to distribution.
Matt Turner [Sun, 7 Dec 2014 04:36:32 +0000 (20:36 -0800)]
glapi/gen: Add KHR_context_flush_control.xml to distribution.

9 years agoconfigure.ac: Drop generating egl-static and gbm Makefiles.
Matt Turner [Sun, 7 Dec 2014 04:34:10 +0000 (20:34 -0800)]
configure.ac: Drop generating egl-static and gbm Makefiles.

9 years agoutil: Add headers and python scripts for distribution.
Matt Turner [Sun, 7 Dec 2014 04:21:20 +0000 (20:21 -0800)]
util: Add headers and python scripts for distribution.

9 years agoglapi: Make mapi/glapi/gen before mapi to avoid distcheck problem.
Matt Turner [Sun, 7 Dec 2014 04:18:51 +0000 (20:18 -0800)]
glapi: Make mapi/glapi/gen before mapi to avoid distcheck problem.

9 years agor200: Avoid out of bounds array access.
Matt Turner [Sun, 7 Dec 2014 07:04:53 +0000 (23:04 -0800)]
r200: Avoid out of bounds array access.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agovc4: Fix referencing of sync objects.
Eric Anholt [Fri, 12 Dec 2014 08:06:21 +0000 (00:06 -0800)]
vc4: Fix referencing of sync objects.

While the pipe_reference_* helpers set the pointer, a bare pipe_reference
doesn't.   Fixes 5 ARB_sync tests.

9 years agoutil: Unbreak usage of assert()/debug_assert() inside expressions.
José Fonseca [Fri, 12 Dec 2014 14:06:17 +0000 (14:06 +0000)]
util: Unbreak usage of assert()/debug_assert() inside expressions.

f0ba7d897d1c22202531acb70f134f2edc30557d made debug_assert()/assert()
unsafe for expressions, but only now that u_atomic.h started to rely on
them for Windows that this became an issue.

This fixes non-debug builds with MSVC.
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agovc4: Consider FS backface color loads as color inputs as well.
Eric Anholt [Fri, 12 Dec 2014 05:28:12 +0000 (21:28 -0800)]
vc4: Consider FS backface color loads as color inputs as well.

This fixes flatshading of backface color in 4 of the piglit interpolation
tests.

9 years agovc4: Drop redundant index size setting.
Eric Anholt [Fri, 12 Dec 2014 04:34:57 +0000 (20:34 -0800)]
vc4: Drop redundant index size setting.

This is already done at set_index_buffer() time.

9 years agovc4: Don't throw out the index offset in the shadow index buffer path.
Eric Anholt [Fri, 12 Dec 2014 04:34:06 +0000 (20:34 -0800)]
vc4: Don't throw out the index offset in the shadow index buffer path.

When we upload shadow indices at draw time, we need the source offset.
Fixes the piglit draw-elements test.

9 years agovc4: Fix triangle-guardband-viewport piglit test.
Eric Anholt [Fri, 12 Dec 2014 04:11:21 +0000 (20:11 -0800)]
vc4: Fix triangle-guardband-viewport piglit test.

The original Broadcom driver also did this with the viewport.

9 years agovc4: Fix a memory leak in setting up QPU instructions for scheduling.
Eric Anholt [Fri, 12 Dec 2014 03:56:42 +0000 (19:56 -0800)]
vc4: Fix a memory leak in setting up QPU instructions for scheduling.

9 years agoi965/gen8+: Remove false perf debug message about MOCS
Ben Widawsky [Thu, 11 Dec 2014 20:40:20 +0000 (12:40 -0800)]
i965/gen8+: Remove false perf debug message about MOCS

We support MOCS on both gen8 and gen9, so the message seems meaningless. Remove
it to avoid confusion.

Trivial.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/gen8: Check correct number of blitter dwords
Ben Widawsky [Thu, 11 Dec 2014 04:00:51 +0000 (20:00 -0800)]
i965/gen8: Check correct number of blitter dwords

The odds of having this patch make a difference on Gen8+ are probably very low.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-but-not-tested-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agomesa/drivers: Add missing mesautil lib to Haiku swrast
Alexander von Gluck IV [Thu, 11 Dec 2014 03:28:50 +0000 (03:28 +0000)]
mesa/drivers: Add missing mesautil lib to Haiku swrast

* Resolves missing util_format_linear_to_srgb_8unorm_table symbol.

9 years agodraw: simplify prim id insertion in prim assembler
Roland Scheidegger [Wed, 10 Dec 2014 02:09:17 +0000 (03:09 +0100)]
draw: simplify prim id insertion in prim assembler

Because all topologies are reduced to basic primitives (i.e. no strips, fans)
and the vertices involved are all copied, there's no need for any elaborate
decisions where to insert the prim id. The logic employed was correct for
first provoking vertex, but didn't account at all for the last provoking
vertex case. And since we now will get the right constant value even if the
primitive type is later changed (for unfilled etc.) this is no longer
required to pass certain tests (which were checking for prim_id == some
const interpolated value so passing because both were wrong in the end).
This is a bit overkill (3x4 values assigned in total even though it's really
one scalar per prim...) but the code is now much easier and I don't need to
add more cases for last provoking vertex.

This fixes piglit primitive-id-no-gs-strip test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodraw: fix another decompose bug affecting constant interpolated attributes
Roland Scheidegger [Wed, 10 Dec 2014 18:39:19 +0000 (19:39 +0100)]
draw: fix another decompose bug affecting constant interpolated attributes

Previously the first provoking vertex convention would only be used if
flatshading were enabled. No matter how I look at it that cannot be possibly
correct. Maybe the code getting used was somewhat simpler that way at a time
where there weren't constant interpolated attributes, only flatshading...
(Note that all other places including the decomposition macros already do
the same.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodraw: fix flatshade stage for constant interpolated values
Roland Scheidegger [Wed, 10 Dec 2014 19:07:25 +0000 (20:07 +0100)]
draw: fix flatshade stage for constant interpolated values

This stage only worked for traditional old-school flatshading, it did ignore
constant interpolated values and only handled colors, the code probably
predates using of constant interpolated values in gallium. So fix this - the
clip stage apparently did this a long time ago already.
Unfortunately this also means the stage needs to be invoked when flatshading
isn't enabled but some other prim changing stages are - for instance with
fill mode line each of the 3 lines in a tri should get the same attribute
value from the leading vertex in the original tri if interpolation is constant,
which did not happen before
Due to that, the stage is now run in more cases, even unnecessary ones. Could
in theory skip it completely if there aren't any constant interpolated
attributes (and rast->flatshade isn't set), but not sure it's worth bothering,
as it looks kinda complicated getting this information in advance.

No piglit change (doesn't really cover this directly).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodraw: copy over prim id header in flatshade stage when emitting lines
Roland Scheidegger [Wed, 10 Dec 2014 19:01:27 +0000 (20:01 +0100)]
draw: copy over prim id header in flatshade stage when emitting lines

Just like we do for tris (det shouldn't matter at this point, however
can have flags for things like line stipple reset).

No piglit change, it would fail line stippling tests if the flatshade
stage were run, which will happen with the next commit.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallium/docs: clarify fragment shader position input w component.
Roland Scheidegger [Mon, 8 Dec 2014 18:07:10 +0000 (19:07 +0100)]
gallium/docs: clarify fragment shader position input w component.

The previous language was a bit misleading, since it sounded like
w was interpolated then the reciprocal calculated which isn't what
should be happening.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agodocs/relnotes: document the removal of GALLIUM_MSAA
Marek Olšák [Wed, 10 Dec 2014 18:59:53 +0000 (19:59 +0100)]
docs/relnotes: document the removal of GALLIUM_MSAA

Cc: 10.2.10.3 10.4 <mesa-stable@lists.freedesktop.org>
9 years agoradeonsi: take into account NULL colorbuffers when computing CB_TARGET_MASK
Marek Olšák [Mon, 8 Dec 2014 14:58:42 +0000 (15:58 +0100)]
radeonsi: take into account NULL colorbuffers when computing CB_TARGET_MASK

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: only emit line stippling and provoking vertex state when it changes
Marek Olšák [Mon, 8 Dec 2014 12:35:36 +0000 (13:35 +0100)]
radeonsi: only emit line stippling and provoking vertex state when it changes

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: fix SPI state dependency on sprite_coord_enable
Marek Olšák [Mon, 8 Dec 2014 11:51:59 +0000 (12:51 +0100)]
radeonsi: fix SPI state dependency on sprite_coord_enable

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: fix line stippling and provoking vertex state for GS primitives
Marek Olšák [Mon, 8 Dec 2014 11:41:37 +0000 (12:41 +0100)]
radeonsi: fix line stippling and provoking vertex state for GS primitives

I'm not sure if GS hw outputs line lists or line strips.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: emit DRAW_PREAMBLE only if it changes
Marek Olšák [Sun, 7 Dec 2014 19:23:56 +0000 (20:23 +0100)]
radeonsi: emit DRAW_PREAMBLE only if it changes

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove setting of VGT_DISPATCH_DRAW_INDEX
Marek Olšák [Mon, 8 Dec 2014 14:17:20 +0000 (15:17 +0100)]
radeonsi: remove setting of VGT_DISPATCH_DRAW_INDEX

It's used only if VGT_SHADER_STAGES_EN.DISPATCH_DRAW_EN is 1, which we don't
set.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: emit GS_OUT_PRIM_TYPE only if it changes
Marek Olšák [Sun, 7 Dec 2014 19:15:49 +0000 (20:15 +0100)]
radeonsi: emit GS_OUT_PRIM_TYPE only if it changes

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: emit primitive restart only if it changes
Marek Olšák [Sun, 7 Dec 2014 19:14:41 +0000 (20:14 +0100)]
radeonsi: emit primitive restart only if it changes

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: emit base vertex and start instance only if they change
Marek Olšák [Sun, 7 Dec 2014 19:04:40 +0000 (20:04 +0100)]
radeonsi: emit base vertex and start instance only if they change

v2: added a helper function for invalidation of the sh constants

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: emit clip registers only if VS, GS, or rasterizer is changed
Marek Olšák [Sun, 7 Dec 2014 18:40:44 +0000 (19:40 +0100)]
radeonsi: emit clip registers only if VS, GS, or rasterizer is changed

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: get info about VS outputs from tgsi_shader_info
Marek Olšák [Sun, 7 Dec 2014 18:30:08 +0000 (19:30 +0100)]
radeonsi: get info about VS outputs from tgsi_shader_info

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: move all shader-related functions to a new file si_state_shaders.c
Marek Olšák [Sun, 7 Dec 2014 16:53:56 +0000 (17:53 +0100)]
radeonsi: move all shader-related functions to a new file si_state_shaders.c

This huge amount of code deserves its own file.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: generate derived and draw-related registers directly in the CS
Marek Olšák [Sun, 7 Dec 2014 15:40:09 +0000 (16:40 +0100)]
radeonsi: generate derived and draw-related registers directly in the CS

The big function is split into 3 smaller functions.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: si_conv_pipe_prim shouldn't fail
Marek Olšák [Sun, 7 Dec 2014 15:02:07 +0000 (16:02 +0100)]
radeonsi: si_conv_pipe_prim shouldn't fail

An assertion should suffice.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove useless variable si_context::pm4_dirty_cdwords
Marek Olšák [Sun, 7 Dec 2014 14:58:46 +0000 (15:58 +0100)]
radeonsi: remove useless variable si_context::pm4_dirty_cdwords

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove unused draw packet functions
Marek Olšák [Sun, 7 Dec 2014 14:53:01 +0000 (15:53 +0100)]
radeonsi: remove unused draw packet functions

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: emit draw packets directly into the CS
Marek Olšák [Sun, 7 Dec 2014 14:52:15 +0000 (15:52 +0100)]
radeonsi: emit draw packets directly into the CS

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add emit util functions for SH registers
Marek Olšák [Sun, 7 Dec 2014 14:48:40 +0000 (15:48 +0100)]
radeonsi: add emit util functions for SH registers

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agotgsi: add tgsi_shader_info::writes_clipvertex
Marek Olšák [Sun, 7 Dec 2014 18:20:10 +0000 (19:20 +0100)]
tgsi: add tgsi_shader_info::writes_clipvertex

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agotgsi: add clip and cull distance writemasks into tgsi_shader_info
Marek Olšák [Sun, 7 Dec 2014 18:08:28 +0000 (19:08 +0100)]
tgsi: add clip and cull distance writemasks into tgsi_shader_info

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agotgsi: add tgsi_shader_info::writes_psize
Marek Olšák [Sun, 7 Dec 2014 17:49:31 +0000 (18:49 +0100)]
tgsi: add tgsi_shader_info::writes_psize

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agocso: put cso_release_all into cso_destroy_context
Marek Olšák [Sun, 7 Dec 2014 13:21:41 +0000 (14:21 +0100)]
cso: put cso_release_all into cso_destroy_context

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoi965: Generate vs code using scalar backend for BDW+
Kristian Høgsberg [Tue, 21 Oct 2014 06:29:41 +0000 (23:29 -0700)]
i965: Generate vs code using scalar backend for BDW+

With everything in place, we can now use the scalar backend compiler for
vertex shaders on BDW+.  We make scalar vertex shaders the default on
BDW+ but add a new vec4vs debug option to force the vec4 backend.

No piglit regressions.

Performance impact is minimal, I see a ~1.5 improvement on the T-Rex
GLBenchmark case, but in general it's in the noise.  Some of our
internal synthetic, vs bounded benchmarks show great improvement, 20%-40%
in some cases, but real-world cases are mostly unaffected.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Clean up fs_visitor::run and rename to run_fs
Kristian Høgsberg [Tue, 28 Oct 2014 06:36:31 +0000 (23:36 -0700)]
i965: Clean up fs_visitor::run and rename to run_fs

Now that fs_visitor::run is back to being only fragment
shader compilation, we can clean up a few stage == MESA_SHADER_FRAGMENT
conditions and rename it to run_fs.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Add fs_visitor::run_vs() to generate scalar vertex shader code
Kristian Høgsberg [Tue, 28 Oct 2014 05:42:50 +0000 (22:42 -0700)]
i965: Add fs_visitor::run_vs() to generate scalar vertex shader code

This patch uses the previous refactoring to add a new run_vs() method
that generates vertex shader code using the scalar visitor and
optimizer.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Rename brw_vec4_prog_data/key to brw_bue_prog_data/key
Kristian Høgsberg [Tue, 25 Nov 2014 22:29:48 +0000 (14:29 -0800)]
i965: Rename brw_vec4_prog_data/key to brw_bue_prog_data/key

These structs aren't vec4 specific, they are shared by shader stages
operating on Vertex URB Entries (VUEs).  VUEs are the data structures in
the URB that hold vertex data between the pipeline geometry stages.
Using vue in the name instead of vec4 makes a lot more sense, especially
when we add scalar vertex shader support.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Prepare for using the ATTR register file in the fs backend
Kristian Høgsberg [Tue, 21 Oct 2014 06:16:48 +0000 (23:16 -0700)]
i965: Prepare for using the ATTR register file in the fs backend

The scalar vertex shader will use the ATTR register file for vertex
attributes.  This patch adds support for the ATTR file to fs_visitor.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Consolidate code to get struct brw_sampler_prog_key_data
Kristian Høgsberg [Tue, 21 Oct 2014 06:13:07 +0000 (23:13 -0700)]
i965: Consolidate code to get struct brw_sampler_prog_key_data

This chunk of code is repeated in a few places, and we're going to add
a MESA_SHADER_VERTEX case to it soon.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Add new SIMD8 VS prog data flag
Kristian Høgsberg [Tue, 21 Oct 2014 06:05:09 +0000 (23:05 -0700)]
i965: Add new SIMD8 VS prog data flag

This flag signals that we have a SIMD8 VS shader so we can set up the
corresponding state accordingly.  This boils down to setting
the BDW+ SIMD8 enable bit in 3DSTATE_VS and making UBO and pull
constant buffers use dword pitch.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Add SIMD8 URB write low-level IR instruction
Kristian Høgsberg [Tue, 21 Oct 2014 06:00:50 +0000 (23:00 -0700)]
i965: Add SIMD8 URB write low-level IR instruction

This is all we need from the generator for SIMD8 vertex shaders.  This
opcode is just the send instruction, all the hard work will happen
in the visitor using LOAD_PAYLOAD.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Remove shader program argument and member from fs_generator
Kristian Høgsberg [Tue, 28 Oct 2014 02:43:31 +0000 (19:43 -0700)]
i965: Remove shader program argument and member from fs_generator

Now that the caller passes in the shader debug name, we don't need this
anymore.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Set shader name for generator from call site
Kristian Høgsberg [Tue, 28 Oct 2014 02:40:47 +0000 (19:40 -0700)]
i965: Set shader name for generator from call site

fs_generator no longer knows what stage it's generating code for, so
we have to set the debug name of the shader from the call site.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Generalize fs_generator further
Kristian Høgsberg [Tue, 21 Oct 2014 05:53:31 +0000 (22:53 -0700)]
i965: Generalize fs_generator further

This removes all stage specific data from the generator, and lets us
create a generator for any stage.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Don't copy propagate constants from sources with saturate
Kristian Høgsberg [Tue, 28 Oct 2014 06:42:41 +0000 (23:42 -0700)]
i965: Don't copy propagate constants from sources with saturate

We don't propagate the saturate bit and some instructions can't
saturate at all.  If the source has saturate set, just skip propagation.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Replace 'noann' debug flag with 'ann'.
Matt Turner [Thu, 13 Nov 2014 18:40:01 +0000 (10:40 -0800)]
i965: Replace 'noann' debug flag with 'ann'.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965: Disable unlit-centroid workaround on Gen < 6.
Matt Turner [Tue, 9 Dec 2014 06:59:17 +0000 (22:59 -0800)]
i965: Disable unlit-centroid workaround on Gen < 6.

Back to the original commit (8313f444) adding the workaround, we were
enabling it on gens <= 7, even though gens <= 5 can't do multisampling.

I cannot find documentation that says that Sandybridge needs this
workaround but in practice disabling it causes these piglit tests to
fail:

EXT_framebuffer_multisample/interpolation {2,4} centroid-deriv{,-disabled}

On Ironlake:

total instructions in shared programs: 4358478 -> 4349671 (-0.20%)
instructions in affected programs:     117680 -> 108873 (-7.48%)

A bunch of shaders in TF2, Portal 2, and L4D2 are cut by 25~30%.

Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agohgl: traverse add-on entries
Adrien Destugues [Tue, 9 Dec 2014 21:38:46 +0000 (21:38 +0000)]
hgl: traverse add-on entries

* Allow using symlinks to add-ons when developing.

9 years agogallium/target: Haiku softpipe
Alexander von Gluck IV [Tue, 9 Dec 2014 21:30:32 +0000 (21:30 +0000)]
gallium/target: Haiku softpipe

* Use print macro to fix warning on 64-bit systems

9 years agogallium/aux: Avoid redefining MAX
Alexander von Gluck IV [Tue, 9 Dec 2014 21:05:03 +0000 (21:05 +0000)]
gallium/aux: Avoid redefining MAX

* Can be redefined on some platforms through u_debug.h

9 years agoclover: Use switch when creating kernel arguments.
Jan Vesely [Sat, 6 Dec 2014 00:05:30 +0000 (19:05 -0500)]
clover: Use switch when creating kernel arguments.

This way we get a warning if an enum value is not handled.

v2: codestyle

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agor600g: only init GS_VERT_ITEMSIZE on r600
Dave Airlie [Wed, 10 Dec 2014 03:48:29 +0000 (13:48 +1000)]
r600g: only init GS_VERT_ITEMSIZE on r600

On evergreen there are 4 regs, on r600/700 there is only one.

Don't initialise regs and trash someone elses state.

Not sure this fixes anything, but hey one less stupid.

Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
Cc: "10.3 10.4" mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agovc4: Do QPU scheduling across uniform loads.
Eric Anholt [Wed, 10 Dec 2014 02:54:29 +0000 (18:54 -0800)]
vc4: Do QPU scheduling across uniform loads.

This means another pass of reordering the uniform data store, but it lets
us pair up a lot more instructions.

total instructions in shared programs: 44639 -> 43176 (-3.28%)
instructions in affected programs:     36938 -> 35475 (-3.96%)

9 years agovc4: Populate the delay field better, and schedule high delay first.
Eric Anholt [Tue, 9 Dec 2014 22:05:52 +0000 (14:05 -0800)]
vc4: Populate the delay field better, and schedule high delay first.

This is a standard scheduling heuristic, and clearly helps.

total instructions in shared programs: 46418 -> 44467 (-4.20%)
instructions in affected programs:     42531 -> 40580 (-4.59%)

9 years agovc4: Skip raddr dependencies for 32-bit immediate loads.
Eric Anholt [Tue, 9 Dec 2014 22:23:39 +0000 (14:23 -0800)]
vc4: Skip raddr dependencies for 32-bit immediate loads.

These don't have raddr fields.

9 years agovc4: Mark VPM read setup as impacting VPM reads, not writes.
Eric Anholt [Tue, 9 Dec 2014 22:20:54 +0000 (14:20 -0800)]
vc4: Mark VPM read setup as impacting VPM reads, not writes.

Fixes assertion failures if we adjust scheduling priorities to emphasize
VPM reads more.

9 years agovc4: Refuse to merge instructions involving 32-bit immediate loads.
Eric Anholt [Wed, 10 Dec 2014 00:34:37 +0000 (16:34 -0800)]
vc4: Refuse to merge instructions involving 32-bit immediate loads.

An immediate load overwrites the mul and add operations, so you can't
merge with them.

9 years agoclover: Fix build after llvm r223802
Aaron Watry [Wed, 10 Dec 2014 01:28:50 +0000 (19:28 -0600)]
clover: Fix build after llvm r223802

Signed-off-by: Aaron Watry <awatry at gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agofreedreno/a4xx: frag-coord / face fixes
Rob Clark [Sun, 7 Dec 2014 19:12:15 +0000 (14:12 -0500)]
freedreno/a4xx: frag-coord / face fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: fix rendering to layer != 0
Rob Clark [Sun, 7 Dec 2014 17:10:38 +0000 (12:10 -0500)]
freedreno/a4xx: fix rendering to layer != 0

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: temp hack for FLAT varyings
Rob Clark [Sat, 6 Dec 2014 21:29:53 +0000 (16:29 -0500)]
freedreno/a4xx: temp hack for FLAT varyings

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3: lower TXP as needed
Rob Clark [Sat, 6 Dec 2014 20:24:23 +0000 (15:24 -0500)]
freedreno/ir3: lower TXP as needed

On a3xx, lower TXP for 3D textures, on a4xx lower all TXP.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: XA gpu hang at startup
Rob Clark [Sat, 6 Dec 2014 17:39:19 +0000 (12:39 -0500)]
freedreno/a4xx: XA gpu hang at startup

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/a4xx: texture fixes
Rob Clark [Fri, 5 Dec 2014 16:43:03 +0000 (11:43 -0500)]
freedreno/a4xx: texture fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: cleanup slice alignment/setup
Rob Clark [Thu, 4 Dec 2014 21:56:33 +0000 (16:56 -0500)]
freedreno: cleanup slice alignment/setup

Collapse things back into a setup_slices() which takes the desired
alignment as a param.  This gets things ready for a4xx which has some
slightly different requirements.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: update generated headers
Rob Clark [Fri, 5 Dec 2014 16:42:44 +0000 (11:42 -0500)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agotgsi/lowering: add support to lower TXP (v2)
Rob Clark [Sat, 6 Dec 2014 18:36:02 +0000 (13:36 -0500)]
tgsi/lowering: add support to lower TXP (v2)

v2: actually do perspective divide for RECT/SHADOWRECT

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agomesa: use build flag to ensure stack is realigned on x86
Timothy Arceri [Sat, 6 Dec 2014 13:09:40 +0000 (00:09 +1100)]
mesa: use build flag to ensure stack is realigned on x86

Nowadays GCC assumes stack pointer is 16-byte aligned even on 32-bits, but that is an assumption OpenGL drivers (or any dynamic library for that matter) can't afford to make as there are many closed- and open- source application binaries out there that only assume 4-byte stack alignment.

V4: fix comment and indentation

V3: move all sse4.1 build flag config to the same location
 and add comment as to why we need to do the realign

V2: use $target_cpu rather than $host_cpu
  and setup build flags in config rather than makefile

https://bugs.freedesktop.org/show_bug.cgi?id=86788
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Matt Turner <mattst88@gmail.com>
CC: "10.4" <mesa-stable@lists.freedesktop.org>
9 years agodraw: implement TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION
Marek Olšák [Mon, 17 Nov 2014 21:30:31 +0000 (22:30 +0100)]
draw: implement TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION

Required by Nine. Tested with util_run_tests.
It's added to softpipe, llvmpipe, and r300g/swtcl.

Tested-by: David Heidelberg <david@ixit.cz>
9 years agomain: return two minor digits for ES shading language version
Samuel Iglesias Gonsalvez [Wed, 26 Nov 2014 12:16:38 +0000 (13:16 +0100)]
main: return two minor digits for ES shading language version

For OpenGL ES 3.0 spec, the minor number for SHADING_LANGUAGE_VERSION is always
two digits, matching the OpenGL ES Shading Language Specification release
number. For example, this query might return the string "3.00".

This patch fixes the following dEQP test:

   dEQP-GLES3.functional.state_query.string.shading_language_version

No piglit regression observed.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoglsl: invariant qualifier is not valid for shader inputs in GLSL ES 3.00
Samuel Iglesias Gonsalvez [Tue, 25 Nov 2014 11:23:10 +0000 (12:23 +0100)]
glsl: invariant qualifier is not valid for shader inputs in GLSL ES 3.00

GLSL ES 3.00 spec, chapter 4.6.1 "The Invariant Qualifier",

    Only variables output from a shader can be candidates for invariance. This
    includes user-defined output variables and the built-in output variables.
    As only outputs can be declared as invariant, an invariant output from one
    shader stage will still match an input of a subsequent stage without the
    input being declared as invariant.

This patch fixes the following dEQP tests:

dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_interp_storage_precision
dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_interp_storage
dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_storage_precision
dEQP-GLES3.functional.shaders.qualification_order.variables.valid.invariant_storage
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_interp_storage_precision_invariant_input
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_interp_storage_invariant_input
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_storage_precision_invariant_input
dEQP-GLES3.functional.shaders.qualification_order.variables.invalid.invariant_storage_invariant_input

No piglit regressions observed.

v2:
- Add spec content in the code

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agomesa: Recompute LegalTypesMask if the GL API has changed
Iago Toral Quiroga [Tue, 2 Dec 2014 11:10:14 +0000 (12:10 +0100)]
mesa: Recompute LegalTypesMask if the GL API has changed

The current code computes ctx->Array.LegalTypesMask just once,
however, computing this needs to consider ctx->API so we need
to make sure that the API for that context has not changed if
we intend to reuse the result.

The context API can change, at least, if we go through
_mesa_meta_begin, since that will always force
API_OPENGL_COMPAT until we call _mesa_meta_end. If any
operation in between these two calls triggers a call to
update_array_format, then we might be caching a value for
LegalTypesMask that will not be right once we have called
_mesa_meta_end and restored the context API.

Fixes the following 179 dEQP tests in i965:
dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.*
dEQP-GLES3.functional.vertex_arrays.single_attribute.normalize.fixed.*
dEQP-GLES3.functional.vertex_arrays.single_attribute.output_types.fixed.*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_draw.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_draw.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_draw.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_copy.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_copy.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_copy.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.static_read.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.stream_read.*fixed*
dEQP-GLES3.functional.vertex_arrays.single_attribute.usages.dynamic_read.*fixed*
dEQP-GLES3.functional.vertex_arrays.multiple_attributes.input_types.3_*fixed2*
dEQP-GLES3.functional.draw.random.{2,18,28,68,83,106,109,156,181,191}

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Returns zero samples when querying GL_NUM_SAMPLE_COUNTS when internal format...
Eduardo Lima Mitev [Thu, 20 Nov 2014 13:52:35 +0000 (14:52 +0100)]
mesa: Returns zero samples when querying GL_NUM_SAMPLE_COUNTS when internal format is integer

From GL ES 3.0 specification, section 6.1.15 Internal Format Queries (page 236),
multisampling is not supported for signed and unsigned integer internal formats.

Fixes 19 dEQP tests under 'dEQP-GLES3.functional.state_query.internal_format.*'.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agomesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0
Eduardo Lima Mitev [Thu, 20 Nov 2014 13:02:46 +0000 (14:02 +0100)]
mesa: Enables GL_RGB and GL_RGBA unsized internal formats for OpenGL ES 3.0

GL_RGB and GL_RGBA are valid internal formats on a GLES3 profile. See
"Table 1. Unsized Internal Formats" at
https://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage2D.xhtml.

Fixes 2 dEQP tests:
- dEQP-GLES3.functional.state_query.internal_format.rgb_samples
- dEQP-GLES3.functional.state_query.internal_format.rgba_samples

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO invalidation...
Eduardo Lima Mitev [Tue, 18 Nov 2014 15:28:18 +0000 (16:28 +0100)]
mesa: Considers GL_DEPTH_STENCIL_ATTACHMENT a valid argument for FBO invalidation under GLES3

In OpenGL and OpenGL-ES 3+, GL_DEPTH_STENCIL_ATTACHMENT is a valid attachment point for the family of functions
that invalidate a framebuffer object (e.g, glInvalidateFramebuffer, glInvalidateSubFramebuffer, etc).
Currently, a GL_INVALID_ENUM error is emitted for this attachment point.

Fixes 21 dEQP test failures under 'dEQP-GLES3.functional.fbo.invalidate.*'.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agovc4: Reserve rb31 instead of r3 for raddr conflict spills.
Eric Anholt [Tue, 9 Dec 2014 00:52:53 +0000 (16:52 -0800)]
vc4: Reserve rb31 instead of r3 for raddr conflict spills.

This increases the cost of a raddr b conflict spill (save r3 to rb31, move
src1 to r3, move rb31 back to r3 when done, instead of just move src1 to
r3), but on average thanks to instruction pairing it's more worthwhile to
have another accumulator.

total instructions in shared programs: 46428 -> 46171 (-0.55%)
instructions in affected programs:     38030 -> 37773 (-0.68%)

9 years agovc4: Prioritize allocating accumulators to short-lived values.
Eric Anholt [Tue, 9 Dec 2014 01:43:29 +0000 (17:43 -0800)]
vc4: Prioritize allocating accumulators to short-lived values.

The register allocator walks from the end of the nodes array looking for
trivially-allocatable things to put on the stack, meaning (assuming
everything is trivially colorable and gets put on the stack in a single
pass) the low node numbers get allocated first.  The things allocated
first happen to get the lower-numbered registers, which is to say the fast
accumulators that can be paired more easily.

When we previously made the nodes match the temporary register numbers,
we'd end up putting the shader inputs (VS or FS) in the accumulators,
which are often long-lived values.  By prioritizing the shortest-lived
values for allocation, we can get a lot more instructions that involve
accumulators, and thus fewer conflicts for raddr and WS.

total instructions in shared programs: 52870 -> 46428 (-12.18%)
instructions in affected programs:     52260 -> 45818 (-12.33%)

9 years agor600g: fix regression since UCMP change
Dave Airlie [Tue, 9 Dec 2014 01:28:52 +0000 (11:28 +1000)]
r600g: fix regression since UCMP change

Since d8da6deceadf5e48201d848b7061dad17a5b7cac where the
state tracker started using UCMP on cayman a number of tests
regressed.

this seems to be r600g is doing CNDGE_INT for UCMP which is >= 0,
we should be doing CNDE_INT with reverse arguments.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoprogram: Delete dead _mesa_realloc_instructions.
Matt Turner [Mon, 8 Dec 2014 21:44:40 +0000 (13:44 -0800)]
program: Delete dead _mesa_realloc_instructions.

Dead since 2010 (commit 284ce209).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoswrast: Remove 'inline' from tex filter functions.
Matt Turner [Thu, 4 Dec 2014 19:34:35 +0000 (11:34 -0800)]
swrast: Remove 'inline' from tex filter functions.

Reduces .text size of mesa_dri_drivers.so (i965-only) by 62k, or 1.4%.

Note that we don't remove inline from lerp_2d(), which has a comment
above it saying it definitely should be inlined. Though, removing the
inline keyword from it doesn't actually change the compiled code for me.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoDon't cast the return value of malloc/realloc
Matt Turner [Mon, 22 Sep 2014 04:24:01 +0000 (21:24 -0700)]
Don't cast the return value of malloc/realloc

See commit 2b7a972e for the Coccinelle script.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoUse calloc instead of malloc/memset-0
Matt Turner [Mon, 22 Sep 2014 04:15:26 +0000 (21:15 -0700)]
Use calloc instead of malloc/memset-0

See commit 6bda027e for the Coccinelle script.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoRemove useless checks for NULL before freeing
Matt Turner [Mon, 22 Sep 2014 04:13:33 +0000 (21:13 -0700)]
Remove useless checks for NULL before freeing

See commits 5067506e and b6109de3 for the Coccinelle script.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi965/skl: Add Skylake PCI IDs
Kristian Høgsberg [Mon, 22 Sep 2014 11:44:19 +0000 (04:44 -0700)]
i965/skl: Add Skylake PCI IDs

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
9 years agoi965/skl: Emit depth stall workaround for gen9 as well
Damien Lespiau [Wed, 27 Feb 2013 15:05:24 +0000 (15:05 +0000)]
i965/skl: Emit depth stall workaround for gen9 as well

The docs say that we shouldn't need this workaround for gen8+, but just
removing it, causes gpu hangs.  We'll revisit this, but for now, just
extend the workaround to gen9.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
9 years agoi965/skl: Fix GS thread count location
Ben Widawsky [Wed, 3 Dec 2014 23:53:29 +0000 (15:53 -0800)]
i965/skl: Fix GS thread count location

SKL moves the GS threadcount to dw8 from dw7, and no longer does the
divide by 2 thing.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
9 years agoi965: Fix union usage for G++ <= 4.6.
Vinson Lee [Sat, 6 Dec 2014 02:05:06 +0000 (18:05 -0800)]
i965: Fix union usage for G++ <= 4.6.

This patch fixes this build error with G++ <= 4.6.

  CXX    test_vf_float_conversions.o
test_vf_float_conversions.cpp: In function ‘unsigned int f2u(float)’:
test_vf_float_conversions.cpp:63:20: error: expected primary-expression before ‘.’ token

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86939
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agovc4: Interleave register allocation from regfile A and B.
Eric Anholt [Sat, 6 Dec 2014 01:08:28 +0000 (17:08 -0800)]
vc4: Interleave register allocation from regfile A and B.

The register allocator prefers low-index registers from vc4_regs[] in the
configuration we're using, which is good because it means we prioritize
allocating the accumulators (which are faster).  On the other hand, it was
causing raddr conflicts because everything beyond r0-r2 ended up in
regfile A until you got massive register pressure.  By interleaving, we
end up getting more instruction pairing from getting non-conflicting
raddrs and QPU_WSes.

total instructions in shared programs: 55957 -> 52719 (-5.79%)
instructions in affected programs:     46855 -> 43617 (-6.91%)

9 years agovc4: Fix decision for whether the MIN operation writes to the B regfile.
Eric Anholt [Mon, 8 Dec 2014 19:27:50 +0000 (11:27 -0800)]
vc4: Fix decision for whether the MIN operation writes to the B regfile.