mesa.git
9 years agoglsl: use separate varying slots for patch varyings
Marek Olšák [Sat, 13 Jun 2015 11:50:12 +0000 (13:50 +0200)]
glsl: use separate varying slots for patch varyings

The idea is to allow 32 normal varyings and 32 patch varyings,
a total of 64. Previously, only a total of 32 was allowed.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: fix locations of 2-dimensional varyings without varying packing (v2)
Marek Olšák [Sat, 16 May 2015 19:12:54 +0000 (21:12 +0200)]
glsl: fix locations of 2-dimensional varyings without varying packing (v2)

v2: renamed producer/consumer_type -> producer/consumer_stage

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: don't demote tess control shader outputs
Marek Olšák [Fri, 3 Oct 2014 22:13:42 +0000 (00:13 +0200)]
glsl: don't demote tess control shader outputs

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: disable varying packing between tessellation shaders
Marek Olšák [Fri, 3 Oct 2014 22:15:33 +0000 (00:15 +0200)]
glsl: disable varying packing between tessellation shaders

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: allow indexing of gl_out with a non-const if length isn't known
Marek Olšák [Tue, 16 Jun 2015 00:43:55 +0000 (02:43 +0200)]
glsl: allow indexing of gl_out with a non-const if length isn't known

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: allow redeclaration of TCS gl_out[]
Chris Forbes [Fri, 12 Sep 2014 09:27:26 +0000 (21:27 +1200)]
glsl: allow redeclaration of TCS gl_out[]

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: validate restrictions on use of barrier()
Chris Forbes [Sun, 7 Sep 2014 09:42:50 +0000 (21:42 +1200)]
glsl: validate restrictions on use of barrier()

With the exception of always-taken switch cases (which are
indistinguishable from straight line code in our IR), this
disallows use of the builtin barrier() function in all the
places it may not appear.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: allow barrier() in tessellation control shaders
Marek Olšák [Sun, 14 Jun 2015 18:14:22 +0000 (20:14 +0200)]
glsl: allow barrier() in tessellation control shaders

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: analyze TES usage of gl_ClipDistance
Chris Forbes [Tue, 9 Sep 2014 07:25:02 +0000 (19:25 +1200)]
glsl: analyze TES usage of gl_ClipDistance

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: push vertex count determination down one level
Chris Forbes [Sun, 7 Sep 2014 06:19:15 +0000 (18:19 +1200)]
glsl: push vertex count determination down one level

We have the prog here, so we don't need the caller to work this out for
us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: pass shader stage to lower_output_reads and handle tess control
Ilia Mirkin [Tue, 22 Jul 2014 01:59:37 +0000 (21:59 -0400)]
glsl: pass shader stage to lower_output_reads and handle tess control

Tessellation control outputs can be read in directly without first
having been written. Accessing these will require some special logic
anyways, so just let them through.

V2: Never lower tess control output reads, whether patch or not -- both
can be read back by other threads.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: properly size unsized arrays in tess stages
Chris Forbes [Mon, 1 Sep 2014 08:48:09 +0000 (20:48 +1200)]
glsl: properly size unsized arrays in tess stages

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: restrict indexing for writes to TCS outputs to gl_InvocationID
Chris Forbes [Sun, 31 Aug 2014 07:35:46 +0000 (19:35 +1200)]
glsl: restrict indexing for writes to TCS outputs to gl_InvocationID

Marek: handle ir_swizzle

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add builtin constants for ARB_tessellation_shader
Chris Forbes [Sun, 17 Aug 2014 10:37:16 +0000 (22:37 +1200)]
glsl: add builtin constants for ARB_tessellation_shader

Limits from other extensions added by Marek.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: allow nonconst indexing of arrays where we can work out an implicit size
Chris Forbes [Sun, 24 Aug 2014 04:46:40 +0000 (16:46 +1200)]
glsl: allow nonconst indexing of arrays where we can work out an implicit size

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: relax unsized input/output block arrays for TCS/TES
Chris Forbes [Mon, 18 Aug 2014 09:51:46 +0000 (21:51 +1200)]
glsl: relax unsized input/output block arrays for TCS/TES

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: add the tessellation extension to the list for the "layout" qualifier
Marek Olšák [Mon, 15 Jun 2015 23:32:28 +0000 (01:32 +0200)]
glsl: add the tessellation extension to the list for the "layout" qualifier

This is technically not needed, but it makes the compiler return a better
error message if tessellation is used with GLSL < 1.50.

Instead of:
    error: syntax error, unexpected NEW_IDENTIFIER, expecting $end
It returns:
    error: #version 150 layout qualifier `triangles' used

And the tessellation spec says:
    OpenGL 3.2 and GLSL 1.50 are required.
So it makes perfect sense.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: don't lower variable indexing on non-patch tessellation inputs/outputs
Marek Olšák [Thu, 28 May 2015 21:24:08 +0000 (23:24 +0200)]
glsl: don't lower variable indexing on non-patch tessellation inputs/outputs

There is no way to lower them, because the array sizes are unknown
at compile time.

Based on a patch from: Fabian Bieler <fabianbieler@fastmail.fm>

v2: add comments

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: make stand-alone compiler work with tessellation shaders.
Fabian Bieler [Thu, 20 Mar 2014 21:34:42 +0000 (22:34 +0100)]
glsl: make stand-alone compiler work with tessellation shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add "in" or "out" prefix to name when flattening interface blocks
Fabian Bieler [Thu, 20 Mar 2014 21:37:37 +0000 (22:37 +0100)]
glsl: add "in" or "out" prefix to name when flattening interface blocks

This is to prevent a name conflict in tessellation shaders built-in interface
blocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: lower gl_TessLevel* from float[n] to vecn.
Fabian Bieler [Mon, 10 Mar 2014 16:55:36 +0000 (17:55 +0100)]
glsl: lower gl_TessLevel* from float[n] to vecn.

Similar to gl_ClipDistance -> gl_ClipDistanceMESA

v2: - renamed is_mesa_var to lowered_builtin_array_variable
    - moved LowerTessLevel into gl_constants
    - cosmetic changes in lower_tess_level.cpp

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: make lower_clip_distance work with tessellation shaders.
Fabian Bieler [Thu, 20 Mar 2014 21:33:05 +0000 (22:33 +0100)]
glsl: make lower_clip_distance work with tessellation shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: allow linking of tessellation shaders.
Chris Forbes [Sun, 21 Sep 2014 01:33:14 +0000 (13:33 +1200)]
glsl: allow linking of tessellation shaders.

Marek: require a tess eval shader if a tess control shader is present

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agoglsl: add the patch in/out qualifier (v2)
Fabian Bieler [Wed, 5 Mar 2014 12:43:17 +0000 (13:43 +0100)]
glsl: add the patch in/out qualifier (v2)

v2: Dropped some unrelated reordering in glsl_parser.yy as Ken suggested.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add tessellation shader defines and built-in variables.
Fabian Bieler [Thu, 20 Mar 2014 21:41:40 +0000 (22:41 +0100)]
glsl: add tessellation shader defines and built-in variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: add tessellation shader parsing support (v2)
Fabian Bieler [Thu, 20 Mar 2014 21:44:43 +0000 (22:44 +0100)]
glsl: add tessellation shader parsing support (v2)

v2: Fixed things that Ken suggested.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: don't allow drawing with tess ctrl shader and without tess eval shader
Marek Olšák [Thu, 28 May 2015 20:08:55 +0000 (22:08 +0200)]
mesa: don't allow drawing with tess ctrl shader and without tess eval shader

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: handle tessellation shaders in use_shader_program
Marek Olšák [Wed, 22 Apr 2015 21:05:34 +0000 (23:05 +0200)]
mesa: handle tessellation shaders in use_shader_program

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add program interface queries for tessellation shaders
Marek Olšák [Sat, 13 Jun 2015 23:21:02 +0000 (01:21 +0200)]
mesa: add program interface queries for tessellation shaders

Based on a patch by Chris Forbes <chrisf@ijw.co.nz>.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add misc tessellation shader stuff
Fabian Bieler [Fri, 7 Mar 2014 09:39:39 +0000 (10:39 +0100)]
mesa: add misc tessellation shader stuff

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add tessellation shader getters (v3)
Fabian Bieler [Fri, 7 Mar 2014 09:39:18 +0000 (10:39 +0100)]
mesa: add tessellation shader getters (v3)

Tessellation dependencies added by Marek.

v2: require tessellation in addition to atomics/images for some glGet queries

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: allow setting of patch parameters.
Marek Olšák [Sat, 13 Jun 2015 21:06:06 +0000 (23:06 +0200)]
mesa: allow setting of patch parameters.

Based on a patch from Fabian Bieler <fabianbieler@fastmail.fm>.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: require VS if TCS or TES is present in pipeline
Chris Forbes [Sun, 21 Sep 2014 00:08:22 +0000 (12:08 +1200)]
mesa: require VS if TCS or TES is present in pipeline

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: allow tess stages in glUseProgramStages
Chris Forbes [Sat, 20 Sep 2014 23:16:06 +0000 (11:16 +1200)]
mesa: allow tess stages in glUseProgramStages

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: support tess stages in glGetProgramPipelineiv
Fabian Bieler [Fri, 7 Mar 2014 09:33:54 +0000 (10:33 +0100)]
mesa: support tess stages in glGetProgramPipelineiv

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: take tessellation into account when validating GS input primitive mode
Marek Olšák [Sat, 13 Jun 2015 20:26:56 +0000 (22:26 +0200)]
mesa: take tessellation into account when validating GS input primitive mode

I've reported the bug in the Khronos bugzilla.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: allow drawing of patch primitives
Chris Forbes [Sun, 21 Sep 2014 00:37:47 +0000 (12:37 +1200)]
mesa: allow drawing of patch primitives

Cosmetic changes and fixes by Marek.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add _mesa_has_tessellation
Marek Olšák [Thu, 28 May 2015 17:11:07 +0000 (19:11 +0200)]
mesa: add _mesa_has_tessellation

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add misc tessellation shader support
Fabian Bieler [Mon, 10 Mar 2014 10:58:37 +0000 (11:58 +0100)]
mesa: add misc tessellation shader support

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add tessellation shader init functions.
Fabian Bieler [Fri, 7 Mar 2014 09:28:03 +0000 (10:28 +0100)]
mesa: add tessellation shader init functions.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add tessellation shader state and limits
Chris Forbes [Sun, 21 Sep 2014 00:41:07 +0000 (12:41 +1200)]
mesa: add tessellation shader state and limits

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add tessellation shader enums
Fabian Bieler [Fri, 7 Mar 2014 09:19:09 +0000 (10:19 +0100)]
mesa: add tessellation shader enums

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomesa: add tessellation shader structs
Fabian Bieler [Fri, 7 Mar 2014 09:13:16 +0000 (10:13 +0100)]
mesa: add tessellation shader structs

Marek: remove unused members, cleanup

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agomapi: add ARB_tessellation_shader
Fabian Bieler [Fri, 7 Mar 2014 08:59:11 +0000 (09:59 +0100)]
mapi: add ARB_tessellation_shader

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agodrirc: drop support for Heaven 3.0, fixes tessellation in 4.0
Marek Olšák [Tue, 16 Jun 2015 20:13:34 +0000 (22:13 +0200)]
drirc: drop support for Heaven 3.0, fixes tessellation in 4.0

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agowinsys/radeon: implement buffer_unmap
Marek Olšák [Thu, 16 Jul 2015 13:27:34 +0000 (15:27 +0200)]
winsys/radeon: implement buffer_unmap

This has been a no-op due to performance concerns. From now on, drivers
should decide when they don't want to unmap, not the winsys.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium/radeon: remove buffer_unmap calls that can potentially decrease perf
Marek Olšák [Thu, 16 Jul 2015 12:54:50 +0000 (14:54 +0200)]
gallium/radeon: remove buffer_unmap calls that can potentially decrease perf

buffer_unmap is currently a no-op on radeon and done correctly on amdgpu.
I plan to fix it for radeon, but before that, all occurences of buffer_unmap
that can negatively affect performance in the future must be removed.

There are 2 reasons for removing buffer_unmap calls:
- There is a likelihood that buffer_map will be called again, so we don't
  want to unmap yet.
- The buffer is being released, which automatically unmaps it.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove switch statement in si_create_context
Marek Olšák [Thu, 16 Jul 2015 12:42:38 +0000 (14:42 +0200)]
radeonsi: remove switch statement in si_create_context

and make si_init_config static

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: don't change pipe_resource in resource_copy_region
Marek Olšák [Thu, 16 Jul 2015 11:17:14 +0000 (13:17 +0200)]
radeonsi: don't change pipe_resource in resource_copy_region

Copied from r600g. pipe_resource can be shared by multiple threads, so we
shouldn't change it.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: upload shader rodata after updating scratch relocations
Marek Olšák [Fri, 10 Jul 2015 21:35:55 +0000 (23:35 +0200)]
radeonsi: upload shader rodata after updating scratch relocations

Cc: 10.5 10.6 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove redundant parameter in si_shader_binary_read
Marek Olšák [Fri, 10 Jul 2015 21:29:04 +0000 (23:29 +0200)]
radeonsi: remove redundant parameter in si_shader_binary_read

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agocso: eliminate some sampler function wrappers
Marek Olšák [Sun, 5 Jul 2015 14:57:58 +0000 (16:57 +0200)]
cso: eliminate some sampler function wrappers

9 years agogallium/tests: use cso_set_samplers
Marek Olšák [Sun, 12 Jul 2015 14:12:59 +0000 (16:12 +0200)]
gallium/tests: use cso_set_samplers

9 years agogallium/util: use cso_set_samplers
Marek Olšák [Sun, 12 Jul 2015 13:52:44 +0000 (15:52 +0200)]
gallium/util: use cso_set_samplers

9 years agost/mesa: use cso_set_samplers
Marek Olšák [Sun, 5 Jul 2015 14:54:44 +0000 (16:54 +0200)]
st/mesa: use cso_set_samplers

9 years agocso: remove clip state handling
Marek Olšák [Sun, 5 Jul 2015 14:34:59 +0000 (16:34 +0200)]
cso: remove clip state handling

There is no need for this.

v2: handle redundant clip state changes in st/mesa

9 years agocso: only allow saving and restoring fragment sampler states
Marek Olšák [Sun, 5 Jul 2015 14:32:49 +0000 (16:32 +0200)]
cso: only allow saving and restoring fragment sampler states

9 years agocso: drop inefficient checking for redundant sampler state changes
Marek Olšák [Sun, 5 Jul 2015 14:10:54 +0000 (16:10 +0200)]
cso: drop inefficient checking for redundant sampler state changes

Drivers can do this better, because they can skip redundant state changes
at per-slot granularity.

9 years agocso: only allow saving and restoring fragment sampler views
Marek Olšák [Sun, 5 Jul 2015 13:53:10 +0000 (15:53 +0200)]
cso: only allow saving and restoring fragment sampler views

Not needed for other shader stages.

9 years agogallium/util: improve dump functions
Marek Olšák [Sat, 4 Jul 2015 11:18:11 +0000 (13:18 +0200)]
gallium/util: improve dump functions

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agotgsi: allow dumping to a file directly
Marek Olšák [Sat, 4 Jul 2015 11:17:07 +0000 (13:17 +0200)]
tgsi: allow dumping to a file directly

9 years agost/mesa: don't call st_validate_state in BlitFramebuffer
Marek Olšák [Thu, 16 Jul 2015 15:14:07 +0000 (17:14 +0200)]
st/mesa: don't call st_validate_state in BlitFramebuffer

None of the draw states are used here.
This fixes a crash in piglit: ext_framebuffer_blit/blit-early

Calling st_manager_validate_framebuffers is the minimum requirement here.

Cc: mesa-stable@lists.freedesktop.org
9 years agodocs/relnotes: document new EGL extensions and EGL 1.5
Marek Olšák [Wed, 29 Apr 2015 15:57:46 +0000 (17:57 +0200)]
docs/relnotes: document new EGL extensions and EGL 1.5

9 years agost/dri: enable 3D textures and sRGB colorspace for EGL
Anatoli Antonovitch [Wed, 10 Jun 2015 12:47:03 +0000 (14:47 +0200)]
st/dri: enable 3D textures and sRGB colorspace for EGL

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
9 years agoegl,dri_interface: use DRI2rendererQueryExtension to enable 3D textures & sRGB
Marek Olšák [Wed, 10 Jun 2015 12:45:58 +0000 (14:45 +0200)]
egl,dri_interface: use DRI2rendererQueryExtension to enable 3D textures & sRGB

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl: implement EGL_KHR_gl_colorspace (v2)
Marek Olšák [Wed, 10 Jun 2015 00:49:29 +0000 (02:49 +0200)]
egl: implement EGL_KHR_gl_colorspace (v2)

v2: add missing "break"

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agost/dri: expose sRGB visuals (v2)
Marek Olšák [Tue, 9 Jun 2015 23:49:36 +0000 (01:49 +0200)]
st/dri: expose sRGB visuals (v2)

v2: The fix for the darkness in Ubuntu Unity is in the hunk
    with the 4-line comment.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglapi: fix argument parsing in glX_proto_recv.py
Dylan Baker [Thu, 2 Jul 2015 17:25:41 +0000 (10:25 -0700)]
glapi: fix argument parsing in glX_proto_recv.py

One of the plugins I use with vim "helpfully" added an underscore to the
front of mode for kicks.

Obviously this isn't a feature used very often because it's been broken
since d986cb7c70db (since May 20th), and no one has noticed.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
9 years agoegl: android: remove DRM_GRALLOC_TOP hack
Emil Velikov [Tue, 21 Jul 2015 14:34:19 +0000 (15:34 +0100)]
egl: android: remove DRM_GRALLOC_TOP hack

Now that the drm_gralloc module exports the correct includes we can get
rid of this hack.

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Varad Gautam <varadgautam@gmail.com>
9 years agoegl: remove old makefile.sources
Emil Velikov [Mon, 13 Jul 2015 23:28:46 +0000 (00:28 +0100)]
egl: remove old makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agoandroid: rework the EGL build
Emil Velikov [Mon, 13 Jul 2015 23:28:10 +0000 (00:28 +0100)]
android: rework the EGL build

See previous two commits for details.

v2: Don't forget git mv, bring back DRM_GRALLOC_TOP. Spotted by Varad.

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Tested-by: Varad Gautam <varadgautam@gmail.com>
9 years agoscons: rework the EGL build
Emil Velikov [Tue, 14 Jul 2015 01:04:30 +0000 (02:04 +0100)]
scons: rework the EGL build

The scons equivalent of the previous commit - just fold the almost
identical driver + main Sconscripts.

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agoautomake: rework the EGL build
Emil Velikov [Tue, 14 Jul 2015 00:58:33 +0000 (01:58 +0100)]
automake: rework the EGL build

Simplify things by merging the two makefiles. This way we can combine
the duplicated HAVE_PLATFORM_ checks, and build the library without
having a separate static library.

v2: use $() when referencing variables, use correct define (Matt)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agogbm: do not build intermittent libgbm_dri static library
Emil Velikov [Tue, 30 Jun 2015 21:43:50 +0000 (22:43 +0100)]
gbm: do not build intermittent libgbm_dri static library

The only user of it (libgbm.la) immediately links it. Just build it
directly into the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: automake: remove unused HAVE_XCB_DRI2 define
Emil Velikov [Mon, 13 Jul 2015 21:35:25 +0000 (22:35 +0100)]
egl: automake: remove unused HAVE_XCB_DRI2 define

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: remove unused _EGL_DRIVER_SEARCH_DIR define
Emil Velikov [Tue, 14 Jul 2015 00:58:12 +0000 (01:58 +0100)]
egl: remove unused _EGL_DRIVER_SEARCH_DIR define

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl/haiku: remove unused DEFAULT_DRIVER_DIR define
Emil Velikov [Mon, 13 Jul 2015 21:16:11 +0000 (22:16 +0100)]
egl/haiku: remove unused DEFAULT_DRIVER_DIR define

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: remove final Windows specific workaround
Emil Velikov [Tue, 14 Jul 2015 00:57:23 +0000 (01:57 +0100)]
egl: remove final Windows specific workaround

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: remove custom string functions
Emil Velikov [Mon, 13 Jul 2015 23:19:54 +0000 (00:19 +0100)]
egl: remove custom string functions

Support for Windows has been removed for a while now, and virtually
every POSIX compliant system provides strcasecmp, strdup and snprintf.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: remove _EGL_PLATFORM_WINDOWS enum
Emil Velikov [Mon, 13 Jul 2015 22:36:19 +0000 (23:36 +0100)]
egl: remove _EGL_PLATFORM_WINDOWS enum

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: remove final references of platform_null
Emil Velikov [Mon, 13 Jul 2015 21:05:46 +0000 (22:05 +0100)]
egl: remove final references of platform_null

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoegl: remove flatten HAVE_SHARED_GLAPI
Emil Velikov [Mon, 13 Jul 2015 21:20:38 +0000 (22:20 +0100)]
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>
9 years agoegl: remove the non-haiku scons build
Emil Velikov [Tue, 14 Jul 2015 00:52:51 +0000 (01:52 +0100)]
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>
9 years agodri/common: remove unused drm_version variable
Emil Velikov [Mon, 13 Jul 2015 20:12:01 +0000 (21:12 +0100)]
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)
9 years agoradeon,r200: allow hyperz for radeon DRM module v2
Emil Velikov [Thu, 9 Jul 2015 17:06:14 +0000 (18:06 +0100)]
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>
9 years agoradeon,r200: remove support for UMS radeon DRM module
Emil Velikov [Thu, 9 Jul 2015 16:34:30 +0000 (17:34 +0100)]
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>
9 years agoradeon,r200: remove unused variable texmicrotile
Emil Velikov [Thu, 9 Jul 2015 16:29:57 +0000 (17:29 +0100)]
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>
9 years agoscons: don't build the kms-dri winsys
Emil Velikov [Wed, 8 Jul 2015 00:44:31 +0000 (01:44 +0100)]
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>
9 years agoandroid: don't build the kms-dri winsys
Emil Velikov [Tue, 7 Jul 2015 20:02:40 +0000 (21:02 +0100)]
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>
9 years agoandroid: dri: correctly set HAVE_LIBDRM
Emil Velikov [Tue, 7 Jul 2015 15:04:27 +0000 (16:04 +0100)]
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>
9 years agoswrast: remove unneeded __NOT_HAVE_DRM_H define
Emil Velikov [Tue, 7 Jul 2015 14:59:32 +0000 (15:59 +0100)]
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>
9 years agodri/common: use HAVE_LIBDRM over __NOT_HAVE_DRM_H
Emil Velikov [Tue, 7 Jul 2015 14:57:41 +0000 (15:57 +0100)]
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>
9 years agoloader: use HAVE_LIBDRM instead of ! __NOT_HAVE_DRM_H
Emil Velikov [Tue, 7 Jul 2015 14:42:15 +0000 (15:42 +0100)]
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>
9 years agost/dri: unwrap/remove __NOT_HAVE_DRM_H magic
Emil Velikov [Wed, 22 Jul 2015 15:34:15 +0000 (16:34 +0100)]
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>
9 years agodri_interface: drop __NOT_HAVE_DRM_H magic
Emil Velikov [Tue, 7 Jul 2015 14:13:46 +0000 (15:13 +0100)]
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>
9 years agodri/swrast: automake: add LIBDRM_CFLAGS
Emil Velikov [Wed, 22 Jul 2015 15:22:44 +0000 (16:22 +0100)]
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>
9 years agoconfigure.ac: do not set HAVE_DRI(23) when libdrm is missing
Emil Velikov [Thu, 9 Jul 2015 20:19:15 +0000 (21:19 +0100)]
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>
9 years agomesa: fix typo s/glGetTextImage/glGetTexImage/
Brian Paul [Wed, 22 Jul 2015 14:04:49 +0000 (08:04 -0600)]
mesa: fix typo s/glGetTextImage/glGetTexImage/

Trivial.

9 years agoradeonsi: Flush when we're asked to return a fence but don't have one yet
Michel Dänzer [Wed, 22 Jul 2015 07:11:39 +0000 (16:11 +0900)]
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>
9 years agomesa: fix misleading comment
Timothy Arceri [Fri, 3 Jul 2015 22:34:32 +0000 (08:34 +1000)]
mesa: fix misleading comment

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>