Commit graph

69054 commits

Author SHA1 Message Date
Emil Velikov
b2439602be makefile: add all headers to the tarball
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-24 20:49:31 +00:00
Emil Velikov
113d59fb55 gbm: remove gbm_gallium_drm from the loader
No longer used as of commit 48c7461d5a0(st/gbm: remove state-tracker)

v2: Add commit message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
2015-03-24 20:49:31 +00:00
Anuj Phogat
d8208312a3 glsl: Generate link error for non-matching gl_FragCoord redeclarations
in different fragment shaders. This also applies to a case when gl_FragCoord
is redeclared with no layout qualifiers in one fragment shader and not
declared but used in other fragment shader.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Khronos Bug#12957
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2015-03-24 11:16:31 -07:00
Eric Anholt
7bc39c8418 vc4: Add a dump-the-surface-contents routine.
This has been useful once again while trying to debug stride issues
between render targets and texturing.
2015-03-24 10:39:12 -07:00
Eric Anholt
4df13f55b6 vc4: Allow DRI3 on simulation, as well.
The problem I'd seen before seems to be gone.
2015-03-24 10:39:12 -07:00
Eric Anholt
7f797e3d17 vc4: Fix pitch alignment of linear textures.
Fixes some non-power-of-two texture rendering when I force ARGB8888 to
raster.
2015-03-24 10:39:12 -07:00
Eric Anholt
b3ea377f86 vc4: Write the alignment of level width consistently in validation.
16 / cpp happens to be the same as utile_w on the only raster format
supported (4 bytes per pixel), but simulator/hw source code generally
talks in terms of utiles.
2015-03-24 10:39:12 -07:00
Eric Anholt
8975a09494 vc4: Fix use of a bool as an enum.
The enum compared to was 0, so it worked out, but it sure looked wrong.
2015-03-24 10:39:12 -07:00
Eric Anholt
04605c21f6 vc4: Decide the HW's format before laying out the miptree.
I'm experimenting with a workaround for raster texture misrendering on
hardware, and this lets me look at the format chosen when computing
strides.
2015-03-24 10:39:12 -07:00
Eric Anholt
25d60763d9 vc4: Use our device-specific ioctls for create/mmap.
They don't do anything special for us, but I've been told by kernel
maintainers that relying on dumb for my acceleration-capable buffers
is not OK.
2015-03-24 10:39:12 -07:00
Eric Anholt
af3d747194 vc4: Make a new #define for making code conditional on the simulator.
I'd like to compile as much of the device-specific code as possible
when building for simulator, and using if (using_simulator) instead of
ifdefs helps.
2015-03-24 10:39:12 -07:00
Eric Anholt
9bafcf630a vc4: Add some useful debug printfs for miptrees.
I keep rewriting these.
2015-03-24 10:39:12 -07:00
Ilia Mirkin
baa22c8825 glsl: avoid calling base_alignment when samplers are involved
Earlier commit 53bf7c8fd2 changed the logic to always call
base_alignment on structs. 1ec715ce8b hacked the function to return 0
for sampler fields, but didn't handle sampler arrays. Instead of
extending the hack, avoid calling base_alignment in the first place on
non-UBO uniforms.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89726
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tapani Palli <tapani.palli@intel.com>
2015-03-24 10:10:13 -04:00
Ilia Mirkin
43277fcd59 Revert "nv50,nvc0: remove bogus 64_FLOAT formats"
This reverts commit 20346808cf.

The conversion is actually done since these are the *B macro variants
and no vtx format is supplied, which makes them go through the translate
module.

This restores the following piglit tests to passing:

  draw-vertices user
  gl-2.0-vertexattribpointer

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-03-23 20:57:52 -04:00
Mario Kleiner
1110113a7f mapi: Make private copies of name strings provided by client.
glXGetProcAddress("glFoo") ends up in stub_add_dynamic() to
create dynamic stubs for dynamic functions. stub_add_dynamic()
doesn't store the caller provided name string "Foo" in a mesa
private copy, but just stores a pointer to the "glFoo" string
passed to glXGetProcAddress - a pointer into arbitrary memory
outside mesa's control.

If the caller passes some dynamically allocated/changing
memory buffer to glXGetProcAddress(), or the caller gets unmapped
from memory, e.g., some dynamically loaded application
plugin which uses OpenGL, this ends badly - with a dangling
pointer.

strdup() the name string provided by the client to avoid
this problem.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-03-23 22:17:03 +00:00
Tom Stellard
dfb1ae9d91 clover: Return 0 as storage size for local kernel args that are not set v2
The storage size for local kernel args can be queried before the
arguments are set by using the CL_KERNEL_LOCAL_MEM_SIZE param
of clGetKernelWorkGroupInfo().

The spec says that if local kernel arguments have not been specified,
then we should assume their size is 0.

v2:
  - Implement using c++11 member initialization.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>

Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
2015-03-23 17:20:21 +00:00
Tom Stellard
769b366b83 gallivm: Use MCInstrInfo in the disassembler for querying instruction info
This fixes the build since llvm r232885 and also simplifies the code.
2015-03-23 14:43:10 +00:00
Giuseppe Bilotta
7932b30892 clover: use get_device_vendor instead of get_vendor
The pipe's get_vendor method returns something more akin to a driver
vendor string in most cases, instead of the actual device vendor. Use
get_device_vendor instead, which was introduced specifically for this
purpose.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-03-23 13:25:34 +00:00
Giuseppe Bilotta
76039b38f0 gallium: implement get_device_vendor() for existing drivers
The only hackish ones are llvmpipe and softpipe, which currently return
the same string as for get_vendor(), while ideally they should return
the CPU vendor.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-03-23 13:25:34 +00:00
Giuseppe Bilotta
31d4e6fbff gallium: introduce get_device_vendor() entrypoint for pipes
This will be needed by Clover to return the correct information
to CL_DEVICE_VENDOR info queries.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-03-23 13:25:34 +00:00
Giuseppe Bilotta
9280f17e82 gallium: remove trailing whitespace in p_screen.h
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2015-03-23 13:25:34 +00:00
Tom Stellard
6e17936bf8 clover: The unit for CL_DEVICE_MEM_BASE_ADDR_ALIGN is bits not bytes
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-03-23 13:22:42 +00:00
Tom Stellard
2b12b1752a clover: Add all the mandatory 1.1 extensions to the extension string
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-03-23 13:22:42 +00:00
Tom Stellard
96f9cc9181 clover: Add a space at the end of CL_DEVICE_OPENCL_C_VERSION
This is required by the spec.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-03-23 13:22:42 +00:00
Francisco Jerez
3d1bba7c9b i965/vec4: Fix handling of multiple register reads and writes in dead_code_eliminate().
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:52:57 +02:00
Francisco Jerez
2babde35b9 i965/vec4: Calculate live intervals with subregister granularity.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:52:57 +02:00
Francisco Jerez
e6e655ef76 i965/vec4: Define helpers to calculate the common live interval of a range of variables.
These will be especially useful when we start keeping track of
liveness information for each subregister.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:52:49 +02:00
Francisco Jerez
eddb87402e i965/vec4: Define helper functions to convert a register to a variable index.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:13:05 +02:00
Francisco Jerez
ce030a6399 i965/vec4: Don't lose the force_writemask_all flag during CSE.
And set it in the MOV instructions that copy the temporary to the
original destination if the generator instruction had it set.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:13:00 +02:00
Francisco Jerez
1db9c0cd0c i965/vec4: Fix handling of multiple register reads and writes in opt_cse().
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:12:56 +02:00
Francisco Jerez
d041a43c0f i965/vec4: Fix handling of multiple register reads and writes during copy propagation.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:12:52 +02:00
Francisco Jerez
588859e18c i965/vec4: Fix handling of multiple register reads and writes in split_virtual_grfs().
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:12:48 +02:00
Francisco Jerez
9304f60cbe i965/vec4: Fix handling of multiple register reads and writes in opt_register_coalesce().
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:12:40 +02:00
Francisco Jerez
74c7e5d351 i965: Define method to check whether a backend_reg is inside a given range.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:12:36 +02:00
Francisco Jerez
bf6eb37e0b i965/vec4: Remove dependency of vec4_live_variables on the visitor.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:12:13 +02:00
Francisco Jerez
2e7622a487 i965/vec4: Trivial copy propagate clean-up.
Fix typo and punctuation in a comment, break long line and add space
before curly bracket.

Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
7526ee36bc i965/vec4: Add argument index and type checks to SEL saturate propagation.
SEL saturate propagation already implicitly relies on these
assumptions.

Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
24073b2cd7 i965/vec4: Fix broken saturate mask check in copy propagation.
try_copy_propagate() was checking the bit of the saturate mask for the
arg-th component of the source to decide whether the whole source
should be saturated (WTF?).  We need to swizzle the original saturate
mask and check that for all enabled channels the saturate flag is
either set or unset, as we cannot saturate a subset of destination
components only.

Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
18dc59c212 i965/vec4: Don't lose copy propagation saturate bits for not written components.
Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
a3733defbe Revert "i965/vec4: Don't lose the saturate modifier in copy propagation."
This reverts commit 0dfec59a27.  The
change prevented propagation of copies with the saturate flag set,
making the whole saturate mask tracking completely useless.  A proper
fix follows.

Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
21c829e5cc i965/vec4: Remove unused method definition.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
516d45f78a i965/vec4: Some more trivial swizzle clean-up.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
430c6bf70e i965/vec4: Improve src_reg/dst_reg conversion constructors.
This simplifies the src_reg/dst_reg conversion constructors using the
swizzle utils introduced in a previous patch.  It also makes them more
useful by changing their semantics slightly: dst_reg(src_reg) used to
set the writemask to XYZW if the src_reg swizzle was anything other
than XXXX, which was almost certainly not what the caller intended if
the swizzle was non-trivial.  After this patch the same components
that are present in the swizzle will be enabled in the resulting
writemask.

src_reg(dst_reg) used to set the first components of the swizzle to
the enabled components of the writemask and then replicate the last
enabled component to fill the swizzle, which, in cases where the
writemask didn't have exactly the first n components set, would in
general not be compatible with the original dst_reg.  E.g.:

| ADD(tmp, src_reg(tmp), src_reg(1));

would *not* do what one would expect (add one to each of the enabled
components of tmp) if tmp didn't have a writemask of the described
form (e.g. YZ, YW, XZW would all fail).  This pattern actually occurs
in many different places in the VEC4 back-end, it's a wonder that it
hasn't caused piglit failures until now.  After this patch
src_reg(dst_reg) will construct a swizzle with each enabled component
at its natural position (e.g. Y at the second position, Z at the
third, and so on).  The resulting swizzle will behave like the
identity when used in any instruction with the original writemask.

I've manually verified that *none* of the callers of both conversion
constructors were relying on the previous broken semantics.  There are
no piglit regressions on any generation.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:33 +02:00
Francisco Jerez
62fd335338 i965/vec4: Pass argument by reference to src_reg/dst_reg conversion constructors.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:32 +02:00
Francisco Jerez
23bda945f5 i965/vec4: Remove swizzle_for_size() in favour of brw_swizzle_for_size().
It could be objected that swizzle_for_size() is "faster" than
brw_swizzle_for_size().  It's not measurably better in any reasonable
CPU-bound benchmark on VLV according to the Finnish benchmarking
system (including the SynMark2 DrvShComp shader compilation
benchmark).

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:32 +02:00
Francisco Jerez
5bcca9f8dc i965/vec4: Remove broken vector size deduction in setup_builtin_uniform_values().
This seemed to be trying to deduce the number of uniform vector
components from the parameter swizzle, but the algorithm would always
give 4 as result.  Instead grab the correct number of components from
the GLSL type.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:32 +02:00
Francisco Jerez
132cdcc468 i965/vec4: Simplify visitor handling of swizzles using the swizzle utils.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:32 +02:00
Francisco Jerez
9a17e4e900 i965/vec4: Simplify opt_register_coalesce() using the swizzle utils.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:32 +02:00
Francisco Jerez
05ec72d8ec i965/vec4: Simplify reswizzle() using the swizzle utils.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:32 +02:00
Francisco Jerez
7b30493dc4 i965/vec4: Simplify opt_reduce_swizzle() using the swizzle utils.
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-03-23 14:09:32 +02:00