mesa.git
10 years agor600g: remove redundant r600_flush_dma_from_winsys
Marek Olšák [Fri, 11 Apr 2014 20:40:14 +0000 (22:40 +0200)]
r600g: remove redundant r600_flush_dma_from_winsys

Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: fold cs_set_flush_callback into cs_create
Marek Olšák [Fri, 11 Apr 2014 20:14:27 +0000 (22:14 +0200)]
winsys/radeon: fold cs_set_flush_callback into cs_create

Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agoradeonsi: cleanup redundant computation of flush flags and rename a function
Marek Olšák [Fri, 11 Apr 2014 19:51:12 +0000 (21:51 +0200)]
radeonsi: cleanup redundant computation of flush flags and rename a function

Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agor600g: remove redundant r600_flush_from_winsys
Marek Olšák [Fri, 11 Apr 2014 19:41:05 +0000 (21:41 +0200)]
r600g: remove redundant r600_flush_from_winsys

Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc
Marek Olšák [Fri, 11 Apr 2014 18:34:46 +0000 (20:34 +0200)]
winsys/radeon: remove cs_write_reloc, add simpler cs_get_reloc

The only difference is that it doesn't write to the CS and only returns
the index.

Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: consolidate hash table lookup
Marek Olšák [Fri, 11 Apr 2014 11:20:02 +0000 (13:20 +0200)]
winsys/radeon: consolidate hash table lookup

I should have done this long ago.

Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agoscons: Add an analyze option.
José Fonseca [Mon, 14 Apr 2014 13:31:02 +0000 (14:31 +0100)]
scons: Add an analyze option.

For Clang static code analyzer, the scan-build script will produce more
comprehensive output.  Nevertheless you can invoke it as

  CC=clang CXX=clang++ scons analyze=1

For MSVC this is the best way to use its static code analysis.  Simply
invoke as

  scons analyze=1

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoutil/u_debug: Add noreturn attribute to _debug_assert_fail().
José Fonseca [Mon, 14 Apr 2014 11:13:32 +0000 (12:13 +0100)]
util/u_debug: Add noreturn attribute to _debug_assert_fail().

As recommended by
http://clang-analyzer.llvm.org/annotations.html#attr_noreturn

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoscons: Enable building through Clang Static Analyzer.
José Fonseca [Mon, 14 Apr 2014 11:10:25 +0000 (12:10 +0100)]
scons: Enable building through Clang Static Analyzer.

By accurately detecting gcc/clang through --version option instead
of executable name.

Clang Static Analyzer reports many issues, most false positives, but it
found at least one real and subtle use-after-free issue
in st_texture_get_sampler_view():

  http://people.freedesktop.org/~jrfonseca/scan-build-2014-04-14-1/report-869047.html#EndPath

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoglsl: Properly handle blocks that define the same field name.
Iago Toral Quiroga [Fri, 4 Apr 2014 13:11:15 +0000 (15:11 +0200)]
glsl: Properly handle blocks that define the same field name.

Currently we can have name space collisions between blocks that define the same
fields. For example:

in block
{
    vec4 Color;
} In[];

out block
{
    vec4 Color;
} Out;

These two blocks will assign the same interface name (block.Color) to the Color
field in flatten_named_interface_blocks_declarations.cpp, leading to havoc.
This was breaking badly the gl-320-primitive-shading test from ogl-samples.

The patch uses the block instance name to avoid collisions, producing names
like block.In.Color and block.Out.Color to avoid the name clash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76394
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agor600g/radeonsi: Map transfer staging texture unsynchronized when possible
Michel Dänzer [Tue, 15 Apr 2014 05:45:13 +0000 (14:45 +0900)]
r600g/radeonsi: Map transfer staging texture unsynchronized when possible

The transfer staging texture is always freshly allocated, so for write-only
transfers we don't need to explicitly wait for the BO to become idle.

Squeezes a few hundered MB/s more out of x11perf -shmput500 with glamor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoRevert "i965/fs: Only sweep NOPs if register coalescing made progress."
Matt Turner [Wed, 16 Apr 2014 00:27:55 +0000 (17:27 -0700)]
Revert "i965/fs: Only sweep NOPs if register coalescing made progress."

This reverts commit f092e8951ce5212ba3cbb382ce3a6666eb6c9bed.

Didn't mean to push this...

10 years agoi965/fs: Only sweep NOPs if register coalescing made progress.
Matt Turner [Tue, 15 Apr 2014 23:28:04 +0000 (16:28 -0700)]
i965/fs: Only sweep NOPs if register coalescing made progress.

Otherwise there's nothing to do.

10 years agoi965: Fix buffer overruns in MSAA MCS buffer clearing.
Eric Anholt [Mon, 14 Apr 2014 23:52:43 +0000 (16:52 -0700)]
i965: Fix buffer overruns in MSAA MCS buffer clearing.

This manifested as rendering failures or sometimes GPU hangs in
compositors when they accidentally got MSAA visuals due to a bug in the X
Server.  Today we decided that the problem in compositors was equivalent
to a corruption bug we'd noticed recently in resizing MSAA-visual
glxgears, and debugging got a lot easier.

When we allocate our MCS MT, libdrm takes the size we request, aligns it
to Y tile size (blowing it up from 300x300=900000 bytes to 384*320=122880
bytes, 30 pages), then puts it into a power-of-two-sized BO (131072 bytes,
32 pages).  Because it's Y tiled, we attach a 384-byte-stride fence to it.
When we memset by the BO size in Mesa, between bytes 122880 and 131072 the
data gets stored to the first 20 or so scanlines of each of the 3 tiled
pages in that row, even though only 2 of those pages were allocated by
libdrm.  In the glxgears case, the missing 3rd page happened to
consistently be the static VBO that got mapped right after the first MCS
allocation, so corruption only appeared once window resize made us throw
out the old MCS and then allocate the same BO to back the new MCS.

Instead, just memset the amount of data we actually asked libdrm to
allocate for, which will be smaller (more efficient) and not overrun.
Thanks go to Kenneth for doing most of the hard debugging to eliminate a
lot of the search space for the bug.

Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77207
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Add support for MSAA resolves from 2D_MS_ARRAY textures.
Eric Anholt [Sat, 1 Mar 2014 00:39:03 +0000 (16:39 -0800)]
meta: Add support for MSAA resolves from 2D_MS_ARRAY textures.

We don't have any piglit tests for this currently.

v2: Use vec3s for the texcoords so it has some hope of working.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Add an accelerated glCopyTexSubImage using glBlitFramebuffer.
Eric Anholt [Fri, 28 Feb 2014 21:23:25 +0000 (13:23 -0800)]
meta: Add an accelerated glCopyTexSubImage using glBlitFramebuffer.

You'll note from the previous commits that there's something of a loop
here: You call CTSI, which calls BlitFB, then if things go wrong that
falls back to CTSI.  As a result, meta CTSI reaches over into blitfb to
tell it "no, don't try that fallback".

v2: Drop the _mesa_update_state(), which was only necessary due to use of
    _mesa_clip_blit() in _mesa_meta_BlitFramebuffer() in another patch
    series.
v3: Drop an _EXT suffix I copy-and-pasted.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Add support for CUBE_MAP_ARRAY to generatemipmap.
Eric Anholt [Tue, 8 Apr 2014 20:34:39 +0000 (13:34 -0700)]
meta: Add support for CUBE_MAP_ARRAY to generatemipmap.

I added support to bind_fbo_image in the process of building meta
CopyTexSubImage, and found that it broke generatemipmap because previously
we would just throw a GL error there and then end up with an incomplete
FBO and fallback.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Infer bind_fbo_image parameters from an incoming image.
Eric Anholt [Mon, 17 Mar 2014 23:45:48 +0000 (16:45 -0700)]
meta: Infer bind_fbo_image parameters from an incoming image.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Move bind_fbo_image() code back to meta.c, to reuse it elsewhere.
Eric Anholt [Mon, 17 Mar 2014 23:26:42 +0000 (16:26 -0700)]
meta: Move bind_fbo_image() code back to meta.c, to reuse it elsewhere.

I need to do the same code again for CopyTexSubImage().

v2: Drop incorrect, not-terribly-useful comment (review by Ken)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Refactor the BlitFramebuffer depth CopyTexImage fallback.
Eric Anholt [Fri, 28 Feb 2014 20:47:54 +0000 (12:47 -0800)]
meta: Refactor the BlitFramebuffer depth CopyTexImage fallback.

This avoids a ReadPixels() if there's accelerated CopyTexImage present.
It now requires GLSL as opposed to just fragment programs, but we don't
have any drivers that do ARB_fp but not GLSL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agometa: Refactor the BlitFramebuffer color CopyTexImage fallback.
Eric Anholt [Fri, 28 Feb 2014 20:36:02 +0000 (12:36 -0800)]
meta: Refactor the BlitFramebuffer color CopyTexImage fallback.

There shouldn't be anything special about copying out a subset of the src
rb to a temp before texturing from it, so just do it when we're figuring
out our src texture binding.

This drops Anuj's change to copy an extra border of 1 pixel around the src
area.  I can't see how that change could be valid, and presumably if
there's some filtering problem at edges we just need to set the right
wrap mode.

v2: Don't fall back to swrast on non-2D/RECT/2D_MS textures when we can
    still CopyTexSubImage.  Fixes a segfault regression on i965 with
    gl-3.2-layered-rendering-blit.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Tested-by: Anuj Phogat <anuj.phogat@gmail.com>
10 years agometa: Drop blit src size fallback.
Eric Anholt [Fri, 28 Feb 2014 20:19:09 +0000 (12:19 -0800)]
meta: Drop blit src size fallback.

I think we can assert that renderbuffer size is <= maximum 2D texture
size.  Our source coordinates should have already been clipped to the src
renderbuffer size, but haven't actually (so we could potentially have
trouble if there's scaling, and we're in the CopyTexImage path that tries
to use src size).  However, this texture size dependency was blocking the
next refactors, so I'm not sure if we want to go ahead with this series
before we get the clipping sorted out or not.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Avoid dependency hints on math opcodes
Mike Stroyan [Thu, 13 Feb 2014 00:24:55 +0000 (17:24 -0700)]
i965: Avoid dependency hints on math opcodes

  Putting NoDDClr and NoDDChk dependency control on instruction
sequences that include math opcodes can cause corruption of channels.
Treat math opcodes like send opcodes and suppress dependency hinting.

Signed-off-by: Mike Stroyan <mike@LunarG.com>
Tested-by: Tony Bertapelli <anthony.p.bertapelli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Expand INTEL_DEBUG to uint64_t.
Matt Turner [Sat, 12 Apr 2014 05:27:31 +0000 (22:27 -0700)]
i965: Expand INTEL_DEBUG to uint64_t.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agodri: Expand driParseDebugString return value to uint64_t.
Matt Turner [Sat, 12 Apr 2014 04:11:38 +0000 (21:11 -0700)]
dri: Expand driParseDebugString return value to uint64_t.

Users will downcast if they don't have >32 debug flags.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Remove dead_code_eliminate_local().
Matt Turner [Mon, 14 Apr 2014 18:18:59 +0000 (11:18 -0700)]
i965/fs: Remove dead_code_eliminate_local().

Subsumed by the new dead_code_eliminate() function. No shader-db
changes.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Clear variable from live-set if it's completely overwritten.
Matt Turner [Mon, 14 Apr 2014 18:17:13 +0000 (11:17 -0700)]
i965/fs: Clear variable from live-set if it's completely overwritten.

One program affected:

instructions in affected programs:     246 -> 244 (-0.81%)

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Reimplement dead_code_elimination().
Matt Turner [Sun, 13 Apr 2014 00:40:18 +0000 (17:40 -0700)]
i965/fs: Reimplement dead_code_elimination().

total instructions in shared programs: 1653399 -> 1651790 (-0.10%)
instructions in affected programs:     92157 -> 90548 (-1.75%)
GAINED:                                2
LOST:                                  2

Also significantly reduces the number of optimization loop iterations:

total loop iterations in shared programs: 39724 -> 31651 (-20.32%)
loop iterations in affected programs:     21617 -> 13544 (-37.35%)

Including some great pathological cases, like 29 -> 3 in Strike Suit
Zero and 24 -> 3 in Dota2.

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Let DCE eliminate dead writes in other basic blocks.
Matt Turner [Mon, 24 Mar 2014 20:23:13 +0000 (13:23 -0700)]
i965/vec4: Let DCE eliminate dead writes in other basic blocks.

We previously stopped searching for unread writes after encountering
control flow, but we can instead just search backwards until we hit
control flow.

instructions in affected programs:     22854 -> 22194 (-2.89%)

10 years agoi965/gs: Add dummy source to prepare_channel_masks instruction.
Matt Turner [Sun, 30 Mar 2014 00:44:45 +0000 (17:44 -0700)]
i965/gs: Add dummy source to prepare_channel_masks instruction.

The generator uses its destination as a source implicitly, which breaks
some assumptions in dead code elimination. Giving the instruction a
source allows us to reason about it better.

10 years agoglsl: Use M_PI_* macros.
Matt Turner [Sun, 6 Apr 2014 05:03:04 +0000 (22:03 -0700)]
glsl: Use M_PI_* macros.

Notice our multiple values for M_PI_2, which rounded ...32 up to
...4 and ...5.

10 years agoi965: Disable Z16 in all APIs.
Kenneth Graunke [Sun, 13 Apr 2014 21:19:03 +0000 (14:19 -0700)]
i965: Disable Z16 in all APIs.

We originally thought that GL 3.0 required GL_DEPTH_COMPONENT16 to map
exactly to Z16.  However, we misread the specification, thanks in part
to LaTeX reordering the tables in the PDF.

Page 180 of the GL 3.0 specification (glspec30.20080923.pdf) says:
"[...] memory allocation per texture component is assigned by the GL to
match the allocations listed in tables 3.16-3.18 as closely as possible.
[...]

Required Texture Formats
[...]
In addition, implementations are required to support the following sized
internal formats.  Requesting one of these internal formats for any
texture type will allocate exactly the internal component sizes and
types shown for that format in tables 3.16-3.17:"

Notably, however, GL_DEPTH_COMPONENT16 does /not/ appear in table 3.16
or table 3.17.  It appears in table 3.18, where the "exact" rule doesn't
apply, and it falls back to the "closely as possible" rule.

The confusing part is that the ordering of the tables in the PDF is:

Table 3.16 (pages 182-184)
Table 3.18 (bottom of page 184 to top of 185)
Table 3.17 (page 185)

Presumably, people saw table 3.16, then saw the table immediately
following with DEPTH_COMPONENT* formats, and assumed it was 3.17.

Based on a patch by Chia-I Wu, but without the driconf option to force
Z16 to be used.  It's not required, and there's apparently no benefit
to actually using it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
10 years agoi965: Update comments about Z16 being slow.
Kenneth Graunke [Sun, 13 Apr 2014 21:15:49 +0000 (14:15 -0700)]
i965: Update comments about Z16 being slow.

We've learned a few things since we originally disabled Z16; this attempts
to summarize the issue.  I am no expert on this subject, though, so the
comment may not be totally accurate.

I did some benchmarking on GM45 and Ironlake, and discovered that for
GLBenchmark 2.7 EgyptHD, using Z16 was 3% slower on GM45 (n=15), and
4.5% slower on Ironlake (n=95).  So, we can drop the "on Ivybridge"
aspect of the comment - it's always slower.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chia-I Wu <olv@lunarg.com>
10 years agor600g/radeonsi: Use caching buffer manager for textures as well
Michel Dänzer [Thu, 10 Apr 2014 09:15:55 +0000 (18:15 +0900)]
r600g/radeonsi: Use caching buffer manager for textures as well

Significantly reduces BO allocation / destruction overhead for transfers,
e.g. measurable via x11perf -shm{ge,pu}t* with glamor.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoi965/gen8: add debug code to show FS disasm with jump locations
Jordan Justen [Sat, 12 Apr 2014 00:22:46 +0000 (17:22 -0700)]
i965/gen8: add debug code to show FS disasm with jump locations

Copied from similar code in gen8_vec4_generator.cpp.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoilo: remove GPE state size estimation
Chia-I Wu [Thu, 10 Apr 2014 06:59:05 +0000 (14:59 +0800)]
ilo: remove GPE state size estimation

Use size defines from genhw.

10 years agoilo: remove GPE command size estimation
Chia-I Wu [Wed, 9 Apr 2014 18:45:23 +0000 (02:45 +0800)]
ilo: remove GPE command size estimation

Use size defines from genhw.

10 years agoilo: remove unused headers
Chia-I Wu [Sun, 13 Apr 2014 16:55:01 +0000 (00:55 +0800)]
ilo: remove unused headers

Remove intel_*.h.  brw_*.h is still needed by the state dumper and
disassembler.

10 years agoilo: use only defines from genhw headers
Chia-I Wu [Sun, 13 Apr 2014 12:07:40 +0000 (20:07 +0800)]
ilo: use only defines from genhw headers

Stop including classic driver headers in genhw.h, with some formatting fixes.

10 years agoilo: scripted conversion to genhw headers
Chia-I Wu [Sun, 13 Apr 2014 15:37:04 +0000 (23:37 +0800)]
ilo: scripted conversion to genhw headers

Hopefully my four hundred line sed script is correct.

10 years agoilo: add genhw headers
Chia-I Wu [Sat, 12 Apr 2014 16:33:00 +0000 (00:33 +0800)]
ilo: add genhw headers

All except genhw.h are generated by https://github.com/olvaffe/envytools/.
intel_chipset.h is deprecated.

10 years agoilo: avoid brw_wm_barycentric_interp_mode in compiler
Chia-I Wu [Fri, 11 Apr 2014 19:17:33 +0000 (03:17 +0800)]
ilo: avoid brw_wm_barycentric_interp_mode in compiler

In preparation for genhw.

10 years agoilo: add TOY_OPCODE_DO
Chia-I Wu [Fri, 11 Apr 2014 18:26:46 +0000 (02:26 +0800)]
ilo: add TOY_OPCODE_DO

We used to give BRW_OPCODE_DO a special meaning, while we should have used
TOY_OPCODE_DO.

10 years agogtest: Update to 1.7.0.
Vinson Lee [Thu, 27 Feb 2014 06:54:24 +0000 (22:54 -0800)]
gtest: Update to 1.7.0.

This patch fixes gtest build errors on Mac OS X 10.9.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73106
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: Consider gl_VertexID and gl_InstanceID active attribs
Chris Forbes [Sat, 12 Apr 2014 09:20:43 +0000 (21:20 +1200)]
mesa: Consider gl_VertexID and gl_InstanceID active attribs

Fixes piglit's spec/gl-3.2/get-active-attrib-returns-all-inputs.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: Extract is_active_attrib() in shaderapi
Chris Forbes [Sat, 12 Apr 2014 09:20:42 +0000 (21:20 +1200)]
mesa: Extract is_active_attrib() in shaderapi

The rules are about to get a bit more complex to account for
gl_InstanceID and gl_VertexID, which are system values.

Extracting this first avoids introducing duplication.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Fix typo in interface block comment
Chris Forbes [Sun, 13 Apr 2014 05:01:07 +0000 (17:01 +1200)]
glsl: Fix typo in interface block comment

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoegl-static: fix build after recent radeon winsys changes
Simone Scanzoni [Sun, 13 Apr 2014 00:36:20 +0000 (02:36 +0200)]
egl-static: fix build after recent radeon winsys changes

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agomesa: Fix typo in error message
Chris Forbes [Sat, 12 Apr 2014 23:53:16 +0000 (11:53 +1200)]
mesa: Fix typo in error message

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: glClearBuffer() should only clear a single buffer.
Iago Toral Quiroga [Mon, 31 Mar 2014 12:17:08 +0000 (14:17 +0200)]
i965: glClearBuffer() should only clear a single buffer.

glClearBuffer() is currently clearing all active draw color buffers (all
buffers that have not been set to GL_NONE when calling glDrawBuffers) instead
of only clearing the one it receives as parameter. Altough brw_clear()
receives a bit mask indicating the color buffers that should be cleared,
this mask is ignored when calling brw_blorp_clear_color().

This was breaking the 'fbo-drawbuffers-none glClearBuffer' piglit test.

The patch provides the bit mask to brw_blorp_clear_color() so it can limit
clearing to the color buffers present in the mask.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76832
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Add comment to explain the weird-looking shadow compares.
Chris Forbes [Sat, 12 Apr 2014 10:32:21 +0000 (22:32 +1200)]
i965: Add comment to explain the weird-looking shadow compares.

This always looks crazy when I stumble across it, until I remember
what the hardware is doing. Describing it ought to short-circuit
that process next time :)

V2: Fix indents to 6 spaces, not 7.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Ignore loop-too-large heuristic if there's bad variable indexing.
Kenneth Graunke [Wed, 9 Apr 2014 01:09:43 +0000 (18:09 -0700)]
glsl: Ignore loop-too-large heuristic if there's bad variable indexing.

Many shaders use a pattern such as:

for (int i = 0; i < NUM_LIGHTS; i++) {
   ...access a uniform array, or shader input/output array...
}

where NUM_LIGHTS is a small constant (such as 2, 4, or 8).

The expectation is that the compiler will unroll those loops, turning
the array access into constant indexing, which is more efficient, and
which may enable array splitting and other optimizations.

In many cases, our heuristic fails - either there's another tiny nested
loop inside, or the estimated number of instructions is just barely
beyond the threshold.  So, we fail to unroll the loop, leaving the
variable indexing in place.

Drivers which don't support the particular flavor of variable indexing
will call lower_variable_index_to_cond_assign(), which generates piles
and piles of immensely inefficient code.  We'd like to avoid generating
that.

This patch detects unsupported forms of variable-indexing in loops, where
the array index is a loop induction variable.  In that case, it bypasses
the loop-too-large heuristic and forces unrolling.

Improves performance in various microbenchmarks: Gl32PSBump8 by 47%,
Gl32ShMapVsm by 80%, and Gl32ShMapPcf by 27%.  No changes in shader-db.

v2: Check ir->array for being an array or matrix, rather than the
    ir_dereference_array itself.
v3: Fix and expand statistics in commit message.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Rename loop_unroll_count::fail to "nested_loop."
Kenneth Graunke [Tue, 8 Apr 2014 22:33:27 +0000 (15:33 -0700)]
glsl: Rename loop_unroll_count::fail to "nested_loop."

The "fail" flag is set if loop_unroll_count encounters a nested loop;
calling the flag "nested_loop" is a bit clearer.

The original reasoning was that count is inaccurate (too small) if there
are nested loops, as we don't do any sort of analysis on the inner loop.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Pass gl_shader_compiler_optimizations to unroll_loops().
Kenneth Graunke [Wed, 9 Apr 2014 02:58:36 +0000 (19:58 -0700)]
glsl: Pass gl_shader_compiler_optimizations to unroll_loops().

Loop unrolling will need to know a few more options in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoglsl: Drop do_common_optimization's max_unroll_iterations parameter.
Kenneth Graunke [Tue, 8 Apr 2014 22:43:46 +0000 (15:43 -0700)]
glsl: Drop do_common_optimization's max_unroll_iterations parameter.

Now that we pass in gl_shader_compiler_options, it makes sense to just
use options->MaxUnrollIterations, rather than passing a separate
parameter.

Half of the invocations already passed options->MaxUnrollIterations,
while the other half passed in a hardcoded value of 32.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Use EmitNoIndirect flags in lower_variable_index_to_cond_assign.
Kenneth Graunke [Wed, 9 Apr 2014 01:31:19 +0000 (18:31 -0700)]
i965: Use EmitNoIndirect flags in lower_variable_index_to_cond_assign.

This will prevent the two from getting out of sync again.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Correct EmitNoIndirect shader compiler option flags.
Kenneth Graunke [Wed, 9 Apr 2014 01:29:01 +0000 (18:29 -0700)]
i965: Correct EmitNoIndirect shader compiler option flags.

These were out of sync with the flags used to control
lower_variable_index_to_cond_assign in brw_shader.cpp.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Reset reg_from when we can't coalesce.
Matt Turner [Wed, 9 Apr 2014 21:04:10 +0000 (14:04 -0700)]
i965/fs: Reset reg_from when we can't coalesce.

Not setting this would prevented coalescing after a failed attempt if
the sources for both MOVs were the same.

total instructions in shared programs: 1654531 -> 1650224 (-0.26%)
instructions in affected programs:     423167 -> 418860 (-1.02%)
GAINED:                                2
LOST:                                  0

Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Fill in a bunch of gen7/hsw data cache-related disasm.
Eric Anholt [Mon, 31 Mar 2014 16:23:24 +0000 (09:23 -0700)]
i965: Fill in a bunch of gen7/hsw data cache-related disasm.

This gets us disasm of atomic ops.

v2: Fix fallthrough on pre-gen7.  (bug caught by Ilia Mirkin).

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoi965: Stop setting up a 1:1 "attrib" member in our vertex inputs.
Eric Anholt [Sun, 6 Apr 2014 19:08:37 +0000 (12:08 -0700)]
i965: Stop setting up a 1:1 "attrib" member in our vertex inputs.

It's just the array index, so we can just go look at the array and see
which element we are.

No significant performance difference (n=140)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Skip a bunch of IB BO refcount twiddling.
Eric Anholt [Sun, 6 Apr 2014 18:16:48 +0000 (11:16 -0700)]
i965: Skip a bunch of IB BO refcount twiddling.

Improves cairo performance on glamor by 1.64828% +/- 1.04742% (n=65).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/gen7: Skip repeated NULL depth/stencil state emits.
Eric Anholt [Sun, 6 Apr 2014 17:49:49 +0000 (10:49 -0700)]
i965/gen7: Skip repeated NULL depth/stencil state emits.

Improves cairo performance on glamor by 2.87752% +/- 0.966977 (n=57).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodocs: Fix ubo indexing description
Chris Forbes [Fri, 11 Apr 2014 20:31:05 +0000 (08:31 +1200)]
docs: Fix ubo indexing description

Ian points out that this being unrestricted was an oversight in the
spec, and is corrected in GLSL4.40.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agodraw: remove unused 'start' variable in draw_stats_clipper_primitives()
Brian Paul [Fri, 11 Apr 2014 17:46:55 +0000 (11:46 -0600)]
draw: remove unused 'start' variable in draw_stats_clipper_primitives()

It was computed, but never actually used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Try vectorizing when seeing a repeated assignment to a channel.
Kenneth Graunke [Tue, 8 Apr 2014 23:55:23 +0000 (16:55 -0700)]
glsl: Try vectorizing when seeing a repeated assignment to a channel.

When considering assignment expressions like:

    v.x += u.x;
    v.x += u.x;

the vectorizer would incorrectly keep going, attempting to find more
instructions to vectorize.  It would overwrite the saved assignment
to point at the second one, and increment channels a second time,
resulting in try_vectorize thinking the expression was a vec2 instead of
a float.

Instead, if we see a repeated assignment to a channel, just try to
vectorize everything we've found so far.  This clears the saved state
so it will start over.

Fixes Piglit's repeated-channel-assignments.vert.

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Propagate explicit binding information from the AST all the way to the linker
Ian Romanick [Thu, 3 Apr 2014 01:58:54 +0000 (18:58 -0700)]
glsl: Propagate explicit binding information from the AST all the way to the linker

Information about the binding was not being properly communicated from
the front-end compiler to the linker.  As a result, the linker never
knew that any UBOs had explicit bindings!

Fixes the piglit test arb_shading_language_420pack-binding-layout.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: github@socker.lepus.uberspace.de [v0]
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Set binding for all elements of UBO array
Ian Romanick [Fri, 4 Apr 2014 20:42:04 +0000 (13:42 -0700)]
linker: Set binding for all elements of UBO array

Previously, a UBO like

    layout(binding=2) uniform U {
        ...
    } my_constants[4];

wouldn't get any bindings set.  The code would try to set the binding of
U, but that would fail.  It should instead set the bindings for U[0],
U[1], ...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Set block bindings based on UniformBlocks rather than UniformStorage
Ian Romanick [Fri, 4 Apr 2014 19:46:01 +0000 (12:46 -0700)]
linker: Set block bindings based on UniformBlocks rather than UniformStorage

For blocks, gl_shader_program::UniformStorage isn't very useful.  The
names stored there are the names of the elements of the block, so
finding blocks with an instance name is hard.  There is also only one
entry in ::UniformStorage for each element of a block array, and that is
a deal breaker.

Using ::UniformBlocks is what _mesa_GetUniformBlockIndex does.  I
contemplated sharing code between set_block_binding and
_mesa_GetUniformBlockIndex, but building the stand-alone compiler and
the unit tests make this hard.  I plan to return to this effort shortly.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Clean up "unused parameter" warnings
Ian Romanick [Fri, 4 Apr 2014 18:11:18 +0000 (11:11 -0700)]
linker: Clean up "unused parameter" warnings

../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:87:1: warning: unused parameter 'type' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'mem_ctx' [-Wunused-parameter]
../../src/glsl/link_uniform_initializers.cpp:127:1: warning: unused parameter 'type' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Fold set_uniform_binding into call site
Ian Romanick [Fri, 4 Apr 2014 18:08:00 +0000 (11:08 -0700)]
linker: Fold set_uniform_binding into call site

In the next patch, we'll see that using
gl_shader_program::UniformStorage is not correct for uniform blocks.
That means we can't use ::UniformStorage to select between the sampler
path and the block path.  Instead we want to just use the type of the
variable.  That's never passed to set_uniform_binding, and it's easier
to just remove the function (especially for later patches in the series)
than to add another parameter.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Various trivial clean-ups in set_sampler_binding
Ian Romanick [Fri, 4 Apr 2014 17:52:31 +0000 (10:52 -0700)]
linker: Various trivial clean-ups in set_sampler_binding

- Remove the spurious block left from the previous commit and re-indent.

- Constify elements.

- Make the spec reference in the code look like other spec references in
  the compiler.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agolinker: Split set_uniform_binding into separate functions for blocks and samplers
Ian Romanick [Fri, 4 Apr 2014 17:45:38 +0000 (10:45 -0700)]
linker: Split set_uniform_binding into separate functions for blocks and samplers

The two code paths are quite different, and there are some problems in
the handling of uniform blocks.  Future changes will cause these paths
to diverge further.  Ultimately, selecting between the two functions
will happen at the set_uniform_binding call site, and
set_uniform_binding will be deleted.

NOTE: This patch just moves code around.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76323
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Cc: github@socker.lepus.uberspace.de
10 years agosoftpipe: fix shadow sampling
Heinrich Janzing [Thu, 10 Apr 2014 11:54:30 +0000 (13:54 +0200)]
softpipe: fix shadow sampling

And remove nonsensical approximation of linear interpolation behavior
for shadow samplers.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Brian Paul <brianp@vmware.com>
10 years agosoftpipe: add PIPE_CAP_MIN/MAX_TEXTURE_GATHER_OFFSET query cases
Brian Paul [Fri, 11 Apr 2014 01:03:58 +0000 (19:03 -0600)]
softpipe: add PIPE_CAP_MIN/MAX_TEXTURE_GATHER_OFFSET query cases

To silence compiler warnings.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
10 years agomesa: use _mesa_get_srgb_format_linear() in sRGB texstore functions
Brian Paul [Fri, 11 Apr 2014 01:00:46 +0000 (19:00 -0600)]
mesa: use _mesa_get_srgb_format_linear() in sRGB texstore functions

Instead of switch statements.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoswrast: use macros to initialize texfetch_funcs[] table
Brian Paul [Fri, 11 Apr 2014 01:00:46 +0000 (19:00 -0600)]
swrast: use macros to initialize texfetch_funcs[] table

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoswrast: fix more fetch_texel function names
Brian Paul [Fri, 11 Apr 2014 01:00:46 +0000 (19:00 -0600)]
swrast: fix more fetch_texel function names

These were missed/typo'd in the previous patch series:
s/R8G8B8A/R8G8B8A8/
s/rgba_16/RGBA_UNORM16/
s/rgba_uint/RGBA_UINT/
s/rgba_int/RGBA_SINT/

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoegl-static: Fix missing radeon_surface.h includes.
José Fonseca [Fri, 11 Apr 2014 15:46:02 +0000 (16:46 +0100)]
egl-static: Fix missing radeon_surface.h includes.

Fixes

  fatal error: radeon_surface.h: No such file or directory

when libdrm is not present, or non-Linux OSes.

Trivial.

10 years agogallium/radeon: fix missing winsys include in pipe-loader.
Knut Andre Tidemann [Fri, 11 Apr 2014 06:59:11 +0000 (08:59 +0200)]
gallium/radeon: fix missing winsys include in pipe-loader.

The commit 3b0b44f7def0acb4f7a7aef086c0bece321418a6 introduced a build
error:

error: dereferencing pointer to incomplete type

This patch fixes this issue in all the affected files.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
10 years agost/omx/enc: separate input buffer private and task structure
Christian König [Sun, 6 Apr 2014 15:07:41 +0000 (17:07 +0200)]
st/omx/enc: separate input buffer private and task structure

Keep tasks as linked list, this way we can associate
more than one encoding task with each buffer.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoradeon/vce: implement B-frame support
Christian König [Fri, 4 Apr 2014 15:14:26 +0000 (17:14 +0200)]
radeon/vce: implement B-frame support

Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoradeon/vce: add proper CPB backtrack
Christian König [Fri, 4 Apr 2014 13:29:18 +0000 (15:29 +0200)]
radeon/vce: add proper CPB backtrack

Remember what frames we encoded at which position.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agovl: add interface for H264 B-frame encoding
Christian König [Fri, 4 Apr 2014 12:22:16 +0000 (14:22 +0200)]
vl: add interface for H264 B-frame encoding

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoradeon/vce: remove RVCE_NUM_CPB_EXTRA_FRAMES
Christian König [Mon, 7 Apr 2014 15:26:31 +0000 (17:26 +0200)]
radeon/vce: remove RVCE_NUM_CPB_EXTRA_FRAMES

Doesn't seems to be needed any more.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agodocs/relnotes: Fix consistency, add i965 to ARB_buffer_storage.
Chris Forbes [Fri, 11 Apr 2014 09:20:13 +0000 (21:20 +1200)]
docs/relnotes: Fix consistency, add i965 to ARB_buffer_storage.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: Fix missing _NEW_SCISSOR in Broadwell SF_CLIP_VIEWPORT state.
Kenneth Graunke [Thu, 10 Apr 2014 05:54:11 +0000 (22:54 -0700)]
i965: Fix missing _NEW_SCISSOR in Broadwell SF_CLIP_VIEWPORT state.

The _Xmin/_Xmax/_Ymin/_Ymax values need to be guarded by _NEW_SCISSOR.

Fixes Piglit's scissor-many, and rendering in GNOME Shell.
Hopefully fixes similar issues with Unity and ChromeOS.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75879
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: James Ausmus <james.ausmus@intel.com>
Tested-by: Timo Aaltonen <tjaalton@ubuntu.com>
10 years agomesa/st: set min/max texture gather offset to driver-reported value
Ilia Mirkin [Wed, 9 Apr 2014 18:59:25 +0000 (14:59 -0400)]
mesa/st: set min/max texture gather offset to driver-reported value

It was always getting set to -8/7 unconditionally.  Use the
driver-reported value instead.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agogallium: add a way to query min/max texture gather offsets
Ilia Mirkin [Wed, 9 Apr 2014 18:58:53 +0000 (14:58 -0400)]
gallium: add a way to query min/max texture gather offsets

Defaults to providing the same offsets as MIN/MAX_TEXEL_OFFSET. For
nvc0, the offset can be -32/31.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoconfigure.ac: require libdrm_radeon 2.4.53
Marek Olšák [Thu, 10 Apr 2014 19:24:50 +0000 (21:24 +0200)]
configure.ac: require libdrm_radeon 2.4.53

We need latest radeon_drm.h.

10 years agowinsys/radeon: fix a race condition in initialization of radeon_winsys::screen
Marek Olšák [Tue, 8 Apr 2014 23:07:52 +0000 (01:07 +0200)]
winsys/radeon: fix a race condition in initialization of radeon_winsys::screen

Create the screen in the winsys while the mutex is locked.
This also results in a nice code cleanup!

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: fix a race condition between winsys_create and winsys_destroy
Marek Olšák [Tue, 8 Apr 2014 22:26:32 +0000 (00:26 +0200)]
winsys/radeon: fix a race condition between winsys_create and winsys_destroy

This also hides the reference count from drivers.

v2: update the reference count while the mutex is locked in winsys_create

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: fix a race condition between 2 calls to radeon_winsys_create
Marek Olšák [Tue, 8 Apr 2014 21:36:53 +0000 (23:36 +0200)]
winsys/radeon: fix a race condition between 2 calls to radeon_winsys_create

This fixes random crashes of: piglit/glx-multithread-shader-compile.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: remove unused radeon_info variables, move backend_map
Marek Olšák [Tue, 8 Apr 2014 20:39:09 +0000 (22:39 +0200)]
winsys/radeon: remove unused radeon_info variables, move backend_map

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: unify radeon_bo::flink and radeon_bo::name
Marek Olšák [Fri, 4 Apr 2014 18:22:55 +0000 (20:22 +0200)]
winsys/radeon: unify radeon_bo::flink and radeon_bo::name

Both contained the GEM flink name.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: remove definitions already present in radeon_drm.h
Marek Olšák [Fri, 4 Apr 2014 18:18:37 +0000 (20:18 +0200)]
winsys/radeon: remove definitions already present in radeon_drm.h

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowinsys/radeon: handle squared micro tiling from GEM_GET_TILING
Marek Olšák [Fri, 4 Apr 2014 18:16:36 +0000 (20:16 +0200)]
winsys/radeon: handle squared micro tiling from GEM_GET_TILING

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agogallium/u_gen_mipmap: rewrite using pipe->blit (v2)
Marek Olšák [Sun, 16 Mar 2014 02:45:27 +0000 (03:45 +0100)]
gallium/u_gen_mipmap: rewrite using pipe->blit (v2)

This replaces u_gen_mipmap with an extremely simple implementation based
on pipe->blit. st/mesa is also cleaned up.

Pros:
- less code
- correct mipmap generation for NPOT 3D textures (u_blitter uses a better
  formula)
- queries are not affected by mipmap generation if drivers disable them

v2: add "first_layer", "last_layer" parameters, drop "face"
v2.1: add format
v2.2: document the format parameter

10 years agost/mesa: properly implement MapTextureImage with multiple mapped slices (v2)
Marek Olšák [Mon, 10 Mar 2014 17:43:17 +0000 (18:43 +0100)]
st/mesa: properly implement MapTextureImage with multiple mapped slices (v2)

This is needed by _mesa_generate_mipmap.

This adds an array of pipe_transfers to st_texture_image. Each transfer is
for mapping a single layer.

v2: allocate the array of transfers on demand

10 years agomesa: remove the MALLOC, CALLOC and FREE macros
Brian Paul [Thu, 10 Apr 2014 01:35:27 +0000 (19:35 -0600)]
mesa: remove the MALLOC, CALLOC and FREE macros

No longer used anywhere.  These also caused trouble in the Gallium
state tracker code where we include both core Mesa and Gallium util
headers (and the macros were defined differently in each world.)
Removing these macros should help avoid macro mix-ups in the future.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoxlib: s/FREE/free/
Brian Paul [Thu, 10 Apr 2014 01:30:58 +0000 (19:30 -0600)]
xlib: s/FREE/free/

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>