Commit graph

85652 commits

Author SHA1 Message Date
Dylan Baker
d4bf9baa43 mesa: Implement ARB_shader_viewport_layer_array for i965
This extension is a combination of AMD_vertex_shader_viewport_index and
AMD_vertex_shader_layer, making it rather trivial to implement.

For gallium I *think* this needs a new cap because of the addition of
support in tessellation evaluation shaders, and since I don't have any
hardware to test it on, I've left that for someone else to wire up.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-20 16:23:04 -07:00
Leo Liu
956f3e3bcd radeon/vce: add firmware support for version 52.8.3
Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
2016-09-20 15:58:56 -04:00
Indrajit Das
f9311265bf st/omx/dec/h265: Correct the timestamping
(derived from commit 3b6bda665a)

v2: fix the tabs(Leo)

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nishanth Peethambaran <nishanth.peethambaran@amd.com>
Signed-off-by: Indrajit Das <indrajit-kumar.das@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2016-09-20 15:58:56 -04:00
Lionel Landwerlin
792d77165b aubinator: add a custom handler for immediate register load
Transforming this :

0x00c77084:  0x11000001:  MI_LOAD_REGISTER_IMM
0x00c77088:  0x0000b020 : Dword 1
    Register Offset: 0x0000b020
    0x00c7708c:  0x00880038 : Dword 2
    Data DWord: 8912952

Into this:

0x007880f0:  0x11000001:  MI_LOAD_REGISTER_IMM
0x007880f4:  0x0000b020 : Dword 1
    Register Offset: 0x0000b020
    0x007880f8:  0x00080040 : Dword 2
    Data DWord: 524352
register L3CNTLREG2 (0xb020) : 0x80040
    SLM Enable: 0
    URB Allocation: 32
    URB Low Bandwidth: 0
    RO Allocation: 32
    RO Low Bandwidth: 0
    DC Allocation: 0
    DC Low Bandwidth: 0

v2: Drop unused arguments (Sirisha)
    Print out register name

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2016-09-20 10:47:21 +01:00
Nayan Deshmukh
0301858a31 st/va: flush the context before calling flush_frontbuffer(v2)
so that the texture is rendered to back buffer before calling
flush_frontbuffer and can be copied to a different buffer in
the function

v2: change comment style

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2016-09-20 11:18:29 +02:00
Nayan Deshmukh
e4cc2276c1 st/vdpau: flush the context before calling flush_frontbuffer
so that the texture is rendered to back buffer before calling
flush_frontbuffer and can be copied to a different buffer in
the function

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2016-09-20 11:18:07 +02:00
Nayan Deshmukh
853e80f5a0 vl/dri3: handle the case of different GPU(v4.2)
In case of prime when rendering is done on GPU other then the
server GPU, use a seprate linear buffer for each back buffer
which will be displayed using present extension.

v2: Use a seprate linear buffer for each back buffer (Michel)
v3: Change variable names and fix coding style (Leo and Emil)
v4: Use PIPE_BIND_SAMPLER_VIEW for back buffer in case when
    a seprate linear buffer is used (Michel)
v4.1: remove empty line
v4.2: destroy the context and handle the case when
      create_context fails (Emil)

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
2016-09-20 11:17:02 +02:00
Ilia Mirkin
40d787ab05 st/vdpau: fix argument type to vlVdpOutputSurfaceDMABuf
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christian König <christian.koenig@amd.com>
2016-09-20 11:13:05 +02:00
Tim Rowley
92ec820244 swr: [rasterizer core] Better thread destruction
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-09-19 20:10:19 -05:00
Tim Rowley
fdf2890423 swr: [rasterizer jitter] Fix missing end-of-file newline
Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-09-19 20:10:19 -05:00
Tim Rowley
2f86a9577a swr: [rasterizer core] Add macros for mapping ArchRast to buckets
Switch all RDTSC_START/STOP macros to use AR_BEGIN/END macros.

Signed-off-by: Tim Rowley <timothy.o.rowley@intel.com>
2016-09-19 20:10:19 -05:00
Kenneth Graunke
04026b43c8 glsl: Skip "unsized arrays aren't allowed" check for TCS/TES/GS vars.
Fixes ESEXT-CTS.draw_elements_base_vertex_tests.AEP_shader_stages and
ESEXT-CTS.texture_cube_map_array.texture_size_tesselation_con_sh.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-19 12:01:11 -07:00
Samuel Pitoiset
6ed05fa4cb nvc0: get rid of nvc0_stage_sampler_states_bind_range()
Same thing as nvc0_stage_set_sampler_views_range().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-19 20:03:24 +02:00
Samuel Pitoiset
407948df1b nvc0: get rid of nvc0_stage_set_sampler_views_range()
This function was quite similar to nvc0_stage_set_sampler_views()
and I don't see any reasons to not remove it.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-19 20:03:20 +02:00
Samuel Pitoiset
557a29b51f nv50/ir: optimize SUB(a, b) to MOV(a - b)
This helps shaders in UE4 demos, especially with Elemental
(+1% perf). This optimization reduces spilling usage in one
shader which explains the little gain.

GF100/GK104:

total instructions in shared programs :2838551 -> 2838045 (-0.02%)
total gprs used in shared programs    :396706 -> 396684 (-0.01%)
total local used in shared programs   :34432 -> 34416 (-0.05%)

                local        gpr       inst      bytes
    helped           1          19         112         112
      hurt           0           0           0           0

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-18 16:42:39 +02:00
Samuel Pitoiset
d8b4f5fcca gk110/ir: fix wrong emission of OP_NOT
This should emit src0 instead of src1.
Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
2016-09-18 16:42:33 +02:00
Martina Kollarova
15804c4b90 r600g/sb: fix struct/class declaration conflicts
A couple of forward-declarations were causing warnings in clang:
    'value' defined as a class here but previously declared as a struct
    [-Wmismatched-tags]

Signed-off-by: Martina Kollarova <martina.kollarova@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2016-09-18 09:23:42 +02:00
Eric Anholt
073129c7af i965: Drop assertion about buffer offset at draw time.
Given robust access, we should just be returning zeroes if the user gives
us a base pointer that's too big, which is what was happens on a release
build.  This was caught by a webgl conformance test for out-of-bounds
draws on servo.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-09-17 17:48:16 +01:00
Lars Hamre
ddd6116e32 tgsi: Enable returns from within loops
Fixes the following piglit test (for softpipe):
/spec/glsl-1.10/execution/fs-loop-return

Signed-off-by: Lars Hamre <chemecse@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:24:13 -06:00
Charmaine Lee
8a6391477e svga: relax restriction of compressed formats for texture upload
This patch relaxes the restriction of compressed formats for texture
upload buffer. For now, 3D texture with compressed format
is still not supported in the texture upload buffer path.

As Brian noted, ETQW does many texture updates with glCompressedTexSubImage.
This patch greatly improves the performance of the ETQW trace.

Tested with ETQW, MTT piglit, glretrace, conform, viewperf

v2: Per Brian's suggestion, removed the subregion boundary check.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:24:13 -06:00
Brian Paul
15dee0fc1d svga: skip query flush if we already have the query result
This reduces the number of times we flush in some situations (the
arbocclude demo is one trivial example).

Tested with Piglit, ETQW, Sauerbraten, arbocclude.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-17 10:24:13 -06:00
Brian Paul
c71e82b8e9 svga: remove unneeded svga_context_flush() in svga_end_query()
Since commit 99d8fe20ab we don't have to flush the command buffer when
we end a query.

Tested with Piglit, Sauerbraten, arbocclude, ETQW (noticably faster now).

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2016-09-17 10:24:13 -06:00
Charmaine Lee
f1b3374d28 svga: use upload buffer for upload texture.
With this patch, when running with vgpu10, instead of mapping directly to the
guest backed memory for texture update, we'll use the texture upload buffer
and use the transfer from buffer command to update the host side texture memory.

This optimization yields about 20% performance improvement with
Lightsmark2008 and about 40% with Tropics.

Tested with Lightsmark2008, Tropics, Heaven, MTT piglit, glretrace, conform.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:24:13 -06:00
Charmaine Lee
a9c4a861d5 svga: refactor svga_texture_transfer_map/unmap functions
Split the functions into separate functions for dma and direct map to make
the code more readable.

Tested with MTT piglit, glretrace, viewperf, conform, various OpenGL apps

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:24:12 -06:00
Charmaine Lee
c8ef82d65a svga: add SVGA3d_vgpu10_TransferFromBuffer()
Also add the corresponding dump function to dump the TransferFromBuffer command.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:24:12 -06:00
Charmaine Lee
2a4b019239 svga: single sample surface can be created as non-multisamples surface
With this patch, single sample surface will be created as non-multisamples
surface.

Tested with piglit, glretrace.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:24:12 -06:00
Charmaine Lee
5947d90830 svga: fix memory leak with sampler state
This patch fixes a memory leak with sampler state when piglit
is run with HW version 11. Sampler state clean up was incorrectly skipped
in svga_cleanup_sampler_state() for vgpu9.

Tested with piglit.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:24:12 -06:00
Brian Paul
12689efbbe svga: fix prim type check/assignment in translate_indices()
Left over test code spotted by Sinclair.

Tested with piglit, Google Earth, Lightsmark, Heaven4, glretraces, etc.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
2016-09-17 10:09:00 -06:00
Charmaine Lee
50359ddb5d svga: use SVGA3D_QUERYTYPE_MAX for svga query type check
Use SVGA3D_QUERYTYPE_MAX instead of SVGA_QUERY_MAX for
svga query type check.

Tested with various OpenGL apps with GALLIUM_HUD set.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:09:00 -06:00
Charmaine Lee
ee39814d90 svga: split the num-resources-mapped hud to textures & buffers
Replace the num-resources-mapped hud with
num-textures-mapped and num-buffers-mapped, so we can
differentiate the map counts for these two different resources.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:09:00 -06:00
Charmaine Lee
f168c886c9 svga: change svga hud defines to enums
This will make it easier to add new hud types.

Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:09:00 -06:00
Brian Paul
4f74b379aa svga: implement an index buffer translation cache
Some OpenGL apps, like Cinebench R15, have many glDrawElements(GL_QUADS)
calls.  Since we don't directly support quads we have to convert these
calls into GL_TRIANGLES which involves generating a new index buffer.

This patch saves the new/translated index buffer in the hope that it
can be reused for a later draw call.

Cinebench R15 increases by about 20% with this change.
The NobelClinician Viewer app also hits this code.
Tested with full piglit run.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-17 10:09:00 -06:00
Brian Paul
581292a78c svga: try to emit fewer buffer rebind commands
If a consecutive sequence of drawing commands references the same
vertex/index buffers, there should be no need to rebind the surfaces
for the second and subsequent drawing commands.

Apps that use multiple display lists benefit from this since the vertex
data for several display lists is often stored in one buffer.

In the case of the legacy E&S Glaze demo, this reduces the size of our
command buffers from 91KB to 44KB.  One WSI Fusion trace shows a 33%
reduction in command buffer sizes.

Tested with full piglit run.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-17 10:09:00 -06:00
Brian Paul
ee5f5e2269 svga: reduce unmapping/remapping of the default constant buffer
Previously, every time we put shader constants into the default constant
buffer we called u_upload_alloc(), which mapped the buffer, and
u_upload_unmap().  We had to unmap the buffer before calling
svga_buffer_handle() to get the winsys handle for the buffer.  But we
really only need to do that the first time we reference the const buffer.
Now we try to keep the upload manager's buffer mapped until we fill it or
flush the command buffer.

v2: add additional comment on the buffer unmapping code in
svga_context_flush(), per Charmaine.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-17 10:09:00 -06:00
Brian Paul
ce3b34b727 svga: optimize memcpy() in svga_buffer_update_hw()
When we migrate a buffer from sw/malloc storage to a hardware buffer,
don't memcpy the whole buffer, just copy the part we've written to.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
2016-09-17 10:08:59 -06:00
Neha Bhende
b7bee25052 svga: Use comparison between svga texture types to use PredCopyRegion command
PredCopyRegion support copy between same type of textures.
Instead of comparing src and dst pipe texture type, compare svga texture
type which can avoid some software fallback.
for example, it avoids a software blit with the Redway3D Aston demo.

Tested piglit tests on VGPU9 and  VGPU10 on GL/DX11Renderer, Redway3D Aston demo

v2: some nit pick suggested by Charmaine.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:08:59 -06:00
Neha Bhende
b9f333cc81 svga: Add function svga_resource_type()
This function returns svga texture type for corresponding pipe texture.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2016-09-17 10:08:59 -06:00
Samuel Pitoiset
50baaf6bc6 nvc0/ir: fix subops for IMAD
Offset was wrong, it's at bit 8, not 4. Also, uses subr instead
of sub when src2 has neg. Similar to GK110 now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
2016-09-17 17:42:45 +02:00
Samuel Pitoiset
9b8b69b3c4 nvc0/ir: fix comments about instructions info
The comment for the commutative flags was wrong because OP_MUL is
before OP_MAD. While we are at it add missing opcodes, and fix
the comment about the short forms.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-17 17:42:40 +02:00
Kenneth Graunke
eaacb27812 mesa: Move buffers-unmapped earlier in check_valid_to_render().
This needs to be above the switch on API, as that can return true
(valid to render) before this error check even had a chance to run.

Fixes ESEXT-CTS.draw_elements_base_vertex_tests.invalid_mapped_bos,
which worked before commit 72f1566f90.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2016-09-16 19:42:56 -07:00
Kenneth Graunke
6b0ba02cae mesa: Expose GL_CONTEXT_FLAGS in ES 3.2.
Fixes four ES32-CTS.context_flags.* tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-16 18:55:38 -07:00
Tom Stellard
91ec6e5664 radeonsi/compute: Use the HSA abi for non-TGSI compute shaders v3
This patch switches non-TGSI compute shaders over to using the HSA
ABI described here:

https://github.com/RadeonOpenCompute/ROCm-Docs/blob/master/AMDGPU-ABI.md

The HSA ABI provides a much cleaner interface for compute shaders and allows
us to share more code in the compiler with the HSA stack.

The main changes in this patch are:
  - We now pass the scratch buffer resource into the shader via user sgprs
    rather than using relocations.
  - Grid/Block sizes are now passed to the shader via the dispatch packet
    rather than at the beginning of the kernel arguments.

Typically for HSA, the CP firmware will create the dispatch packet and set
up the user sgprs automatically.  However, in Mesa we let the driver do
this work.  The main reason for this is that I haven't researched how to
get the CP to do all these things, and I'm not sure if it is supported
for all GPUs.

v2:
  - Add comments explaining why we are setting certain bits of the scratch
    resource descriptor.

v3:
  - Use amdgcn-mesa-mesa3d triple instead of amdgcn--mesa3d.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-09-16 23:07:10 +00:00
Tom Stellard
a2b8346fa6 radeonsi/compute: Add some more debug printfs 2016-09-16 22:51:06 +00:00
Marek Olšák
ae0a4a1299 glsl: remove interpolateAt* instructions for demoted inputs
This fixes 8 fs-interpolateat* piglit crashes on radeonsi, because it can't
handle non-input operands in interpolateAt*.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-09-16 22:35:08 +02:00
Marek Olšák
d58a3906cb mesa: fix glGetFramebufferAttachmentParameteriv w/ on-demand FRONT_BACK alloc
This fixes 66 CTS tests on st/mesa.

Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-09-16 22:35:08 +02:00
Serge Martin
1c8d4c694b clover: fix getting scalar args api size
This fix getting the size of a struct arg. vec3 types still work ok.
Only buit-in args need to have power of two alignment, getTypeAllocSize
reports the correct size in all cases.

Acked-by: Francisco Jerez <currojerez@riseup.net>
2016-09-16 22:09:47 +02:00
Ilia Mirkin
f65187bb93 docs: add GL_ARB_gl_spirv to features list
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-09-16 12:04:12 -04:00
Rob Clark
ba8a50955d ttn: fix warning after 7bf76563e
Signed-off-by: Rob Clark <robdclark@gmail.com>
2016-09-16 11:55:26 -04:00
Brian Paul
702ff0b9a0 gallium/docs: document alpha_to_coverage and alpha_to_one blend state
The gallium interface defines these like DX10.  Note that OpenGL ignores
these options if MSAA is disabled or the dest buffer doesn't support
MSAA.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-09-16 08:44:26 -06:00
Brian Paul
187c278121 st/mesa: update comment in st_atom_msaa.c
The old comment was a copy and paste mistake.  Indent another comment.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2016-09-16 08:44:26 -06:00