Commit Graph

83902 Commits

Author SHA1 Message Date
Ilia Mirkin e988999791 nv50/ir: fix bb positions after exit instructions
It's fairly rare that the BB layout puts BBs after the exit block, which
is likely the reason these issues lingered for so long.

This fixes a fraction of issues with the giant pixmark piano shader.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
2016-08-16 21:56:16 -04:00
Ilia Mirkin 0b5f40b881 nv50/ir: properly clear upper bits of a bitset fill
Found by inspection. In practice, val is always == 0, so this never got
triggered.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-08-16 21:56:16 -04:00
Francisco Jerez 4d436c011f i965/fs: Estimate maximum sampler message execution size more accurately.
The current logic used to determine the execution size of sampler
messages was based on special-casing several argument and opcode
combinations, which unsurprisingly missed the possibility that some
messages could exceed the payload size limit or not depending on the
number of coordinate components present.  In particular:

 - The TXL, TXB and TEX messages (the latter on non-FS stages only)
   would attempt to use SIMD16 on Gen7+ hardware even if a shadow
   reference was present and the texture was a cubemap array, causing
   it to overflow the maximum supported sampler payload size and
   crash.

 - The TG4_OFFSET message with shadow comparison was falling back to
   SIMD8 regardless of the number of coordinate components, which is
   unnecessary when two coordinates or less are present.

Both cases have been handled incorrectly ever since cubemap arrays and
texture gather were respectively enabled (the current logic used by
the SIMD lowering pass is almost unchanged from the previous no16
fall-back logic used pre-SIMD lowering times).

Fixes the following GL4.5 conformance test on Gen7-8 (the bug also
affects Gen9+ in principle, but SKL passes the test by luck because it
manages to use the TXL_LZ message instead of TXL):

 GL45-CTS.texture_cube_map_array.sampling

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97267
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-16 16:31:59 -07:00
Francisco Jerez 61a02fb74c i965/fs: Return zero from fs_inst::components_read for non-present sources.
This makes it easier for the caller to find out how many scalar
components are actually read by the instruction.  As a bonus we no
longer need to special-case BAD_FILE in the implementation of
fs_inst::regs_read.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-16 16:31:59 -07:00
Francisco Jerez 0c754d1c42 i965/fs: Lower TEX to TXL during NIR translation.
This simplifies the code slightly and will allow the SIMD lowering
pass to find out easily what the actual texturing opcode is in order
to determine the maximum execution size of texturing instructions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-08-16 16:31:59 -07:00
Rob Clark 5def00875d freedreno/a3xx: fix generic clear path
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-08-16 19:26:03 -04:00
Brian Paul df2dcf6200 st/mesa: use pipe var instead of st->pipe in st_create_context_priv()
As is done in most other places in the function.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 08:28:33 -06:00
Brian Paul 038b1b11fe gallium: remove unused u_clear.h file
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 08:28:33 -06:00
Brian Paul 22b8288b33 gallium/i915: inline the util_clear() code into i915_clear_blitter()
This is the only place the util_clear() function was used.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 08:28:32 -06:00
Brian Paul 66debeae9d gallium/util: minor reformatting in u_box.h
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 08:28:32 -06:00
Brian Paul b6c81a780f svga: remove unused var in svga_mark_surfaces_dirty()
Signed-off-by: Brian Paul <brianp@vmware.com>
2016-08-16 08:28:22 -06:00
Brian Paul 1e5eb79d9a svga: avoid a calloc in svga_buffer_transfer_map()
Just initialize the two other pipe_transfer fields explicitly.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-08-16 08:24:53 -06:00
Brian Paul f934117bbb svga: don't call os_get_time() when not needed by Gallium HUD
The calls to os_get_time() were showing up higher than expected in
profiles.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-08-16 08:24:53 -06:00
Brian Paul dcf2126f90 svga: remove unneeded memset() call in draw_vgpu10()
All three fields of the vbuffer_attrs[] array are assigned in the following
loop.  The remaining elements of the array are not used.

Tested with full Piglit run, Heaven 4.0, etc.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-08-16 08:24:52 -06:00
Brian Paul ced0dd0e95 svga: reduce looping in svga_mark_surfaces_dirty()
We don't need to loop over the max number of color buffers, just the
current number (which is usually one).

Tested with full Piglit run, Heaven 4.0, etc.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-08-16 08:24:52 -06:00
Brian Paul 88efaf9878 svga: minor clean-ups in define_rasterizer_object()
Add const qualifiers, new comment.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-08-16 08:24:52 -06:00
Brian Paul ce9c05a593 svga: remove incorrect buffer invalidation code
Fixes regression with team_fortress_2 trace.
This change has been in our in-house tree for some time.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-08-16 08:24:52 -06:00
Brian Paul 06b23f747d svga: additional comments for svga_hw_draw_state members
And re-order a few fields.

Signed-off-by: Brian Paul <brianp@vmware.com>
2016-08-16 08:24:52 -06:00
Brian Paul 7c5eda6f4e svga: use the sws local var to simplify some code
Signed-off-by: Brian Paul <brianp@vmware.com>
2016-08-16 08:24:52 -06:00
Brian Paul 7b821941f6 svga: minor whitespace and code clean-ups
Signed-off-by: Brian Paul <brianp@vmware.com>
2016-08-16 08:24:52 -06:00
Rob Clark 27f12dd8fd freedreno/a4xx: use generic clear path
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-08-16 09:21:13 -04:00
Rob Clark f77e59e76c freedreno/a3xx: use generic clear path
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-08-16 09:21:13 -04:00
Rob Clark a8e6734a83 freedreno: support for using generic clear path
Since clears are more or less just normal draws, there isn't that much
benefit in having hand-rolled clear path.  Add support to use u_blitter
instead if gen specific backend doesn't implement ctx->clear().

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-08-16 09:21:13 -04:00
Rob Clark 142dd7b9c0 gallium/u_blitter: split out a helper for common clear state
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 09:21:13 -04:00
Rob Clark 2b2f436c69 gallium/u_blitter: add helper to save FS const buffer state
Not (currently) state that is overwridden by u_blitter itself, but
drivers with custom blit/clear which are reusing part of the u_blitter
infrastructure will use it.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 09:21:13 -04:00
Rob Clark 433e12fea8 gallium/u_blitter: export some functions
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-08-16 09:21:13 -04:00
Nicolas Boichat 78e3cea419 egl/dri2: dri2_make_current: Release previous context's display
eglMakeCurrent can also be used to change the active display. In that
case, we need to decrement ref_count of the previous display (possibly
destroying it), and increment it on the next display.

Also, old_dsurf/old_rsurf cannot be non-NULL if old_ctx is NULL, so
we only need to test if old_ctx is non-NULL.

v2: Save the old display before destroying the context.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97214
Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reported-by: Alexandr Zelinsky <mexahotabop@w1l.ru>
Tested-by: Alexandr Zelinsky <mexahotabop@w1l.ru>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
2016-08-16 17:30:35 +09:00
Nayan Deshmukh 09dff7ae2e st/vdpau: change the order in which filters are applied(v3)
Apply the median and matrix filter before the compostioning
we apply the deinterlacing first to avoid the extra overhead
in processing the past and the future surfaces in deinterlacing.

v2: apply the filters on all the surfaces (Christian)
v3: use get_sampler_view_planes() instead of
    get_sampler_view_components() and iterate over
    VL_MAX_SURFACES (Christian)

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2016-08-16 10:07:35 +02:00
Kenneth Graunke 1f47f78fc3 glcpp: Update tests for new #undef of built-in macro rules.
Ian recently changed the preprocessor to allow this in most GLSL
versions, but not GLSL ES 3.00+.  This patch converts the existing
test that expects a failure to a #version 300 es shader, and adds
a #version 110 shader to make sure that it's allowed.

Fixes 'make check'.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97307
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2016-08-15 22:55:34 -07:00
Dave Airlie c2f2252037 anv: fix writemask on blit fragment shader.
I'm not sure if anything even uses this, but I found this on radv, so
just fix it on anv for consistency.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-08-16 10:29:44 +10:00
Nicolas Boichat c0580f6a38 egl/android: Set dpy->DriverData to NULL on error
Avoid use-after-free on error.

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15 19:00:30 +01:00
Nicolas Boichat a9e8fb7397 egl/drm: Set disp->DriverData to NULL on error
Avoid use-after-free on error.

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15 19:00:30 +01:00
Nicolas Boichat 0e67d86540 egl/surfaceless: Set disp->DriverData to NULL on error
Avoid use-after-free on error.

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15 19:00:30 +01:00
Nicolas Boichat 48fd952f28 egl/wayland: Set disp->DriverData to NULL on error
Avoid use-after-free, fix spec@egl_khr_fence_sync@conformance.

Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reported-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15 19:00:30 +01:00
Jan Ziak 769ac1ec78 egl/x11: avoid using freed memory if dri2 init fails
Found with valgrind:

==4841== Invalid read of size 4
==4841==    at 0x56BDC80: dri2_initialize (egl_dri2.c:783)
==4841==    by 0x56BAFE5: _eglMatchAndInitialize (egldriver.c:261)
==4841==    by 0x56BB15E: _eglMatchDriver (egldriver.c:295)
==4841==    by 0x56B58C9: eglInitialize (eglapi.c:480)
==4841==    by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x402E59: main
==4841==  Address 0x6a05824 is 148 bytes inside a block of size 480 free'd
==4841==    at 0x4C2B680: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==4841==    by 0x56C2AAE: dri2_initialize_x11_swrast (platform_x11.c:1233)
==4841==    by 0x56C2AAE: dri2_initialize_x11 (platform_x11.c:1493)
==4841==    by 0x56BDCEB: dri2_initialize (egl_dri2.c:805)
==4841==    by 0x56BAFAF: _eglMatchAndInitialize (egldriver.c:261)
==4841==    by 0x56BB0C9: _eglMatchDriver (egldriver.c:292)
==4841==    by 0x56B58C9: eglInitialize (eglapi.c:480)
==4841==    by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x402E59: main
==4841==  Block was alloc'd at
==4841==    at 0x4C2A868: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==4841==    by 0x56C2A47: dri2_initialize_x11_swrast (platform_x11.c:1171)
==4841==    by 0x56C2A47: dri2_initialize_x11 (platform_x11.c:1493)
==4841==    by 0x56BDCEB: dri2_initialize (egl_dri2.c:805)
==4841==    by 0x56BAFAF: _eglMatchAndInitialize (egldriver.c:261)
==4841==    by 0x56BB0C9: _eglMatchDriver (egldriver.c:292)
==4841==    by 0x56B58C9: eglInitialize (eglapi.c:480)
==4841==    by 0x4F537DC: _glfwInitEGL (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x4F4BEFB: _glfwPlatformInit (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x4F46F40: glfwInit (in /usr/lib64/libglfw.so.3.2)
==4841==    by 0x402E59: main

Signed-off-by: Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b@gmail.com>
Fixes: 9ee683f877 (egl/dri2: Add reference count for dri2_egl_display)
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15 19:00:29 +01:00
Emil Velikov 6b4b2a4dd6 anv: add genX_multisample.h to the sources list(s).
Otherwise it won't end up in the release tarball.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15 19:00:29 +01:00
Kevin Strasser 71258e9462 anv/x11: Add support for Xlib platform
Some applications continue to use the Xlib client library and expect that
VK_KHR_xlib_surface will be available in the driver. Service these
applications by converting the Display pointer to xcb_connection_t and use
the existing xcb code in the driver.

Signed-off-by: Kevin Strasser <kevin.strasser@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-08-15 09:47:06 -07:00
Tapani Pälli 5d9b50e596 glx: apple specific occurences of dummyContext check
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Cc: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2016-08-15 09:24:10 +03:00
Bernard Kilarski 2e3f067458 glx: fix error code when there is no context bound
v2: change all related NULL checks to check against dummyContext
v3: really check for dummyContext *only* when ctx was from
    __glXGetCurrentContext
v4: cover more checks, add dummyBuffer, dummyVtable (Emil)

Signed-off-by: Bernard Kilarski <bernard.r.kilarski@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
2016-08-15 09:24:10 +03:00
Mathias Fröhlich 312ece9cd7 mesa: Remove duplicate include.
In api_validate.c stdbool.h was included twice.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-15 07:10:39 +02:00
Mathias Fröhlich 84984b9986 vbo: Remove always true return from vbo_bind_arrays.
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-15 07:10:39 +02:00
Mathias Fröhlich 72f1566f90 mesa: Move check for vbo mapping into api_validate.c.
Instead of checking for mapped buffers in vbo_bind_arrays
do this check in api_validate.c. This additionally
enables printing the draw calls name into the error
string.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-15 07:10:39 +02:00
Mathias Fröhlich b7b0c51f1f mesa: Move _mesa_all_buffers_are_unmapped to arrayobj.c.
Move the function to check if all vao buffers are
unmapped into the vao implementation file.
Rename the function to _mesa_all_buffers_are_unmapped.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-15 07:10:39 +02:00
Mathias Fröhlich c17cf1c8f5 vbo: Array draw must not care about glBegin/glEnd vbo mapping.
In array draw do not check if the vertex buffer object that
is used to implement immediate mode glBegin/glEnd is mapped.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-08-15 07:10:39 +02:00
Ilia Mirkin 5c1ccd8053 nv50,nvc0: fix depth range when halfz is enabled
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97231
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
2016-08-14 17:41:49 -04:00
Ilia Mirkin c85b7f0e87 gallium/util: add helper to compute zmin/zmax for a viewport state
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
2016-08-14 17:41:33 -04:00
Ilia Mirkin 68b64f32e8 vbo: allow DrawElementsBaseVertex in display lists
Looks like it was missed originally. The multi version is there already.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97331
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable@lists.freedesktop.org
2016-08-14 12:06:51 -04:00
Rob Clark 561fd226d4 freedreno/a3xx+a4xx: move common VBOs to fd_context
These are the same for a3xx and later.  (a2xx could probably use them
too, but due to limited hw support and ancient downstream kernels, it
isn't so easy to test.)

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-08-13 13:59:03 -04:00
francians@gmail.com a49fb4ab2d freedreno/a2xx: add missing casts to silence notices
Signed-off-by: Francesco Ansanelli <francians@gmail.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-08-13 09:37:41 -04:00
Rob Clark 78ba262d00 freedreno/ir3: fix issue with emit_tex()
For various tex fetch instructions, coord's get fixed up in different
ways.  But modifying the array returned from get_src() has side-effects
if the same SSA src is used again.. the later instruction will see the
previous fixups.

Fix this, and const'ify things to prevent this sort of mistake in the
future.

Noticed by Varad when adding support for txf_ms.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-08-13 09:33:47 -04:00