Commit Graph

71267 Commits

Author SHA1 Message Date
Emil Velikov d62879565a egl: remove _EGL_PLATFORM_WINDOWS enum
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-07-22 16:35:26 +01:00
Emil Velikov 32debea337 egl: remove final references of platform_null
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-07-22 16:35:26 +01:00
Emil Velikov dc1ece3748 egl: remove flatten HAVE_SHARED_GLAPI
It is simply not possible to use the dri backend without shared glapi,
as the alternative provider (libGL) is not always present. We have fixed
the build for a while now, so we can rip this out.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-07-22 16:35:26 +01:00
Emil Velikov 78674631a2 egl: remove the non-haiku scons build
It has been broken since 2011 with commit c98ea26e16b(egl: Make
egl_dri2 and egl_glx built-in drivers.). When the backends got merged
into the main library each entry point was guarded by a
_EGL_BUILT_IN_DRIVER_* define.

As the define was missing, the linker kindly removed the whole of the
dri2 backend, thus we did not notice any errors due to the unresolved
link to xcb and friends.

Cc: Chia-I Wu <olv@lunarg.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2015-07-22 16:35:26 +01:00
Emil Velikov ce2a4bd541 dri/common: remove unused drm_version variable
As of last commit the only user of it (radeon/r200) no longer uses it.
As such let's remove it and cleanup the nasty hacks that we had in place
to support this.

v2: Leave LIBDRM_CFLAGS around.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1)
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
2015-07-22 16:35:26 +01:00
Emil Velikov 5284e9e2c4 radeon,r200: allow hyperz for radeon DRM module v2
The original code only half considered hyperz as an option. As per
previous commit "major != 2 cannot occur" we can simply things, and
allow users to set the option if they choose to do so.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-07-22 16:35:26 +01:00
Emil Velikov 48926da0f7 radeon,r200: remove support for UMS radeon DRM module
As mentioned by Michel Dänzer
 "FWIW though, any code which is specific to radeon DRM major version 1
  can be removed, because that's the UMS major version."

and Marek Olšák
 "major != 2" can't occur. You don't have to check the major version at
  all and you can just assume it's always 2."

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-07-22 16:35:26 +01:00
Emil Velikov bf6247f608 radeon,r200: remove unused variable texmicrotile
Dead since at least 2009 with commit ccf7814a315(radeon: major cleanups
removing old dead codepaths.)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2015-07-22 16:35:26 +01:00
Emil Velikov 66d77cd71c scons: don't build the kms-dri winsys
Same as previous commit - unused (gbm is not a thing outside the
autotools build).

v2: Remove trailing HAVE_LIBDRM.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 16:35:25 +01:00
Emil Velikov a29a8b92ff android: don't build the kms-dri winsys
GBM (the only user of kms-dri) is currently not available under Android.
Considering we have no way of testing/using this let's not bother
building it for now.

Cc: Chih-Wei Huang <cwhuang@linux.org.tw>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 16:35:25 +01:00
Emil Velikov fe1503fe38 android: dri: correctly set HAVE_LIBDRM
Set the macro if we're not building swrast alone.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang@linux.org.tw>
2015-07-22 16:35:25 +01:00
Emil Velikov 787995bffb swrast: remove unneeded __NOT_HAVE_DRM_H define
No longer applicable since the cleanup of dri_interface.h.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 16:35:25 +01:00
Emil Velikov 9ab5b644ef dri/common: use HAVE_LIBDRM over __NOT_HAVE_DRM_H
See previous commit message for details.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 16:35:25 +01:00
Emil Velikov 1c328b8aa7 loader: use HAVE_LIBDRM instead of ! __NOT_HAVE_DRM_H
Double negatives in English language are normally avoided, plus the
former seems cleaner and more consistent.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-07-22 16:35:25 +01:00
Emil Velikov 72c784347b st/dri: unwrap/remove __NOT_HAVE_DRM_H magic
With the dri_interface.h clean of the macro, we can remove the final
only st/dri specific use of the very same.

Seemingly it was incorrectly used, as the build-time presence of dri2 is
not libdrm specific. At run-time, the code is already limited to dri2
use-cases plus returning true, when the extension is not present (or too
old) will likely lead to a crash as one tries to use it shortly after
the dri_with_format() call.

As a side effect this gives us a nice cleanup the builds.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 16:35:25 +01:00
Emil Velikov 0efd773f71 dri_interface: drop __NOT_HAVE_DRM_H magic
v2: use HAVE_LIBDRM macro.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-07-22 16:33:11 +01:00
Emil Velikov 816e4c1b5e dri/swrast: automake: add LIBDRM_CFLAGS
With the follow up commit we'll remove the __NOT_HAVE_DRM_H macro. As
requested by Ian HAVE_LIBDRM will be used instead, which will lead to
swrast including drm.h when libdrm package is available, even though we
don't need/make use of the header.

As the define is added after the AM_CFLAGS we cannnot use -UHAVE_LIBDRM,
but instead let's just add LIBDRM_CFLAGS. The latter of which will
expand to NULL when the libdrm package is not around.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 16:33:11 +01:00
Emil Velikov 16f6d432de configure.ac: do not set HAVE_DRI(23) when libdrm is missing
These conditionals are used to guard both dri modules and loader(s).

Currently if we try to build the gallium swrast dri module (without glx)
on a system that's missing libdrm the build will fail.

v2: Make sure we assign prior to checking the have_libdrm variable.

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-22 16:33:10 +01:00
Brian Paul fe42902009 mesa: fix typo s/glGetTextImage/glGetTexImage/
Trivial.
2015-07-22 08:17:24 -06:00
Michel Dänzer 800efb0690 radeonsi: Flush when we're asked to return a fence but don't have one yet
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2015-07-22 16:11:39 +09:00
Timothy Arceri fcc1949cc4 mesa: fix misleading comment
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2015-07-22 13:34:45 +10:00
Timothy Arceri 13322a6590 mesa: fix active sampler conflict validation
The type stored in gl_uniform_storage is the type of a single array
element not the array type so size was always 1.

V2: Dont validate sampler units pointing to 0

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2015-07-22 12:58:40 +10:00
Timothy Arceri 09c440c718 glsl: check for leading zeros in array index validation
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2015-07-22 12:58:33 +10:00
Brian Paul 7fccebf980 swrast: remove unneeded & operators in _swrast_choose_texture_sample_func()
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2015-07-21 18:44:07 -06:00
Brian Paul 300926def0 mesa: move check for no-op glShadeModel call earlier
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-07-21 18:44:07 -06:00
Brian Paul d323f26830 mesa: move check for no-op glAlphaFunc call earlier
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-07-21 18:44:07 -06:00
Brian Paul 61ed88b1dd mesa: move check for no-op glFrontFace call earlier
If the new mode matches the current mode, there can be no error.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-07-21 18:44:07 -06:00
Brian Paul 24799c4223 mesa: s/GLint/GLsizei/ for consistency
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul b94367ba8d docs: document that GL_ARB_get_texture_sub_image is completed
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 89212f9d06 mesa: enable GL_ARB_get_texture_sub_image for all drivers
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 48f9f0bfdd mesa: add API dispatch for GL_ARB_get_texture_sub_image
This adds the new glGetTextureSubImage() and
glGetCompressedTextureSubImage() functions.  Also update the
dispatch sanity test program.

v2: remove stray brace, move xi:include line in gl_API.xml, fix extension
number typo, s/program/texture/ in xml file.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 2494f91fb8 mesa: add new _mesa_Get[Compressed]TextureSubImage() functions
Simple implementations in terms of get_[compressed_]texture_image().

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul a92f0277d8 mesa: overhaul the glGetCompressedTexImage code
Same idea as the previous patch.
v2: a few clean-ups spotted by Ilia

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul f20cfc5a40 mesa: overhaul the glGetTexImage code
1. Reorganize the error checking code.
2. Lay groundwork for getting sub images by passing image offset and
   dimensions to the error checking code.
3. Implement _mesa_GetnTexImageARB(), _mesa_GetTexImage() and
   _mesa_GetTextureImage() all in terms of get_texture_image().

v2: pass offset/width/height/depth arguments to the error checking
function, avoid using magic width/height/depth values.
v3: remove unused bufSize param to get_texture_image()

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 613f1e00b8 mesa: 80-column wrapping in texgetimage.c
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 2a95fd1531 mesa: replace Driver.GetCompressedTexImage() w/ GetCompressedTexSubImage()
For now, pass offsets of zero and width/height/depth equal to the
whole image.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 5bfc360e40 mesa: make _mesa_get_[compressed_]texture_image() static
These functions are only called from teximage.c

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 1ad305b612 mesa: plumb offset/size parameters through GetTexSubImage code
Needed for GL_ARB_get_texture_sub_image.  But at this point, the
offsets are always zero and the sizes match the whole texture image.

v2: Fixes, suggestions from Laura Ekstrand:
* Fix calls to ctx->Driver.UnmapTextureImage() to pass the correct
  slice value.
* Added comments and assertions to check zoffset+depth<=tex->Depth before
  the 'img' loops.
* Added a new zoffset==0 assert in get_tex_memcpy().

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul e693fc299f mesa: replace Driver.GetTexImage with GetTexSubImage()
The new driver hook has x/y/zoffset and width/height/depth parameters
for the new glGetTextureSubImage() function.

The meta code and gallium state tracker are updated to handle the
new parameters.

Callers to Driver.GetTexSubImage() pass in offsets=0 and sizes equal
to the whole texture size.

v2: update i965 driver code, s/GLint/GLsizei/ in GetTexSubImage hook

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 0963718790 meta: add offset, width, height parameters to decompress_texture_image()
In preparation for decompressing texture sub images.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 18:35:38 -06:00
Brian Paul 2a2c946942 meta: handle subimages in _mesa_meta_setup_texture_coords()
v2: fix depth, total_depth mix-up in meta.h, per Laura Ekstrand.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2015-07-21 18:35:38 -06:00
Brian Paul d7bd9fa1a3 mesa: assorted whitespace, formatting fixes in teximage.c
Trivial.
2015-07-21 18:35:38 -06:00
Brian Paul 98a6c5ea11 mesa: allow GL_TEXTURE_CUBE_MAP_ARRAY case for glCompressedTexSubImage3D()
Since s3tc works for cube maps and 2D arrays, it should also work for
cube arrays.  NVIDIA's driver supports this too.  Seems like the spec
should say this.

This is a minor follow-on fix for the commit "mesa: fix up some texture
error checks".

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
2015-07-21 18:35:38 -06:00
Jonathan Gray 4c7196b684 mesa: include stdarg.h for va_list
Include stdarg.h for va_list.  Unbreaks the build on OpenBSD:

In file included from mesa/program/dummy_errors.c:24:
../src/mesa/main/errors.h:85: error: expected declaration specifiers or '...' before 'va_list'

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 17:53:00 -04:00
Ilia Mirkin a2a1a5805f gallium: replace INLINE with inline
Generated by running:
git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g'
git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g'
git checkout src/gallium/state_trackers/clover/Doxyfile

and manual edits to
src/gallium/include/pipe/p_compiler.h
src/gallium/README.portability

to remove mentions of the inline define.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2015-07-21 17:52:16 -04:00
Samuel Pitoiset 958b5c3111 nvc0: force cache flush when binding a new ubo
This fixes the following piglit test:
  ext_transform_feedback-immediate-reuse-uniform-buffer

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 22:02:23 +02:00
Samuel Pitoiset a62ccdec62 nv50: force cache flush when binding a new ubo
This fixes the following piglit test:
  ext_transform_feedback-immediate-reuse-uniform-buffer

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-21 21:39:36 +02:00
Vinson Lee 912921059d st/mesa: Silence GCC unused-variable warning.
Silence a release build warning.

st_glsl_to_tgsi.cpp: In function 'pipe_error st_translate_program(gl_context*, uint, ureg_program*, glsl_to_tgsi_visitor*, const gl_program*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, const GLuint*, const GLuint*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, boolean, boolean)':
st_glsl_to_tgsi.cpp:5461:36: warning: unused variable 'pscreen' [-Wunused-variable]
                struct pipe_screen *pscreen = st->pipe->screen;
                                    ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2015-07-21 12:25:41 -07:00
Adam Jackson 5b4a7ec8f1 r600/sb: Fix an &/&& mistake
gcc says:

    sb/sb_sched.cpp: In member function 'bool r600_sb::alu_group_tracker::try_reserve(r600_sb::alu_node*)':
    sb/sb_sched.cpp:492:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses]
      if (!trans & fbs)

It happens to be harmless; if fbs is ever non-zero, it will be VEC_210,
which is 5, so (!trans & 5) == 1 and the branch works as expected.  But
logical AND is clearly what was meant.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-21 13:38:27 -04:00
Anuj Phogat 545dec5b3e Revert "i965/gen9: Plugin the code for selecting YF/YS tiling on skl+"
Commit c9dbdc0 introduced some dead code which is supposed to be used
once we have Yf/Ys tiling working and performing better. Ken reported
the issue that static analysis tool now shows warnings due to the dead
code. To fix these warnings, this patch reverts the changes made in
commit c9dbdc0.

It'll be better to add the Yf/Ys tiling selection code later, when we
are ready to use it.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2015-07-21 09:56:07 -07:00