Commit Graph

63709 Commits

Author SHA1 Message Date
Ville Syrjälä ca55a1aaa7 i915: Fix gen2 texblend setup
Fix an off by one in the texture unit walk during texblend
setup on gen2. This caused the last enabled texunit to be
skipped resulting in totally messed up texturing.

This is a regression introduced here:
 commit 1ad443ecdd
 Author: Eric Anholt <eric@anholt.net>
 Date:   Wed Apr 23 15:35:27 2014 -0700

    i915: Redo texture unit walking on i830.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-06-23 12:42:00 +03:00
Iago Toral Quiroga c822db6a05 mesa: Make Geom.UsesEndPrimitive a bool instead of a GLboolean 2014-06-23 07:55:51 +02:00
Emil Velikov df71b39f5c targets/r600/xvmc: convert to static/shared pipe-drivers
The r600 equivalent of previous commit.

v2: Correctly include the radeon winsys/radeon_common.

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:07 +01:00
Emil Velikov dc01ca44a7 targets/xvmc-nouveau: convert to static/shared pipe-drivers
Similar to vdpau targets, we're going to convert the individual
target libraries into a single one.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:04 +01:00
Emil Velikov 291d70210d targets/radeonsi/vdpau: convert to static/shared pipe-drivers
Similar to previous commits, this allows us to minimise some
of the duplication by compacting all vdpau targets into a
single library.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:06:01 +01:00
Emil Velikov f85e7ce057 targets/r600/vdpau: convert to static/shared pipe-drivers
Similar to previous commit, this allows us to minimise some
of the duplication by compacting all vdpau targets into a
single library.

v2: Include the radeon winsys only when there is a user for it.
v3: Correcly include the winsys. Now with extra brown bag :\

Cc: Christian König <christian.koenig@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:05:58 +01:00
Emil Velikov 9df2c4956b targets/vdpau-nouveau: convert to static/shared pipe-drivers
Create a single library (for the vdpau api) thus reducing
the overall size of mesa. Current commit converts
vdpau-nouveau, with upcomming commits handling the rest.

The library can be built with the relevant pipe-drivers
statically linked in, or loaded as shared modules.
Currently we default to static.

Add SPLIT_TARGETS to guard the other VL targets.

Note: symlink handling is rather ugly and will need an
update to work with BSD and other non-linux platforms.

v2: Split the conversion into per-target basis.

Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Thomas Helland <thomashelland90 at gmail.com>
2014-06-22 23:05:49 +01:00
Chris Forbes 8b2e0ddf8a Partially revert "glsl: Add builtin define for ARB_fragment_layer_viewport"
This partially reverts commit cc18b1ec21,
which dropped some unrelated code due to a fumbled rebase.
2014-06-22 23:54:21 +12:00
Rob Clark 1f3ca56b76 freedreno: use util_copy_framebuffer_state()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-22 07:28:17 -04:00
Rob Clark c63450e829 freedreno/a3xx: WFI fixes/cleanup
Blob driver seems to need WFI in some cases after CP_EVENT_WRITE,
implying that this is asynchronous and should reset needs_wfi.
Also, CP_INVALIDATE_STATE seems to need WFI.  But CP_LOAD_STATE
does not.

The blob driver also puts WFIs before writing GRAS_CL_VPORT registers.
The latter may be a work-around, as these registers should be banked/
context registers.  I haven't yet found a lockup that this averts, but
I expect viewport to change infrequently so out of paranoia I will
keep these for now.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-22 07:25:43 -04:00
Chris Forbes b2c1f3a019 glsl: Add gl_Layer and gl_ViewportIndex builtins to fragment shader
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:19 +12:00
Chris Forbes cc18b1ec21 glsl: Add builtin define for ARB_fragment_layer_viewport
The spec doesn't actually mention adding this, but this is the usual
pattern so I'm assuming it's a spec bug.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:17 +12:00
Chris Forbes fcc9b4c15e glsl: Add extension plumbing for ARB_fragment_layer_viewport
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:15 +12:00
Chris Forbes 51c82bddef mesa: Add extension plumbing for ARB_fragment_layer_viewport
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:52:13 +12:00
Chris Forbes 22448c819d glapi: Add (empty) api section for ARB_fragment_layer_viewport
This extension is purely GLSL -- there are no new GL API elements.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-06-22 16:51:29 +12:00
Kenneth Graunke a20994d616 i965: Save meta stencil blit programs in the context.
When the last context in a share group is destroyed, the hash table
containing all of the shader programs (ctx->Shared->ShaderObjects) is
destroyed, throwing away all of the shader programs.

Using a static variable to store program IDs ends up holding on to them
after this, so we think we still have a compiled program, when it
actually got destroyed.  _mesa_UseProgram then hits GL errors, since no
program by that ID exists.

Instead, store the program IDs in the context, so we know to recompile
if our context gets destroyed and the application creates another one.

Fixes es3conform tests when run without -minfmt (where it creates
separate contexts for testing each visual).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77865
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
2014-06-21 10:47:47 -07:00
Emil Velikov dfaf6116c9 scons: avoid building any piece of i915
Leftover from commit c21fca8bf2.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2014-06-21 16:43:10 +01:00
Aaron Watry 564821c917 gallivm: Fix build after LLVM commit 211259
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 19:49:18 -05:00
Daniel Manjarres 86bd2196b4 glx: Don't crash on swap event for a Window (non-GLXWindow)
Prior to GLX 1.3 there was the glxMakeCurrent() function that took a
single drawable handle. The Drawable could be either a bare XID for a
Window or an XID for a glxpixmap.

GLX 1.3 added glxMakeContextCurrent that takes 2 handles: one for
reading, one for writing. Nowadays the old glxMakeCurrent call is
implemented as a call to glxMakeContextCurrent with the single handle
duplicated.

Because of this it is allowed to use a plain-old Window ID as an
argument to glxMakeContextCurrent, although nobody really documents this
sort of thing. The manpage for the NEW call specifies the arguments as
GLXPixmaps, but the actual code accepts Window XIDs too, and handles
them correctly.

Similarly, the glxSelectEvents function can also take a bare Window XID.

The "piglit" tests all use GLXWindows and/or GLXPixmaps. You never
tested swap events with a bare Window XID. That is what my app was
doing.

The swap_events code worked with Window XIDs in mesa 7.x.y. The new code
added in versions 8, 9, and 10 assumes that all buffer swap events have
a GLXPixmap associated with them. Because of the historical quirks
above, this is not true. Swap events for bare Window XIDs do NOT have a
glxpixmap resulting in a segfault.

Any app that uses the old school glxMakeCurrent call with a Window XID
while trying to use swap_events will crash when the libs try to lookup
the nonexistent GLXPixmap associated with the incoming swap event.

I believe that the people who wrote the spec overlooked this, because
the "sbc" field comes from the OML_sync extension that is defined in
terms of glxpixmaps only.

v2 (idr): Formatting changes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54372
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
2014-06-20 11:04:04 -07:00
Bruno Jiménez 2d2af4cd2c r600g/compute: Use gallium util functions for double lists
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2014-06-20 13:44:12 -04:00
Bruno Jiménez 257d697fb9 r600g/compute: Map only against intermediate buffers
With this we can assure that mapped buffers will never change
its position when relocating the pool.

This patch should finally solve the mapping bug.

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:44:08 -04:00
Bruno Jiménez 9b933b73a9 r600g/compute: Implement compute_memory_demote_item
This function will be used when we want to map an item
that it's already in the pool.

v2: 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:44:04 -04:00
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