Commit graph

85652 commits

Author SHA1 Message Date
Michel Dänzer
67c5e843b9 vl/dri3: Destroy Present event context when destroying drawable v2
Without this, the X server may accumulate stale Present event contexts
if a client performs several video decoding sessions using the same
window.

v2: Based on Chris Wilson's review:
* Use xcb_discard_reply() instead of free(xcb_request_check())

Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
2016-08-04 15:45:43 +09:00
Michel Dänzer
5d191bafa2 loader/dri3: Destroy Present event context when destroying drawable v2
Without this, the X server may accumulate stale Present event contexts
if a client ends up creating and destroying DRI drawables for the same
window.

v2: Based on Chris Wilson's review:
* Use xcb_present_select_input_checked so that protocol errors
  generated by old X servers can be handled gracefully
* Use xcb_discard_reply() instead of free(xcb_request_check())
2016-08-04 15:45:43 +09:00
Ben Widawsky
1743c4184b gbm: Correct bo_import documentation (trivial)
Missed here:
commit a43d286ef7
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Fri Mar 28 10:17:11 2014 -0700

    gbm: Add import from fd

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-08-03 10:56:41 -07:00
Eric Anholt
bc1fc9c985 vc4: Avoid generating a custom shader per level in glGenerateMipmaps().
We were baking in the LOD of the source level to each shader.  Instead,
pass it in as a uniform -- this requires storing it to a temp register,
but that's better than compiling a ton of separate shaders:

total instructions in shared programs: 115032 -> 115036 (0.00%)
instructions in affected programs:     96 -> 100 (4.17%)
LOST:                                  572
2016-08-03 10:55:54 -07:00
Eric Anholt
e97e9e62a1 vc4: Tell valgrind about BO allocations from mmap time to destroy.
This helps in debugging memory pressure.  It would be nice if we could
tell valgrind about it all the way from allocation time to destroy, but we
need a pointer to hand to VALGRIND_MALLOCLIKE_BLOCK.
2016-08-03 10:28:20 -07:00
Jan Ziak
fd32868590 loader: fix memory leak in loader_dri3_open
Found via "valgrind --leak-check=full glxgears".

Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b@gmail.com>
Acked-by: Boyan Ding <boyan.j.ding@gmail.com>
Cc: "12.0 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-03 10:25:09 -07:00
Eric Anholt
a0671d67de vc4: Fix a leak of the src[] array of VPM reads in optimization.
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-08-03 10:25:09 -07:00
Eric Anholt
9f95690959 vc4: Fix leak of the bo_handles table. 2016-08-03 10:25:08 -07:00
Eric Anholt
02f8c444e8 vc4: Fix handling of UBO range offsets.
The ranges are in units of bytes, not dwords.  This wasn't caught by
piglit tests because ttn tends to make one big uniform file, so we only
had one UBO range with a src and dst offset of 0.
2016-08-03 10:25:08 -07:00
Eric Anholt
9128acfb57 nir: Allow opt_peephole_select to work on empty blocks.
nir_opt_peephole_select has the job of removing IF statements with no side
effects.  However, if the IF statement's successor didn't have any
instructions in it, we were skipping it, which occurred in mupen64 on vc4
with glsl_to_nir enabled:

instructions in affected programs:     6134 -> 4120 (-32.83%)
total uniforms in shared programs: 38268 -> 38219 (-0.13%)

No changes on Haswell shader-db.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-03 10:25:08 -07:00
Eric Anholt
36b9eb82c1 vc4: Dump NIR at shader state creation time as well.
I keep wanting to see this version of the NIR.
2016-08-03 10:25:08 -07:00
Marek Olšák
435d9595d3 r600g: use last_gfx_fence like radeonsi
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
a6bfafa083 gallium/radeon: move last_gfx_fence from radeonsi to common code
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
c15a9dec29 radeonsi: skip unnecessary si_update_shaders calls
Small decrease in draw call overhead.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
c2a0e99169 radeonsi: print the command line to VM fault reports (v2)
v2: rebase on top of Brian's commit

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
6573ad69ef ddebug: print the command line to all logs (v2)
for piglit with the pipelined hang detection mode

v2: rebase on top of Brian's commit

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
840353059a ddebug: don't use fmemopen on non-Linux OS
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97140

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
c88b309fd5 radeonsi: don't set the last parameter component of llvm.AMDGPU.cube
LLVM doesn't use it.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
42c5f839ad radeonsi: use llvm.amdgcn.cube* if available
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
1fb6e55eaf radeonsi: use llvm.amdgcn.rsq.f64 if available
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Marek Olšák
db2d31dab1 radeonsi: use v_mad_f32 for fma
v_fma_f32 runs at FP64 rate (= slow). Alien Isolation and F1 2015 seem
to use fma for all d3d multiply-add instructions, which is silly.

This tries to restore performance for those games.

The main difference between v_mad_f32 and v_fma_f32 is that v_mad doesn't
support denormals, which we don't enable anyway, because they are slow too.

Also, there is code size reduction:
  Totals from affected shaders:
  VGPRS: 109796 -> 109808 (0.01 %)
  Spilled SGPRs: 29995 -> 30022 (0.09 %)
  Spilled VGPRs: 12 -> 13 (8.33 %) <-- it's just one shader going from 12 to 13
  Code Size: 6667596 -> 6476356 (-2.87 %) bytes
  Max Waves: 26931 -> 26899 (-0.12 %)

I've not actually tested real performance.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-08-03 17:46:46 +02:00
Haixia Shi
4c4bfed670 i965: use mt->offset in intel_miptree_map_movntdqa()
We need to include mt->offset in the calculation of src pointer because its
value may be non-zero, for example in a cubemap texture.

Signed-off-by: Haixia Shi <hshi@chromium.org>
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Chad Versace <chad@kiwitree.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Change-Id: I461ad5b204626d5a1c45611fc6b63735dcf29f63
2016-08-03 08:28:52 -07:00
Timothy Arceri
6fb6201f71 nir: fix validation message
Looks like a copy and paste error from f752effa08

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-08-03 09:31:57 +10:00
Chad Versace
2d788a9181 .mailmap: Update my address
I left Intel, so make my personal address the canonical address.
2016-08-02 13:29:53 -07:00
Tim Rowley
11072de368 swr: build swr with -fno-strict-aliasing
swr rasterizer contains numerous data transfers between vectors
and ordinary C types.  Fixing for strict aliasing will take time.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-08-02 14:30:33 -05:00
Andres Gomez
3356ac208b ast: Updated AST_NUM_OPERATORS for coherence with ast_operators
AST_NUM_OPERATORS stores the dimension of the ast_operators
enumeration but was not updated after its last modification.

This doesn't add any real modification for any code paths but it makes
sense for coherence.

v2 (Eric Engestrom): Just place the define at the end of the
                     enumeration, not below.

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-08-02 21:33:03 +03:00
Matt Turner
c3211ae093 i965: Disable the unlit centroid workaround on Gen7.
Once upon a time (commit 8313f44409) Paul added code for the unlit
centroid workaround (WaCopyUnlitCentroidBarys). His commit message
claims it fixed the EXT_framebuffer_multisample/interpolation {2,4}
{centroid-deriv,centroid-deriv-disabled} piglit tests but does not say
on which platform, though he cites the IVB PRM.

"3DSTATE_WM [DevIVB, DevHSW]" says

   "[DevIVB]: Workaround: When Centroid Barycentric mode is required, HW
    may produce incorrect interpolation results when a 2X2 pixels have
    unlit pixels."

I later disabled it for Haswell (commit f6db414f3c) with no known ill
effects.

The Sandybridge page does not have this text, but the workarounds
database (see WaCopyUnlitCentroidBarys) says the issues applies *only*
to Sandybridge, and in fact in commit 1a2de7dce8 I note that disabling
the workaround on Sandybridge causes the tests Paul originally mentioned
to fail.

So this is, and always has been, a huge confusing mess.

Disabling the workaround indeed causes the tests Paul originally
mentioned to fail on Sandybridge but not on Ivybridge/Baytrail.

On Ivybridge:

   total instructions in shared programs: 6914901 -> 6909599 (-0.08%)
   instructions in affected programs: 106766 -> 101464 (-4.97%)
   helped: 884

   total cycles in shared programs: 70874764 -> 70813774 (-0.09%)
   cycles in affected programs: 794144 -> 733154 (-7.68%)
   helped: 688
   HURT: 186

   LOST:   1
   GAINED: 6

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-02 10:37:13 -07:00
Marek Olšák
6db93cd167 gallium/util: fix align64
it cut off the upper 32 bits

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-08-01 23:28:14 +02:00
Matt Turner
88ad8c7ded mesa: Drop -fno-strict-aliasing.
Improves performance of OglBatch7 by 4.06851% +/- 1.17925% (n=169) on
Haswell, and cuts ~18k of .text:

   text     data      bss      dec      hex  filename
5824627   287816    29384  6141827   5db783  before/i965_dri.so
5806354   287816    29384  6123554   5d7022  after/i965_dri.so

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2016-08-01 12:09:17 -07:00
Matt Turner
12a14052e8 i915: Avoid aliasing violation.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-08-01 12:09:17 -07:00
Matt Turner
be35c6ba92 draw: Avoid aliasing violations.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-01 12:09:17 -07:00
Matt Turner
8e68f35d32 r600g: Avoid aliasing violations.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-01 12:09:17 -07:00
Matt Turner
d2838f77ec r300g: Avoid aliasing violation.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-01 12:09:17 -07:00
Matt Turner
16ff8f9ae8 gallium/auxiliary: Add u_bitcast.h header.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-01 12:09:17 -07:00
Matt Turner
bbe012f02a glsl_to_tgsi: Avoid aliasing violations.
Reviewed-by: Dave Airlie <airlied@redhat.com>
2016-08-01 12:09:17 -07:00
Brian Paul
500a3dd11f st/mesa: silence missing braces warning in st_program.c
Silence a gcc warning:
state_tracker/st_program.c: In function 'st_create_fp_variant':
state_tracker/st_program.c:957:10: warning: missing braces around initializer [-Wmissing-braces]
          nir_lower_drawpixels_options options = {0};
          ^
state_tracker/st_program.c:957:10: warning: (near initialization for 'options.texcoord_state_tokens') [-Wmissing-braces]

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-01 12:20:19 -06:00
Brian Paul
13fa051356 auxiliary/os: add new os_get_command_line() function
This can be used by the driver to get the command line which started
the process.  Will be used by the VMware driver for extra logging.

For now, this is only implemented for Linux via /proc/self/cmdline
and Windows via GetCommandLine().

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-01 12:20:19 -06:00
Charmaine Lee
c2b4942afc svga: avoid redundant SetVertexBuffer/SetIndexBuffer commands at rebind
This patch eliminates the redundant SetVertexBuffers and
SetIndexBuffer commands that are emitted for rebind purpose.
With this patch, the set commands will be skipped, but we will still
reference the associated resources to allow the kernel to
bring in the resources.

Tested with Lightsmark2008, Valley, MTT glretrace, piglit, conform.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-08-01 12:20:19 -06:00
Rob Clark
53b2b8bf6f u_vbuf: fix potentially bogus assert
There are cases where we hit u_vbuf path due to alignment or pitch-
alignment restrictions, but for an output-format that u_vbuf does not
support translating (yet the driver does support natively).  In which
case we hit the memcpy() path and don't care that u_vbuf doesn't
understand it.

Fixes crash with debug build of mesa in:
dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.user_ptr_stride17_components2_quads1

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95000
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-01 13:42:11 -04:00
Ben Widawsky
e7c8c85785 gbm: Removed unused function.
AFAICT, it's never been used.

It was briefly nudged in the right direction here:
commit 10e5ffd496
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sat Jan 25 17:19:10 2014 +0000

    gbm: do not export _gbm_mesa_get_device

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kristian H. Kristensen <hoegsberg@chromium.org>
2016-08-01 09:11:14 -07:00
Timothy Arceri
cec377eed3 i965: fix comparison warning
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-01 14:52:07 +10:00
Eric Anholt
26ff7e373f vc4: Zero-initialize the hardware sampler view structure.
Fixes failure to initialize the force_first_level flag, causing
failures in piglit levelclamp.
2016-07-31 19:23:03 -07:00
Mathias Fröhlich
b730960e77 mesa: Remove set but not used gl_client_array::Stride.
The field is only read for printing today and
there it was probably a leftover.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:46 +02:00
Mathias Fröhlich
56c65cd315 mesa: Remove set but not used gl_client_array::Enabled.
The way it is used today does not care about the
Enabled flag anymore.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:46 +02:00
Mathias Fröhlich
43a6f435ca vbo: Use the VAO array enabled flags in vbo_exec_array.
Instead of gl_client_array::Enabled inside a VAO,
directly use the gl_vertex_attrib_array::Enabled value
which is the origin of the above.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:46 +02:00
Mathias Fröhlich
4cda690019 vbo: Walk the VAO in check_array_data.
Only a debugging function, but move away from
gl_client_array and use the first order information
from the VAO.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:46 +02:00
Mathias Fröhlich
99b42184f9 vbo: Walk the VAO in print_draw_arrays.
Only a debugging function, but move away from
gl_client_array and use the first order information
from the VAO. Also make use of gl_vert_attrib_name.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:45 +02:00
Mathias Fröhlich
eec516d8e1 mesa: Walk the VAO in _mesa_print_arrays.
Only a debugging function, but move away from
gl_client_array and use the first order information
from the VAO. Also make use of gl_vert_attrib_name.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:45 +02:00
Mathias Fröhlich
144737a498 vbo: Walk the VAO to check for mapped buffers.
Similarily to _mesa_all_varyings_in_vbos walk the VAO
to check if we have an illegal mapped buffer object
instead of walking all gl_client_arrays.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:45 +02:00
Mathias Fröhlich
3f5e5696fe vbo: Walk the VAO to see if all varyings are in vbos.
In vbo_draw_transform_feedback we currently look at
exec->array.inputs to determine if all varying
vertex attributes reside in vbos. But the vbo_bind_arrays
call only happens past the vbo_all_varyings_in_vbos
query. Thus we may work on a stale set of client arrays.
Using the current VAOs content for this query feels much
more logical to me.
Additionally with this change mesa makes more use of the
information already tracked in the VAO instead of looping
across VERT_ATTRIB_MAX vertex arrays.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-07-31 10:05:45 +02:00