Commit graph

94421 commits

Author SHA1 Message Date
Marek Olšák
5e81df0f10 ac/surface: fix hybrid graphics where APU=GFX9, dGPU=older
v2: don't do it for compressed textures (bpp = 0)

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (v1)
2017-07-26 19:53:26 +02:00
Marek Olšák
ed2b3f5c81 radeonsi: decrease the number of compiler threads
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-26 19:53:26 +02:00
Marek Olšák
433f6f7ac9 gallium/radeon: make S_FIXED function signed and move it to shared code
This fixes a bug uncovered by:
    2412c4c81e
    util: Make CLAMP turn NaN into MIN.

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-26 19:53:26 +02:00
Marek Olšák
033b4e4340 st/mesa: also clamp and quantize per-unit lod bias
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-26 19:53:26 +02:00
Marek Olšák
914f11e75b st/mesa: fix unconditional return in st_framebuffer_iface_remove
Noticed by James Legg @ Feral.

Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-26 16:47:17 +02:00
Marek Olšák
a7617a49fb drirc: whitelist glthread for Mount and Blade Warband
From 25-26 min fps to 31, used the game in conjuction with a mod (full
invasion 2) beaumaris castle map and 200 bots.
2017-07-26 15:23:00 +02:00
Grigori Goronzy
39bf7756b9 egl: move KHR_no_error vs debug/robustness check further down
We'll fail to flag an error if the context flags appear after the
no-error attribute in the context attribute list.

Delay the check to after attribute parsing to fix this.

Fixes: 4909519a66 ("egl: Add EGL_KHR_create_context_no_error support")
Cc: mesa-stable@lists.freedesktop.org
[Emil Velikov: add fixes/stable tags, commit message polish]
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-26 11:50:32 +01:00
Andres Rodriguez
a973b9a9f8 radv: rename physical_device->uuid[] to cache_uuid[]
We have a few UUIDs, so lets be more specific.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-26 20:42:36 +10:00
Nicolai Hähnle
a0e6b9a2db radeonsi/gfx9: reduce max threads per block to 1024 on gfx9+
The number of supported waves per thread group has been reduced to 16
with gfx9. Trying to use 32 waves causes hangs, and barriers might
not work correctly with > 16 waves.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-26 11:51:00 +02:00
Nicolai Hähnle
65fbaab0b7 radeonsi: fix detection of DRAW_INDIRECT_MULTI on SI
The firmware version numbers for SI were wrong. The new numbers are probably
too conservative (we don't have a definitive answer by the firmware team),
but DRAW_INDIRECT_MULTI has been confirmed to work with these versions on
Tahiti (by Gustaw) and on Verde (by myself).

While this is technically adding a feature, it's a feature we thought we had
for a long time. The change is small enough and we're early enough in the 17.2
release cycle that it should still go in.

Reported-by: Gustaw Smolarczyk <wielkiegie@gmail.com>
Cc: 17.2 <mesa-stable@lists.freedesktop.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-26 11:48:32 +02:00
Iago Toral Quiroga
31f1863ace anv: only expose up to 28 vertex attributes
The EU limit of 128 GRFs should allow 32 vertex elements of 4 GRFs.
However, the maximum allowed value of "Vertex URB Entry Read Length"
in SIMD8 is 15. And 15 * 8 = 120 gives us a limit of 30 vertex elements.
Because we also need to reserve a vertex buffer to upload
VertexIndex/InstanceIndex and another to upload DrawID when needed,
we can only expose 28.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-26 08:16:43 +02:00
Iago Toral Quiroga
a848e693ef anv/cmd_buffer: fix off by one error in assertion
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-26 08:02:06 +02:00
Kenneth Graunke
445367242a i965: Shut up Coverity warning about HiZ buffers.
Here the AUX_USAGE_* mode indicates that we have HiZ, so we will have
a HiZ buffer.  But Coverity doesn't know that, so it thinks it might
be NULL because we checked hiz_buf != NULL earlier.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-07-25 22:14:21 -07:00
Kenneth Graunke
698636cc97 i965: Fix = vs == in MCS aux usage assert.
Caught by Coverity (CID 1415680).

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-07-25 22:14:21 -07:00
Kenneth Graunke
f6e674fa51 i965: Fix offset addition in get_isl_surf.
Increase the value, not the pointer to the stack variable.

Caught by Coverity (CID 1415574).  Not shipped in a real release.

Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-07-25 22:14:21 -07:00
Andres Rodriguez
7b48163d7c mesa/st: fix inconsistent indentation of st_cb_bufferobjects.c
No changes, just re-indent.

Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
2017-07-26 14:54:46 +10:00
Timothy Arceri
b0333e55b7 compiler: move glsl_interface_packing enum to shader_enums.h
This allows us to drop the duplicate gl_uniform_block_packing enum.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-26 10:39:52 +10:00
Timothy Arceri
7ee383669f mesa/st: fix unused variable warnings
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-26 10:39:52 +10:00
Timothy Arceri
87e5f39cf1 mesa/st: move st_pipe_format_to_mesa_format() call to where its used
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-26 10:39:52 +10:00
Timothy Arceri
17f05e52e7 gallium/util: fix unused variable warning
Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-26 10:39:52 +10:00
Timothy Arceri
5fac8c116e mesa: drop useless assert
NewBufferObj() is called when the shared state is allocated so we
wouldn't get this far if it was NULL.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-26 10:16:20 +10:00
Timothy Arceri
6be1c69b97 mesa: call binding functions directly from glDeleteBuffers
This avoids useless error checking.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-26 10:16:20 +10:00
Timothy Arceri
003c8b1167 mesa: move static binding functions above _mesa_DeleteBuffers()
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-26 10:16:20 +10:00
Timothy Arceri
4943353bff mesa: don't try to re-generate the default buffer
It should have been created by this point.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2017-07-26 10:16:20 +10:00
Eric Anholt
4d4872708e broadcom/vc4: Switch the V3D 2.1 XML over to restricted address fields.
This keeps the flags out of v3d_decode.c's output.  In the generated code,
only the unpack functions see any change (where they now get the
restricted start value), and vc4 doesn't use the unpack functions yet.
2017-07-25 14:55:12 -07:00
Eric Anholt
82fdc10606 broadcom/genxml: Support address fields with <32 bits
I was writing the XML such that the address field overlapped various flags
in the alignment bits, which caused pain when trying to unpack for decode.
Instead, keep the XML matching the docs (address fields don't overlap),
and just infer the appropriate shift value during decode.

During pack, the address is just applied to the appropriate bits
already, ignoring the sub-byte start/end fields.
2017-07-25 14:55:12 -07:00
Eric Anholt
53492917e2 broadcom/vc4: Use the RA callback to improve register selection's choices.
We simply pick r4 if available (anything else would force a MOV), then
round-robin through accumulators (avoids physical regfile RAW delay
slots), then round-robin through the physical regfile.

The effect on instruction count is pretty impressive:

total instructions in shared programs: 76563 -> 74526 (-2.66%)
instructions in affected programs:     66463 -> 64426 (-3.06%)

and we could probably do better with a little heuristic of "if we're going
to choose a physical reg, and other operands of instructions using this as
a src have the same physical regfile, then use the other regfile".
2017-07-25 14:55:10 -07:00
Eric Anholt
7a34a0e890 ra: Add a callback for selecting a register from what's available.
VC4 has had a tension, similar to pre-Sandybridge Intel, where we want to
use low-numbered registers (more parallelism on Intel, fewer delay slots
on vc4), but in order to give instruction scheduling the most freedom to
avoid delays we want to round-robin between registers of the same cost.
Our two heuristics so far have chosen one end or the other of that
tradeoff.

The callback, instead, hands the driver the set of registers that are
available, and the driver gets to make its own choice.  This will be used
in vc4 to round-robin between registers of the same cost, and might be
used in the future for improving bank selection.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-25 14:44:52 -07:00
Eric Anholt
3dae034423 ra: Don't put a node in its own adjacency set.
All the paths looping over adjacency had guards against considering
themselves (the non-obvious one was ra_any_neighbors_conflict(), which has
in_stack set).

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-25 14:44:52 -07:00
Eric Anholt
30146f29a7 ra: Pull the body of a loop out to a helper function.
I was going to indent this code another level, and decided it would be
easier to read as a helper.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-25 14:44:52 -07:00
Eric Anholt
16e17ce04b broadcom/vc4: Scissor blits performed using the rendering engine.
Without this, a BlitFramebuffer would mark the whole framebuffer as being
changed (so we emit loads/stores of all of it) rather than just the
modified subset.
2017-07-25 14:44:52 -07:00
Eric Anholt
93fec49a75 broadcom/vc4: Prefer blit via rendering to the software fallback.
I don't know how I managed to leave this here for so long.  Found when
working on a 1:1 overlapping blit extension for X11.

Cc: mesa-stable@lists.freedesktop.org
2017-07-25 14:44:52 -07:00
Eric Anholt
b3c78a51f3 broadcom/vc4: Switch the Viewport Center fields to a fixed-point representation.
This gets us automatic CL decoding to a floating-point value, and drops a
magic number from the emit code.  250x250 shader runner tests now say they
have a center of 125.0 instead of 2000.
2017-07-25 14:44:52 -07:00
Eric Anholt
299c9a2db1 broadcom/vc4: Use the XML decoder for CL dumping.
The VC4_DEBUG_CL output goes from:

0x00000010 0x00000010: 0x06 VC4_PACKET_START_TILE_BINNING
0x00000011 0x00000011: 0x38 VC4_PACKET_PRIMITIVE_LIST_FORMAT
0x00000012 0x00000012: 0x12
0x00000013 0x00000013: 0x66 VC4_PACKET_CLIP_WINDOW
0x00000014 0x00000014: 0x00
0x00000015 0x00000015: 0x00
0x00000016 0x00000016: 0x00
0x00000017 0x00000017: 0x00
0x00000018 0x00000018: 0xfa
0x00000019 0x00000019: 0x00
0x0000001a 0x0000001a: 0xfa
0x0000001b 0x0000001b: 0x00

to:

0x00000010 0x00000010: 0x06 Start Tile Binning
0x00000011 0x00000011: 0x38 Primitive List Format
    Data Type: 1 (16-bit index)
    Primitive Type: 2 (Triangles List)
0x00000013 0x00000013: 0x66 Clip Window
    Clip Window Height in pixels: 250
    Clip Window Width in pixels: 250
    Clip Window Bottom Pixel Coordinate: 0
    Clip Window Left Pixel Coordinate: 0

v2: Squash in robher's fixes for Android
2017-07-25 14:44:52 -07:00
Eric Anholt
5b102160ae broadcom/genxml: Introduce a V3D packet/struct decoder.
This is copied from Intel's XML decoder, modified to handle V3D's
byte-oriented packets.

v2: Squash in robher's fixes for Android
2017-07-25 14:44:52 -07:00
Eric Anholt
12b55c8e27 broadcom: add editorconfig
This is the same 8-space style used in the vc4 and vc5 gallium drivers.
2017-07-25 14:44:52 -07:00
Eric Anholt
decd2b32aa intel/decoder: Reuse the gen_make_gen() helper.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-25 14:44:52 -07:00
Eric Anholt
19ffa4bfb2 intel/decoder: Reuse the MAX2 macro instead of defining another one.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-25 14:44:52 -07:00
Brian Paul
91735e2d4a svga: implement MSAA alpha_to_one feature
The device doesn't directly support this feature so we implement it with
additional shader code which sets the color output(s) w component to
1.0 (or max_int or max_uint).

Fixes 16 Piglit ext_framebuffer_multisample/*alpha-to-one* tests.

v2: only support unorm/float buffers, not int/uint, per Roland.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-25 15:40:24 -06:00
Brian Paul
71d3b69b23 svga: rework the FS white fragments code
When we forcibly write white to FS outputs (for XOR mode emulation)
we were using a temp register.  But that's not really necessary.
This also fixes the case of writing white to multiple color buffers.

Subsequent changes will build on this.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2017-07-25 15:40:23 -06:00
Brian Paul
1ab8901d6f gallium/util: s/unsigned/enum tgsi_texture_type/
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-07-25 15:40:23 -06:00
Kamil Páral
22379f7cad drirc: whitelist glthread for Overlord 1+2, Oil Rush, War Thunder, Saints Row 2
Performance delta on Core i5-4570 + Radeon R9 270:
    Overlord: +20% in certain locations
    Overlord II: +20% in certain locations
    Oil Rush: +12% in most locations
    War Thunder: +4-9% in benchmarks
    Saints Row 2: +10-35% in certain locations
2017-07-25 21:29:54 +02:00
Lionel Landwerlin
9f439ae120 i965: perf: flush batchbuffers at the beginning of queries
As Chris commented, it makes more sense to have batch buffer flushes
before the query. Usually applications like frame_retrace do a series
of queries and in that case, with flushes at the end of the queries,
we might still have the first query contained in 2 different batchs.
More generally it would be quite usual to have the query contained in
2 batch buffers because we never now what's the fill rate of the
current batch buffer.

If we move the flushing at the beginning of the queries, it's pretty
much guaranteed that queries will be contained in a single batch
buffer (unless the amount of commands is huge, but then it's only fair
to include reloading request times in the measurements).

Fixes: adafe4b733 ("i965: perf: minimize the chances to spread queries across batchbuffers")
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "17.2 17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-07-25 18:56:33 +01:00
Daniel Stone
45383d32d4 st/dri2: Return invalid modifier when no driver support
Always initialise whandle.modifier for DRIImage modifier queries, so if
the driver doesn't support it then we return false for the query.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Fixes: d33fe8b84e ("st/dri: enable DRIimage modifier queries")
2017-07-25 18:40:07 +01:00
Daniel Stone
b4a18f13ce st/dri: Check get-handle return value in queryImage
In the DRIImage queryImage hook, check if resource_get_handle() failed
and return FALSE if so.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-07-25 18:40:06 +01:00
Michal Srb
e6d7937b86 r600: Add support for B5G5R5A1.
Fixes rendercheck errors when using glamor acceleration in X server.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2017-07-25 19:17:03 +02:00
Leo Liu
82fcf3142f radeon/vcn: move message buffer to vram for now
To workaround an unknown bug.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2017-07-25 12:27:09 -04:00
Jose Fonseca
8d655263ca trace: Correct transfer box size calculation.
For textures we must not approximate the calculation with `stride *
height`, or `slice_stride * depth`, as that can easily lead to buffer
overflows, particularly for partial transfers.

This should address the issue that Bruce Cherniak found and diagnosed.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2017-07-25 17:18:04 +01:00
Samuel Pitoiset
c3ea898932 mesa: add active_shader_program() helper
To reduce code duplication.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-25 11:56:06 +02:00
Samuel Pitoiset
b8338f8df2 mesa: add bind_program_pipeline() helper
To reduce code duplication.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-07-25 11:56:06 +02:00