Commit Graph

63537 Commits

Author SHA1 Message Date
Bruno Jiménez 0b8c29915b r600g/compute: Avoid problems when promoting items mapped for reading
Acording to the OpenCL spec, it is possible to have a buffer mapped
for reading and at read from it using commands or buffers.

With this we can keep the mapping (that exists against the
temporary item) and read with a kernel (from the item we have
just added to the pool) without problems.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:00 -04:00
Bruno Jiménez 3da1b17555 r600g/compute: Only move to the pool the buffers marked for promoting
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:57 -04:00
Bruno Jiménez 4d1e4429e6 r600g/compute: divide the item list in two
Now we will have a list with the items that are in the pool
(item_list) and the items that are outside it (unallocated_list)

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:54 -04:00
Bruno Jiménez e3dfe3f7b2 r600g/compute: Add statuses to the compute_memory_items
These statuses will help track whether the items are mapped
or if they should be promoted to or demoted from the pool

v2: Use the new is_item_in_pool util function,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:50 -04:00
Bruno Jiménez 9e491eb5d7 r600g/compute: Add an util function to know if an item is in the pool
Every item that has been placed in the pool must have start_in_dw
different from -1.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:46 -04:00
Bruno Jiménez 0038402753 r600g/compute: Add an intermediate resource for OpenCL buffers
This patch changes completely the way buffers are added to the
compute_memory_pool. Before this, whenever we were going to
map a buffer or write to or read from it, it would get placed
into the pool. Now, every unallocated buffer has its own
r600_resource until it is allocated in the pool.

NOTE: This patch also increase the GPU memory usage at the moment
of putting every buffer in it's place. More or less, the memory
usage is ~2x(sum of every buffer size)

v2: Cleanup

v3: Use temporary variables to avoid so many castings in functions,
    as suggested by Tom Stellard

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:43:28 -04:00
Iago Toral Quiroga 96a95f48ea mesa: Copy Geom.UsesEndPrimitive when cloning a geometry program.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-20 09:50:54 +02:00
Iago Toral Quiroga ec712bf469 mesa: Init Geom.UsesEndPrimitive in shader programs.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-20 09:50:54 +02:00
Matt Turner e974781301 glsl: Optimize (v.x + v.y) + (v.z + v.w) into dot(v, 1.0).
Cuts five instructions out of SynMark's Gl32VSInstancing benchmark.
2014-06-19 16:11:52 -07:00
Matt Turner f043971097 glsl: Pass in options to do_algebraic().
Will be used in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
2014-06-19 16:11:51 -07:00
Matt Turner 1d9f74eda7 glsl: Rebalance expression trees that are reduction operations.
The intention of this pass was to give us better instruction scheduling
opportunities, but it unexpectedly reduced some instruction counts as
well:

total instructions in shared programs: 1666639 -> 1666073 (-0.03%)
instructions in affected programs:     54612 -> 54046 (-1.04%)
(and trades 4 SIMD16 programs in SS3)
2014-06-19 16:11:51 -07:00
Emil Velikov d300f3f51a automake: include the libdeps in the correct order
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80254
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 22:53:56 +01:00
Francisco Jerez 4a39e5073a clover: Calculate the serialized size of a module efficiently.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-19 20:17:19 +02:00
Francisco Jerez ab023c27a3 clover: Optimize module serialization for vectors of fundamental types.
Tested-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-19 20:17:08 +02:00
Roland Scheidegger cad60420d5 gallivm: set mcpu when initializing llvm execution engine
Previously llvm detected cpu features automatically when the execution engine
was created (based on host cpu). This is no longer the case, which meant llvm
was then not able to emit some of the intrinsics we used as we didn't specify
any sse attributes (only on avx supporting systems this was not a problem since
despite at least some llvm versions enabling it anyway we always set this
manually). So, instead of trying to figure out which MAttrs to set just set
MCPU.

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
2014-06-19 16:58:00 +02:00
Tom Stellard 4aa128a123 clover: Don't use llvm's global context
An LLVMContext should only be accessed by a single and using the global
context was causing crashes in multi-threaded environments.  Now we use
a separate context for each compile.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 10:41:10 -04:00
Tom Stellard 0cc391f013 clover: Prevent Clang from printing number of errors and warnings to stderr.
https://bugs.freedesktop.org/show_bug.cgi?id=78581

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 10:18:26 -04:00
Michel Dänzer 93b6b1fa83 radeon/llvm: Adapt to AMDGPU.rsq intrinsic change in LLVM 3.5
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 09:58:03 -04:00
Emil Velikov 949beb0b84 configure: add HAVE_GALLIUM_STATIC_TARGETS
Will be used to control the linking mode of pipe-drivers
in gallium targets.

Keep this hardcoded to static, as the pipe-drivers bare
an unstable interface which we do not want to expose to
the normal user.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:46:19 +01:00
Emil Velikov d22b39e4db targets: use GALLIUM_PIPE_LOADER_WINSYS_LIB_DEPS
Drop ~50 lines of buildsystem mayhem.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov 571b2467ca automake: introduce helper variable
- gallium_pipe_loader_winsys_libs

Will be used in upcomming commits to reduce duplication
in the build.

v2: Drop the megadriver/static_target variables.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov 86c30c6c5b target-helpers: add dd_configuration(), dd_driver_name()
Add a couple of helpers to be used by the dri targets when
built with static pipe-drivers. Both functions provide
functionality required by the dri state-tracker.

With this patch ilo, nouveau and r300 gain support for
throttle dri configuration.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:40:01 +01:00
Emil Velikov 573b55e302 target-helpers: add dd_create_screen() helper
Will be used by gallium targets that statically link the
pipe-drivers in the final library. Provides identical
functionality to device_descriptor.create_screan.

v2:
 - Don't sw_screen_wrap the i915/svga screen.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:39:50 +01:00
Emil Velikov 1e414faa5e target-helpers: add a note about debug wrappers
If memory serves me right, at least one debug wrapper does
not return the base screen on failure.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:15 +01:00
Emil Velikov 665a4d9d9b targets/pipe-loader: add driver specific drm_configuration
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov 36ff20027c pipe-loader: add pipe_loader_ops::configuration()
Required for the dri state-tracker. Will be used to retrieve
driver specific configuration parameters:
 - share_fd (dmabuf) capability
 - throttle

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov 7f00611d78 pipe-loader: note that we leak pipe_loader_drm_device->base->driver_name
The string is malloc'd (strdup) in loader_get_driver_for_fd().

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Emil Velikov 6984e8db91 automake: stop building i915-sw and drop explicit linking to softpipe
Unused and possibly broken. Will be completely removed in
upcomming commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-06-19 12:37:14 +01:00
Ilia Mirkin 25182e249e nv30: hack to avoid errors on unexpected color/zeta combinations
This is just a hack, it should be possible to create a temporary zeta
surface and render to that instead. However that's more complicated and
this avoids the render being entirely broken and errors being reported
by the card.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 01:05:52 -04:00
Ilia Mirkin e1fe1435b1 nv30: tidy screen caps, add missing ones
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin c092c46b27 nv30: avoid dangling references to deleted contexts
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 01:05:52 -04:00
Ilia Mirkin 5af80f6268 nv30: plug some memory leaks on screen destroy and shader compile
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-19 01:05:52 -04:00
Ilia Mirkin 22e9551af0 nv50: organize screen caps
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin b03be4b0ee nvc0: organize screen caps
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
Ilia Mirkin 7e7097a4f4 nvc0: remove vport_int hack and instead use the usual state validation
Commit ad4dc772 fixed an issue with the viewport not being restored
correctly. However it's rather hackish and confusing. Instead just mark
the viewport dirty and let the viewport validation take care of it.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-06-19 01:05:52 -04:00
David Heidelberger 8658fe3e4c r300g: don't advertize PIPE_FORMAT_B10G10R10X2_UNORM on < r500
Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-06-19 01:43:09 +02:00
Marek Olšák 57f3da997a radeonsi: implement ARB_texture_query_lod
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 00:18:17 +02:00
Marek Olšák 6a2b38381e radeonsi: pass ARB_conservative_depth parameters to the hardware
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-06-19 00:17:36 +02:00
Marek Olšák 1df7199fc9 gallium: implement ARB_texture_query_levels
The extension is always supported if GLSL 1.30 is supported.

Softpipe and llvmpipe support is also added (trivial).
Radeon and nouveau support is already done.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:36 +02:00
Marek Olšák 552c70a837 st/mesa: set sampler_view::last_level correctly
It was set to pipe_resource::last_level and _MaxLevel was embedded in max_lod,
that's why it worked for ordinary texturing. However, min_lod doesn't have
any effect on texelFetch and textureQueryLevels, so we must still set
last_level correctly.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:09 +02:00
Dave Airlie c530282bbc st/mesa: handle array textures in st_texture_image_copy
Marek: also handle cube arrays

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2014-06-19 00:17:09 +02:00
Marek Olšák 6818e117ce radeonsi: cosmetic changes in si_shader.c
reviewed by Michel Dänzer
2014-06-19 00:17:09 +02:00
Marek Olšák c7b5a5c4a3 radeonsi: implement ARB_texture_gather and Gather functions from GLSL 4.00
All ARB_texture_gather and gather-related ARB_gpu_shader5 piglit tests pass.

reviewed by Michel Dänzer
2014-06-19 00:17:09 +02:00
Marek Olšák 0df3551bf4 st/mesa: fix geometry shader max texture limit in state validation
Reviewed-by: Brian Paul <brianp@vmware.com>
2014-06-19 00:14:00 +02:00
Marek Olšák bb867e2f2f r600g: fix the max vertex shader input limit 2014-06-19 00:14:00 +02:00
Ian Romanick cc219d1d65 meta: Respect the driver's maximum number of draw buffers
Commit c1c1cf5f9 added infrastructure for saving and restoring draw
buffer state.  However, it universially used MAX_DRAW_BUFFERS, but many
drivers support far fewer than that at limit.  For example, the radeon
and i915 drivers only support 1.  Using MAX_DRAW_BUFFERS causes meta to
generate GL errors.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80115
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org> [on Broadwell]
Tested-by: jpsinthemix@verizon.net
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-18 14:45:25 -07:00
Roland Scheidegger 56335b4441 gallivm: fix SCALED -> NORM conversions
Such conversions (which are most likely rather pointless in practice) were
resulting in shifts with negative shift counts and shifts with counts the same
as the bit width. This was always undefined in llvm, the code generated was
rather horrendous but happened to work.
So make sure such shifts are filtered out and replaced with something that
works (the generated code is still just as horrendous as before).

This fixes lp_test_format, https://bugs.freedesktop.org/show_bug.cgi?id=73846.

v2: prettify by using build context shift helpers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2014-06-18 19:52:57 +02:00
Kristian Høgsberg 7928b946ad mesa: Remove glClear optimization based on drawable size
A drawable size of 0x0 means that we don't have buffers for a drawable yet,
not that we have a zero-sized buffer.  Core mesa shouldn't be optimizing out
drawing based on buffer size, since the draw call could be what triggers
the driver to go and get buffers.  As discussed in the referenced bug report,
the optimization was added as part of a scatter-shot attempt to fix a
different problem.  There's no other example in mesa core of using the
buffer size in this way.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74005
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-18 10:15:03 -07:00
Juha-Pekka Heikkila fe5224b16a mesa: In emit_texenv() type mismatch was forced with typecast
Type mismatch caused random memory to be copied when casted
memory area was smaller than expected type.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-18 16:15:51 +03:00
Grigori Goronzy 6cd30f5d73 radeon/uvd: disable VC-1 simple/main on UVD 2.x
It's about as broken as on later UVD revisions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66452
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>

Reviewed-by: Christian König <christian.koenig@amd.com>
2014-06-18 13:58:52 +02:00