Commit graph

65652 commits

Author SHA1 Message Date
Eric Anholt
d64ca0a765 vc4: Add support for shadow samplers.
This doesn't quite make depth-tex-compare work, presumably because we're
not hitting equality with itof(sample) * 1.0/0xffffff in the 0xffffff
case.  arb_fragment_program_shadow tests pass, though, as well as a bunch
of other shadow-related stuff.
2014-09-09 20:41:43 -07:00
Eric Anholt
7d5c57f8e9 vc4: Add support for texture swizzles.
Fixes depth-tex-modes.
2014-09-09 20:39:29 -07:00
Eric Anholt
1e77c93340 vc4: Move the texture format into a struct.
I'm going to be putting some bitfields into the struct as well.
2014-09-09 20:38:39 -07:00
Eric Anholt
e7a6c54473 vc4: Add support for depth texturing. 2014-09-09 20:38:39 -07:00
Eric Anholt
d952a98c53 vc4: Expose r4 to register allocation.
We potentially need to be careful that use of a value stored in r4 isn't
copy-propagated (or something) across another r4 write.  That doesn't
appear to happen currently, and this makes the dataflow more obvious.  It
also opens up not unpacking the r4 value, which will be useful for depth
textures.
2014-09-09 20:38:39 -07:00
Eric Anholt
be1fcd2cd3 vc4: Drop pointless raddr conflict handling on SF.
SF doesn't have a src[1].
2014-09-09 20:38:39 -07:00
Eric Anholt
04faeff28a vc4: The r4_count is supposed to be how many writes, not reads.
It's part of the key so that you can tell which r4 value is being read.
2014-09-09 20:38:38 -07:00
Michel Dänzer
5679ccfcaf r600g,radeonsi: Set RADEON_GEM_NO_CPU_ACCESS flag for tiled BOs
This lets the kernel know that such BOs can be pinned outside of the CPU
accessible part of VRAM.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2014-09-10 12:01:10 +09:00
Rob Clark
720cfb6fe9 freedreno/a3xx: enable hw primitive-restart
Since software primitive-restart emulation is going to be removed (and
anyways, mostly seemed to be crash prone in combination with
u_primconvert and oddball scenarios (like PIPE_PRIM_POLYGON with only a
single vertex), might as well do it in hardware (which fortunately
didn't turn out to be too hard to figure out).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
564183f39c freedreno: update generated headers
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
a2c22d80d4 freedreno/ir3: fix potential segfault in RA
Triggered by shaders like:

  FRAG
  PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
  DCL OUT[0], COLOR
  DCL CONST[0]
  DCL TEMP[0..2], LOCAL
    0: IF CONST[0].xxxx :0
    1:   MOV TEMP[0], TEMP[1]
    2: ELSE :0
    3:   MOV TEMP[0], TEMP[2]
    4: ENDIF
    5: MOV OUT[0], TEMP[0]
    6: END

not really a sane shader, although driver segfaulting is probably
not the appropriate response.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
4f338c9bbf freedreno: don't overflow cmdstream buffer so much
We currently aren't too clever about dealing with running out of
cmdstream buffer space.  Since we use a single buffer for both drawing
and tiling commands, we need to ensure there is enough space at the tail
of the cmdstream buffer to fit the tiling commands.

Until we get more clever, the easy solution is a threshold to trigger
flushing rendering even if the application does not trigger flush (swap,
changing render target, etc).  This way we at least don't crash for apps
that do several thousand draw calls (like some piglit tests do).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Rob Clark
fd4884e929 freedreno/ir3: add no-copy-propagate fallback step
Most of the things the new compiler still has trouble with basically
amount to cp stage removing too many copies.  But without the cp stage,
the shaders the new compiler produces are still better (perf and
correctness) than the old compiler.  So a simple thing to do until I
have more time to work on it is first trying falling back to new
compiler without cp, before finally falling back to old compiler.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-09 19:42:18 -04:00
Emil Velikov
e387fdd235 ilo: add ilo_builder.h to the sources list
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 22:17:39 +01:00
Kenneth Graunke
e36bbff0e6 ir_to_mesa: Stop converting uniform booleans.
Excess conversions considered harmful.

Recently Matt reworked the boolean uniform handling to use the value of
UniformBooleanTrue, rather than integer 1, when uploading uniforms:

    mesa: Upload boolean uniforms using UniformBooleanTrue.
    glsl: Use UniformBooleanTrue value for uniform initializers.

Marek then set the default to 1.0f for drivers without native integer
support:

    mesa: set UniformBooleanTrue = 1.0f by default

However, ir_to_mesa was assuming a value of integer 1, and arranging for
it to be converted to 1.0f on upload.  Since Marek's commit, we were
uploading 1.0f = 0x3f800000 which was being interpreted as the integer
value 1065353216 and converted to float as 1.06535322E9, which broke
assumptions in ir_to_mesa that "true" was exactly 1.0f.

+13 Piglits on classic swrast (fs-bool-less-compare-true,
{vs,fs}-op-not-bool-using-if, glsl-1.20/execution/uniform-initializer).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2014-09-09 13:19:44 -07:00
Jonathan Gray
c68073e65f configure.ac: strip _GNU_SOURCE from llvm-config output
Mesa already defines _GNU_SOURCE for glibc based systems and defining
_GNU_SOURCE will break the Mesa build on other systems such as OpenBSD.

_GNU_SOURCE only seems to be included in llvm-config output when
LLVM is built via autoconf and not when it is built by cmake.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2014-09-09 20:04:45 +01:00
Stefan Dirsch
49022a9713 xmlconfig: suppress libGL warnings when LIBGL_DEBUG == "quiet"
Let's handle LIBGL_DEBUG env. variable in Mesa in a consistent way.

Fixes: https://bugzilla.novell.com/show_bug.cgi?id=895730
Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
Reviewed-by: Courtney Goeltzenleuchter <courtney@lunarg.com>
2014-09-09 19:46:57 +01:00
Emil Velikov
3d8b53ffb4 automake: remove obsolete NEED_GALLIUM_LOADER
Superseded by HAVE_LOADER_GALLIUM. The latter has a *DRM* brethren
making the whose easier on which one to keep.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:45:24 +01:00
Emil Velikov
44ec468e80 configure: enable the gallium loader only when needed
With the gallium megadrivers we've converted most ST to optionally
use either statically linked in or shared pipe-drivers.

The hardcoded switch forgot to conditionally enable the build of the
shared pipe-drivers which resulted in them being constantly build.

Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Cc: James Ausmus <james.ausmus@intel.com>
Reported-by: James Ausmus <james.ausmus@intel.com>
Tested-by: James Ausmus <james.ausmus@intel.com>
Bugzilla: https://code.google.com/p/chromium/issues/detail?id=412089
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:45:10 +01:00
Emil Velikov
6dcd5ae725 configure: inform the user when we're building sw/kms-dri
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:37 +01:00
Emil Velikov
2903289706 configure: kill off NEED_WINSYS_WRAPPER
Just drop the conditional and simplify our build. This means that
it'll build every time, but it does not require any dependencies nor
does it take that long to compile 200 lines of boilerplate code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:37 +01:00
Emil Velikov
0d0313ce9b configure: kill off NEED_NONNULL_WINSYS
The variable was unused and gave false information. The need for nonnull
winsys currently does not relate as it used to. Nowadays one can mix and
match more freely with plenty of winsys' to make your head spin.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:36 +01:00
Emil Velikov
40bb6f9313 configure: bail out if building svga without libdrm
With recent commit we removed the NEED_NONNULL_WINSYS checks when
selecting the hardware (inc svga) winsys. svga has only one winsys
that explicitly requires libdrm (via it's bundled version of
vmwgfx_drm.h) but configure.ac never really checks for it.

Add the check early to prevent people from shooting themselves when
they select the driver but lack libdrm.

$ ./autogen.sh --disable-dri --disable-egl --disable-gallium-llvm
--with-dri-drivers=swrast --with-gallium-drivers=svga,swrast

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82539
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-09 19:39:36 +01:00
Eric Anholt
2220692330 vc4: Fix segfaults when rendering with no color render target. 2014-09-09 07:29:16 -07:00
Eric Anholt
5774f16453 vc4: Fill out the stencil clear field.
The rest of stencil handling isn't done yet, but it documents an extra
cl_u8(0) and helps make it obvious why we don't need to format clear_depth
the same way the depth/stencil buffer is formatted.
2014-09-09 07:29:16 -07:00
Eric Anholt
fd6e4fccad vc4: Flip around the depth/stencil fields.
After implementing depth stores, it looks like this is the way things
actually are, according to hiz-depth-read-fbo-d24-s0's probes.
2014-09-09 07:29:16 -07:00
Eric Anholt
2cbecee4b7 vc4: Add support for loading/storing the depth buffer.
For now it still requires the color buffer to be present -- we're relying
on the store of color buffer contents to end the frame, and we have to do
something with color buffers in the rendering config packet.
2014-09-09 07:29:16 -07:00
Eric Anholt
1663a89374 vc4: Don't forget to do initial tile clearing for depth/stencil. 2014-09-09 07:29:16 -07:00
Eric Anholt
2cbdbeb4fa vc4: Ignore non-address bits of the offset for load/store.
These only get used for full buffer dumps, which we don't support yet
anyway.
2014-09-09 07:29:16 -07:00
Eric Anholt
a894898255 vc4: Add a debug flag for flushing after every draw.
It was useful on i965, but it's even more useful for debugging tiled
renderers.
2014-09-09 07:29:12 -07:00
Eric Anholt
840f381120 vc4: Add missing null terminator to the debug options list.
So far, apparently there's been some NULL laying at the address just after
the options anyway, but the next commit changed that.
2014-09-09 07:28:12 -07:00
Tom Stellard
181581280b configure.ac: Fix build with git-svn llvm version string
Reviewed-and-tested-by: Jan Vesely <jan.vesely@rutgers.edu>
2014-09-09 09:47:25 -04:00
Kalyan Kondapally
78c9201a5b Linking fails when not writing gl_Position.
According to GLSL-ES Spec(i.e. 1.0, 3.0), gl_Position value is undefined
after the vertex processing stage if we don't write gl_Position. However,
GLSL 1.10 Spec mentions that writing to gl_Position is mandatory. In case
of GLSL-ES, it's not an error and atleast the linking should pass.
Currently, Mesa throws an linker error in case we dont write to gl_position
and Version is less then 140(GLSL) and 300(GLSL-ES). This patch changes
it so that we don't report an error in case of GLSL-ES.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83380
2014-09-09 10:39:39 +03:00
Chia-I Wu
2a49a94079 ilo: remove unused ilo_cp functions
Remove

  ilo_cp_begin()
  ilo_cp_steal()
  ilo_cp_write()
  ilo_cp_write_multi()
  ilo_cp_write_bo()
  ilo_cp_end()
  ilo_cp_steal_ptr()
  ilo_cp_assert_no_implicit_flush()
2014-09-09 13:31:37 +08:00
Chia-I Wu
90f4b131fc ilo: convert GPE GEN6 command functions to use ilo_builder
Similar to the changes to GEN7 command functions, but to GEN6 this time.

As every GPE function has been converted, remove
ilo_cp_assert_no_implicit_flush() calls.
2014-09-09 13:31:37 +08:00
Chia-I Wu
80e29ae42c ilo: convert GPE GEN7 command functions to use ilo_builder
Make these changes

  ilo_cp_begin()    -> ilo_builder_batch_pointer()
  ilo_cp_write()    -> direct memory set
  ilo_cp_write_bo() -> ilo_builder_batch_reloc()

and use this chance to drop the "_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
fff9869164 ilo: convert GPE state functions to use ilo_builder
Make these changes

  ilo_cp_steal_ptr() and memcpy() -> ilo_builder_state_write()
  ilo_cp_steal_ptr()              -> ilo_builder_state_pointer()

and use this chance to drop the "_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
c81a973e04 ilo: convert GPE surface functions to use ilo_builder
Make these changes

  ilo_cp_steal_ptr() and memcpy()   -> ilo_builder_surface_write()
  ilo_cp_steal() and ilo_cp_write() -> ilo_builder_surface_write()
  ilo_cp_write_bo()                 -> ilo_builder_surface_reloc()

and use this chance to drop the "_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
6cbd1f4bd3 ilo: convert BLT to use ilo_builder
Make these changes

  ilo_cp_begin()    -> ilo_builder_batch_pointer()
  ilo_cp_write()    -> direct memory set
  ilo_cp_write_bo() -> ilo_builder_batch_reloc()

and make sure there is no implicit flush.  Use this chance to drop the
"_emit_" infix.
2014-09-09 13:31:37 +08:00
Chia-I Wu
d2acd67313 ilo: use ilo_builder for kernels and STATE_BASE_ADDRESS
Remove instruction buffer management from ilo_3d and adapt ilo_shader_cache to
upload kernels to ilo_builder.  To be able to do that, we also let ilo_builder
manage STATE_BASE_ADDRESS.
2014-09-09 13:31:37 +08:00
Chia-I Wu
55f80a3290 ilo: make ilo_cp based on ilo_builder
This makes ilo_cp use the builder to manage batch buffers, and use
ilo_builder_decode() to replace ilo_3d_pipeline_dump().
2014-09-09 13:31:36 +08:00
Chia-I Wu
dab4a676f7 ilo: add a builder for building BOs for submission
Comparing to how we manage batch and instruction buffers, the new builder

 - does not flush
 - manages both types of buffers
 - manages STATE_BASE_ADDRESS
 - uploads kernels using unsynchronized mapping
 - has its own decoder for the buffers
 - provides more helpers
2014-09-09 13:31:36 +08:00
Chia-I Wu
43bf14eaeb ilo: make toy_compiler_disassemble() more useful
Do not require a toy_compiler so that it can be used in other places, such as
state dumping.  Add a bool to control whether the raw instruction words are
shown.
2014-09-09 13:31:30 +08:00
Ilia Mirkin
4ea1565bbc nv50/ir: accomodate all file types, there are now more than 8
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:12 -04:00
Ilia Mirkin
5966903c28 nvc0/ir: uses was always null at that point in the code
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:12 -04:00
Ilia Mirkin
874a9396c5 nv50/ir: avoid array overrun when checking for supported mods
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
2014-09-08 20:06:12 -04:00
Ilia Mirkin
64c5aeaa94 nouveau: buffer can never be null
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Ilia Mirkin
1792d60900 nvc0/ir: insn can never be null
Reported by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Ilia Mirkin
9ced42b1aa nvc0: size is a uint16_t, remove unnecessary assertion
Reported by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00
Ilia Mirkin
564e305094 nvc0: avoid null deref of screen when collecting stats
Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-09-08 20:06:11 -04:00