Neil Roberts [Fri, 7 Mar 2014 18:05:45 +0000 (18:05 +0000)]
Fix the initial value of glDrawBuffers for GLES
Under GLES 3 it is not valid to pass GL_FRONT to glDrawBuffers. Instead,
GL_BACK has a magic interpretation which means it will render to the front
buffer on single-buffered contexts and the back buffer on double-buffered. We
were incorrectly setting the initial value to GL_FRONT for single-buffered
contexts. This probably doesn't really matter at the moment except that
presumably it would be exposed in the API via glGetIntegerv.
When we switch to configless contexts this is more important because in that
case we always want to rely on the magic interpretation of GL_BACK in order to
automatically switch between the front and back buffer when a new surface with
a different number of buffers is bound. We also do this for GLES 1 and 2
because the internal value doesn't matter in that case and it is convenient to
use the same code to have the magic interpretation of GL_BACK.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Neil Roberts [Fri, 7 Mar 2014 18:05:44 +0000 (18:05 +0000)]
Use the magic behaviour of GL_BACK in GLES 1 and 2 as well as 3
In GLES 3 it is not possible to select rendering to the front buffer and
instead selecting GL_BACK has the magic interpretation that it is either the
front buffer on single-buffered configs or the back buffer on double-buffered.
GLES 1 and 2 have no way of selecting the draw buffer at all. In that case we
were initialising the draw buffer to either GL_FRONT or GL_BACK depending on
the context's config and then leaving it at that.
When we switch to having configless contexts we ideally want Mesa to
automatically switch between the front and back buffer whenever a double-
or single-buffered surface is bound. To make this happen we can just allow
the magic behaviour from GLES 3 in GLES 1 and 2 as well. It shouldn't matter
what the internal value of the draw buffer is in GLES 1 and 2 because there
is no way to query it from the external API.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Ian Romanick [Mon, 10 Feb 2014 21:48:26 +0000 (13:48 -0800)]
glsl: Fix typo
Remove extra "any" and re-word-wrap the comment.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Ian Romanick [Wed, 12 Feb 2014 00:37:56 +0000 (16:37 -0800)]
glsl: Rewrite unrolled link_invalidate_variable_locations calls as a loop
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Carl Worth [Wed, 12 Mar 2014 17:21:53 +0000 (10:21 -0700)]
docs: Import 10.0.4 release notes, add news item.
Mike Stroyan [Tue, 11 Mar 2014 23:07:00 +0000 (17:07 -0600)]
mesa: Release gl_debug_state when destroying context.
Commit
6e8d04a caused a leak by allocating ctx->Debug but never freeing it.
Release the memory in _mesa_free_errors_data when destroying a context.
Use FREE to match CALLOC_STRUCT from _mesa_get_debug_state.
Reviewed-by: Brian Paul <brianp@vmware.com>
Niels Ole Salscheider [Mon, 3 Mar 2014 19:28:55 +0000 (20:28 +0100)]
r600g: compute memory pool size is given in dw
Multiply the dw value by 4 in order to map the complete buffer.
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Eric Anholt [Mon, 3 Mar 2014 19:14:42 +0000 (11:14 -0800)]
meta: Always restore the framebuffers and current renderbuffer.
The few paths that were playing with framebuffers and renderbuffer were
saving and restoring them.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Eric Anholt [Mon, 3 Mar 2014 18:39:08 +0000 (10:39 -0800)]
i965: Drop intel_check_front_buffer_rendering().
This was being applied in a subset of the places that
intel_prepare_render() was called, to set the same flag that
intel_prepare_render() was setting.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Eric Anholt [Mon, 3 Mar 2014 18:43:10 +0000 (10:43 -0800)]
i965: Drop broken front_buffer_reading/drawing optimization.
The flag wasn't getting updated correctly when the ctx->DrawBuffer or
ctx->ReadBuffer changed. It usually ended up working out because most
apps only have one window system framebuffer, or if they have more than
one and they have any front read/drawing, they will have called
glReadBuffer()/glDrawBuffer() on it when they get started on the new
buffer.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Eric Anholt [Mon, 3 Mar 2014 18:13:46 +0000 (10:13 -0800)]
intel: When checking for updating front buffer reading, use the right fb.
It's the ctx->ReadBuffer that gets read from, not the ctx->DrawBuffer.
So, if you happened to have a ctx->ReadBuffer that was the winsys buffer,
and it had previously been intel_prepare_render()ed but not invalidated
since then, and you called glReadBuffer() to switch to front buffer
instead of back buffer reading on the winsys fbo while your drawbuffer was
a user FBO, you'd never get the front buffer's miptree fetched, and
segfault.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Marek Olšák [Sat, 8 Mar 2014 22:34:36 +0000 (23:34 +0100)]
r600g,radeonsi: attempt to fix racy multi-context apps calling BufferData
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75061
v2: minimize the window where cs_buf != new_buf
Marek Olšák [Sun, 9 Mar 2014 00:03:40 +0000 (01:03 +0100)]
r600g,radeonsi: fix broken buffer download
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sat, 8 Mar 2014 14:15:41 +0000 (15:15 +0100)]
r600g,radeonsi: use a fallback in dma_copy instead of failing
v2: - allow byte-aligned DMA buffer copies on Evergreen
- fix piglit/texsubimage regression
- use the fallback for 3D copies (depth > 1) as well
Marek Olšák [Sun, 9 Mar 2014 21:29:20 +0000 (22:29 +0100)]
radeonsi: small cleanup in get_param
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 9 Mar 2014 19:05:54 +0000 (20:05 +0100)]
radeonsi: set correct alignment for texture buffers and constant buffers
I think these are all equivalent to vertex buffer fetches which should be
dword-aligned. Scalar loads are also dword-aligned.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 9 Mar 2014 21:12:26 +0000 (22:12 +0100)]
r600g, radeonsi: fix primitives-generated query with disabled streamout
Buffers are disabled by VGT_STRMOUT_BUFFER_CONFIG, but the query only works
if VGT_STRMOUT_CONFIG.STREAMOUT_0_EN is enabled.
This moves VGT_STRMOUT_CONFIG to its own state. The register is set to 1
if either streamout or the primitives-generated query is enabled.
However, the primitives-emitted query is also incremented, so it's disabled
by setting VGT_STRMOUT_BUFFER_SIZE to 0 when there is no buffer bound.
This fixes piglit:
ARB_transform_feedback2/counting with pause
EXT_transform_feedback/primgen-query transform-feedback-disabled
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 9 Mar 2014 21:10:27 +0000 (22:10 +0100)]
r600g,radeonsi: don't add streamout.num_dw_for_end twice
It's already added in need_cs_space.
Also don't calculate anything if there are no buffers.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Sun, 9 Mar 2014 19:03:57 +0000 (20:03 +0100)]
r600g,radeonsi: fix MAX_TEXTURE_3D_LEVELS and MAX_TEXTURE_ARRAY_LAYERS limits
CB_COLORi_VIEW.SLICE_MAX can be at most 2047.
This fixes the maxlayers piglit test.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Fri, 7 Mar 2014 16:25:05 +0000 (17:25 +0100)]
st/dri: flush drawable textures before unreferencing
This fixes piglit/fbo-sys-blit with fast clear on radeonsi.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 6 Mar 2014 01:44:07 +0000 (02:44 +0100)]
radeonsi: implement fast color clear
This works for both multi-sample and single-sample color buffers.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 6 Mar 2014 01:38:57 +0000 (02:38 +0100)]
r600g: move fast color clear code to a common place
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 6 Mar 2014 01:14:42 +0000 (02:14 +0100)]
r600g,radeonsi: move CMASK register values from r600_surface to r600_texture
When doing fast clear for single-sample color buffers for the first time,
a CMASK buffer has to be allocated and the CMASK state in all pipe_surfaces
referencing the color buffer must be updated. Updating all surfaces is kinda
silly, so let's move the values to r600_texture instead.
This is only for Evergreen and later. R600-R700 don't have fast clear.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Wed, 5 Mar 2014 23:28:14 +0000 (00:28 +0100)]
radeonsi: convert the framebuffer state to atom-based
This looks like r600g. The shared Cayman MSAA code is used here.
The real motivation for this is that I need the ability to change values
of color registers after the framebuffer state is set. The PM4 state cannot
be modified easily after it's generated. With this, I can just change
r600_surface::cb_color_xxx and set framebuffer.atom.dirty=true and it's done.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Tue, 4 Mar 2014 18:46:55 +0000 (19:46 +0100)]
r600g: move cayman MSAA setup to a common place
I will use this in radeonsi.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Tue, 4 Mar 2014 16:49:39 +0000 (17:49 +0100)]
radeonsi: move framebuffer-related state to a new struct si_framebuffer
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Marek Olšák [Thu, 20 Feb 2014 14:39:35 +0000 (15:39 +0100)]
r600g,radeonsi: set priorities for relocations
Marek Olšák [Thu, 20 Feb 2014 14:35:15 +0000 (15:35 +0100)]
r300g,uvd,vce: set priorities for relocations
This updates all occurences of cs_add_reloc.
Marek Olšák [Thu, 20 Feb 2014 14:31:59 +0000 (15:31 +0100)]
winsys/radeon: add interface for setting a priority number for each relocation
The cs_add_reloc change is commented out not to break compilation.
The highest priority of all cs_add_reloc calls is send to the kernel.
Jonathan Gray [Mon, 10 Mar 2014 13:27:00 +0000 (07:27 -0600)]
glsl: Link glsl_compiler with pthreads library.
Fixes the following build error on OpenBSD:
./.libs/libglsl.a(builtin_functions.o)(.text+0x973): In function `mtx_lock':
../../include/c11/threads_posix.h:195: undefined reference to `pthread_mutex_lock'
./.libs/libglsl.a(builtin_functions.o)(.text+0x9a5): In function `mtx_unlock':
../../include/c11/threads_posix.h:248: undefined reference to `pthread_mutex_unlock'
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Brian Paul <brianp@vmware.com>
Jonathan Gray [Mon, 10 Mar 2014 14:54:43 +0000 (08:54 -0600)]
gallium: add endian detection for OpenBSD
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Emil Velikov [Tue, 11 Mar 2014 11:50:37 +0000 (11:50 +0000)]
automake: allow only shared builds
Static and shared builds were possible in the good old days
of static makefiles. Currently the build system does not
distinguish nor does anything special when one requests a
static build.
Print a warning message for the packager that static builds
are not supported and continue building shared libs.
Currently only Debian and derivatives use static build, and
they use it for building a Xlib powered libGL. This patch
will only change the warning message they are seeing but
the binaries produced will be identical.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Emil Velikov [Tue, 4 Mar 2014 20:02:35 +0000 (20:02 +0000)]
configure: update enable-llvm-shared-libs comments
- As of commit
cb080a10b68(configure.ac: Don't require shared LLVM when
building OpenCL) opencl does not mandate using shared llvm.
- Add a warning message that building with static llvm may cause
compilation problems.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Emil Velikov [Sat, 1 Mar 2014 13:45:21 +0000 (13:45 +0000)]
st/dri: build the drm backend when libdrm is present
Prevent build issues on systems lacking libdrm.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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]
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>
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>
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.
Chia-I Wu [Sun, 2 Mar 2014 06:02:12 +0000 (14:02 +0800)]
ilo: add support for PIPE_QUERY_PIPELINE_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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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().
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.
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.
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.
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.
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.
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.
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>
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>
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>
Marek Olšák [Sun, 9 Mar 2014 23:19:21 +0000 (00:19 +0100)]
r600g: document why texture offset emulation is needed
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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