mesa.git
11 years agofreedreno: gallium driver for adreno
Rob Clark [Sat, 27 Oct 2012 16:07:34 +0000 (11:07 -0500)]
freedreno: gallium driver for adreno

Currently works on a220.  Others in the a2xx family look pretty similar
and should be pretty straightforward to support with the same driver.

The a3xx has a new shader ISA, and while many registers appear similar,
the register addresses have been completely shuffled around.  I am not
sure yet whether it is best to support with the same driver, but
different compiler, or whether it should be split into a different
driver.

v1: original
v2: build file updates from review comments, and remove GPL licensed
    header files from msm kernel
v3: smarter temp/pred register assignment, fix clear and depth/stencil
    format issues, resource_transfer fixes, scissor fixes

Signed-off-by: Rob Clark <robdclark@gmail.com>
11 years agod3d1x: Remove.
José Fonseca [Mon, 11 Mar 2013 10:13:47 +0000 (10:13 +0000)]
d3d1x: Remove.

Unused/unmaintained.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
11 years agonv50: Remove nv0_ir_from_sm4.*
José Fonseca [Mon, 11 Mar 2013 10:14:19 +0000 (10:14 +0000)]
nv50: Remove nv0_ir_from_sm4.*

Unused, depends on d3d1x.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
11 years agogallivm: clean up passing derivatives around
Roland Scheidegger [Sat, 9 Mar 2013 00:46:33 +0000 (01:46 +0100)]
gallivm: clean up passing derivatives around

Previously, the derivatives were calculated and passed in a packed form
to the sample code (for implicit derivatives, explicit derivatives were
packed to the same format).
There's several reasons why this wasn't such a good idea:
1) the derivatives may not even be needed (not as bad as it sounds since
llvm will just throw the calculations needed for them away but still)
2) the special packing format really shouldn't be part of the sampler
interface
3) depending what the sample code actually does the derivatives will
be processed differently, hence there is no "ideal" packing. For cube
maps with explicit derivatives (which we don't do yet) for instance the
packing looked downright useless, and for non-isotropic filtering we'd
need different calculations too.

So, instead just pass the derivatives as is (for explicit derivatives),
or let the rho calculating sample code calculate them itself. This still
does exactly the same packing stuff for implicit derivatives for now,
though explicit ones are handled in a more straightforward manner (quick
estimates show performance should be quite similar, though it is much
easier to follow and also does the rho calculation per-pixel until the
end, which we eventually need for spec compliance anyway).

No piglit changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agoi965: Fix typo in doxygen hyperlink
Chad Versace [Thu, 21 Feb 2013 03:59:07 +0000 (19:59 -0800)]
i965: Fix typo in doxygen hyperlink

s/brw_state_upload/brw_upload_state/

Found because the link was broken.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
11 years agomesa: Reduce memory usage for reg alloc with many graph nodes (part 2).
Eric Anholt [Wed, 20 Feb 2013 01:01:41 +0000 (17:01 -0800)]
mesa: Reduce memory usage for reg alloc with many graph nodes (part 2).

After the previous fix that almost removes an allocation of 4*n^2
bytes, we can use a bitset to reduce another allocation from n^2 bytes
to n^2/8 bytes.

Between the previous commit and this one, the peak heap size for an
oglconform ARB_fragment_program max instructions test on i965 goes from
4GB to 255MB.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55825
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: Reduce the memory usage for reg alloc with many graph nodes (part 1)
Eric Anholt [Wed, 20 Feb 2013 00:46:41 +0000 (16:46 -0800)]
mesa: Reduce the memory usage for reg alloc with many graph nodes (part 1)

We were allocating an adjacency_list entry for every possible
interference that could get created, but that usually doesn't happen.
We can save a lot of memory by resizing the array on demand.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Improve CSE performance by expiring some available expressions.
Eric Anholt [Wed, 20 Feb 2013 00:20:10 +0000 (16:20 -0800)]
i965/fs: Improve CSE performance by expiring some available expressions.

We're already walking the list, and we can easily know when something
has no reason to be in the list any longer, so take a brief extra step
to reduce our worst-case runtime (an oglconform test that emits the
maximum instructions in a fragment program).  I don't actually know what
the worst-case runtime was, because it was too long and I got bored.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Improve live variables calculation performance.
Eric Anholt [Tue, 19 Feb 2013 22:36:06 +0000 (14:36 -0800)]
i965/fs: Improve live variables calculation performance.

We can execute way fewer instructions by doing our boolean manipulation
on an "int" of bits at a time, while also reducing our working set size.

Reduces compile time of L4D2's slowest shader from 4s to 1.1s
(-72.4% +/- 0.2%, n=10)

v2: Remove redundant masking (noted by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Also do the gen4 SEND dependency workaround against other SENDs.
Eric Anholt [Thu, 7 Mar 2013 01:50:50 +0000 (17:50 -0800)]
i965/fs: Also do the gen4 SEND dependency workaround against other SENDs.

We were handling the the dependency workaround for the first written reg
of a send preceding the one we're fixing up, but didn't consider the other
regs.  Thus if you had two sampler calls that got allocated to the same
set of regs, one might, rarely, ovewrite the other.  This was occurring in
XBMC's GLSL shaders.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44567
NOTE: This is a candidate for the stable branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Switch to using sampler LD messages for uniform pull constants.
Eric Anholt [Wed, 6 Mar 2013 22:47:22 +0000 (14:47 -0800)]
i965/fs: Switch to using sampler LD messages for uniform pull constants.

When forcing the compiler to always generate pull constants instead of
push constants (in order to have an easy to use testcase), improves
performance of my old GLSL demo 23.3553% +/- 1.42968% (n=7).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60866
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Fix broken rendering in large shaders with UBO loads.
Eric Anholt [Wed, 6 Mar 2013 23:58:46 +0000 (15:58 -0800)]
i965/fs: Fix broken rendering in large shaders with UBO loads.

The lowering process creates a new vgrf on gen7 that should be represented
in live interval analysis.  As-is, it was getting a conflicting allocation
with gl_FragDepth in the dolphin emulator, producing broken rendering.

NOTE: This is a candidate for the 9.1 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Add a comment about about an implementation detail.
Eric Anholt [Thu, 7 Mar 2013 01:12:28 +0000 (17:12 -0800)]
i965/fs: Add a comment about about an implementation detail.

I was going to fix the code above like the previous commit, but we already
had that covered (otherwise all our uniform access would have been broken,
unlike just pull constants).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Fix register allocation for uniform pull constants in 16-wide.
Eric Anholt [Thu, 7 Mar 2013 00:38:10 +0000 (16:38 -0800)]
i965/fs: Fix register allocation for uniform pull constants in 16-wide.

We were allowing a compressed instruction to write a register that
contained the last use of a uniform pull constant (either UBO load or push
constant spillover), so it would get half its values smashed.

Since we need to see the actual instruction to decide this, move the
pre-gen6 pixel_x/y logic here, which should improve the performance of
register allocation since virtual_grf_interferes() is called more than
once per instruction.

NOTE: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61317
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agointel: Remove some unused debug flags.
Eric Anholt [Wed, 6 Mar 2013 00:24:07 +0000 (16:24 -0800)]
intel: Remove some unused debug flags.

I was looking at the list to see what might be interesting to document for
application developers, and it turns out some are completely dead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodraw/gs: Correctly iterate the emitted primitives
Zack Rusin [Fri, 8 Mar 2013 03:15:03 +0000 (19:15 -0800)]
draw/gs: Correctly iterate the emitted primitives

We were assuming that each emitted primitive had the same
number of vertices. That is incorrect. Emitted primitives
can have arbirtrary number of vertices. Simply increment
index on iteration to fix it.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agotgsi/exec: Correctly reset NumOutputs before parsing the shader
Zack Rusin [Fri, 8 Mar 2013 03:11:28 +0000 (19:11 -0800)]
tgsi/exec: Correctly reset NumOutputs before parsing the shader

Whenever we're binding the shaders we're incrementing NumOutputs,
assuming the parser spots an output decleration, but we were never
reseting the variable. That means that each subsequent bind of
a geometry shader would add its number of output to the number
of output bound by all previously ran shaders and our indexes
would get completely messed up.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agodraw/llvm: another quick hack for drawing with no position output
Roland Scheidegger [Mon, 11 Mar 2013 16:03:55 +0000 (17:03 +0100)]
draw/llvm: another quick hack for drawing with no position output

Also need to skip things if we have no cv value but pos value
(happens with geometry shaders enabled).
Needs a round of cleanup, though.

11 years agosoftpipe: don't use samplers with prebaked sampler and sampler_view state
Roland Scheidegger [Fri, 8 Mar 2013 21:29:34 +0000 (22:29 +0100)]
softpipe: don't use samplers with prebaked sampler and sampler_view state

This is needed for handling the dx10-style sample opcodes.
This also simplifies the logic by getting rid of sampler variants
completely (sampler_views though OTOH have sort of variants because
some of their state is different depending on the shader stage they
are bound to).
No significant performance difference (openarena run:
840 frames in 459.8 seconds vs. 840 frames in 460.5 seconds).

v2: fix reference counting bug spotted by Jose.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agotgsi: emit code for SVIEWINFO and SAMPLE_I
Roland Scheidegger [Fri, 8 Mar 2013 21:10:21 +0000 (22:10 +0100)]
tgsi: emit code for SVIEWINFO and SAMPLE_I

Can handle them since the single sampler interface was introduced.

v2: simplify txf/sample_i handling a bit according to Brian's feedback.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agotgsi: fix wrong reg used for unit for TGSI_OPCODE_TXF
Roland Scheidegger [Fri, 8 Mar 2013 18:45:52 +0000 (19:45 +0100)]
tgsi: fix wrong reg used for unit for TGSI_OPCODE_TXF

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agor600g/llvm: Fix build
Tom Stellard [Mon, 11 Mar 2013 15:10:51 +0000 (11:10 -0400)]
r600g/llvm: Fix build

11 years agor600g: add debug options disabling various copy-buffer-related features
Marek Olšák [Tue, 5 Mar 2013 00:15:45 +0000 (01:15 +0100)]
r600g: add debug options disabling various copy-buffer-related features

This will be invaluable for debugging and bug reports.

11 years agomesa: don't allocate a texture if width or height is 0 in CopyTexImage
Marek Olšák [Mon, 4 Mar 2013 12:26:51 +0000 (13:26 +0100)]
mesa: don't allocate a texture if width or height is 0 in CopyTexImage

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallium/util: attempt to fix blitting multisample texture arrays
Marek Olšák [Sun, 3 Mar 2013 16:33:11 +0000 (17:33 +0100)]
gallium/util: attempt to fix blitting multisample texture arrays

We don't have a test for this yet, but obviously the swizzle was wrong.

11 years agor600g: allocate FMASK right after the texture, so that it's aligned with it
Marek Olšák [Sun, 3 Mar 2013 13:54:31 +0000 (14:54 +0100)]
r600g: allocate FMASK right after the texture, so that it's aligned with it

This avoids the kernel CS checker errors with MSAA textures.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: remove r600.h, move the stuff elsewhere (mostly to r600_pipe.h)
Marek Olšák [Sun, 3 Mar 2013 13:33:00 +0000 (14:33 +0100)]
r600g: remove r600.h, move the stuff elsewhere (mostly to r600_pipe.h)

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: remove r600_hw_context_priv.h, move the stuff to r600_pipe.h
Marek Olšák [Sun, 3 Mar 2013 13:21:34 +0000 (14:21 +0100)]
r600g: remove r600_hw_context_priv.h, move the stuff to r600_pipe.h

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: remove deprecated state management code
Marek Olšák [Sat, 2 Mar 2013 16:36:05 +0000 (17:36 +0100)]
r600g: remove deprecated state management code

It's nice to see so much code that did pretty much nothing go away.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: atomize pixel shader
Marek Olšák [Sat, 2 Mar 2013 16:14:51 +0000 (17:14 +0100)]
r600g: atomize pixel shader

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: atomize vertex shader
Marek Olšák [Thu, 28 Feb 2013 16:27:36 +0000 (17:27 +0100)]
r600g: atomize vertex shader

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: inline r600_pipe_shader function
Marek Olšák [Fri, 1 Mar 2013 17:42:52 +0000 (18:42 +0100)]
r600g: inline r600_pipe_shader function

also change names of other functions, so that they make sense

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: dump vertex elements state along with the fetch shader
Marek Olšák [Fri, 1 Mar 2013 15:58:03 +0000 (16:58 +0100)]
r600g: dump vertex elements state along with the fetch shader

11 years agogallium/util: dump instance_divisor
Marek Olšák [Fri, 1 Mar 2013 15:57:27 +0000 (16:57 +0100)]
gallium/util: dump instance_divisor

11 years agor600g: remove bytecode dumping
Marek Olšák [Fri, 1 Mar 2013 16:13:18 +0000 (17:13 +0100)]
r600g: remove bytecode dumping

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g: use a single env var R600_DEBUG, disable bytecode dumping
Marek Olšák [Fri, 1 Mar 2013 15:31:49 +0000 (16:31 +0100)]
r600g: use a single env var R600_DEBUG, disable bytecode dumping

Only the disassembler is used to dump shaders. Here's a few examples
how to use R600_DEBUG.

Log compute info:
  R600_DEBUG=compute

Dump all shaders:
  R600_DEBUG=fs,vs,gs,ps,cs

Dump pixel shaders only:
  R600_DEBUG=ps

Disable Hyper-Z:
  R600_DEBUG=nohyperz

Disable the LLVM backend:
  R600_DEBUG=nollvm

Or use any combination of the above, or print all options:
  R600_DEBUG=help

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g: cleanup #include recursion between r600_pipe.h and evergreen_compute.h
Marek Olšák [Fri, 1 Mar 2013 14:32:46 +0000 (15:32 +0100)]
r600g: cleanup #include recursion between r600_pipe.h and evergreen_compute.h

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g: don't check for R600_ENABLE_S3TC env var
Marek Olšák [Fri, 1 Mar 2013 14:30:39 +0000 (15:30 +0100)]
r600g: don't check for R600_ENABLE_S3TC env var

11 years agoglapi/gen: Remove duplicate PYTHON_FLAGS
Stefan Brüns [Sat, 9 Mar 2013 20:55:50 +0000 (21:55 +0100)]
glapi/gen: Remove duplicate PYTHON_FLAGS

PYTHON_GEN calls python with PYTHON_FLAGS

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
11 years agoi965: Link i965_dri.so with C++ linker.
Frank Henigman [Fri, 1 Mar 2013 02:21:51 +0000 (21:21 -0500)]
i965: Link i965_dri.so with C++ linker.

Force C++ linking of i965_dri.so by adding a dummy C++ source file.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agogallium/util: Correct shift value for TSC feature detection.
Maxence Le Doré [Thu, 7 Mar 2013 01:30:03 +0000 (02:30 +0100)]
gallium/util: Correct shift value for TSC feature detection.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoconfigure.ac: Build dricommon for DRI gallium drivers
Matt Turner [Tue, 5 Mar 2013 18:25:55 +0000 (10:25 -0800)]
configure.ac: Build dricommon for DRI gallium drivers

Commit 67ef7559 added an || test "x$enable_dri" check in an attempt to
get the DRI common bits built in some necessary cases. That change was
inappropriate as it made these common DRI pieces be built
unconditionally, so some builds were broken.

Subsequently, commit 998d975e3 change the "|| test" to a "-a"
conjunction within the existing test invocation. This made the '-a
"x$enable_dri" = xyes' clause have no effect, (as it was inside an
enclosing test for the same condition). So the new breakage from
commit 67ef7559 was addressed, but the original problems were
regressed.

The immediately preceding commit removed the redundant condition.

Now, finally this commit fixes the original problem as described in
the commit message of 67ef7559: this code should be compiled when
using the DRI state tracker. In order to do so, the HAVE_*_DRI
conditionals must be moved after the last assignment of HAVE_COMMON_DRI.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61821
Tested-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoconfigure.ac: Remove redundant checks of enable_dri.
Matt Turner [Tue, 5 Mar 2013 18:27:22 +0000 (10:27 -0800)]
configure.ac: Remove redundant checks of enable_dri.

The whole block is enclosed inside if test "x$enable_dri" = xyes.

11 years agomesa: Allow ETC2/EAC formats with ARB_ES3_compatibility.
Matt Turner [Mon, 4 Mar 2013 19:32:32 +0000 (11:32 -0800)]
mesa: Allow ETC2/EAC formats with ARB_ES3_compatibility.

Fixes piglit's oes_compressed_etc2_texture-miptree tests on Desktop GL.
Reported-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi915g: Use PIPE_FLUSH_END_OF_FRAME to trigger throttling
Stéphane Marchesin [Fri, 8 Mar 2013 21:32:55 +0000 (13:32 -0800)]
i915g: Use PIPE_FLUSH_END_OF_FRAME to trigger throttling

This helps with jittering, instead of throttling at every command
buffer we only throttle once a frame.

11 years agoi915g: Update TODO
Stéphane Marchesin [Sat, 9 Mar 2013 00:16:33 +0000 (16:16 -0800)]
i915g: Update TODO

11 years agodocs: document another Viewperf bug
Brian Paul [Fri, 8 Mar 2013 17:32:39 +0000 (10:32 -0700)]
docs: document another Viewperf bug

11 years agodri/nouveau: fix crash in nouveau_flush
Jan de Groot [Thu, 7 Mar 2013 18:48:13 +0000 (19:48 +0100)]
dri/nouveau: fix crash in nouveau_flush

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

Note: this is a candidate for the stable branches

11 years agodraw: add const qualifier to silence compiler warning
Brian Paul [Thu, 7 Mar 2013 15:10:56 +0000 (08:10 -0700)]
draw: add const qualifier to silence compiler warning

11 years agollvmpipe: remove the power of two sizeof(struct cmd_block) assertion
Brian Paul [Wed, 6 Mar 2013 23:57:20 +0000 (16:57 -0700)]
llvmpipe: remove the power of two sizeof(struct cmd_block) assertion

It fails on 32-bit systems (I only tested on 64-bit).  Power of two
size isn't required, so just remove the assertion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agovbo: fix crash found with shared display lists
Brian Paul [Wed, 6 Mar 2013 19:08:17 +0000 (12:08 -0700)]
vbo: fix crash found with shared display lists

This fixes a crash when a display list is created in one context
but executed from a second one.  The vbo_save_context::vertex_store
memeber will be NULL if we never created a display list with the
context.  Just check for that before dereferencing the pointer.

Fixes http://bugzilla.redhat.com/show_bug.cgi?id=918661

Note: This is a candidate for the stable branches.

11 years agomesa: fix glGetInteger*(GL_SAMPLER_BINDING).
Alan Hourihane [Wed, 6 Mar 2013 18:14:01 +0000 (18:14 +0000)]
mesa: fix glGetInteger*(GL_SAMPLER_BINDING).

If the sampler object has been deleted on another context, an
alternative context may reference the old sampler. So ensure the sampler
object still exists.

Note: this is a candidate for the stable branch.

Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoradeon/llvm: document LLVM commit
Christian König [Thu, 7 Mar 2013 09:06:24 +0000 (10:06 +0100)]
radeon/llvm: document LLVM commit

We need at least that revision to work correctly now.

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agoradeon/llvm: enable LICM and DCE pass v2
Christian König [Wed, 27 Feb 2013 21:40:24 +0000 (22:40 +0100)]
radeon/llvm: enable LICM and DCE pass v2

LICM stands for Loop Invariant Code Motion. Instructions that
does not depend of loop index are moved outside of loop body.

DCE is DeadCodeElimination.

v2: updated commit msg, thx to Vincent.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Vincent Lejeune <vljn at ovi.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: add LLVMNoUnwindAttribute to intrinsic
Christian König [Wed, 27 Feb 2013 21:39:26 +0000 (22:39 +0100)]
radeonsi: add LLVMNoUnwindAttribute to intrinsic

So LLVM can better eliminate dead code.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: rework input interpolation
Christian König [Tue, 5 Mar 2013 14:07:39 +0000 (15:07 +0100)]
radeonsi: rework input interpolation

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: remove SI.vs.load.buffer.index
Christian König [Tue, 5 Mar 2013 11:14:02 +0000 (12:14 +0100)]
radeonsi: remove SI.vs.load.buffer.index

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeon/llvm: make SGPRs proper function arguments v2
Christian König [Mon, 4 Mar 2013 15:30:06 +0000 (16:30 +0100)]
radeon/llvm: make SGPRs proper function arguments v2

v2: remove unrelated changes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeon/llvm: replace shader type intrinsic with function attribute
Christian König [Mon, 4 Mar 2013 14:35:30 +0000 (15:35 +0100)]
radeon/llvm: replace shader type intrinsic with function attribute

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: switch to v*i8 for resources and samplers v2
Christian König [Fri, 1 Mar 2013 10:34:16 +0000 (11:34 +0100)]
radeonsi: switch to v*i8 for resources and samplers v2

v2: remove unrelated changes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agor600g/llvm: Update CONSTANT_BUFFER address space definition
Christian König [Thu, 7 Mar 2013 09:02:24 +0000 (10:02 +0100)]
r600g/llvm: Update CONSTANT_BUFFER address space definition

To match recent LLVM changes.

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agodraw/llvm: fix inputs to the geometry shader
Zack Rusin [Wed, 27 Feb 2013 09:28:18 +0000 (01:28 -0800)]
draw/llvm: fix inputs to the geometry shader

We can't clip and viewport transform the vertices before we let
the geometry shader process them. Lets make sure the generated
vertex shader has both disabled if geometry shader is present.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agodraw: use geometry shader info in clip_init_state if appropriate
Bryan Cain [Fri, 15 Feb 2013 16:09:12 +0000 (10:09 -0600)]
draw: use geometry shader info in clip_init_state if appropriate

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agodraw: account for separate shader objects in geometry shader code
Bryan Cain [Fri, 15 Feb 2013 16:05:36 +0000 (10:05 -0600)]
draw: account for separate shader objects in geometry shader code

The geometry shader code seems to have been originally written with the
assumptions that there are the same number of VS outputs as GS outputs and
that VS outputs are in the same order as their corresponding GS inputs. Since
TGSI uses separate shader objects, these are both wrong assumptions. This
was causing several valid vertex/geometry shader combinations to either render
incorrectly or trigger an assertion.

Conflicts:
src/gallium/auxiliary/draw/draw_gs.c

Reviewed-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agoUnreference sampler object when it's currently bound to texture unit.
Alan Hourihane [Wed, 6 Mar 2013 16:08:58 +0000 (16:08 +0000)]
Unreference sampler object when it's currently bound to texture unit.

This change specifically unbinds a sampler object from the texture unit
if it's bound to a unit. The spec calls for default object when deleting
sampler objects which are currently bound.

Note: this is a candidate for the stable branches

Signed-off-by: Alan Hourihane <alanh@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agollvmpipe: fix incorrect 'j' array index in dummy texture code
Brian Paul [Wed, 6 Mar 2013 01:08:50 +0000 (18:08 -0700)]
llvmpipe: fix incorrect 'j' array index in dummy texture code

Use 0 instead.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agollvmpipe: remove unused cmd_block_list struct
Brian Paul [Mon, 4 Mar 2013 21:44:47 +0000 (14:44 -0700)]
llvmpipe: remove unused cmd_block_list struct

11 years agollvmpipe: add some scene limit sanity check assertions
Brian Paul [Mon, 4 Mar 2013 21:38:20 +0000 (14:38 -0700)]
llvmpipe: add some scene limit sanity check assertions

Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agollvmpipe: tweak CMD_BLOCK_MAX and LP_SCENE_MAX_SIZE
Brian Paul [Mon, 4 Mar 2013 21:33:04 +0000 (14:33 -0700)]
llvmpipe: tweak CMD_BLOCK_MAX and LP_SCENE_MAX_SIZE

We advertise a max texture/surfaces size of 8K x 8K but the old values
for these limits didn't actually allow us to handle that surface size.

For 8K x 8K we'll have 16384 bins.  Each bin needs at least one cmd_block
object which was 2192 bytes in size.  Since 16384 * 2192 exceeded
LP_SCENE_MAX_SIZE we'd silently fail in lp_scene_new_data_block() and not
draw the complete scene.

By reducing CMD_BLOCK_MAX to 29 we get nice 512-byte cmd_blocks.  And
by increasing LP_SCENE_MAX_SIZE to 9 MB we can allocate enough command
blocks for 8K x 8K, plus a few regular data blocks.

Fixes the (improved) piglit fbo-maxsize test.

Note: This is a candidate for the stable branches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
11 years agoi965: Don't fill buffer with zeroes.
Kenneth Graunke [Mon, 4 Mar 2013 19:38:28 +0000 (11:38 -0800)]
i965: Don't fill buffer with zeroes.

This was only necessary because our bounds checking was off by one, and
thus we read an extra pair of values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoi965: Fix off-by-one in query object result gathering.
Kenneth Graunke [Mon, 4 Mar 2013 19:37:35 +0000 (11:37 -0800)]
i965: Fix off-by-one in query object result gathering.

If we've written N pairs of values to the buffer, then last_index = N,
but the values are 0 .. N-1.  Thus, we need to use <, not <=.

This worked anyway because we fill the buffer with zeroes, so we just
added an extra (0 - 0) to our results.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agoradeon/llvm: fix trivial warnings
Christian König [Wed, 6 Mar 2013 11:08:54 +0000 (12:08 +0100)]
radeon/llvm: fix trivial warnings

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agoradeonsi: fix trivial warning
Christian König [Wed, 6 Mar 2013 10:49:53 +0000 (11:49 +0100)]
radeonsi: fix trivial warning

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agointel: Improve the matching (more formats!) for TexImage from PBOs.
Eric Anholt [Tue, 29 Jan 2013 00:59:29 +0000 (11:59 +1100)]
intel: Improve the matching (more formats!) for TexImage from PBOs.

Mesa core is the place for encoding what format/type matches a mesa
format, so rely on that.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agointel: Improve the test for readpixels blit path format checking.
Eric Anholt [Mon, 28 Jan 2013 06:44:17 +0000 (17:44 +1100)]
intel: Improve the test for readpixels blit path format checking.

We were allowing things like copying RG1616 to a user's ARGB8888
format, while we were denying anything that wasn't ARGB8888 or
RGB565.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agointel: Fold intel_region_copy() into its one caller.
Eric Anholt [Mon, 28 Jan 2013 00:32:49 +0000 (11:32 +1100)]
intel: Fold intel_region_copy() into its one caller.

This is similar code to intel_miptree_copy_slice, but the knobs
are all set differently.

v2: fix whitespace

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agointel: Transition intel_region_map() to being a miptree operation.
Eric Anholt [Sun, 27 Jan 2013 22:14:42 +0000 (09:14 +1100)]
intel: Transition intel_region_map() to being a miptree operation.

I'm trying to move us away from the region structure, and all the
callers are currently dereferencing a miptree to get the region.

In this change, the map_refcount is dropped.  However, the bo->virtual is
itself map refcounted, so that's already dealt with.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agointel: Remove num_mapped_regions tracking.
Eric Anholt [Sun, 27 Jan 2013 21:57:15 +0000 (08:57 +1100)]
intel: Remove num_mapped_regions tracking.

The point of tracking the value was removed in February 2012
(65b096aeddd9b45ca038f44cc9adfff86c8c48b2), and this should have
been removed at the same time.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agointel: Remove the struct intel_region reuse hash table.
Eric Anholt [Sun, 27 Jan 2013 19:37:43 +0000 (05:37 +1000)]
intel: Remove the struct intel_region reuse hash table.

I don't see any reason for it -- it was introduced with the DRI2
invalidate work by krh in 2010 with no explanation.  I suspect it was
something about wanting the same drm_intel_bo struct underneath multiple
openings of the BO within one process, but that's covered by libdrm at
this point.  As far as the struct region goes, it is not threadsafe, so
multiple contexts sharing a region could have mixed up the map_count and
assertion failed or worse.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoscons: Provide shorthand aliases for software winsyses.
José Fonseca [Tue, 5 Mar 2013 22:46:38 +0000 (22:46 +0000)]
scons: Provide shorthand aliases for software winsyses.

11 years agoscons: Fix llvm-config not found error message.
José Fonseca [Tue, 5 Mar 2013 22:46:01 +0000 (22:46 +0000)]
scons: Fix llvm-config not found error message.

"% llvm_version" is bogus copy'n'past cruft.

11 years agomesa: Modify candidate search string
Ian Romanick [Tue, 5 Mar 2013 22:51:26 +0000 (14:51 -0800)]
mesa: Modify candidate search string

Several commits on master for the 9.1 branch had "NOTE" messages in a
slightly different format.

NOTE: This is a candidate for stable branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Remove the special enum for _mesa_error debug output.
Eric Anholt [Sat, 23 Feb 2013 00:09:19 +0000 (16:09 -0800)]
mesa: Remove the special enum for _mesa_error debug output.

Now all the per-message enums from mtypes are gone.  Now we can extend
unique message IDs into all generators of debug output without having to
update mtypes.h for each one.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Remove the enum for the oom-within-debug-output case.
Eric Anholt [Sat, 23 Feb 2013 00:07:47 +0000 (16:07 -0800)]
mesa: Remove the enum for the oom-within-debug-output case.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Remove now-unused gl_winsys_error and gl_shader_error enums.
Eric Anholt [Fri, 22 Feb 2013 23:59:48 +0000 (15:59 -0800)]
mesa: Remove now-unused gl_winsys_error and gl_shader_error enums.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Report ARB_debug_output for both shader errors and warnings.
Eric Anholt [Fri, 22 Feb 2013 23:57:25 +0000 (15:57 -0800)]
mesa: Report ARB_debug_output for both shader errors and warnings.

This ends up reusing the dynamic ID support, so a silly enum gets to go
away.  We don't assign good IDs to different messages yet, but at least
that's tractable now.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agointel: Add missing perf debug for a stall on mapping a BO.
Eric Anholt [Fri, 22 Feb 2013 22:39:15 +0000 (14:39 -0800)]
intel: Add missing perf debug for a stall on mapping a BO.

I was testing the ARB_debug_output code and wrote an obvious sample that
should have hit this, and got confused that my ARB_debug_output was
broken.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoi965: Make perf_debug() output to GL_ARB_debug_output in a debug context.
Eric Anholt [Fri, 22 Feb 2013 21:15:20 +0000 (13:15 -0800)]
i965: Make perf_debug() output to GL_ARB_debug_output in a debug context.

I tried to ensure that performance in the non-debug case doesn't change
(we still just check one condition up front), and I think the impact is
small enough in the debug context case to warrant including all of it.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agointel: Finish renaming fallback_debug() to perf_debug().
Eric Anholt [Fri, 22 Feb 2013 20:56:13 +0000 (12:56 -0800)]
intel: Finish renaming fallback_debug() to perf_debug().

They're about to change to handle GL_ARB_debug_output, so just make one
function.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agointel: Hook up the WARN_ONCE macro to GL_ARB_debug_output.
Eric Anholt [Fri, 22 Feb 2013 21:03:51 +0000 (13:03 -0800)]
intel: Hook up the WARN_ONCE macro to GL_ARB_debug_output.

This doesn't provide detailed error type information, but it's important
to get these relatively severe but rare error messages out to the
developer through whatever mechanism they are using.

v2: Rebase on new WARN_ONCE additions.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> (v1)
11 years agomesa: Add support for GL_ARB_debug_output with dynamic ID allocation.
Eric Anholt [Fri, 22 Feb 2013 18:43:40 +0000 (10:43 -0800)]
mesa: Add support for GL_ARB_debug_output with dynamic ID allocation.

We can emit messages now without always having to use the same ID for
each, or having a giant table of all possible errors in mtypes.h.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Merge handling of application-provided and built-in error sources.
Eric Anholt [Thu, 12 Jul 2012 17:22:15 +0000 (10:22 -0700)]
mesa: Merge handling of application-provided and built-in error sources.

I want to have dynamic IDs so that we don't need to add to mtypes.h for
every error we might want to add.  To do so, I need to get rid of the
static arrays and actually support all the crazy filtering of dynamic IDs
that we already support for application-provided error sources.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Fix _mesa_problem() on context destroy after application debug output
Eric Anholt [Sat, 23 Feb 2013 01:08:28 +0000 (17:08 -0800)]
mesa: Fix _mesa_problem() on context destroy after application debug output

This was apparently not noticed because we don't have any testing of
application-generated debug output.  However, as I'm changing the
GL-generated debug output to use the same path as
application/middleware-generated debug output, this obviously became an
issue.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Move debug type/severity enums to mesa core.
Eric Anholt [Fri, 22 Feb 2013 23:06:19 +0000 (15:06 -0800)]
mesa: Move debug type/severity enums to mesa core.

These will get reused by new ARB_debug_output messages in drivers/core,
instead of having the caller pass GL enums and have us immediately
switch-statement those into enums.

Add source enums will be handled in the next commit, because the way
different sources are handled at the moment is pretty strange.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Replace open-coded _mesa_lookup_enum_by_nr().
Eric Anholt [Fri, 22 Feb 2013 22:47:15 +0000 (14:47 -0800)]
mesa: Replace open-coded _mesa_lookup_enum_by_nr().

The new one doesn't have the same behavior for GL_NO_ERROR, but we don't
produce errors with GL_NO_ERROR as the error type.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: Remove extra #define MAXSTRING duplicating MAX_DEBUG_MESSAGE_LENGTH.
Eric Anholt [Thu, 12 Jul 2012 17:21:13 +0000 (10:21 -0700)]
mesa: Remove extra #define MAXSTRING duplicating MAX_DEBUG_MESSAGE_LENGTH.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agodri/nouveau: NV17_3D class is not available for NV1a chipset
Marcin Slusarz [Sat, 16 Feb 2013 22:25:08 +0000 (23:25 +0100)]
dri/nouveau: NV17_3D class is not available for NV1a chipset

Should fix https://bugs.freedesktop.org/show_bug.cgi?id=60510

Note: this is a candidate for the stable branches

Acked-by: Francisco Jerez <currojerez@riseup.net>
11 years agotgsi: handle projection modifier for array textures.
Roland Scheidegger [Tue, 5 Mar 2013 16:24:32 +0000 (17:24 +0100)]
tgsi: handle projection modifier for array textures.

This partly reverts 6ace2e41da7dded630d932d03bacb7e14a93d47a.
Apparently with GL_MESA_texture_array fixed-function texturing
with texture arrays is possible, and hence we have to handle TXP.
(Though noone seems to know the semantics, softpipe now does what
it did before, which is to NOT project the array coord, llvmpipe
for instance however indeed does project the array coord. Unlike
before it will project the comparison coord for shadow1d array, as
that clearly was an error.)
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=61828.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agost/mesa: translate ir offset parameters for non-TXF opcodes.
Roland Scheidegger [Tue, 5 Mar 2013 01:02:13 +0000 (02:02 +0100)]
st/mesa: translate ir offset parameters for non-TXF opcodes.

Otherwise the state tracker will crash if the texture instructions
have offsets.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoconfigure.ac: Remove stale comment about --x-* arguments.
Matt Turner [Mon, 4 Mar 2013 18:29:57 +0000 (10:29 -0800)]
configure.ac: Remove stale comment about --x-* arguments.

Should have been removed with e273ed37.

Note: This is a candidate for the 9.1 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>