Commit Graph

55813 Commits

Author SHA1 Message Date
Christian König 52947b93b2 tgsi/ureg: cleanup local temporary emission v2
Instead of emitting each temporary separately, emit them in a chunk.

v2: keep separate function for emitting temps

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-03-19 13:38:31 +01:00
Andreas Boll 36320bfa54 radeon/llvm: Link against libgallium.la to fix an undefined symbol
Ported from downstream:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/patches/119-libllvmradeon-link.patch;h=ee47f8a07dbf33c32f8b57faed923680ed6648fb;hb=refs/heads/ubuntu%2B1

Fixes a regression introduced with
f70c385351

NOTE: This is a candidate for the 9.1 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62434
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-03-19 12:07:51 +01:00
Kristian Høgsberg de315f76a2 wayland: Add prime fd passing as a buffer sharing mechanism
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2013-03-18 21:15:41 -04:00
Kristian Høgsberg 2356e28452 Add dri image entry point for creating image from fd
Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2013-03-18 21:03:54 -04:00
Kristian Høgsberg 664fe6dc84 wayland: allocate a __DRIimage for the color buffer
No functional change here, but this will let us query the image
for an fd handle later.

Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2013-03-18 21:03:46 -04:00
Rob Clark 4e8f5c52bb DRI2: HACK: no GLX_INTEL_swap_event if no ScheduleSwap
If ddx does not support swap, don't advertise it.  This is a hack to
work around current xservers which advertise this extension even when it
is clearly not supported.  When:

http://lists.x.org/archives/xorg-devel/2013-February/035449.html

is merged in upstream xserver and makes it's way into most distros then
this hack can be removed.  In the mean time, it is required to allow
gnome-shell/clutter/etc to work properly with a DDX driver which does
not support ScheduleSwap.

Signed-off-by: Rob Clark <robdclark@gmail.com>
2013-03-18 14:16:43 -04:00
Paul Berry 5a13e051d9 i965/blorp: Add INTEL_DEBUG=blorp flag.
This debug flag prints out the native GEN assembly for a blitting
shader produced using BLORP.  Hopefully this should be useful in
developing additional BLORP features.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-03-18 09:27:25 -07:00
Alex Deucher 2da8ee16a8 r600g: properly set non_disp tiling mode for DMA (v2)
Needs to be set for depth, stencil, and fmask just
like other blocks.

v2: drop additional cayman bits for now

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-03-17 13:32:48 -04:00
Alex Deucher 4409758a04 r600g: Use blitter rather than DMA for 128bpp on cayman (v3)
On cayman, 128bpp surfaces require non_disp ordering for hw
access to both linear and tiled surfaces.  When we use the 3D
engine we can set the non_disp ordering on both the tiled and
linear sides (via CB or texture), but when we use the DMA
engine, we can only set the non_disp ordering on the tiled
side, so after a L2T operation with the DMA engine, the data
ends up in the wrong order on the tiled side.

v2: cayman/TN only

v3: fix comments

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=60802

Note: this is a candidate for the 9.1 branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-03-17 13:32:48 -04:00
Paul Berry 346a1b9bb9 i965: Simplify separate stencil check
The only format returned by _mesa_get_format_base_format() that
satisfies _mesa_is_depthstencil_format() is GL_DEPTH_STENCIL, so we
can simplify the check.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-03-16 10:15:51 -07:00
Maarten Lankhorst f70c385351 gallium/build: Fix visibility CFLAGS in automake
v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - Fix formatting - use one CFLAG per line

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59238
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
2013-03-16 12:45:22 +01:00
José Fonseca 49ae9b08d4 scons: Warn when using MSVS versions prior to 2012.
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-03-15 19:55:54 +00:00
Paul Berry c5d5827951 i965: Apply depthstencil alignment workaround when doing fast clears.
Fast depth clears have the same depth/stencil alignment requirements
as other drawing operations.  Therefore, we need to call
brw_workaround_depthstencil_alignment() from both the clear and
drawing paths.

Without this fix, we get image corruption if the following conditions
hold: (a) the first ever drawing operation to a depth miplevel (or the
first drawing operation after having used the texture for sampling) is
a clear, (b) the depth miplevel has a size that is eligible for fast
depth clears, and (c) the depth miplevel has an offset within the
miptree that isn't 8x8 aligned.

Fixes piglit "depthstencil-render-miplevels" tests with size 273.

NOTE: This is a candidate for stable branches

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-03-15 11:52:33 -07:00
Paul Berry eed6baf762 Replace gl_frag_attrib enum with gl_varying_slot.
This patch makes the following search-and-replace changes:

gl_frag_attrib -> gl_varying_slot
FRAG_ATTRIB_* -> VARYING_SLOT_*
FRAG_BIT_* -> VARYING_BIT_*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:26:17 -07:00
Paul Berry f117abe664 Get rid of _mesa_frag_attrib_to_vert_result().
Now that there is no difference between the enums that represent
vertex outputs and fragment inputs, there's no need for a conversion
function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:26:07 -07:00
Paul Berry 10a131211e Get rid of _mesa_vert_result_to_frag_attrib().
Now that there is no difference between the enums that represent
vertex outputs and fragment inputs, there's no need for a conversion
function.  But we still need to be able to detect when a given vertex
output has no corresponding fragment input.  So it is replaced by a
new function, _mesa_varying_slot_in_fs(), which tells whether the
given varying slot exists as an FS input or not.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:25:57 -07:00
Paul Berry 827c074fb1 mtypes.h: Modify gl_frag_attrib to refer to new gl_varying_slot enum.
This paves the way for eliminating the gl_frag_attrib enum entirely.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:25:46 -07:00
Paul Berry a6d807c86f Replace gl_geom_result enum with gl_varying_slot.
This patch makes the following search-and-replace changes:

gl_geom_result -> gl_varying_slot
GEOM_RESULT_* -> VARYING_SLOT_*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:25:36 -07:00
Paul Berry d453225efc mtypes.h: Modify gl_geom_result to refer to new gl_varying_slot enum.
This paves the way for eliminating the gl_geom_result enum entirely.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:25:26 -07:00
Paul Berry d7c60a4a4f Replace gl_geom_attrib enum with gl_varying_slot.
This patch makes the following search-and-replace changes:

gl_geom_attrib -> gl_varying_slot
GEOM_ATTRIB_* -> VARYING_SLOT_*
GEOM_BIT_* -> VARYING_BIT_*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:25:15 -07:00
Paul Berry 094bcf399c mtypes.h: Modify gl_geom_attrib to refer to new gl_varying_slot enum.
This paves the way for eliminating the gl_geom_attrib enum entirely.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:25:05 -07:00
Paul Berry 36b252e947 Replace gl_vert_result enum with gl_varying_slot.
This patch makes the following search-and-replace changes:

gl_vert_result -> gl_varying_slot
VERT_RESULT_* -> VARYING_SLOT_*

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:24:54 -07:00
Paul Berry 9e729a79b0 mtypes.h: Modify gl_vert_result to refer to new gl_varying_slot enum.
This paves the way for eliminating the gl_vert_result enum entirely.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:24:44 -07:00
Paul Berry 8a076c5f05 mtypes.h: Add new gl_varying_slot enum, and bitfield defines.
Future patches will make use of the enum.  It will eventually take the
place of the existing enums gl_vert_result, gl_geom_attrib,
gl_geom_result, and gl_frag_attrib, all of which represent essentially
the same information but using inconsistent values.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:24:34 -07:00
Paul Berry 6bec74bfd9 i965: Change fragment input related bitfields to 64-bit.
This patch updates the bitfields brw_context::wm.input_size_masks,
tracker::size_masks, and brw_wm_prog_key::proj_attrib_mask, all of
which are indexed by gl_frag_attrib, from 32-bit to 64-bit.

This paves the way for supporting geometry shaders, and for merging
the gl_frag_attrib and gl_vert_result enums.  The combination of these
two will require at least 55 bits in the bitfields.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
2013-03-15 09:24:30 -07:00
Alex Deucher 03eef7f8ef r600g: add Richland APU pci ids
Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-03-15 09:24:14 -04:00
Brian Paul fec8733d4e st/dri: add support for the always_have_depth_buffer option
This involved adding another driOptionCache to dri_screen.  The
existing one just held the default values.  But now we also need
to have the values from the DRI config file so that we can get at
the always_have_depth_buffer config option, which is per-screen.
2013-03-15 07:05:01 -06:00
Brian Paul 5d1b3097e2 driconf: add a miscellaneous section and always_have_depth_buffer option
This option is needed for some applications that neglect to request
a depth buffer when choosing a visual/fbconfig.

The Linux app Topogun is an example of this problem.
2013-03-15 07:04:13 -06:00
Brian Paul b3d184bac6 driconf: reorder options, reformat comments, etc
Move the options into the proper section (Debug, Quality, Performance,
etc).

Update comments and add some whitespace to improve readability.
2013-03-15 07:04:08 -06:00
Philipp Brüschweiler c07c18081e wayland: fix segfault when using software rendering
wayland_roundtrip() was given an incorrect parameter.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=62362

Note: This is a candidate for the stable branches.

Signed-off-by: Brian Paul <brianp@vmware.com>
2013-03-15 06:50:23 -06:00
Brian Paul f4a2c29d93 softpipe: fix up NUM_ENTRIES confusion
There were two different NUM_ENTRIES #defines for the framebuffer
tile cache and the texture tile cache.  Rename the later to fix
the warnings:

In file included from sp_flush.c:40:0:
sp_tex_tile_cache.h:76:0: warning: "NUM_ENTRIES" redefined
sp_tile_cache.h:78:0: note: this is the location of the previous definition
In file included from sp_context.c:50:0:
sp_tex_tile_cache.h:76:0: warning: "NUM_ENTRIES" redefined
sp_tile_cache.h:78:0: note: this is the location of the previous definition

Also, replace occurances of NUM_ENTRIES with Element() macro to
be safer.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2013-03-14 18:17:18 -06:00
Brian Paul 2f6970ae97 st/osmesa: silence some optimized build warnings 2013-03-14 18:09:42 -06:00
Brian Paul 6a9d7659d6 draw: init pre_clip_pos = NULL to fix optimized build warning 2013-03-14 18:09:42 -06:00
Brian Paul 622b1fcc18 glx: init screen = 0 to fix optimized build warning 2013-03-14 18:09:42 -06:00
Kenneth Graunke 91df4d746b i965: Make INTEL_DEBUG=shader_time use the RAW surface format.
Untyped Atomic Operation messages are illegal for non-RAW formats.  The
IVB hardware proceeds happily (after all, who cares what the format of the
surface is if you're doing untyped ops on it?), but later hardware
apparently doesn't.  The simulator for gen7 does complain, though.

v2: Rebase against updates to previous patches. (by anholt)

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-03-14 12:30:40 -07:00
Kenneth Graunke 125b34cffb i965: Specialize SURFACE_STATE creation for shader time.
This is basically a copy and paste of gen7_create_constant_surface, but
with the parameters filled in to offer a simpler interface.

It will diverge shortly.

I didn't bother adding it to the vtable for now since shader time is only
exposed on Gen7+.

v2: Replace tabs in the new code (by anholt)
    Add back dropped memset() and add a comment about HSW channel selects.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-03-14 12:30:40 -07:00
Kenneth Graunke f27a220cad i965: Fix INTEL_DEBUG=shader_time for Haswell.
Haswell's "Data Cache" data port is a single unit, but split into two
SFIDs to allow for more message types without adding more bits in the
message descriptor.

Untyped Atomic Operations are now message 0010 in the second data cache
data port, rather than 6 in the first.

v2: Use the #defines from the previous commit. (by anholt)

NOTE: This is a candidate for the 9.1 branch.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
2013-03-14 12:30:40 -07:00
Eric Anholt a2d08f170a i965: Add definitions for gen7+ data cache messages.
We were sparsely using some of these message types, but I'll just fill
them all in now.  It will be used for fixing shader_time on HSW.

v2: Add missing MEDIA_BLOCK_READ.

NOTE: This is a candidate for the 9.1 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-03-14 12:30:39 -07:00
Eric Anholt db3a0f13ef i965: Split shader_time entries into separate cachelines.
This avoids some snooping overhead between EUs processing separate shaders
(so VS versus FS).

Improves performance of a minecraft trace with shader_time by 28.9% +/-
18.3% (n=7), and performance of my old GLSL demo by 93.7% +/- 0.8% (n=4).

v2: Add a define for the stride with a comment explaining its units and
    why.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-03-14 12:30:39 -07:00
José Fonseca a35a19a6ea scons: Define _ALLOW_KEYWORD_MACROS on MSVC builds.
scons/llvm.py defines inline globally to workaround issues with LLVM C
binding headers, so the only way to is to avoid
aggravating xkeycheck.h errors is to set _ALLOW_KEYWORD_MACROS.

This fixes MSVC 2012 build with LLVM.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-03-14 19:01:10 +00:00
José Fonseca 6a3d77e13d softpipe: Shrink context size.
- each softpipe_tex_tile_cache 50*64*64*4*4 = 3,276,800 bytes
- each softpipe_context has 3*32 softpipe_tex_tile_cache, i.e, each softpipe
  context is 314,572,800 bytes, i.e, 300MB

That is, in a 32bits process (around 3GB virtual memory max), we can
only fit 10 contexts.

This change is a short-term hack to shrink the context size.  Longer
term we'll need to change how the texture cache works.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-03-14 11:59:53 +00:00
Christian König ce3aa0e775 radeon/llvm: fix LLVM dependencies
Since commit 1c4f283151 we obvious depend on this.

Signed-off-by: Christian König <christian.koenig@amd.com>
2013-03-14 12:38:54 +01:00
Anuj Phogat d78dcdf103 mesa: Fix FB blitting in case of zero size src or dst rect
Framebuffer blitting operation should be skipped if any of the
dimensions (width/height) of src/dst rect is zero.

V2: Move the dimension check after error checking in _mesa_BlitFramebuffer.

Fixes: fbblit(negative.nullblit.zeroSize) in Intel oglconform
https://bugs.freedesktop.org/show_bug.cgi?id=59495

Note: Candidate for all the stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-03-13 17:58:09 -07:00
Roland Scheidegger 1826659272 tgsi: fix sample_d emit for arrays
Those cases were apparently forgotten.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-03-14 00:22:55 +01:00
Roland Scheidegger 9e93d7c4fd llvmpipe: don't assert when trying to render to surfaces with multiple layers
instead just warn when creating the surface, rendering will simply happen
to first layer.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-03-14 00:22:30 +01:00
Roland Scheidegger 81e728982d softpipe: don't assert when creating surfaces with multiple layers
We can't handle them yet, however we can safely just warn (we will
just render to first layer, which is fine since we can't handle
rendertarget system value neither).
Also make behavior more predictable with buffer surfaces
(it would sometimes hit bogus asserts because of the union in the surface,
instead create the surface but assert when trying to set a buffer
in the framebuffer).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-03-14 00:21:56 +01:00
José Fonseca 4889315619 llvmpipe: Fix geometry shader token leak.
Trivial. Matches softpipe's code.
2013-03-13 21:46:50 +00:00
Tom Stellard c95177ea88 radeon/llvm: Add missing license headers
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
2013-03-13 16:01:31 +00:00
Tom Stellard 1c4f283151 radeon/llvm: Make radeon_llvm_util.cpp a C file
All the functions in this file are now implemented in C.
2013-03-13 16:01:31 +00:00
Tom Stellard 3958c104c6 radeon/llvm: Optimize radeon_llvm_strip_unused_kernels()
Just delete unused kernels rather than marking them as internal and
running the GlobalDCE pass.

Also implement this function in C and inline it into
radeon_llvm_get_kernel_module()
2013-03-13 16:01:31 +00:00