mesa.git
10 years agonvc0: add support for PIPE_CAP_SAMPLE_SHADING
Ilia Mirkin [Mon, 21 Apr 2014 04:28:13 +0000 (00:28 -0400)]
nvc0: add support for PIPE_CAP_SAMPLE_SHADING

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonv50: add support for PIPE_CAP_SAMPLE_SHADING
Ilia Mirkin [Sun, 30 Mar 2014 22:25:40 +0000 (18:25 -0400)]
nv50: add support for PIPE_CAP_SAMPLE_SHADING

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agomesa/st: add support for ARB_sample_shading
Ilia Mirkin [Sun, 30 Mar 2014 22:21:50 +0000 (18:21 -0400)]
mesa/st: add support for ARB_sample_shading

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agogallium: add basic support for ARB_sample_shading
Ilia Mirkin [Sun, 30 Mar 2014 22:21:04 +0000 (18:21 -0400)]
gallium: add basic support for ARB_sample_shading

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agomapi: OpenVG symbol exports.
Enrico Horn [Fri, 25 Apr 2014 18:38:13 +0000 (20:38 +0200)]
mapi: OpenVG symbol exports.

Fixes another mistake in 144bbb7b78e.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77502

10 years agoglsl: Use properly typed arguments for bitfieldInsert.
Matt Turner [Fri, 25 Apr 2014 19:22:22 +0000 (12:22 -0700)]
glsl: Use properly typed arguments for bitfieldInsert.

bitfieldInsert takes scalar integers for its last two arguments. Since
bitfieldInsert is lowered on i965 to two instructions that have more
flexible arguments, I didn't notice when I wrote this.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agoi965: Don't bother flushing the batch if it doesn't ref our mt to map.
Eric Anholt [Wed, 23 Apr 2014 20:45:22 +0000 (13:45 -0700)]
i965: Don't bother flushing the batch if it doesn't ref our mt to map.

-1.1372% +/- 0.858033% effect on cairo runtime on glamor (n=175).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoegl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORM
Ander Conselvan de Oliveira [Tue, 8 Apr 2014 20:28:42 +0000 (23:28 +0300)]
egl: Protect use of gbm_dri with ifdef HAVE_DRM_PLATFORM

Otherwise it fails to compile if the drm egl platform is disabled.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agowayland: Fix the logic in disabling the prime capability
Neil Roberts [Tue, 8 Apr 2014 20:28:40 +0000 (23:28 +0300)]
wayland: Fix the logic in disabling the prime capability

It looks like this bit of code is trying to disable the prime capability if
the driver doesn't support createImageFromFds. However the logic looks a bit
broken and what it would actually do is disable all other capabilities apart
from prime. This patch fixes it to actually disable prime.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agogbm: Set errno on errors
Ander Conselvan de Oliveira [Tue, 8 Apr 2014 20:28:39 +0000 (23:28 +0300)]
gbm: Set errno on errors

This should give the caller some information of what called the error.
For the gbm_bo_import() case, for instance, it is possible to know if
the import is not supported or the error was caused by an invalid
parameter.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agogbm/dri: Fix out-of-memory error path in dri_device_create()
Ander Conselvan de Oliveira [Tue, 8 Apr 2014 20:28:38 +0000 (23:28 +0300)]
gbm/dri: Fix out-of-memory error path in dri_device_create()

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agogallium/tests: conditionally include sw/dri winsys
Emil Velikov [Tue, 1 Apr 2014 16:42:42 +0000 (17:42 +0100)]
gallium/tests: conditionally include sw/dri winsys

In all fairness we allow the gallium tests to be build with --disable-dri
which will result in the approapriate winsys to not be build, thus the
build will fail.

  ./configure --disable-dri --with-gallium-drivers=svga --enable-gallium-tests

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoautomake: cleanup pipe-loader handling when using sw/xlib winsys
Emil Velikov [Tue, 1 Apr 2014 16:42:41 +0000 (17:42 +0100)]
automake: cleanup pipe-loader handling when using sw/xlib winsys

Rather than defining our own set of variables, use NEED_WINSYS_XLIB
and based on it include the sw/xlib winsys.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agopipe-loader: conditionally build and use pipe_loader_sw_probe_dri
Emil Velikov [Tue, 1 Apr 2014 16:42:40 +0000 (17:42 +0100)]
pipe-loader: conditionally build and use pipe_loader_sw_probe_dri

The function relies on the sw/dri winsys which is build only when --enable-dri
is set. Fixes build issues with the following config

 ./configure --disable-dri --with-gallium-drivers=svga --enable-xa

Issue can be reproduced with any hw gallium driver + st that uses the pipe-loader.

Cc: Brian Paul <brianp@vmware.com>
Reported-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agollvmpipe: fix clearing of individual color buffers in a fb
Roland Scheidegger [Wed, 23 Apr 2014 18:23:07 +0000 (20:23 +0200)]
llvmpipe: fix clearing of individual color buffers in a fb

GL (3.0) allows you to clear individual color buffers in a fb. In fact
for fbs containing both int and float/normalized color buffers this is
required (because the clearing values are otherwise undefined if applied
to all buffers). The gallium interface was changed a while ago, but llvmpipe
ignored it (hence doing such individual clears always resulted in clearing
all buffers, plus some assorted asserts due to the mixed fbs).
So change the clear command to indicate the buffer to be cleared. Also, because
indicating the buffer to be cleared would have made lp_rast_arg_cmd larger
which is unacceptable (we're trying to shrink it some day) allocate the clear
value in the scene and just pass a pointer.
There's several advantages and disadvantages here:
+ clearing individual buffers works (we could also actually bin such clears now
if they'd come through clear_render_target() if the surface is in the current
fb, though we didn't do this before for the single rb case and still don't try).
+ since there's one clear per rb, we do the format conversion in setup rather
than per bin. Aside from the (drop in the ocean...) performance advantage this
means that clearing to very small values (that is, denormal when converted to
the format) should work for small float (fp16 etc.) formats, as the util code
couldn't handle it correctly before (because cpu denorms are disabled when
executing the bin commands, screwing up the magic conversion and flushing
the values to 0, though this was not verified).
- there's some overhead for traditional old-style clear-all MRT cases, since
there's one rast clear command per rb instead of one for all rbs.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=76976.

v2: get rid of the ugly manual memcpy stuff and just use union util_color.
This is 32 bytes instead of 16 but as the allocation is per scene we can live
with those additional 16 bytes (and the additional 128 bytes in the setup
context), which makes the code much more obvious. Suggested by Brian.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallium/util: use ui[4] instead of ui in union util_color
Roland Scheidegger [Wed, 23 Apr 2014 18:00:03 +0000 (20:00 +0200)]
gallium/util: use ui[4] instead of ui in union util_color

util_color often merely represents a collection of bytes, however it is
inconvenient if those bytes can only be accessed as floats/doubles for int
formats exceeding 32bits.
(Note that since rgba8 formats use one uint, not 4 bytes, hence the byte and
short member were left as is.)

10 years agollvmpipe: (trivial) use correct LP_MIN_VECTOR_ALIGN define for alignment.
Roland Scheidegger [Fri, 4 Apr 2014 02:24:49 +0000 (04:24 +0200)]
llvmpipe: (trivial) use correct LP_MIN_VECTOR_ALIGN define for alignment.

Currently it's the same value.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agor600g: fix hang on RV740 by using DX_RASTERIZATION_KILL instead of SX_MISC
Marek Olšák [Sun, 20 Apr 2014 16:17:51 +0000 (18:17 +0200)]
r600g: fix hang on RV740 by using DX_RASTERIZATION_KILL instead of SX_MISC

Changing SX_MISC hangs RV740. When we're at it, let's use DX_RASTERIZATION_KILL
on all R700 and later chipsets.

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor600g: fix for an MSAA hang on RV770
Marek Olšák [Sun, 20 Apr 2014 16:11:56 +0000 (18:11 +0200)]
r600g: fix for an MSAA hang on RV770

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor600g: fix for broken CULL_FRONT behavior on R6xx
Marek Olšák [Sun, 20 Apr 2014 13:19:43 +0000 (15:19 +0200)]
r600g: fix for broken CULL_FRONT behavior on R6xx

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor600g: fix for HTILE on R6xx
Marek Olšák [Sun, 20 Apr 2014 13:17:23 +0000 (15:17 +0200)]
r600g: fix for HTILE on R6xx

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor600g: fix buffer copying on R600-R700
Marek Olšák [Sat, 19 Apr 2014 22:53:32 +0000 (00:53 +0200)]
r600g: fix buffer copying on R600-R700

This fixes broken rendering in DOTA 2.

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor600g: fix flushing on RV670, RS780, RS880 again
Marek Olšák [Sat, 19 Apr 2014 21:39:13 +0000 (23:39 +0200)]
r600g: fix flushing on RV670, RS780, RS880 again

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor600g: fix MSAA resolve on R6xx when the destination is 1D-tiled
Marek Olšák [Sat, 19 Apr 2014 21:11:41 +0000 (23:11 +0200)]
r600g: fix MSAA resolve on R6xx when the destination is 1D-tiled

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agor600g: disable async DMA on R700
Marek Olšák [Sat, 19 Apr 2014 13:47:54 +0000 (15:47 +0200)]
r600g: disable async DMA on R700

Cc: 10.0 10.1 mesa-stable@lists.freedesktop.org
10 years agor600g: fix edge flags and layered rendering on R600-R700
Marek Olšák [Sat, 19 Apr 2014 15:21:57 +0000 (17:21 +0200)]
r600g: fix edge flags and layered rendering on R600-R700

We forgot to set these bits.

Cc: 10.1 mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agost/mesa: remove trailing NULL colorbuffers
Marek Olšák [Sun, 20 Apr 2014 01:41:47 +0000 (03:41 +0200)]
st/mesa: remove trailing NULL colorbuffers

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agor300g: don't crash when getting NULL colorbuffers
Marek Olšák [Sun, 20 Apr 2014 02:32:24 +0000 (04:32 +0200)]
r300g: don't crash when getting NULL colorbuffers

Cc: mesa-stable@lists.freedesktop.org
10 years agor300g: fix runtime warning after winsys cleanup
Marek Olšák [Sun, 20 Apr 2014 01:39:23 +0000 (03:39 +0200)]
r300g: fix runtime warning after winsys cleanup

Broken by:
  b2238b3452b0bcf3c1216c20c9918f9f0664b464
  winsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc

10 years agoradeonsi: implement GL_ARB_vertex_type_10f_11f_11f_rev
Marek Olšák [Fri, 18 Apr 2014 14:16:44 +0000 (16:16 +0200)]
radeonsi: implement GL_ARB_vertex_type_10f_11f_11f_rev

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agost/xlib: Do minimal version checking in glXCreateContextAttribsARB.
José Fonseca [Thu, 24 Apr 2014 14:49:01 +0000 (15:49 +0100)]
st/xlib: Do minimal version checking in glXCreateContextAttribsARB.

The current version checking is wrongly refusing to create 3.3 contexts;
unsupported version are checked elsewhere; and the DRI path doesn't do
this sort of checking neither.

This enables piglit glsl 3.30 tests to run without skipping.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agollvmpipe: Advertise GLSL 3.30.
José Fonseca [Thu, 24 Apr 2014 14:00:12 +0000 (15:00 +0100)]
llvmpipe: Advertise GLSL 3.30.

According to Roland all TGSI support is there in theory.

In practice there are a few piglit failures and crashes, as this hadn't
been tested before.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agost/xlib: Honour request of 3.1 contexts through core profile where available.
José Fonseca [Thu, 24 Apr 2014 14:05:47 +0000 (15:05 +0100)]
st/xlib: Honour request of 3.1 contexts through core profile where available.

The GLX_ARB_create_context_profile spec says:

    "If version 3.1 is requested, the context returned may implement
    any of the following versions:

      * Version 3.1. The GL_ARB_compatibility extension may or may not
        be implemented, as determined by the implementation.

      * The core profile of version 3.2 or greater."

Mesa does not support GL_ARB_compatibility, and there are no plans to
ever support it, therefore the only chance to honour a 3.1 context is
through core profile, i.e, the 2nd alternative from the spec.

This change does that.  And with it piglit tests that require 3.1
contexts no longer skip.

Assuming there is no objection with this change, src/glx/dri_common.c
and src/gallium/state_trackers/wgl/stw_context.c should also be updated
accordingly, given they have the same logic.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agodraw/llvm: reduce memory usage
Zack Rusin [Wed, 23 Apr 2014 21:06:13 +0000 (17:06 -0400)]
draw/llvm: reduce memory usage

Lets make draw_get_option_use_llvm function available unconditionally
and use it to avoid useless allocations when LLVM paths are active.
TGSI machine is never used when we're using LLVM.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agodocs: fix typo in 10.1.1 release notes URL
Brian Paul [Thu, 24 Apr 2014 14:37:23 +0000 (08:37 -0600)]
docs: fix typo in 10.1.1 release notes URL

10 years agoswrast: move texture_slices() calls out of loops
Brian Paul [Wed, 23 Apr 2014 15:59:55 +0000 (09:59 -0600)]
swrast: move texture_slices() calls out of loops

Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agoswrast: move null pointer check earlier in _swrast_map_teximage()
Brian Paul [Wed, 23 Apr 2014 15:57:11 +0000 (09:57 -0600)]
swrast: move null pointer check earlier in _swrast_map_teximage()

There's no reason to compute texel size, stride, etc. if there's no
image data to map.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agoswrast: remove _mesa_ prefix from static function
Brian Paul [Wed, 23 Apr 2014 15:55:25 +0000 (09:55 -0600)]
swrast: remove _mesa_ prefix from static function

And add a const qualifier.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agoswrast: allocate swrast_texture_image::ImageSlices array if needed
Brian Paul [Wed, 23 Apr 2014 15:49:58 +0000 (09:49 -0600)]
swrast: allocate swrast_texture_image::ImageSlices array if needed

Fixes a segmentation fault in conform divzero.c test.
This happens when glTexImage(level, width=0, height=0) is called.  We
don't allocate texture memory in that case so the ImageSlices array
was never allocated.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
10 years agoswrast: Fix vertex color in _swsetup_Translate()
nick [Wed, 23 Apr 2014 14:18:00 +0000 (08:18 -0600)]
swrast: Fix vertex color in _swsetup_Translate()

Straightforward fix to properly load dest->color with color data, as
opposed to position data as previously implemented.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=27499
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallivm: Fix wrong operator in lp_exec_default.
José Fonseca [Thu, 24 Apr 2014 13:49:53 +0000 (14:49 +0100)]
gallivm: Fix wrong operator in lp_exec_default.

Courtesy of MSVC static code analyser.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agomesa/st: Handle empty frame-buffers without asserting.
José Fonseca [Thu, 24 Apr 2014 13:48:37 +0000 (14:48 +0100)]
mesa/st: Handle empty frame-buffers without asserting.

Fixes assertion failures with radeonsi.

Tested-by: Marek Olšák <maraeo@gmail.com>
10 years agomesa/st: Fix pipe_framebuffer_state::height for PIPE_TEXTURE_1D_ARRAY.
José Fonseca [Thu, 3 Apr 2014 14:56:46 +0000 (15:56 +0100)]
mesa/st: Fix pipe_framebuffer_state::height for PIPE_TEXTURE_1D_ARRAY.

This prevents buffer overflow w/ llvmpipe when running piglit

  bin/gl-3.2-layered-rendering-clear-color-all-types 1d_array single_level -fbo -auto

v2: Compute the framebuffer size as the minimum size, as pointed out by
Brian;  compacted code;  ran piglit quick test list (with no
regressions.)

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoutil/u_debug: Pass correct size to strncat.
José Fonseca [Tue, 22 Apr 2014 11:32:17 +0000 (12:32 +0100)]
util/u_debug: Pass correct size to strncat.

Courtesy of Clang static analyzer.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agofreedreno/a3xx: fix TOTALATTRTOVS
Rob Clark [Tue, 22 Apr 2014 19:43:51 +0000 (15:43 -0400)]
freedreno/a3xx: fix TOTALATTRTOVS

In cases where varying fetches are optimized away (just pass-through in
vertex shader, but unused in fragment shader) we need to calculate the
correct TOTALATTROVS based on the actual number of varyings fetched,
otherwise lockup.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoi965: Make Broadwell HiZ path arrange for TC flushes.
Kenneth Graunke [Mon, 21 Apr 2014 21:08:49 +0000 (14:08 -0700)]
i965: Make Broadwell HiZ path arrange for TC flushes.

HiZ operations make the depth/render caches out of sync with the sampler
caches.  We need to arrange for a TC flush to happen before the target
buffer is used by the sampler.  Calling brw_render_cache_set_add_bo
makes that happen.

On previous generations, brw_blorp_exec took care of flushing the
texture cache by calling intel_batchbuffer_emit_mi_flush after doing
any rendering.  If we were to use the normal drawing path, then
brw_postdraw_set_buffers_need_resolve would handle this.

On Broadwell, we don't use BLORP, and we don't emit a rectangle
primitive via the normal drawing path.  The 3DSTATE_WM_HZ_OP and
PIPE_CONTROL implicitly make drawing happen.  So, none of our existing
code makes this flush happen - we need to do it directly.

Fixes 11 Piglit copyteximage subtests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77223
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77226
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Use uint16_t for control/src index tables.
Matt Turner [Mon, 21 Apr 2014 01:12:38 +0000 (18:12 -0700)]
i965: Use uint16_t for control/src index tables.

No need to use 32-bits to store 15 and 12.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agoi965/disasm: Fix s/xoo/xor/ typo.
Matt Turner [Sun, 20 Apr 2014 21:36:37 +0000 (14:36 -0700)]
i965/disasm: Fix s/xoo/xor/ typo.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/disasm: Remove tables with obvious mappings.
Matt Turner [Sun, 20 Apr 2014 03:46:57 +0000 (20:46 -0700)]
i965/disasm: Remove tables with obvious mappings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa/st: enable EXT_shader_integer_mix when NativeIntegers is on
Ilia Mirkin [Tue, 22 Apr 2014 02:22:27 +0000 (22:22 -0400)]
mesa/st: enable EXT_shader_integer_mix when NativeIntegers is on

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agost/omx/enc: implement frame reordering and B-frames
Christian König [Wed, 26 Mar 2014 16:42:19 +0000 (17:42 +0100)]
st/omx/enc: implement frame reordering and B-frames

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agost/omx/enc: replace omx buffer with texture buffer
Leo Liu [Thu, 17 Apr 2014 16:19:04 +0000 (12:19 -0400)]
st/omx/enc: replace omx buffer with texture buffer

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agoradeonsi: Fix calculation of number of banks for SI
Michel Dänzer [Mon, 21 Apr 2014 09:23:38 +0000 (18:23 +0900)]
radeonsi: Fix calculation of number of banks for SI

The way cik_num_banks() was calculating the index only makes sense for
the CIK specific macrotile mode array. For SI, we need to use the tile
mode index directly.

This happened to work most of the time because most of the SI tiling
modes use the same number of banks.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoglsl: Only allow `invariant` on shader in/out between stages.
Chris Forbes [Mon, 21 Apr 2014 03:45:32 +0000 (15:45 +1200)]
glsl: Only allow `invariant` on shader in/out between stages.

Previously this was special-cased for VS and FS; it never got updated
when geometry shaders came along. Generalize using is_varying_var() so
this won't be broken again with tessellation.

Note that there are two copies of the logic for `invariant`: It can be
present as part of a new declaration, and also as a redeclaration of an
existing variable or block member.

Fixes the four new piglits:
   spec/glsl-1.50/compiler/invariant-qualifier-*.geom

Note for stable: This won't quite pick cleanly due to whitespace and
state->target -> state->stage renames. Should be straightforward
adjustments though.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agosvga: move draw debug code into separate function
Brian Paul [Mon, 21 Apr 2014 20:23:38 +0000 (14:23 -0600)]
svga: move draw debug code into separate function

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agomesa: move declaration before code
Brian Paul [Mon, 21 Apr 2014 19:24:25 +0000 (13:24 -0600)]
mesa: move declaration before code

To fix MSVC build.

10 years agomesa: Fix error code generation in glReadPixels()
Anuj Phogat [Thu, 13 Mar 2014 01:02:30 +0000 (18:02 -0700)]
mesa: Fix error code generation in glReadPixels()

Section 4.3.1, page 220, of OpenGL 3.3 specification explains
the error conditions for glreadPixels():

   "If the format is DEPTH_STENCIL, then values are taken from
    both the depth buffer and the stencil buffer. If there is
    no depth buffer or if there is no stencil buffer, then the
    error INVALID_OPERATION occurs. If the type parameter is
    not UNSIGNED_INT_24_8 or FLOAT_32_UNSIGNED_INT_24_8_REV,
    then the error INVALID_ENUM occurs."

Fixes failing Khronos CTS test packed_depth_stencil_error.test

V2: Avoid code duplication

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Add an error condition in glGetFramebufferAttachmentParameteriv()
Anuj Phogat [Wed, 12 Mar 2014 00:04:11 +0000 (17:04 -0700)]
mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()

From the OpenGL 4.4 spec page 275:
  "If pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, param will
   contain the format of components of the specified attachment,
   one of FLOAT, INT, UNSIGNED_INT, SIGNED_NORMALIZED, or
   UNSIGNED_NORMALIZED for floating-point, signed integer,
   unsigned integer, signed normalized fixedpoint, or unsigned
   normalized fixed-point components respectively. If no data
   storage or texture image has been specified for the attachment,
   param will contain NONE. This query cannot be performed for a
   combined depth+stencil attachment, since it does not have a
   single format."

Fixes Khronos CTS test: packed_depth_stencil_parameters.test

Khronos Bug# 9170
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agolibgl-gdi: silence unused variable warning when not using LLVM
Brian Paul [Mon, 21 Apr 2014 15:49:40 +0000 (09:49 -0600)]
libgl-gdi: silence unused variable warning when not using LLVM

10 years agodocs: import 10.0.5 release notes and update links
Brian Paul [Mon, 21 Apr 2014 15:00:06 +0000 (09:00 -0600)]
docs: import 10.0.5 release notes and update links

10 years agodocs: import 10.1.1 release notes, update links
Brian Paul [Mon, 21 Apr 2014 14:56:31 +0000 (08:56 -0600)]
docs: import 10.1.1 release notes, update links

10 years agomesa: fix GetStringi error message with correct function name
Benjamin Bellec [Mon, 21 Apr 2014 14:44:20 +0000 (08:44 -0600)]
mesa: fix GetStringi error message with correct function name

Signed-off-by: Benjamin Bellec <b.bellec@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: <mesa-stable@lists.freedesktop.org>
10 years agost/mesa: fix invalid pointer use in st_texture_get_sampler_view()
Brian Paul [Fri, 18 Apr 2014 18:20:28 +0000 (12:20 -0600)]
st/mesa: fix invalid pointer use in st_texture_get_sampler_view()

The '**used' pointer was pointing into the stObj->sampler_views array.
If 'free' was null, we'd realloc that array, thus making the 'used'
pointer invalid.  This soon led to memory errors.

Just change the pointer to be '*used' so it points directly at the
pipe_sampler_view.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoglsl: Fix typo
Chris Forbes [Mon, 21 Apr 2014 03:55:58 +0000 (15:55 +1200)]
glsl: Fix typo

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: Use ctx->Texture._MaxEnabledTexImageUnit for upper bound
Chris Forbes [Sun, 13 Apr 2014 00:37:32 +0000 (12:37 +1200)]
i965: Use ctx->Texture._MaxEnabledTexImageUnit for upper bound

Avoid looping over 32/48/96 (!!) tex image units every draw, most of
which we don't care about.

Improves performance on everyone's favorite not-a-benchmark by 2.9% on
Haswell.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Track max enabled tex image unit
Chris Forbes [Sun, 13 Apr 2014 00:37:31 +0000 (12:37 +1200)]
mesa: Track max enabled tex image unit

This gives us a better bound for some hot loops in the drivers than
MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is ridiculously large on modern
hardware, and only getting worse as more shader stages are added.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agonouveau/codegen: add missing values for OP_TXLQ into the target arrays
Ilia Mirkin [Fri, 18 Apr 2014 06:25:43 +0000 (02:25 -0400)]
nouveau/codegen: add missing values for OP_TXLQ into the target arrays

Also rework things so that if someone were to add an opcode without
adjusting the values in these arrays, there will be a compilation error.

This fixes a few quadop-related piglit regressions since commit
d5faf8e78603.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonvc0: change logic for centering of eng2d blit when downsampling
Ilia Mirkin [Fri, 18 Apr 2014 04:08:16 +0000 (00:08 -0400)]
nvc0: change logic for centering of eng2d blit when downsampling

We want to center the sample. The old code may have been correct given
the limited values of ms_x/y, but the new logic should be more
intuitive. Note that ms_x can only be 1/2 and ms_y can only be 0/1.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agonv50: use 2d blit when src/dst have same number of samples
Ilia Mirkin [Fri, 18 Apr 2014 03:51:25 +0000 (23:51 -0400)]
nv50: use 2d blit when src/dst have same number of samples

The 2D engine should be usable in more cases, but this fixes MS blits
between textures with the same MS settings. Otherwise a single sample is
selected to be the target texel value.

This allows other tests to work that render to a RB and then blit that
to a texture for input into a shader that uses sampler2DMS to verify it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agogallium/docs: fix PIPE_CAP_ENDIANNESS delimiter, remove trailing spaces
Ilia Mirkin [Fri, 18 Apr 2014 00:16:02 +0000 (20:16 -0400)]
gallium/docs: fix PIPE_CAP_ENDIANNESS delimiter, remove trailing spaces

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agomesa: update glext.h to version 20140313
Petri Latvala [Mon, 17 Mar 2014 08:43:50 +0000 (10:43 +0200)]
mesa: update glext.h to version 20140313

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/fs: Implement fs_inst::force_sechalf support on Broadwell.
Kenneth Graunke [Fri, 18 Apr 2014 00:58:45 +0000 (17:58 -0700)]
i965/fs: Implement fs_inst::force_sechalf support on Broadwell.

Back when I originally wrote this code, force_sechalf was only used for
Gen4 code, so I didn't bother hooking it up.  However, it's used more
generally these days.  In particular, we use it for computing
gl_SamplePosition.

Fixes Piglit's spec/ARB_sample_shading/builtin-gl-sample-position tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77222
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Allow explicit binding on atomics again
Chris Forbes [Sat, 12 Apr 2014 07:44:46 +0000 (19:44 +1200)]
glsl: Allow explicit binding on atomics again

As of 943b2d52bf5, layout(binding) on an atomic would fail the assertion
here.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoradeonsi: fix num banks selection on SI for dma setup (v2)
Alex Deucher [Fri, 18 Apr 2014 17:03:37 +0000 (13:03 -0400)]
radeonsi: fix num banks selection on SI for dma setup (v2)

The number of banks varies based on the tile mode index
just like CIK.

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

v2: fix ordering for nbanks calculation for consistency

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoi965/fs: Reduce restrictions on interference in register coalescing.
Matt Turner [Wed, 16 Apr 2014 05:46:55 +0000 (22:46 -0700)]
i965/fs: Reduce restrictions on interference in register coalescing.

We previously only allowed coalescing registers that interfere (i.e.,
whose live ranges overlap) if the destination register's live range was
entirely inside the source's live range. This is unnecessary -- we only
need to check for interfering writes in the intersection of their live
ranges.

total instructions in shared programs: 1639470 -> 1638453 (-0.06%)
instructions in affected programs:     84751 -> 83734 (-1.20%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Give up in interference check if we see a WHILE.
Matt Turner [Wed, 16 Apr 2014 01:59:24 +0000 (18:59 -0700)]
i965/fs: Give up in interference check if we see a WHILE.

Rather than any old control flow. Muchnick's algorithm just checks for
interfering writes between the MOV and the end of the program. Handling
this when you have backward branches is hard, so don't, but there's no
reason to bail if you see forward branches.

instructions in affected programs:     4270 -> 4248 (-0.52%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Simplify interference scan in register coalescing.
Matt Turner [Wed, 9 Apr 2014 21:31:10 +0000 (14:31 -0700)]
i965/fs: Simplify interference scan in register coalescing.

We were starting at the beginning of the instruction list, rather than
with the MOV instruction itself. This allows us to coalesce after
control flow.

Excluding the shaders from an unreleased title, the shader-db results:

total instructions in shared programs: 1603791 -> 1594215 (-0.60%)
instructions in affected programs:     678772 -> 669196 (-1.41%)
GAINED:                                5
LOST:                                  0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Unindent can_coalesce_vars().
Matt Turner [Wed, 9 Apr 2014 21:23:07 +0000 (14:23 -0700)]
i965/fs: Unindent can_coalesce_vars().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Recognize nop-MOV instructions early.
Matt Turner [Wed, 16 Apr 2014 01:15:59 +0000 (18:15 -0700)]
i965/fs: Recognize nop-MOV instructions early.

And avoid rewriting other instructions unnecessarily. Removes a few
self-moves we weren't able to handle because they were components of a
large VGRF.

instructions in affected programs:     830 -> 826 (-0.48%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Only sweep NOPs if register coalescing made progress.
Matt Turner [Tue, 15 Apr 2014 23:28:04 +0000 (16:28 -0700)]
i965/fs: Only sweep NOPs if register coalescing made progress.

Otherwise there's nothing to do.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agor600g,radeonsi: don't skip the context flush if a fence should be returned
Marek Olšák [Fri, 18 Apr 2014 11:25:11 +0000 (13:25 +0200)]
r600g,radeonsi: don't skip the context flush if a fence should be returned

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

10 years agosvga: fix comment for emit_adjusted_vertex_attribs()
Brian Paul [Thu, 17 Apr 2014 22:15:37 +0000 (16:15 -0600)]
svga: fix comment for emit_adjusted_vertex_attribs()

10 years agosvga: compute need_swvfetch in svga_create_vertex_elements_state()
Brian Paul [Thu, 17 Apr 2014 18:27:53 +0000 (11:27 -0700)]
svga: compute need_swvfetch in svga_create_vertex_elements_state()

This saves us doing it at state validation time.

Reviewed-by: Matthew McClure <mcclurem@vmware.com>
10 years agosvga: add VS code to set attribute W component to 1
Brian Paul [Thu, 17 Apr 2014 16:00:29 +0000 (09:00 -0700)]
svga: add VS code to set attribute W component to 1

There's a few 3-component vertex attribute formats that have no
equivalent SVGA3D_DECLTYPE_x format.  Previously, we had to use
the swtnl code to handle them.  This patch lets us use hwtnl for
more vertex attribute types by fetching 3-component attributes as
4-component attributes and explicitly setting the W component to 1.

This lets us handle PIPE_FORMAT_R16G16B16_SNORM/UNORM and
PIPE_FORMAT_R8G8B8_UNORM vertex attribs without using the swtnl path.

Fixes piglit normal3b3s GL_SHORT test.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agosvga: implement support for signed byte vertex attributes
Brian Paul [Thu, 17 Apr 2014 15:54:47 +0000 (08:54 -0700)]
svga: implement support for signed byte vertex attributes

There's no SVGA3D_DECLTYPE that directly corresponds to
PIPE_FORMAT_R8G8B8_SNORM.  Previously, we used the swtnl fallback
path to handle this but that's slow and causes invariance issues.
Now we fetch the attribute as SVGA3D_DECLTYPE_UBYTE4N and insert
some extra VS instructions to remap the attributes from the range
[0,1] to the range[-1,1].

Fixes Sauerbraten sw fallback.
Fixes piglit normal3b3s-invariance test.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agosvga: move translated vertex declaration types into svga_velems_state
Brian Paul [Thu, 17 Apr 2014 15:45:25 +0000 (08:45 -0700)]
svga: move translated vertex declaration types into svga_velems_state

Now only translate the formats once in svga_create_vertex_elements_state().
And rename the array and use the proper SVGA3dDeclType type.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agoRevert "svga: add work-around for Sauerbraten Z fighting issue"
Brian Paul [Tue, 15 Apr 2014 16:28:16 +0000 (09:28 -0700)]
Revert "svga: add work-around for Sauerbraten Z fighting issue"

This reverts commit c875d6e57a817bb6a8163a8a98ebd2768ee91848.

Conflicts:
src/gallium/drivers/svga/svga_context.c

This work-around will no longer be needed after the next patch
which properly supports signed-byte vertex attributes.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agosvga: use new inst_token_setp() helper function
Brian Paul [Tue, 15 Apr 2014 16:18:46 +0000 (09:18 -0700)]
svga: use new inst_token_setp() helper function

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agosvga: use new inst_token_predicated() helper function
Brian Paul [Tue, 15 Apr 2014 16:13:04 +0000 (09:13 -0700)]
svga: use new inst_token_predicated() helper function

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
10 years agoi965: Retype pre-Gen6 varying pull load destination to UW.
Kenneth Graunke [Thu, 17 Apr 2014 03:15:23 +0000 (20:15 -0700)]
i965: Retype pre-Gen6 varying pull load destination to UW.

This sets up the proper execution mask for sends in SIMD16 mode.

Fixes Piglit's glsl-fs-normalmatrix, glsl-fs-uniform-array-2,
glsl-fs-uniform-array-6, and glsl-fs-uniform-array-7 on Ironlake,
which regressed when I enabled SIMD16 pull parameter support in
commit b207e88b25e526d0f1ada7b19605b880a27866dc.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Fix error condition for multisample proxy texture targets
Anuj Phogat [Fri, 4 Apr 2014 01:29:52 +0000 (18:29 -0700)]
mesa: Fix error condition for multisample proxy texture targets

Fixes failures in Khronos OpenGL CTS test proxy_textures_invalid_samples

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Add glBlitFramebuffer to commands affected by conditional rendering
Anuj Phogat [Fri, 4 Apr 2014 23:49:19 +0000 (16:49 -0700)]
i965: Add glBlitFramebuffer to commands affected by conditional rendering

Fixes failures in Khronos OpenGL CTS test conditional_render_test9

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoswrast: Add glBlitFramebuffer to commands affected by conditional rendering
Anuj Phogat [Mon, 7 Apr 2014 18:20:55 +0000 (11:20 -0700)]
swrast: Add glBlitFramebuffer to commands affected by conditional rendering

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoi965: Fix component mask and varying_to_slot mapping for gl_ViewportIndex
Anuj Phogat [Fri, 11 Apr 2014 17:56:50 +0000 (10:56 -0700)]
i965: Fix component mask and varying_to_slot mapping for gl_ViewportIndex

gl_ViewportIndex doesn't get its own varying slot. It is stored
in VARYING_SLOT_PSIZ.z. This patch fixes the issue for both gen7
and gen8 because gen7_upload_3dstate_so_decl_list() is shared
between them.

Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins.
Makes new piglit test glsl-1.50-transform-feedback-builtins pass for
'gl_ViewportIndex'.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Fix component mask and varying_to_slot mapping for gl_Layer
Anuj Phogat [Fri, 11 Apr 2014 17:55:38 +0000 (10:55 -0700)]
i965: Fix component mask and varying_to_slot mapping for gl_Layer

gl_Layer doesn't get its own varying slot. It is stored in
VARYING_SLOT_PSIZ.y. This patch fixes the issue for both gen7
and gen8 because gen7_upload_3dstate_so_decl_list() is shared
between them.

Fixes failures in OpenGL Khronos CTS test transform_feedback_builtins.
Makes new piglit test glsl-1.50-transform-feedback-builtins pass for
'gl_Layer'.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Put an assertion to check valid varying_to_slot[varying]
Anuj Phogat [Mon, 14 Apr 2014 21:09:32 +0000 (14:09 -0700)]
i965: Put an assertion to check valid varying_to_slot[varying]

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoradeonsi: Added Diag Handler to receive LLVM Error messages
Darren Powell [Mon, 31 Mar 2014 22:00:28 +0000 (18:00 -0400)]
radeonsi: Added Diag Handler to receive LLVM Error messages

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agowinsys/radeon: remove some unused code
Marek Olšák [Wed, 16 Apr 2014 12:02:26 +0000 (14:02 +0200)]
winsys/radeon: remove some unused code

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agowinsys/radeon: remove is_handle_added array
Marek Olšák [Mon, 14 Apr 2014 13:32:39 +0000 (15:32 +0200)]
winsys/radeon: remove is_handle_added array

Use index -1 if a buffer is not added.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agowinsys/radeon: remove local variable reloc from radeon_get_reloc
Marek Olšák [Mon, 14 Apr 2014 13:25:43 +0000 (15:25 +0200)]
winsys/radeon: remove local variable reloc from radeon_get_reloc

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>