platform/upstream/mesa.git
10 years agoglx: cleanup unneeded headers
Emil Velikov [Fri, 28 Feb 2014 17:56:01 +0000 (17:56 +0000)]
glx: cleanup unneeded headers

 - xf86dri.h is the old dri1 header, not required by dri2 nor dri3
 - fold xf86drm.h inclusiong inside dri2.h
 - dri3_glx does not have any drm specific dependencies
 - glapi.h is not required by the dri2 and dri3 codepaths

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglx/tests: honor enable-driglx-direct configure flag
Jon TURNEY [Tue, 12 Nov 2013 17:32:13 +0000 (17:32 +0000)]
glx/tests: honor enable-driglx-direct configure flag

Recent commit fixed build issues in dri2_query_renderer.c by
wrapping in defined(direct_rendering) && !defined(applegl)

This patch targets the query_renderer tests, so that make check
passes on platforms such as hurd and cygwin.

v2: (Emil)
 - Rebase and update commit message.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoconfigure: read libomxil-bellagio.pc only when it exists
Emil Velikov [Mon, 3 Mar 2014 02:21:53 +0000 (02:21 +0000)]
configure: read libomxil-bellagio.pc only when it exists

Currenly configure.ac will print a warning when one is missing the package.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agoautomake: create compat symlinks only for linux systems
Emil Velikov [Sun, 9 Mar 2014 11:50:44 +0000 (11:50 +0000)]
automake: create compat symlinks only for linux systems

The primary users of these are linux developers, although
it can be extended for *BSD and others if needed.

Fixes make install for Cygwin and OpenBSD at least.

v2:
 - Wrap vdpau targets as well.
v3:
 - Fold HAVE_COMPAT_SYMLINKS conditional within install*links.mk

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63269
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> (v1)
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agoconfigure: use LIB_EXT rather than hardcoded .so
Emil Velikov [Sat, 8 Mar 2014 19:48:04 +0000 (19:48 +0000)]
configure: use LIB_EXT rather than hardcoded .so

Some platforms different library extension - dll, dylib, a.
Honor that when we are creating the required links.

Rename LIB_EXTENSION to LIB_EXT while we're here.

With libglapi linking aside, building classic drivers on
non-linux platforms should be possible now.

v2: Resolve conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoautomake: do not use symbols names for static glapi.la
Emil Velikov [Sun, 2 Mar 2014 20:06:38 +0000 (20:06 +0000)]
automake: do not use symbols names for static glapi.la

In the cases where one links against the static glapi.la there
is no need to create temporary variables only to explicitly
link agaist it.

Instead use SHARED_GLAPI_LIB to explicitly indicate when one
is building and linking with the shared glapi provider.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoconfigure: remove old makefile variables
Emil Velikov [Sun, 2 Mar 2014 14:30:37 +0000 (14:30 +0000)]
configure: remove old makefile variables

All the variables were used before the automake conversion
and do not make sense (nor are used) currently.

Replace GL_LIB_NAME with lib$(GL_LIB).$(LIB_EXTENSION) for
apple-glx. The build has been broken for ages, but this will
ease the recovery process as it happens.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agogallium/targets: use install-gallium-targets.mk
Emil Velikov [Sun, 2 Mar 2014 21:10:57 +0000 (21:10 +0000)]
gallium/targets: use install-gallium-targets.mk

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agogallium/targets: drop link generation for non DRI targets
Emil Velikov [Sat, 8 Mar 2014 19:06:17 +0000 (19:06 +0000)]
gallium/targets: drop link generation for non DRI targets

All three (xvmc and omx) do not have an alternative loading
similar to the dri modules. Thus one needs to explicitly install
them in order to use/test them.

v2:
 - Keep vdpau targets, as an equivalent of LIBGL_DRIVERS_PATH
is being worked on.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agotargets/vdpau: use install-gallium-links.mk
Emil Velikov [Sat, 8 Mar 2014 19:04:22 +0000 (19:04 +0000)]
targets/vdpau: use install-gallium-links.mk

Drop the duplication across all vdpau targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agotargets/dri: use install-gallium-links.mk
Emil Velikov [Sun, 2 Mar 2014 21:03:24 +0000 (21:03 +0000)]
targets/dri: use install-gallium-links.mk

Drop the duplication across all dri targets.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoautomake: introduce install-gallium-links.mk
Emil Velikov [Sun, 2 Mar 2014 20:59:39 +0000 (20:59 +0000)]
automake: introduce install-gallium-links.mk

This helper script will be used to minimise the duplication
during link generation across all gallium targets.

v2:
 - Handle vdpau_LTLIBRARIES. Requested by Christian König.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoautomake: use install-lib-links.mk across all classic mesa
Emil Velikov [Sun, 2 Mar 2014 20:13:54 +0000 (20:13 +0000)]
automake: use install-lib-links.mk across all classic mesa

Use the handy script and minimise the boilerplate in the makefiles.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoautomake: make install-lib-links less chatty
Emil Velikov [Mon, 3 Mar 2014 03:04:38 +0000 (03:04 +0000)]
automake: make install-lib-links less chatty

There is little point in echoing everything that the script does
to stdout. Wrap it in AM_V_GEN so that a reasonable message is
printed as a indication of it's invocation.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoautomake: use only the folder name if it's a subfolder of the present one
Emil Velikov [Sat, 8 Mar 2014 19:01:28 +0000 (19:01 +0000)]
automake: use only the folder name if it's a subfolder of the present one

v2: Resolve rebase conflicts.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoautomake: silence folder creation
Emil Velikov [Mon, 3 Mar 2014 02:57:40 +0000 (02:57 +0000)]
automake: silence folder creation

There is little gain in printing whenever a folder is created.

v2:
 - Use $(AM_V_at) over @ to have control in verbose builds.
Suggested by Erik Faye-Lund.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoautomake: use MKDIR_P when possible
Emil Velikov [Mon, 3 Mar 2014 01:56:40 +0000 (01:56 +0000)]
automake: use MKDIR_P when possible

Use the automake predefined macro over hardcoding mkdir -p everywhere.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
10 years agoradeon: Fix build.
Vinson Lee [Tue, 11 Mar 2014 05:49:51 +0000 (22:49 -0700)]
radeon: Fix build.

Fix build error introduced with commit
dfa25ea5cd19d5a050a1c94bd7370a2259b9f007.

  CC       r600_streamout.lo
r600_streamout.c:108:6: error: conflicting types for 'r600_set_streamout_targets'
void r600_set_streamout_targets(struct pipe_context *ctx,
     ^
./r600_pipe_common.h:413:6: note: previous declaration is here
void r600_set_streamout_targets(struct pipe_context *ctx,
     ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76009
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agogallium: allow setting of the internal stream output offset
Zack Rusin [Thu, 6 Mar 2014 23:43:44 +0000 (18:43 -0500)]
gallium: allow setting of the internal stream output offset

D3D10 allows setting of the internal offset of a buffer, which is
in general only incremented via actual stream output writes. By
allowing setting of the internal offset draw_auto is capable
of rendering from buffers which have not been actually streamed
out to. Our interface didn't allow. This change functionally
shouldn't make any difference to OpenGL where instead of an
append_bitmask you just get a real array where -1 means append
(like in D3D) and 0 means do not append.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agometa: use non-ARB shader/program create/delete functions
Brian Paul [Sun, 9 Mar 2014 01:06:30 +0000 (18:06 -0700)]
meta: use non-ARB shader/program create/delete functions

The non-ARB versions take GLuint ids, not GLhandleARB.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: s/GLhandleARB/GLuint/ for glGetUniform functions
Brian Paul [Sun, 9 Mar 2014 01:06:30 +0000 (18:06 -0700)]
mesa: s/GLhandleARB/GLuint/ for glGetUniform functions

The GL specs say the parameter is GLuint, not GLhandleARB.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agomesa: rename MESA_FORMAT_X8Z24_UNORM -> MESA_FORMAT_X8_UINT_Z24_UNORM
Brian Paul [Sun, 9 Mar 2014 01:19:21 +0000 (18:19 -0700)]
mesa: rename MESA_FORMAT_X8Z24_UNORM -> MESA_FORMAT_X8_UINT_Z24_UNORM

To follow the example of MESA_FORMAT_Z24_UNORM_X8_UINT.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: reorder MESA_FORMAT enums
Brian Paul [Sun, 9 Mar 2014 01:19:21 +0000 (18:19 -0700)]
mesa: reorder MESA_FORMAT enums

The MESA_FORMAT_x enums in formats.h weren't declared in any sort
of reasonable order.  Now it should be a little more logical.
This also required reordering tables in formats.c and s_texfetch.c

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Acked-by: Eric Anholt <eric@anholt.net>
10 years agomesa: trim down format.h comments
Brian Paul [Sun, 9 Mar 2014 01:19:21 +0000 (18:19 -0700)]
mesa: trim down format.h comments

There's no real reason to list all the formats in the comments.

Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Don't fix-up scalar uniforms for 3 src instructions.
Matt Turner [Sat, 8 Mar 2014 20:16:13 +0000 (12:16 -0800)]
i965/vec4: Don't fix-up scalar uniforms for 3 src instructions.

Removes unnecessary MOV instructions in L4D2, TF2, Dota2, and many other
Steam games.

total instructions in shared programs: 1668126 -> 1657509 (-0.64%)
instructions in affected programs:     242235 -> 231618 (-4.38%)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Disassemble 3 src instructions' rep_ctrl field.
Matt Turner [Sat, 8 Mar 2014 20:15:28 +0000 (12:15 -0800)]
i965: Disassemble 3 src instructions' rep_ctrl field.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Disassemble 3-src operands widths' correctly.
Matt Turner [Sat, 8 Mar 2014 19:07:10 +0000 (11:07 -0800)]
i965: Disassemble 3-src operands widths' correctly.

<4,1,1> isn't a real thing. We meant <4,4,1>, i.e., each component of
the whole register.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Move binding table update packets to binding table setup time.
Eric Anholt [Fri, 7 Mar 2014 00:29:39 +0000 (16:29 -0800)]
i965: Move binding table update packets to binding table setup time.

This keeps us from needing to reemit all the other stage state just
because a surface changed.

Improves unoptimized glamor x11perf -f8text by 1.10201% +/- 0.489869%
(n=296). [v1]

v2:
 - Drop binding table packets from Gen8 unit state as well.
 - Pass _3DSTATE_BINDING_TABLE_POINTERS_XS to brw_upload_binding_table,
   cutting even more code.
v3: Don't forget to drop them from 3DSTATE_GS (botched refactor in v2).

Signed-off-by: Eric Anholt <eric@anholt.net> [v1]
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> [v2, v3]
Reviewed-by: Eric Anholt <eric@anholt.net> [v3]
10 years agoi965: Reorganize the code in brw_upload_binding_tables.
Kenneth Graunke [Thu, 6 Mar 2014 23:39:50 +0000 (15:39 -0800)]
i965: Reorganize the code in brw_upload_binding_tables.

This makes both the empty and non-empty binding table paths exit through
the bottom of the function, which gives us a place to share code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agofix vdpau interop when using -Bsymbolic-functions in ldflags
Maarten Lankhorst [Thu, 6 Mar 2014 14:20:56 +0000 (15:20 +0100)]
fix vdpau interop when using -Bsymbolic-functions in ldflags

Explicitly add radeon_drm_winsys_create and nouveau_drm_screen_create to
the dynamic list. This will ensure vdpau interop still works even when
the user links with -Bsymbolic-functions in hardened builds.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Rachel Greenham <rachel@strangenoises.org>
Reported-by: Peter Frühberger <peter.fruehberger@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agoilo: do not set I915_EXEC_NO_RELOC
Chia-I Wu [Mon, 10 Mar 2014 11:03:14 +0000 (19:03 +0800)]
ilo: do not set I915_EXEC_NO_RELOC

This reverts most of commit d80f0c34b733a874adfdd3a2267e4deec345cc6b.  Upon a
closer reading, having the presumed offsets written is not enough to set the
flag.  EXEC_OBJECT_NEEDS_GTT and/or EXEC_OBJECT_WRITE of the reloc entries
must also be set appropriately.

10 years agoilo: add support for PIPE_QUERY_PIPELINE_STATISTICS
Chia-I Wu [Sun, 2 Mar 2014 06:02:12 +0000 (14:02 +0800)]
ilo: add support for PIPE_QUERY_PIPELINE_STATISTICS

10 years agoilo: add ILO_3D_PIPELINE_WRITE_STATISTICS
Chia-I Wu [Sun, 2 Mar 2014 05:36:08 +0000 (13:36 +0800)]
ilo: add ILO_3D_PIPELINE_WRITE_STATISTICS

The command writes statistics registers to the specified bo.

10 years agoilo: add some MI commands to GPE
Chia-I Wu [Sun, 2 Mar 2014 03:59:26 +0000 (11:59 +0800)]
ilo: add some MI commands to GPE

We will need MI commands that load/store registers.

10 years agoilo: set PIPE_CONTROL_GLOBAL_GTT_WRITE automatically
Chia-I Wu [Sun, 2 Mar 2014 04:15:17 +0000 (12:15 +0800)]
ilo: set PIPE_CONTROL_GLOBAL_GTT_WRITE automatically

Set the flag automatically in gen6_emit_PIPE_CONTROL(), and set it only for
GEN6.

10 years agoilo: print a warning when PPGTT is disabled
Chia-I Wu [Mon, 10 Mar 2014 04:40:29 +0000 (12:40 +0800)]
ilo: print a warning when PPGTT is disabled

Despite what the PRMs say, the driver appears to work fine when PPGTT is
disabled.  But at least print a warning in that case.

10 years agoilo: require hardware logical context support
Chia-I Wu [Mon, 10 Mar 2014 04:31:30 +0000 (12:31 +0800)]
ilo: require hardware logical context support

The code paths are not tested for a while, and have some known issues.

10 years agoilo: protect the decode context with a mutex
Chia-I Wu [Mon, 10 Mar 2014 04:25:18 +0000 (12:25 +0800)]
ilo: protect the decode context with a mutex

The decode context is not thread safe.

10 years agoilo: set I915_EXEC_NO_RELOC when available
Chia-I Wu [Mon, 10 Mar 2014 04:11:33 +0000 (12:11 +0800)]
ilo: set I915_EXEC_NO_RELOC when available

The winsys makes it clear that the pipe drivers should write presumed offsets.
We can always set I915_EXEC_NO_RELOC when the kernel supports it.

10 years agoilo: move ring types to winsys
Chia-I Wu [Sun, 9 Mar 2014 13:55:23 +0000 (21:55 +0800)]
ilo: move ring types to winsys

It results in less code despite that i915_drm.h specifies the ring type as
part of the execution flags.

10 years agoilo: winsys may limit the batch buffer size
Chia-I Wu [Sat, 8 Mar 2014 18:07:18 +0000 (02:07 +0800)]
ilo: winsys may limit the batch buffer size

The maximum batch buffer size is determined at the time of
drm_intel_bufmgr_gem_init().  Make sure the pipe driver does not exceed the
limit.

10 years agoilo: PIPE_CAP_QUERY_TIMESTAMP may not be supported
Chia-I Wu [Sat, 8 Mar 2014 18:00:46 +0000 (02:00 +0800)]
ilo: PIPE_CAP_QUERY_TIMESTAMP may not be supported

Reading TIMESTAMP register may fail, depending on both kernel and hardware.

10 years agoilo: rework winsys batch buffer functions
Chia-I Wu [Sat, 8 Mar 2014 09:32:37 +0000 (17:32 +0800)]
ilo: rework winsys batch buffer functions

Rename

  intel_winsys_check_aperture_size() to intel_winsys_can_submit_bo(),
  intel_bo_exec() to intel_winsys_submit_bo(), and
  intel_winsys_decode_commands() to intel_winsys_decode_bo().

Make a semantic change to ignore intel_context when the ring is not the render
ring.

10 years agoilo: replace bo alloc flags by initial domains
Chia-I Wu [Sat, 8 Mar 2014 15:55:15 +0000 (23:55 +0800)]
ilo: replace bo alloc flags by initial domains

The only alloc flag is INTEL_ALLOC_FOR_RENDER, which can as well be expressed
by specifying the initial write domain.  The change makes it obvious that we
failed to set INTEL_ALLOC_FOR_RENDER in several places.

10 years agoilo: remove intel_bo_get_size()
Chia-I Wu [Sat, 8 Mar 2014 09:22:45 +0000 (17:22 +0800)]
ilo: remove intel_bo_get_size()

Commit bfa8d21759c5f2b5b0885c696842167bd4c64fee uses it to work around a
hardware limitation.  But there are other ways to do it without the need for
intel_bo_get_size().

10 years agoilo: remove intel_bo_get_virtual()
Chia-I Wu [Sat, 8 Mar 2014 08:22:06 +0000 (16:22 +0800)]
ilo: remove intel_bo_get_virtual()

Make the map functions return the pointer directly.

10 years agoilo: rework winsys bo reloc functions
Chia-I Wu [Sat, 8 Mar 2014 07:57:51 +0000 (15:57 +0800)]
ilo: rework winsys bo reloc functions

Rename

  intel_bo_emit_reloc() to intel_bo_add_reloc(),
  intel_bo_clear_relocs() to intel_bo_truncate_relocs(), and
  intel_bo_references() to intel_bo_has_reloc().

Besides, we need intel_bo_get_offset() only to get the presumed offset afer
adding a reloc entry.  Remove the function and make intel_bo_add_reloc()
return the presumed offset.  While at it, switch to gem_bo->offset64 from
gem_bo->offset.

10 years agoilo: add a wrapper to cast struct intel_bo
Chia-I Wu [Sat, 8 Mar 2014 07:55:39 +0000 (15:55 +0800)]
ilo: add a wrapper to cast struct intel_bo

It is just drm_intel_bo, but having a wrapper makes the code cleaner.

10 years agoilo: fix DRM_API_HANDLE_TYPE_FD export
Chia-I Wu [Sat, 22 Feb 2014 14:53:04 +0000 (22:53 +0800)]
ilo: fix DRM_API_HANDLE_TYPE_FD export

It can be exported by drm_intel_bo_gem_export_to_prime().  The code is already
in winsys, just not enabled.

10 years agoilo: improve winsys documentation/comments
Chia-I Wu [Sat, 8 Mar 2014 06:25:07 +0000 (14:25 +0800)]
ilo: improve winsys documentation/comments

Document the interface, and add comments as to why some features are enabled
and why some checks are made.

10 years agoilo: remove intel_winsys_enable_reuse()
Chia-I Wu [Sat, 8 Mar 2014 05:50:53 +0000 (13:50 +0800)]
ilo: remove intel_winsys_enable_reuse()

It should be an (winsys) implementation detail.

10 years agomesa/glsl: introduce a remap table for uniform locations
Tapani Pälli [Thu, 6 Mar 2014 09:00:17 +0000 (11:00 +0200)]
mesa/glsl: introduce a remap table for uniform locations

Patch adds a remap table for uniforms that is used to provide a mapping
from application specified uniform location to actual location in the
UniformStorage. Existing UniformLocationBaseScale usage is removed as
table can be used to set sequential values for array uniform elements.

This mapping helps to implement GL_ARB_explicit_uniform_location so that
uniforms locations can be reorganized and handled in a more easy manner.

v2: small fixes + rename parameters for merge and split functions (Ian)
    improve documentation, remove old check for location bounds (Eric)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: remove _mesa_symbol_table_iterator structure
Tapani Pälli [Thu, 27 Feb 2014 08:15:05 +0000 (10:15 +0200)]
mesa: remove _mesa_symbol_table_iterator structure

Nothing uses this structure, removal fixes Klocwork error about
the possible oom condition in _mesa_symbol_table_iterator_ctor.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoradeonsi: Use proper member name for deleting export shader PM4 state
Michel Dänzer [Mon, 10 Mar 2014 03:21:50 +0000 (12:21 +0900)]
radeonsi: Use proper member name for deleting export shader PM4 state

Fixes double-free with some piglit tests using geometry shaders.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agor600g: document why texture offset emulation is needed
Marek Olšák [Sun, 9 Mar 2014 23:19:21 +0000 (00:19 +0100)]
r600g: document why texture offset emulation is needed

10 years agoRevert nvc0 part of "nv50: adjust blit_3d handling of ms output textures"
Ilia Mirkin [Sun, 9 Mar 2014 06:36:12 +0000 (01:36 -0500)]
Revert nvc0 part of "nv50: adjust blit_3d handling of ms output textures"

The nvc0 bits don't appear to work, and I thought I had removed them
from the commit. Oops.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
10 years agonv50: adjust blit_3d handling of ms output textures
Ilia Mirkin [Thu, 6 Mar 2014 05:51:48 +0000 (00:51 -0500)]
nv50: adjust blit_3d handling of ms output textures

This fixes some unwanted scaling when the output is multisampled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
10 years agonouveau: fix fence waiting logic in screen destroy
Ilia Mirkin [Thu, 6 Mar 2014 03:25:55 +0000 (22:25 -0500)]
nouveau: fix fence waiting logic in screen destroy

nouveau_fence_wait has the expectation that an external entity is
holding onto the fence being waited on, not that it is merely held onto
by the current pointer. Fixes a use-after-free in nouveau_fence_wait
when used on the screen's current fence.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75279
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Cc: "9.2 10.0 10.1" <mesa-stable@lists.freedesktop.org>
10 years agonouveau: add valid range tracking to nouveau_buffer
Ilia Mirkin [Thu, 27 Feb 2014 06:07:51 +0000 (01:07 -0500)]
nouveau: add valid range tracking to nouveau_buffer

This logic is borrowed from the radeon code. The transfer logic will
only get called for PIPE_BUFFER resources, so it shouldn't be necessary
to worry about them becoming render targets.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
10 years agogbm: make 'devices' array static
Julien Cristau [Mon, 3 Mar 2014 16:41:56 +0000 (17:41 +0100)]
gbm: make 'devices' array static

It's only used in this one file as far as I can tell, and exporting a
symbol named 'devices' from a shared library is a recipe for trouble.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoautomake: make clean the correct git_sha1.h.tmp
Emil Velikov [Wed, 5 Mar 2014 13:04:14 +0000 (13:04 +0000)]
automake: make clean the correct git_sha1.h.tmp

When building out of tree, the file ends up dangling which
may result in a binary with the old git sha.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoradeonsi: fix freeing descriptor buffers
Christian König [Sat, 8 Mar 2014 13:52:25 +0000 (14:52 +0100)]
radeonsi: fix freeing descriptor buffers

That structure member is a pointer, so the loop with
the Elements macro only freed up the first entry.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: fix leaking the bound state on destruction v2
Christian König [Fri, 7 Mar 2014 20:52:51 +0000 (21:52 +0100)]
radeonsi: fix leaking the bound state on destruction v2

v2: rebased on stale pointer fixes

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: avoid stale state pointers
Christian König [Sat, 8 Mar 2014 13:18:30 +0000 (14:18 +0100)]
radeonsi: avoid stale state pointers

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeonsi: avoid stale pointers in si_delete_shader_selector
Christian König [Sat, 8 Mar 2014 13:16:23 +0000 (14:16 +0100)]
radeonsi: avoid stale pointers in si_delete_shader_selector

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoRevert "winsys/radeon: if there's VRAM-only usage, keep it"
Marek Olšák [Sat, 8 Mar 2014 15:00:25 +0000 (16:00 +0100)]
Revert "winsys/radeon: if there's VRAM-only usage, keep it"

This reverts commit 67aef6dafa29fed008ea6065c425a6a92a651be9.

It caused GPU hangs. The question is why.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75900

10 years agoradeon/vce: fix memory leak
Christian König [Fri, 7 Mar 2014 17:31:40 +0000 (18:31 +0100)]
radeon/vce: fix memory leak

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoglcpp: Do not remove spaces to preserve locations.
Sir Anthony [Wed, 5 Feb 2014 14:15:56 +0000 (20:15 +0600)]
glcpp: Do not remove spaces to preserve locations.

After preprocessing by glcpp all adjacent spaces were replaced by
single one and glsl parser received column-shifted shader source.
It negatively affected ast location set up and produced wrong error
messages for heavily-spaced shaders.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Change locations from yylloc to appropriate tokens positions.
Sir Anthony [Wed, 5 Feb 2014 15:18:11 +0000 (21:18 +0600)]
glsl: Change locations from yylloc to appropriate tokens positions.

Reviewed-by: Carl Worth <cworth@cworth.org>
10 years agoglsl: Add ast_node method to set location range.
Sir Anthony [Wed, 5 Feb 2014 15:18:10 +0000 (21:18 +0600)]
glsl: Add ast_node method to set location range.

Reviewed-by: Carl Worth <cworth@cworth.org>
10 years agoglsl: Make ast_node location comments more informative.
Sir Anthony [Thu, 6 Feb 2014 16:00:02 +0000 (22:00 +0600)]
glsl: Make ast_node location comments more informative.

Reviewed-by: Carl Worth <cworth@cworth.org>
10 years agoglsl: Extend ast location structure to hande end token position.
Sir Anthony [Wed, 5 Feb 2014 15:18:09 +0000 (21:18 +0600)]
glsl: Extend ast location structure to hande end token position.

Reviewed-by: Carl Worth <cworth@cworth.org>
10 years agoglsl: Update lexers in glsl and glcpp to hande end position of token.
Sir Anthony [Wed, 5 Feb 2014 15:18:08 +0000 (21:18 +0600)]
glsl: Update lexers in glsl and glcpp to hande end position of token.

Reviewed-by: Carl Worth <cworth@cworth.org>
10 years agoscons: Add drivers/common/meta_generate_mipmap.c to src/mesa/SConscript.
Vinson Lee [Sat, 8 Mar 2014 07:39:29 +0000 (23:39 -0800)]
scons: Add drivers/common/meta_generate_mipmap.c to src/mesa/SConscript.

This patch fixes this SCons build error introduced with commit
70e7905608b374f65d1f4b657f8ab61808c76ef6.

build/linux-x86_64-debug/mesa/libmesa.a(driverfuncs.os): In function `_mesa_init_driver_functions':
src/mesa/drivers/common/driverfuncs.c:99: undefined reference to `_mesa_meta_GenerateMipmap'

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
10 years agometa: Support GenerateMipmaps on 1DArray textures.
Kenneth Graunke [Thu, 6 Mar 2014 09:56:53 +0000 (01:56 -0800)]
meta: Support GenerateMipmaps on 1DArray textures.

I don't know how many people care about this case, but it's easy enough
to do, so we may as well.  The tricky part is that for some reason Mesa
stores the number of array slices in Height, not Depth.

I thought the easiest way to handle that here was to make Height = 1
(the actual height), and srcDepth = srcImage->Height.  This requires
some munging when calling _mesa_prepare_mipmap_level, so I created a
wrapper that sorts it out for us.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Use srcWidth/Height/Depth rather than srcImage->Width and such.
Kenneth Graunke [Thu, 6 Mar 2014 09:47:15 +0000 (01:47 -0800)]
meta: Use srcWidth/Height/Depth rather than srcImage->Width and such.

This is equivalent for now, and will differ once we add 1DArray support.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Support GenerateMipmaps on 2DArray textures.
Kenneth Graunke [Thu, 6 Mar 2014 05:02:06 +0000 (21:02 -0800)]
meta: Support GenerateMipmaps on 2DArray textures.

This is largely a matter of looping over the number of slices/layers,
and not minifying depth (presumably that code exists for the unfinished
3D texture support).

Normally, I would have made the loop over array slices the outermost
loop.  I suspect that would make it trickier to support 3D textures
someday, though, so I didn't.  The advantage is that we would only have
one BufferData call per slice, rather than one per miplevel and slice.

However, a GenerateMipmaps microbenchmark indicates that either way is
basically just as fast.  So I'm not sure it's worth bothering.

Improves performance in a GenerateMipmaps microbenchmark by nearly 5x.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Add a 'layer' argument to bind_fbo_image().
Kenneth Graunke [Thu, 6 Mar 2014 04:55:51 +0000 (20:55 -0800)]
meta: Add a 'layer' argument to bind_fbo_image().

For array textures and 3D textures, this represents the layer to use.
Just pass 0 for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Refactor code for binding a texture image to the FBO.
Kenneth Graunke [Thu, 6 Mar 2014 03:19:32 +0000 (19:19 -0800)]
meta: Refactor code for binding a texture image to the FBO.

Almost the exact same code appeared twice, and it needs to expand to
handle additional texture targets.  Refactor it to tidy up the code and
avoid duplicating more work in the future.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Use minify() in GenerateMipmaps code.
Kenneth Graunke [Thu, 6 Mar 2014 03:06:51 +0000 (19:06 -0800)]
meta: Use minify() in GenerateMipmaps code.

This is what the macro is for.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Drop redundant FBO creation code in GenerateMipmaps.
Kenneth Graunke [Thu, 6 Mar 2014 03:21:00 +0000 (19:21 -0800)]
meta: Drop redundant FBO creation code in GenerateMipmaps.

fallback_required() already creates the FBO in order to check whether we
can render to the format.  So it's guaranteed to exist.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Replace GLboolean with bool in fallback_required().
Kenneth Graunke [Thu, 6 Mar 2014 02:48:40 +0000 (18:48 -0800)]
meta: Replace GLboolean with bool in fallback_required().

This doesn't interact with the GL API, so we shouldn't use GL types.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Make _mesa_meta_check_generate_mipmap_fallback static.
Kenneth Graunke [Thu, 6 Mar 2014 02:43:23 +0000 (18:43 -0800)]
meta: Make _mesa_meta_check_generate_mipmap_fallback static.

This was only ever used in one place; there's no reason for it to be
non-static.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: Split GenerateMipmap() into its own file.
Kenneth Graunke [Thu, 6 Mar 2014 02:37:57 +0000 (18:37 -0800)]
meta: Split GenerateMipmap() into its own file.

Putting the implementation of each GL function in its own file makes it
much easier not to get lost.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agometa: De-static setup_texture_coords().
Kenneth Graunke [Thu, 6 Mar 2014 02:32:42 +0000 (18:32 -0800)]
meta: De-static setup_texture_coords().

This will be used in multiple files soon.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglapi: Add KHR_debug.xml
Timothy Arceri [Sat, 8 Mar 2014 04:45:26 +0000 (15:45 +1100)]
glapi: Add KHR_debug.xml

10 years agomesa: add missing DebugMessageControl types
Timothy Arceri [Sat, 8 Mar 2014 04:37:46 +0000 (15:37 +1100)]
mesa: add missing DebugMessageControl types

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: make ARB_debug_output functions an alias of
Timothy Arceri [Sat, 8 Mar 2014 04:35:54 +0000 (15:35 +1100)]
mesa: make ARB_debug_output functions an alias of
 KHR_debug

Also update dispatch sanity removing ARB_debug_output checks and
removing KHR_debug placeholders as the checks have already been added

V2: Make sure we exit case statements with conditional breaks rather than
just dropping through.

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoglapi: move KHR_debug into its own file
Timothy Arceri [Sat, 8 Mar 2014 04:31:59 +0000 (15:31 +1100)]
glapi: move KHR_debug into its own file

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoglx_pbuffer: Refactor GetDrawableAttribute
Adel Gadllah [Mon, 24 Feb 2014 19:44:41 +0000 (20:44 +0100)]
glx_pbuffer: Refactor GetDrawableAttribute

Move the pdraw != NULL check out so that they don't
have to be duplicated.

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglx: Update glxext.h to revision 25407
Adel Gadllah [Mon, 24 Feb 2014 19:44:40 +0000 (20:44 +0100)]
glx: Update glxext.h to revision 25407

Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoradeon: Include radeon_elf_util.c in the list of LLVM_C_FILES v2
Tom Stellard [Fri, 7 Mar 2014 21:55:48 +0000 (16:55 -0500)]
radeon: Include radeon_elf_util.c in the list of LLVM_C_FILES v2

This fixes the a build breakage caused by
6974eb907600b9d0176d3158ff0fd30ac3e56a55 on build configurations where
all the following are true:

1. radeonsi is not being built
2. r600g is being built
3. opencl is disabled
4. --enable-r600-llvm-compiler is not being used
5. libelf is not installed

v2:
  - Add $(RADEON_CFLAGS) to libllvmradeon_la_CFLAGS

Tested-by: Brian Paul <brianp@vmware.com>
10 years agost/mesa: only mark framebuffer as sRGB capable if Mesa supports the format
Brian Paul [Fri, 7 Mar 2014 17:53:03 +0000 (10:53 -0700)]
st/mesa: only mark framebuffer as sRGB capable if Mesa supports the format

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
10 years agoradeon/llvm: Factor elf parsing code out into its own function
Tom Stellard [Mon, 3 Feb 2014 20:54:02 +0000 (15:54 -0500)]
radeon/llvm: Factor elf parsing code out into its own function

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agoradeon: Rename struct radeon_llvm_binary to radeon_shader_binary v2
Tom Stellard [Mon, 3 Feb 2014 18:50:09 +0000 (13:50 -0500)]
radeon: Rename struct radeon_llvm_binary to radeon_shader_binary v2

And move its definition into r600_pipe_common.h;  This struct is a just
a container for shader code and has nothing to do with LLVM.

v2:
  - Drop unrelated Makefile change

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agogallium: rename R4A4 and A4R4 formats to match their swizzle
Marek Olšák [Tue, 4 Mar 2014 11:42:37 +0000 (12:42 +0100)]
gallium: rename R4A4 and A4R4 formats to match their swizzle

Like L4A4.

Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agomesa: fix the format of glEdgeFlagPointer
Marek Olšák [Mon, 3 Mar 2014 00:01:05 +0000 (01:01 +0100)]
mesa: fix the format of glEdgeFlagPointer

Softpipe expects a float in the vertex shader, which is what glEdgeFlag
generates.

This fixes piglit/gl-2.0-edgeflag.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoradeonsi: fix blit compressed texture workaround to support 2D arrays
Marek Olšák [Mon, 3 Mar 2014 18:22:56 +0000 (19:22 +0100)]
radeonsi: fix blit compressed texture workaround to support 2D arrays

We don't have a piglit test for this, but I think it's correct.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agor600g: fix blitting the last 2 mipmap levels for Evergreen
Marek Olšák [Mon, 3 Mar 2014 21:53:58 +0000 (22:53 +0100)]
r600g: fix blitting the last 2 mipmap levels for Evergreen

This fixes a lot of compressedteximage piglit tests.

R600-R700 don't have this issue.

Cc: mesa-stable@lists.freedesktop.org
10 years agor600g: fix texelFetchOffset GLSL functions
Marek Olšák [Mon, 3 Mar 2014 17:29:39 +0000 (18:29 +0100)]
r600g: fix texelFetchOffset GLSL functions

Cc: mesa-stable@lists.freedesktop.org