Commit Graph

81707 Commits

Author SHA1 Message Date
Emil Velikov 793574afad egl: add missing link against $(CLOCK_LIB)
Some platforms require separate library in order to resolve the
clock_gettime() symbol. Add the link or the build will fail.

Fixes: 70299474f5 ("egl: add EGL_KHR_reusable_sync to egl_dri")

Cc: Dongwon Kim <dongwon.kim@intel.com>
Reported-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-23 12:07:47 +01:00
Emil Velikov d67e757d11 egl: android: remove explicit glFlush call
The DRI flush extension should already do the same thing.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Rob Herring <robh@kernel.org>
2016-05-23 12:07:47 +01:00
Emil Velikov 9b3c7481c6 egl: android: drop dri2_create_image_android_native_buffer argument
The drv is no longer used/needed as of last commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
2016-05-23 12:07:47 +01:00
Emil Velikov 38ef6f5f60 egl: android: directly use dri2_create_image_dma_buf()
Make the function non static so that we can use it directly from the
android platform code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
2016-05-23 12:07:47 +01:00
Emil Velikov 2cd687ce97 configure.ac: error out when building from git without python3
Bail early, as opposed to later on during the build.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-23 12:07:47 +01:00
Emil Velikov a155cdaace vl/drm: don't call close(-1) in vl_drm_screen_create error path
Analogous to previous commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2016-05-23 12:07:47 +01:00
Emil Velikov ed3f6ccce0 st/xa: don't call close(-1) in xa_tracker_create error path
Analogous to previous commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2016-05-23 12:07:46 +01:00
Emil Velikov 6e00a1e6cb st/dri: don't call close(-1) in dri{2, kms_}_init_screen error path
Add separate labels and jump to the correct one as needed.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
2016-05-23 12:07:46 +01:00
Eric Engestrom 7362bb3e21 vk/intel: use negative VK_NO_PROTOTYPES scheme
3d0fac7aca changed all
VK_PROTOTYPES to VK_NO_PROTOTYPES
This brings the Intel header in line with the rest of the Vulkan code.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chad Versace <chad.versace@intel.com>
2016-05-23 12:07:46 +01:00
Rob Herring 8aeb6d768b gbm: Add map/unmap functions
This adds map and unmap functions to GBM utilizing the DRIimage extension
mapImage/unmapImage functions or existing internal mapping for dumb
buffers. Unlike prior attempts, this version provides a region to map and
usage flags for the mapping. The operation follows the same semantics as
the gallium transfer_map() function.

This was tested with GBM based gralloc on Android.

Signed-off-by: Rob Herring <robh@kernel.org>
[Emil Velikov: drop no longer relevant hunk from commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-23 12:07:46 +01:00
Rob Herring 1f4869a208 configure.ac: add pthreadstubs support
Add pthreadstubs to avoid pulling in full pthreads library. GBM will be the
first user.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-23 12:07:46 +01:00
Rob Herring 0a4275b534 gbm: rename gbm_dri_bo_{map,unmap} to gbm_dri_bo_{map,unmap}_dumb
In preparation to add public map/unmap functions, rename the existing
gbm_dri_bo_{map,unmap} functions to indicate that they are only for dumb
buffers.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-23 12:07:46 +01:00
Rob Herring e8431a630d st/dri: Add support for DRIimage extension mapImage/unmapImage
Implement support for mapImage/unmapImage functions in version 12 of the
DRIimage extension.

Signed-off-by: Rob Herring <robh@kernel.org>
[Emil Velikov: align/indent the map/unmap vfuncs]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-23 12:07:46 +01:00
Rob Herring a0f06f168f DRI: Add DRIimage map and unmap functions
Add mapImage and unmapImage functions to DRIimage extension for mapping
and unmapping DRIimages for CPU access. The caller provides the region of
the image to map and is returned a pointer to the beginning of the region
and the stride (which could be different from the original).

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-23 12:07:46 +01:00
Rob Herring bdfa635f72 gbm: Add Android build support
In order to use libgbm for gralloc, add it to the Android build.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-23 12:07:46 +01:00
Rob Herring 64a005e3ee gbm: add Android gallium_dri.so library loading support
GBM needs the same special gallium_dri.so loading as EGL for Android, so
copy over the same hunk from the EGL code.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-23 12:07:46 +01:00
Rob Herring 7d79eec456 gbm: split out source file to Makefile.sources
In preparation to add Android build support, split out the source file
lists to Makefile.sources

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>

[Emil Velikov: Whitespace cleanup.]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-05-23 12:07:46 +01:00
Rob Herring fc1806e041 Android: Move setting DEFAULT_DRIVER_DIR to shared location
Move the defining of DEFAULT_DRIVER_DIR path to a common location so both
EGL and GBM can use it.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-05-23 12:07:45 +01:00
Emil Velikov 6ce11e7e2c c11/threads: create mutexattrs only when needed
If the mutexattrs are the default one can just pass NULL to
pthread_mutex_init. As the compiler does not know this detail it
unnecessarily creates/destroys the attrs.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-23 12:07:45 +01:00
Andres Gomez 4424bf5da4 configure: added xcb to dri3 modules to pkg-conf
This fixes a recent linking error in libvulkan_common

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
2016-05-23 11:21:34 +02:00
Juan A. Suarez Romero 3c9096eea4 glsl/linker: dvec3/dvec4 consume twice input vertex attributes
From the GL 4.5 core spec, section 11.1.1 (Vertex Attributes):

"A program with more than the value of MAX_VERTEX_ATTRIBS
active attribute variables may fail to link, unless
device-dependent optimizations are able to make the program
fit within available hardware resources. For the purposes
of this test, attribute variables of the type dvec3, dvec4,
dmat2x3, dmat2x4, dmat3, dmat3x4, dmat4x3, and dmat4 may
count as consuming twice as many attributes as equivalent
single-precision types. While these types use the same number
of generic attributes as their single-precision equivalents,
implementations are permitted to consume two single-precision
vectors of internal storage for each three- or four-component
double-precision vector."

This commits makes dvec3, dvec4, dmat2x3, dmat2x4, dmat3, dmat3x4,
dmat4x3 and dmat4 consume twice as many attributes as equivalent
single-precision types.

v3: count doubles as consuming two attributes (Dave Airlie)
v4: make reference to spec (Michael Schellenberger Costa)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>

Signed-off-by: Antia Puentes <apuentes@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
2016-05-23 10:48:07 +02:00
Francisco Jerez b46867cd37 i965/fs: do not depend on std140 alignment rules for UBO loads
The previous implementation relied on the std140 alignment rules to
avoid handling misalignment in the case where we are loading more than
2 double components from a vector, which requires to emit a second load
message.

This alternative implementation deals with misalignment and is more
flexible going forward.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
2016-05-23 08:56:57 +02:00
Iago Toral Quiroga 38b719d624 nir: handle double-precision in fsign, fsat, fnot and frcp
I think these are not strictly necessary since the floats in them
should be automatically promoted to doubles when operated with
double sources, but it makes things more explicit at least.

Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-23 08:54:37 +02:00
Iago Toral Quiroga 3f73039ade nir: handle double-precision in fabs, frsq and fsqrt
Reviewed-by: Matt Turner <mattst88@gmail.com>
2016-05-23 08:54:28 +02:00
Dave Airlie 3466db3969 glsl/parser: handle multiple layout sections with AST nodes.
For geometry/compute inputs and tess control outputs, we create
an AST node to keep track of some things. However if we have
multiple layout sections, we don't ever link the node into the AST.

This is because we create the node on the rightmost layout declaration
and don't pass it back in so it gets linked at the end of the parsing
of the rightmost.

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:20:01 +10:00
Dave Airlie aaa69c79cd glsl: allow layout qualifier overrides with ARB_shading_language_420pack
GLSL 4.20 allows overriding the layout qualifiers.

This helps fix:
GL45-CTS.shading_language_420pack.qualifier_override_layout

Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie 6f2dc0d044 subroutines: handle explicit indexes properly
The code didn't deal with explicit function indexes properly.
It also handed out the indexes at link time, when we really
need them in the lowering pass to create the correct if ladder.

So this patch moves assigning the non-explicit indexes earlier,
fixes the lowering pass and the lookups to get the correct values.

This fixes a few of:
GL45-CTS.explicit_uniform_location.subroutine-index-*

Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie 5fe912831c mesa/subroutines: fix reset on bindpipeline
Fixes:
GL45-CTS.shader_subroutine.subroutine_uniform_reset

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie 7fa0250f94 mesa/subroutines: count number subroutines properly.
The code was implementing the ACTIVE_SUBROUTINE_UNIFORMS
incorrectly, using the number of types not the number of
uniforms. This is different than the locations as the
locations may be sparsly allocated.

This fixes:
GL43-CTS.shader_subroutine.four_subroutines_with_two_uniforms

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie 22db9b10eb mesa/subroutines: don't generate error in GetSubroutineIndex.
GLSL spec says this doesn't generate an error.

Fixes:
GL45-CTS.explicit_uniform_location.subroutine-loc

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie 3b8b6be7bb glsl/ast: for geom shaders allow stream flags in input flags.
This fixes:
GL45-CTS.shader_subroutine.subroutines_with_separate_shader_objects

Since we set the stream flags earlier on all geom shaders, we
shouldn't fall over later if we find one.

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie 93b3b6af3c glsl/linker: skip inactive explicit locations.
This fixes a crash in:
GL45-CTS.explicit_uniform_location.subroutine-loc-negative-link-max-num-of-locations

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie c714731653 glsl: fix subroutine uniform .length().
This fixes .length() on subroutine uniform arrays, if
we don't find the identifier normally, we look up the corresponding
subroutine identifier instead.

Fixes:
GL45-CTS.shader_subroutine.arrays_of_arrays_of_uniforms
GL45-CTS.shader_subroutine.arrayed_subroutine_uniforms

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:57 +10:00
Dave Airlie 432ac19c1a glsl/linker: link error on too many subroutine functions.
This fixes:
GL45-CTS.explicit_uniform_location.subroutine-index-negative-link-max-num-of-indices

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:56 +10:00
Dave Airlie 18b0a13e80 glsl: produce a linker error for a subroutine uniform with no functions.
If a subroutine uniform is declared with no functions backing it,
that isn't legal, so we should fail to link.

Fixes:
GL43-CTS.shader_subroutine.subroutine_uniform_wo_matching_subroutines

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:56 +10:00
Dave Airlie b572b599ef glsl: validate subroutine types match function signature.
This fixes:
GL43-CTS.shader_subroutine.subroutines_incompatible_with_subroutine_type

It just makes sure the signatures match as well as the return
types.

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:19:56 +10:00
Dave Airlie ba3414d832 arb_shader_subroutine: check active subroutine limit
_mesa_GetActiveSubroutineUniformiv needs to check
against the number of types here.

Noticed while playing with ogl conform.

Reviewed-by: Chris Forbes <chrisforbes@google.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 16:18:25 +10:00
Ilia Mirkin 74e71cbfcb nv30: don't assert when running out of registers
This happens with dEQP tests. The code doesn't at all protect against
this condition, so while unhandled, this is an expected situation.

Also avoid using more than the first 16 registers for nv3x vertex
programs.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-05-22 22:57:18 -04:00
Ilia Mirkin 36ff09cdfe nouveau: allow allocating non-object-backed buffers
On nv30, for example, there is no hardware index buffer support. So all
of those will be created entirely in user memory.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-05-22 22:57:18 -04:00
Tobias Klausmann 96f390ff35 llvm/softpipe: Enable cull_distance as draw supports it.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 11:04:37 +10:00
Dave Airlie e6d9389366 tgsi: remove culldist semantic.
This isn't used anymore in the tree, culldist's
are part of the clipdist semantic, we could in theory
rename it, but I'm not sure there is much point, and
I'd have to be careful with virgl.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 11:03:44 +10:00
Dave Airlie d17062a40e draw: stop using CULLDIST semantic.
The way the HW works doesn't really fit with having
two semantics for this.

The GLSL compiler emits 2 vec4s and two properties,
this makes draw use those instead of CULLDIST semantics.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 11:03:40 +10:00
Emil Velikov bddb3b5375 virgl: remove unused state_tracker/graw.h include
Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 11:02:17 +10:00
Dave Airlie 62c728f7d8 mesa/queryobject: return INVALID_VALUE if offset < 0 (v2)
This fixes:
GL45-CTS.direct_state_access.queries_errors

The ARB_direct_state_access spec agrees.

v2: move check down further (Ilia)

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-05-23 07:33:03 +10:00
Samuel Pitoiset a7fad12931 nvc0/ir: fix indirect access for images
When the array doesn't start at 0 we need to account for su->tex.r.
While we are at it, make sure to avoid out of bounds access by masking
the index.

This fixes GL45-CTS.shading_language_420pack.binding_image_array.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reported-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-05-22 23:06:16 +02:00
Ilia Mirkin cb9a51d1f6 nv30: reset the stencil mask when fast-clearing
Apparently the stencil mask applies to clears on nv30/nv40. Reset it to
0xff before doing a stencil clear. This fixes gl-1.0-readpixsanity and
a number of other piglit tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-05-22 14:48:56 -04:00
Ilia Mirkin f57a8440d5 nv30,nv50: add PIPE_SHADER_CAP_PREFERRED_IR support
The mesa state tracker has recently started to query this.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2016-05-22 14:05:36 -04:00
Ilia Mirkin 9f19ccff9c nvc0: fix setting of tess_mode in various situations
This fixes a lot of INVALID_VALUE errors reported by the card when
running dEQP tests.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
2016-05-22 11:58:22 -04:00
Ilia Mirkin d6edae7090 nv50/ir: fix prog info init
Left over from the pre-mainline tess support. Adapt to use the new
defines.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
2016-05-22 11:58:22 -04:00
Ilia Mirkin 035b1097db nvc0/ir: return 0 for gl_TessCoord.z for non-triangles modes
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
2016-05-22 11:58:22 -04:00