Commit Graph

85845 Commits

Author SHA1 Message Date
Emil Velikov 8222100631 loader: annotate __driConfigOptionsLoader as static
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-18 17:06:07 +01:00
Emil Velikov d561e064a8 loader: separate USE_DRICONF code into separate function
Improves readability and allows us to do further cleanups a lot easier.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-18 17:06:04 +01:00
Emil Velikov be239326aa loader: slim down loader_get_pci_id_for_fd implementation(s)
Currently mesa has three code paths in the loader - libudev, manual
sysfs and drm ioctl one.

Considering the issues we had with libudev - strip those down in favour
of the libdrm drm device API. The latter can be implemented in any way
depending on the platform and can be reused by others.

v2: Use correct message on drmGetDevice failure. (Nicolai)

Cc: Jonathan Gray <jsg@jsg.id.au>
Cc: Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
2016-10-18 17:06:04 +01:00
Emil Velikov fd00aba5f4 configure.ac: mark libdrm as have_pci_id provider
With follow on work, we'll untangle and simplify all the different
codepaths in loader. Then again, we forget to set have_pci_id when
libdrm is present (one of the codepaths available).

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-18 17:06:01 +01:00
Ilia Mirkin 8c78fdb328 gm107/ir: fix bit offset of tex lod setting for indirect texturing
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2016-10-18 09:56:14 -04:00
Ilia Mirkin ecea2f69ef gm107/ir: fix texturing with indirect samplers
The indirect handle has to come right after the coordinates, so if there
was a sample/bias/depth compare/offset, everything would end up being
shifted by one argument position.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
2016-10-18 09:56:14 -04:00
Marek Olšák 34099894c3 gallium/tgsi: add missing #include
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-18 11:20:57 +02:00
Julien Isorce dbc8e18116 st/va: set default rt formats when calling vaCreateConfig
As specified in va.h, default value should be set on attributes
not present in the input list.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
2016-10-18 08:44:14 +01:00
Kenneth Graunke 9f677d6541 i965: Fix gl_InvocationID in dual object GS where invocations == 1.
dEQP-GLES31.functional.geometry_shading.instanced.geometry_1_invocations
draws using a geometry shader that specifies

   layout(points, invocations = 1) in;

and then uses gl_InvocationID.  According to the Haswell PRM, the
"GS Instance ID 0" (and 1) thread payload fields are undefined in
dual object mode:

   "If 'dispatch mode' is DUAL_OBJECT this field is not valid."

But there's no point in using them - if there's only one invocation,
the ID will be 0.  So just load a constant.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-17 20:22:02 -07:00
Jason Ekstrand 52904ba85c anv: Get rid of anv_cmd_buffer_emit_state_base_address
All code that would have once called this can now call the gen-specific
version.  The switching version is no longer needed.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-17 17:41:35 -07:00
Jason Ekstrand 7998e37774 anv/cmd_buffer: Move descriptor flushing into genX_cmd_buffer.c
It really should have gone here all along.  We were trying a bit too hard
to make it gen-agnostic just because it didn't have any #if's.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-17 17:41:35 -07:00
Jason Ekstrand eddaa237c0 anv/cmd_buffer: Expose ensure_push_constant_*
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-17 17:41:35 -07:00
Jason Ekstrand 1f3e6468d2 anv/cmd_buffer: Unify flush_compute_state across gens
With one small genxml change, the two versions were basically identical.
The only differences were one #define for HSW+ and a field that is missing
on Haswell but exists everywhere else.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-17 17:41:35 -07:00
Jason Ekstrand 2314c9ed2e anv/cmd_buffer: Move Begin/End/Execute to genX_cmd_buffer.c
vkBeginCommandBuffer and vkCmdExecuteCommands both call into the
gen-specific emit_state_base_address function and vkEndCommandBuffer
belongs with begin.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-17 17:41:35 -07:00
Jason Ekstrand ac0ca066de anv/cmd_buffer: Move state base address re-emit into ExecuteCommands
This has two primary advantages.  First, it means that the batch_chain code
knows less about the actual command buffer contents which is good because
improves separation.  Second, it means that it only gets re-emitted once
after all of the secondaries instead of once after each secondary which is
just wasteful.  It also has the advantage of cleaning the code up a bit.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2016-10-17 17:41:35 -07:00
Edward O'Callaghan 1c05f92590 doc/features.txt: factor out radeonsi as GL45 complete
V2. add i965/hsw+ to list
V3. rebased on master.
V4. 'DONE' -> 'DONE ()'.
V5. remove i965/hsw+ from list :/

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-18 09:55:45 +11:00
Ian Romanick 89e1436e2d i965: Silence unused parameter warnings
brw_link.cpp:76:44: warning: unused parameter ‘shader_type’ [-Wunused-parameter]
                            gl_shader_stage shader_type,
                                            ^
brw_nir.c: In function ‘brw_nir_lower_vs_inputs’:
brw_nir.c:194:55: warning: unused parameter ‘devinfo’ [-Wunused-parameter]
                         const struct gen_device_info *devinfo,
                                                       ^
brw_vec4_visitor.cpp:914:37: warning: unused parameter ‘sampler’ [-Wunused-parameter]
                            uint32_t sampler,
                                     ^
brw_vec4_visitor.cpp:1146:34: warning: unused parameter ‘stream_id’ [-Wunused-parameter]
 vec4_visitor::gs_emit_vertex(int stream_id)
                                  ^

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-17 11:32:03 -07:00
Ian Romanick 7c0c3740f0 glsl: Remove unused function import_prototypes
Once upon a time, this was used to extract prototypes from the shader
containing GLSL built-in functions.  This was removed by f5692f45 in
November 2010 for Mesa 7.10.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-17 11:32:03 -07:00
Ian Romanick 5c025ea6fc glsl: Remove prototypes for nonexistent functions
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-17 11:32:03 -07:00
Ian Romanick fde48c1262 glsl: Replace assert with unreachable
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-17 11:32:03 -07:00
Lionel Landwerlin 696f5c1853 anv: replace , with ; in anv_batch_emit()
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-17 18:16:38 +01:00
Lionel Landwerlin 6b17e3a6da intel: aubinator: use different colors to signal batch start/end
This makes the stream of commands a bit easier to read.

v2 (Ken): Use bold text on green headers for easier readability;
          swap the green and blue headers so the majority stay blue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2016-10-17 18:16:38 +01:00
Nicolai Hähnle c3ce0d22b4 st/glsl_to_tgsi: fix [ui]vec[34] conversion to double
The corresponding opcodes for integers need to be treated the same as F2D.

Fixes GL45-CTS.gpu_shader_fp64.conversions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-17 19:09:45 +02:00
Nicolai Hähnle 1dd99a15a4 st/glsl_to_tgsi: fix atomic counter addressing
When more than one atomic counter buffer is in use, UniformStorage[n].opaque
is set up to contain indices that are contiguous across all used buffers.

This appears to be used by i965 via NIR, but for TGSI we do not treat atomic
counter buffers as opaque, so using the data in the opaque array is incorrect.

Fixes GL45-CTS.compute_shader.resource-atomic-counter.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-17 19:09:42 +02:00
Nicolai Hähnle 9d6f82320c st/glsl_to_tgsi: fix a corner case of std140 layout in uniform buffers
See the comment in the code for an explanation. This fixes
GL45-CTS.buffer_storage.map_persistent_draw.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-17 19:09:39 +02:00
Nicolai Hähnle 57a1514203 st/mesa: fix fragment shader output mapping
Properly handle the case where there is a gap in the assigned output locations,
e.g. a fragment shader writes to color buffer 2 but not to color buffers 0 & 1.

Fixes GL45-CTS.gtf33.GL3Tests.explicit_attrib_location.explicit_attrib_location_pipeline.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-17 19:09:37 +02:00
Nicolai Hähnle e0213f36bb glsl: print non-zero bindings of variables
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-17 19:09:33 +02:00
Nicolai Hähnle 9160b4d981 radeonsi: unify the constant load paths
Remove the split between direct and indirect.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-17 19:08:45 +02:00
Nicolai Hähnle 51f9b38ce8 radeonsi: fix indirect loads of 64 bit constants
This fixes GL45-CTS.compute_shader.fp64-case3.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-17 19:08:36 +02:00
Eric Engestrom e9864f93c6 gbm: add a couple missing includes
Needed for memset() and drmIoctl().

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
2016-10-17 08:47:38 -07:00
Iago Toral Quiroga 8785a8ff89 glsl: fail compilation of compute shaders when unsupported
Generally, we only check for the presence of compute shaders during
parsing when we find any language (like layout qualifiers) that are
specific to compute shaders, however, it is possible to define an
empty compute shader does not use any language specific to compute
shaders at all and we should fail the compilation anyway. dEQP checks
this.

This patch adds a check for compute shader availability after we have
parsed the source code. At this point we know the effective GLSL version
and also extensions enabled in the shader.

Fixes a subcase of the following dEQP tests:
dEQP-GLES31.functional.debug.negative_coverage.callbacks.shader.compile_compute_shader
dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.compile_compute_shader
dEQP-GLES31.functional.debug.negative_coverage.log.shader.compile_compute_shader

The tests still fail because there is one more subcase that fails that needs
another fix.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-17 15:14:12 +02:00
Tapani Pälli 3d48353e29 egl/android: fix error in droid_add_configs_for_visuals()
This was some kind of leftover in commit acd35c8 and format_count
array variable (declared in outer scope) should be used instead.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Fixes: acd35c8758 ("egl/android: tweak droid_add_configs_for_visuals()")
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-17 11:51:15 +01:00
Marek Olšák 74d145f4a8 radeonsi: shorten "shader->selector" to "sel" in si_shader_create
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-17 12:13:00 +02:00
Marek Olšák 2e74e8ead9 radeonsi: clear DB_RENDER_OVERRIDE
Vulkan doesn't set these fields even though it doesn't use HiS.
HiS is disabled by programming DB_SRESULTS_COMPARE_STATEn to 0.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2016-10-17 12:13:00 +02:00
Kenneth Graunke f30f48476f glsl: Disable textureOffset(sampler2DArrayShadow, ...) in GLSL ES.
This has apparently never existed in GLSL ES.

Fixes dEQP-GLES3.functional.shaders.texture_functions.invalid
.textureoffset_sampler2darrayshadow_vec4_ivec2_vertex and
.textureoffset_sampler2darrayshadow_vec4_ivec2_fragment

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98244
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-10-16 15:05:00 -07:00
Axel Davy 9baf4505fb st/nine: Fix multisample limit check
Fixes regression introduced by
b560305687

The regression prevents some apps to start.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
2016-10-17 00:02:52 +02:00
Eric Anholt c61eb3c91c vc4: Fix fast clear color packing for 565.
Piglit didn't manage to cover this because fbo-clear-formats uses
scissors, so we don't get fast clearing.
2016-10-16 11:22:50 -07:00
Eric Anholt 46cd3bab93 state_tracker: Fix check for scissor enabled when < 0.
DEQP's clear tests like to give us x + w < 0 or y + h < 0.  Since we
were comparing to an unsigned, it would get promoted to unsigned and come
out as bignum >= width or height and we would clear the whole fb instead
of none of the fb.

Fixes 10 tests under deqp-gles2/functional/color_clear.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2016-10-16 11:22:50 -07:00
Chad Versace 07422bf32b egl/surfaceless: Fix comparison between pointer and integer
Fixes GCC warning:
  drivers/dri2/platform_surfaceless.c:196:18: warning: comparison
      between pointer and integer

Fixes: 4b8a55809e ("egl/surfaceless: tweak surfaceless_add_configs_for_visuals()")
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-10-16 09:03:31 -07:00
Emil Velikov d19b014b77 egl/surfaceless: use correct index when accesing the visual
i is used for the driver_configs, while j is for the visuals.

Fixes: 4b8a55809e ("egl/surfaceless: tweak surfaceless_add_configs_for_visuals()")
Reported-by: Chad Versace <chadversary@chromium.org>
Tested-by: Chad Versace <chadversary@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2016-10-16 09:03:27 -07:00
Gustaw Smolarczyk 36cb5508e8 radv/winsys: Fail early on overgrown cs.
When !use_ib_bos, we can't easily chain ibs one to another. If the
required cs size grows over 1Mi - 8 dwords just fail the cs so that we
won't assert-fail in radv_amdgpu_winsys_cs_submit later on.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
2016-10-16 12:38:53 +02:00
Kenneth Graunke 493237d4ee glsl: Drop the ES requirement that VS outputs must be flat qualified.
Several conformance tests violate this requirement:

ES31-CTS.core.tessellation_shader.max_patch_vertices
ES31-CTS.core.tessellation_shader.tessellation_control_to_tessellation_evaluation.data_pass_through

I submitted a merge request to fix the conformance tests, but Khronos
opted to drop this GLSL ES specific requirement in favor of making flat
qualification of VS outputs optional, matching modern desktop GL.

Note that there were 7 Piglit tests which enforce this rule:
tests/spec/glsl-es-3.00/compiler/interpolation/qualifiers/*nonflat*
but these were deleted in Piglit commit acc0a2fabbd714bc704c16f1675e7c0.

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15465#c7
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
2016-10-15 13:47:47 -07:00
Jason Ekstrand 6ef5a44a43 intel/genxml: Make some PIPE_CONTROL fields booleans
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:50 -07:00
Jason Ekstrand f34de3e8b0 intel/genxml: Make "Predication enable" a boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:46 -07:00
Jason Ekstrand 468e1042cb intel/genxml; Make "Use Global GTT a boolean
We also remove the redundant zero defaults since everything without an
explicit default gets zeroed automatically.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:43 -07:00
Jason Ekstrand ce86227175 intel/genxml; Make "Tiled Surface" a boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:39 -07:00
Jason Ekstrand e6f9637d8a intel/genxml: Make "SO Buffer Enable" fields boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:36 -07:00
Jason Ekstrand fa0285eaac intel/genxml: Make "Stencil Buffer Enable" a boolean
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:30 -07:00
Jason Ekstrand 34826078f6 intel/genxml: Make a couple of STREAMOUT fields booleans
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:26 -07:00
Jason Ekstrand 6a064ad01d intel/genxml: Make "Include Vertex Handles" and "Include Primitive ID" booleans
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-10-15 12:20:23 -07:00