mesa.git
10 years agometa: Add storage to the vertex structure for R, G, B, and A
Ian Romanick [Sun, 15 Dec 2013 03:32:39 +0000 (19:32 -0800)]
meta: Add storage to the vertex structure for R, G, B, and A

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Use common routine to configure fixed-function TNL state
Ian Romanick [Sat, 14 Dec 2013 19:36:32 +0000 (11:36 -0800)]
meta: Use common routine to configure fixed-function TNL state

Also... glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0) *is* the identity
matrix, so drop the unnecessary call to _mesa_Ortho.

v2: Rename setup_ff_TNL_for_blit() to setup_ff_tnl_for_blit().  Seems
    silly to capitalize one out of two to three acronyms in the name
    (change by anholt, acked by idr).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Fix General and Indirect Base Addresses on Broadwell.
Kenneth Graunke [Mon, 3 Feb 2014 22:30:39 +0000 (14:30 -0800)]
i965: Fix General and Indirect Base Addresses on Broadwell.

I set the "address modify enable" bit in the wrong DWord.  The first
DWord is the high 16 bits of the address, while the second is the low
32-bits and enable bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Drop VECTOR_MASK_ENABLE in Broadwell's 3DSTATE_VS packet.
Kenneth Graunke [Mon, 3 Feb 2014 18:45:31 +0000 (10:45 -0800)]
i965: Drop VECTOR_MASK_ENABLE in Broadwell's 3DSTATE_VS packet.

We never set it on previous generations, but I had to set it in
3DSTATE_PS for correct behavior.  For symmetry, I set it in 3DSTATE_VS
as well, but there's no actual need to do so.  Piglit works fine either
way.  The documentation also remarks that there should never be a need
to program this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/gs: Fix EndPrimitive on Broadwell.
Kenneth Graunke [Thu, 30 Jan 2014 00:31:31 +0000 (16:31 -0800)]
i965/gs: Fix EndPrimitive on Broadwell.

My earlier patch (i965: Reserve space for "Vertex Count" in GS outputs.)
incremented Global Offset for most URB writes to make room for the new
"Vertex Count" field, but failed to shift the URB writes used for
writing control bits.

Confusingly, Global Offset must be incremented by 2 here, rather than 1.
The URB writes we use for actual data are HWord writes, which treat
Global Offset as a 256-bit offset.  These are OWord writes, so it's
treated as a 128-bit offset instead.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/vec4: Support arbitrarily large sampler indices on Broadwell+.
Kenneth Graunke [Thu, 23 Jan 2014 19:05:46 +0000 (11:05 -0800)]
i965/vec4: Support arbitrarily large sampler indices on Broadwell+.

I added support for these on Haswell, but forgot to update the Broadwell
code before landing it.  Fixes Piglit's max-samplers test.

v2: Use get_element_ud() for the destination as well as the source.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Support arbitrarily large sampler indices on Broadwell+.
Kenneth Graunke [Thu, 23 Jan 2014 18:58:25 +0000 (10:58 -0800)]
i965/fs: Support arbitrarily large sampler indices on Broadwell+.

I added support for these on Haswell, but forgot to update the Broadwell
code before landing it.  Partially fixes Piglit's max-samplers test.

v2: Use get_element_ud() consistently, rather than using it for the
    source but using brw_vec1_grf for the destination..

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965/fs: Fix Broadwell texture header setup to be uncompressed.
Kenneth Graunke [Thu, 23 Jan 2014 18:55:16 +0000 (10:55 -0800)]
i965/fs: Fix Broadwell texture header setup to be uncompressed.

MOV_RAW disables masking, but doesn't force the instruction to be
uncompressed.  That needs to be done by hand.

Fixes textureGather and texture offset tests.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: GL_ARB_half_float_pixel is not optional
Ian Romanick [Mon, 13 Jan 2014 23:23:48 +0000 (15:23 -0800)]
mesa: GL_ARB_half_float_pixel is not optional

Almost every driver already supported it.  All current and future
Gallium drivers always support it, and most existing classic drivers
support it.

This only changes radeon and nouveau.

This extension only adds data types that can be passed to, for example,
glTexImage2D.  It does not add internal formats.  Since you can already
pass GL_FLOAT to glTexImage2D this shouldn't pose any additional issues
with those drivers.  Note that r200 and i915 already supported this
extension, and they don't support floating-point textures either.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agomesa: Fix extension dependency for half-float TexBOs
Ian Romanick [Mon, 13 Jan 2014 23:18:23 +0000 (15:18 -0800)]
mesa: Fix extension dependency for half-float TexBOs

Half-float TexBOs should require both GL_ARB_half_float_pixel and
GL_ARB_texture_float.  This doesn't matter much in practice.  Every
driver that supports GL_ARB_texture_buffer_object already supports
GL_ARB_half_float_pixel.  We only expose the TexBO extension in core
profiles, and those require GL_ARB_texture_float.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Silence unused parameter warning in _mesa_meta_CopyTexSubImage
Ian Romanick [Tue, 17 Dec 2013 21:38:50 +0000 (13:38 -0800)]
meta: Silence unused parameter warning in _mesa_meta_CopyTexSubImage

drivers/common/meta.c: In function '_mesa_meta_CopyTexSubImage':
drivers/common/meta.c:3744:52: warning: unused parameter 'rb' [-Wunused-parameter]

Unfortunately, the parameter can't just be removed because it is part of
the dd_function_table::CopyTexSubImage interface.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Silence unused parameter warning in setup_drawpix_texture
Ian Romanick [Tue, 17 Dec 2013 03:07:24 +0000 (19:07 -0800)]
meta: Silence unused parameter warning in setup_drawpix_texture

drivers/common/meta.c: In function 'setup_drawpix_texture':
drivers/common/meta.c:1572:30: warning: unused parameter 'texIntFormat' [-Wunused-parameter]

setup_drawpix_texture has never used this paramater.  Before the
refactor commit 04f8193aa it was used in several locations.  After that
commit, texIntFormat was only used in alloc_texture.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Refactor common VAO and VBO initialization code
Ian Romanick [Sat, 14 Dec 2013 19:24:36 +0000 (11:24 -0800)]
meta: Refactor common VAO and VBO initialization code

v2: Clean up some stray binding calls

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
Reviewed-by: Eric Anholt <eric@anholt.net> (v2)
10 years agometa: Track the _mesa_meta_DrawPixels VBO just like the others
Ian Romanick [Sat, 14 Dec 2013 20:03:01 +0000 (12:03 -0800)]
meta: Track the _mesa_meta_DrawPixels VBO just like the others

All of the other meta routines have a particular pattern for creating
and tracking the VAO and VBO.  This one function deviated from that
pattern for no apparent reason.

Almost all of the code added in this patch will be removed shortly.

v2: Drop glDeleteBuffers() of the old, now-uninitialized vbo variable.
    Fixes getteximage-formats and fbo-mipmap-copypix regression when "2"
    landed in the variable (change by anholt).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Expand the vertex structure for the GenerateMipmap and decompress paths
Ian Romanick [Sat, 14 Dec 2013 08:57:06 +0000 (00:57 -0800)]
meta: Expand the vertex structure for the GenerateMipmap and decompress paths

Final intermediate step leading to some code sharing.  Note that the new
GemerateMipmap and decompress vertex structures are the same as the new vertex
structure in BlitFramebuffer and the others.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Expand the vertex structure for the DrawPixels paths
Ian Romanick [Sat, 14 Dec 2013 08:55:50 +0000 (00:55 -0800)]
meta: Expand the vertex structure for the DrawPixels paths

Another step leading to some code sharing.  Note that the new DrawPixels
vertex structure is the same as the new vertex structure in BlitFramebuffer
and the others.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Expand the vertex structure for the Clear paths
Ian Romanick [Sat, 14 Dec 2013 03:37:02 +0000 (19:37 -0800)]
meta: Expand the vertex structure for the Clear paths

Another step leading to some code sharing.  Note that the new Clear
vertex structure is the same as the new BlitFramebuffer and CopyPixels
vertex structure.

The "sizeof(float) * 7" hack is temporary.  It will magically disappear
in a just a couple more patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Expand the vertex structure for the CopyPixels paths
Ian Romanick [Sat, 14 Dec 2013 03:32:08 +0000 (19:32 -0800)]
meta: Expand the vertex structure for the CopyPixels paths

Another step leading to some code sharing.  Note that the new CopyPixels
vertex structure is the same as the new BlitFramebuffer vertex
structure.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agometa: Expand the vertex structure for the BlitFramebuffer paths
Ian Romanick [Sat, 14 Dec 2013 03:04:20 +0000 (19:04 -0800)]
meta: Expand the vertex structure for the BlitFramebuffer paths

This is the first of several steps leading to some code sharing.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agonv30,nvc0: only claim a single viewport
Ilia Mirkin [Tue, 11 Feb 2014 05:42:26 +0000 (00:42 -0500)]
nv30,nvc0: only claim a single viewport

It should be possible to make this be 16 on nvc0.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agost/clover: use VISIBILITY_CXXFLAGS where approapriate
Emil Velikov [Sat, 8 Feb 2014 04:06:19 +0000 (04:06 +0000)]
st/clover: use VISIBILITY_CXXFLAGS where approapriate

Use the c++ visibility flags when building cpp files.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoomx: use VISIBILITY_CFLAGS to control exported symbols
Emil Velikov [Sat, 8 Feb 2014 03:56:38 +0000 (03:56 +0000)]
omx: use VISIBILITY_CFLAGS to control exported symbols

Initial step of cleaning the exported symbols from targets/omx

 - Mark omx_component_library_Setup as public

v2: Keep export-symbols-regex

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com> (v1)
10 years agoosmesa: drop obsolete AM_CXXFLAGS
Emil Velikov [Sat, 8 Feb 2014 02:56:32 +0000 (02:56 +0000)]
osmesa: drop obsolete AM_CXXFLAGS

There is no cpp files during the build process, thus we
can safely drop the unused cxxflags.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agost/vdpau: automake: export only PUBLIC symbols
Emil Velikov [Sat, 8 Feb 2014 01:40:40 +0000 (01:40 +0000)]
st/vdpau: automake: export only PUBLIC symbols

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agost/vdpau: do not export VdpPresentationQueueTargetCreateX11
Emil Velikov [Fri, 7 Feb 2014 16:37:50 +0000 (16:37 +0000)]
st/vdpau: do not export VdpPresentationQueueTargetCreateX11

The function pointer is retrieved via VdpGetProcAddress just
like all the other vdpau functions and should not be exported.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
10 years agowayland-egl: automake: add symbol test
Emil Velikov [Fri, 7 Feb 2014 19:06:02 +0000 (19:06 +0000)]
wayland-egl: automake: add symbol test

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agost/egl: automake: avoid exporting all symbols
Emil Velikov [Fri, 7 Feb 2014 18:48:21 +0000 (18:48 +0000)]
st/egl: automake: avoid exporting all symbols

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agotargets/egl-static: automake: don't export local symbols
Emil Velikov [Fri, 7 Feb 2014 18:44:19 +0000 (18:44 +0000)]
targets/egl-static: automake: don't export local symbols

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agogbm: automake: add symbol tests
Emil Velikov [Fri, 7 Feb 2014 16:08:04 +0000 (16:08 +0000)]
gbm: automake: add symbol tests

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agotargets/gbm: automake: do not export internal symbols
Emil Velikov [Sat, 25 Jan 2014 17:59:36 +0000 (17:59 +0000)]
targets/gbm: automake: do not export internal symbols

Add VISIBILITY_CFLAGS to automake build, so that
only required symbols are exported.

v2: Rebase

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agogbm: do not export _gbm_mesa_get_device
Emil Velikov [Sat, 25 Jan 2014 17:19:10 +0000 (17:19 +0000)]
gbm: do not export _gbm_mesa_get_device

This symbol is internal and was never part of the API.
Unused by any of the gbm backends, it makes sense to
simply not export it.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agogbm: automake: add
Emil Velikov [Sat, 25 Jan 2014 17:22:05 +0000 (17:22 +0000)]
gbm: automake: add
VISIBILITY_CFLAGS

Currently the library exports every symbol imaginable,
rather than the ones defined by the API.

Note: This may cause issues for libraries that are linking
agaist libgbm's internals.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agost/gbm: automake: do not export gbm_gallium_drm_device_create
Emil Velikov [Fri, 7 Feb 2014 20:06:56 +0000 (20:06 +0000)]
st/gbm: automake: do not export gbm_gallium_drm_device_create

Symbol is internal and was never meant to be exported.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoauxiliary/pipe-loader: automake: avoid exporting all symbols
Emil Velikov [Fri, 7 Feb 2014 19:58:20 +0000 (19:58 +0000)]
auxiliary/pipe-loader: automake: avoid exporting all symbols

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoegl/dri2/android: free driver_name in dri2_initialize_android error path
Emil Velikov [Sat, 25 Jan 2014 15:56:59 +0000 (15:56 +0000)]
egl/dri2/android: free driver_name in dri2_initialize_android error path

v2:
Cleanup driver name if dri2_load_driver() fails. Spotted by Chad

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agodri/nouveau: Pass the API into _mesa_initialize_context
Emil Velikov [Sat, 25 Jan 2014 15:23:41 +0000 (15:23 +0000)]
dri/nouveau: Pass the API into _mesa_initialize_context

Currently we create a OPENGL_COMPAT context regardless of
what was requested by the program. Correct that by retaining
the program's request and passing it into _mesa_initialize_context.

Based on a similar commit for radeon/r200 by Ian Romanick.

Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoconfigure: cleanup libudev handling
Emil Velikov [Wed, 29 Jan 2014 17:19:46 +0000 (17:19 +0000)]
configure: cleanup libudev handling

Add the explicit note about the required version during configure.
Require the same version (151) of udev when building the pipe-loader.
Mention the udev version requirement in GBM Requires.private.

v2: Resolve a couple of silly typos. Spotted by Ilia
v3: Cleanup platfrom/platform typo. Spotten by Stefan

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agogbm: drop unneeded dependency of libudev
Emil Velikov [Wed, 29 Jan 2014 16:25:12 +0000 (16:25 +0000)]
gbm: drop unneeded dependency of libudev

As of recently we dlopen the library, additionally the only
code that is including the libudev.h header, is the loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoopencl: do not link against libudev
Emil Velikov [Wed, 29 Jan 2014 17:04:19 +0000 (17:04 +0000)]
opencl: do not link against libudev

Previously the linking was required due to dependency of udev in the
pipe-loader. Now this is no longer the case, as we dlopen the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agogallium/tests: do not link against libudev
Emil Velikov [Wed, 29 Jan 2014 17:03:29 +0000 (17:03 +0000)]
gallium/tests: do not link against libudev

Previously the linking was required due to dependency of udev in the
pipe-loader. Now this is no longer the case, as we dlopen the library.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoegl-static: stop linking against libudev
Emil Velikov [Wed, 29 Jan 2014 16:21:46 +0000 (16:21 +0000)]
egl-static: stop linking against libudev

No longer required since all the udev code is in the loader.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoegl_dri2: remove LIBUDEV_CFLAGS from Makefile.am
Emil Velikov [Wed, 29 Jan 2014 16:51:14 +0000 (16:51 +0000)]
egl_dri2: remove LIBUDEV_CFLAGS from Makefile.am

None of the code within builds or (explicitly) requires udev.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoconfigure: drop LIBUDEV_CFLAGS from X11_INCLUDES
Emil Velikov [Wed, 29 Jan 2014 16:49:41 +0000 (16:49 +0000)]
configure: drop LIBUDEV_CFLAGS from X11_INCLUDES

The cflags are explicitly included in the only Makefile that
handles udev dependant code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agopipe-loader: drop obsolete libudev.h include
Emil Velikov [Wed, 29 Jan 2014 16:23:42 +0000 (16:23 +0000)]
pipe-loader: drop obsolete libudev.h include

All the udev code is in the loader, so there is no
reason for us to include this header.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoconfigure: error out when building radeonsi without gallium-llvm
Emil Velikov [Fri, 7 Feb 2014 22:13:44 +0000 (22:13 +0000)]
configure: error out when building radeonsi without gallium-llvm

--enable-gallium-llvm is required by radeonsi. Currently we
check only for LLVM_VERSION_INT which is 0, whenever gallium-llvm
is disabled explicitly.

./configure --with-gallium-drivers=r600,radeonsi --disable-gallium-llvm

v2: Correct typo in error message. Spotted by Tom Stellard

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoomx/radeonsi: fix target
Christian König [Tue, 11 Feb 2014 15:58:24 +0000 (16:58 +0100)]
omx/radeonsi: fix target

Another minor typo.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agoomx: fix some minor configure.ac issues
Christian König [Tue, 11 Feb 2014 15:55:30 +0000 (16:55 +0100)]
omx: fix some minor configure.ac issues

Matt Turner noted the incorrect order, but I somehow forgotten to
change it before pushing upstream. The other one is a typo during rebase.

Signed-off-by: Christian König <christian.koenig@amd.com>
10 years agovl: add H264 encoding interface
Christian König [Mon, 15 Jul 2013 15:16:22 +0000 (09:16 -0600)]
vl: add H264 encoding interface

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
10 years agoi965: Don't call abort() on an unknown device.
Kenneth Graunke [Mon, 10 Feb 2014 09:54:23 +0000 (01:54 -0800)]
i965: Don't call abort() on an unknown device.

If we don't recognize the PCI ID, we can't reasonably load the driver.
However, calling abort() is quite rude - it means the application that
tried to initialize us (possibly the X server) can't continue via
fallback paths.  We already have a more polite mechanism - failing to
create the context.  So, just use that.

While we're at it, improve the error message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73024
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Lu Hua <huax.lu@intel.com>
10 years agoglsl: Add locking to builtin_builder singleton
Daniel Kurtz [Fri, 7 Feb 2014 11:29:06 +0000 (19:29 +0800)]
glsl: Add locking to builtin_builder singleton

Consider a multithreaded program with two contexts A and B, and the
following scenario:

1. Context A calls initialize(), which allocates mem_ctx and starts
   building built-ins.
2. Context B calls initialize(), which sees mem_ctx != NULL and assumes
   everything is already set up.  It returns.
3. Context B calls find(), which fails to find the built-in since it
   hasn't been created yet.
4. Context A finally finishes initializing the built-ins.

This will break at step 3.  Adding a lock ensures that subsequent
callers of initialize() will wait until initialization is actually
complete.

Similarly, if any thread calls release while another thread is still
initializing, or calling find(), the mem_ctx/shader would get free'd while
from under it, leading to corruption or use-after-free crashes.

Fixes sporadic failures in Piglit's glx-multithread-shader-compile.

Bugzilla: https://bugs.freedesktop.org/69200
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "10.1 10.0" <mesa-stable@lists.freedesktop.org>
10 years agoi965/fs: Simplify FS_OPCODE_SET_OMASK stride mashing a bit.
Kenneth Graunke [Mon, 10 Feb 2014 23:37:09 +0000 (15:37 -0800)]
i965/fs: Simplify FS_OPCODE_SET_OMASK stride mashing a bit.

In the first case, we can simply call stride(mask, 16, 8, 2) rather than
creating a new register with a different stride, then immediately
changing it a second time.

In the second case, the stride was already what we wanted, so we can
just use mask without any changes at all.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965/fs: Simplify FS_OPCODE_SET_SAMPLE_ID stride mashing a bit.
Kenneth Graunke [Mon, 10 Feb 2014 22:46:49 +0000 (14:46 -0800)]
i965/fs: Simplify FS_OPCODE_SET_SAMPLE_ID stride mashing a bit.

stride(brw_vec1_reg(...) ...) takes some register, changes the strides,
then changes the strides again.  Let's do it once.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agodocs/GL3.txt: denote r600g support for ARB_viewport_array
Dave Airlie [Wed, 5 Feb 2014 01:00:38 +0000 (11:00 +1000)]
docs/GL3.txt: denote r600g support for ARB_viewport_array

Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agor600g: add support for multiple viewports.
Dave Airlie [Fri, 31 Jan 2014 08:06:25 +0000 (08:06 +0000)]
r600g: add support for multiple viewports.

tested on rv635 and barts.

Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agost/mesa: add support for GL_ARB_viewport_array (v0.2)
Dave Airlie [Tue, 21 Jan 2014 05:26:29 +0000 (15:26 +1000)]
st/mesa: add support for GL_ARB_viewport_array (v0.2)

this just ties the mesa code to the pre-existing gallium interface,
I'm not sure what to do with the CSO stuff yet.

0.2: fix min/max bounds

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agost/mesa: add support for viewport index semantic
Dave Airlie [Tue, 21 Jan 2014 04:55:59 +0000 (14:55 +1000)]
st/mesa: add support for viewport index semantic

This adds GS output and FS input support, even though FS input
support isn't supported until GLSL 4.30 from what I can see.

Signed-off-by: Dave Airlie <airlied@redhat.com>
10 years agoi965: Program 2x MSAA sample positions.
Kenneth Graunke [Mon, 10 Feb 2014 00:41:30 +0000 (16:41 -0800)]
i965: Program 2x MSAA sample positions.

There are only two sensible placements for 2x MSAA samples - and one is
the mirror image of the other.  I chose (0.25, 0.25) and (0.75, 0.75).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: Store 4x MSAA sample positions in a scalar value, not an array.
Kenneth Graunke [Mon, 10 Feb 2014 00:34:22 +0000 (16:34 -0800)]
i965: Store 4x MSAA sample positions in a scalar value, not an array.

Storing a single value in an array is rather pointless.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: Duplicate less code in GetSamplePositions driver hook.
Kenneth Graunke [Mon, 10 Feb 2014 00:29:41 +0000 (16:29 -0800)]
i965: Duplicate less code in GetSamplePositions driver hook.

The 4x and 8x cases contained identical code for extracting the X and
Y sample offset values and converting them from U0.4 back to float.

Without this refactoring, we'd have to duplicate it a third time in
order to support 2x MSAA.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agonouveau/video: make sure that firmware is present when checking caps
Ilia Mirkin [Sat, 8 Feb 2014 20:22:46 +0000 (15:22 -0500)]
nouveau/video: make sure that firmware is present when checking caps

Apparently some players are ill-prepared for us claiming that a decoder
exists only to have creating it fail, and express this poor preparation
with crashes (e.g. flash). Check that firmware is there to increase the
chances of there being a high correlation between reported capabilities
and ability to create a decoder.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 10.0 10.1 <mesa-stable@lists.freedesktop.org>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agomesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.
Kenneth Graunke [Sat, 8 Feb 2014 05:53:18 +0000 (21:53 -0800)]
mesa: Fix MESA_FORMAT_Z24_UNORM_S8_UINT vs. X8_UINT mix-up.

In commit eeed49f5f290793870c60b5b635b977a732a1eb4, Mark accidentally
renamed MESA_FORMAT_S8_Z24 to MESA_FORMAT_Z24_UNORM_X8_UINT and
MESA_FORMAT_X8_Z24 to MESA_FORMAT_Z24_UNORM_S8_UINT, reversing their
sense.  The commit message was correct, but what sed commands actually
got run didn't match that.

This patch swaps the two enum names, reversing them.  This should undo
the damage, but might break things if people have manually fixed a few
instances in the meantime...

Mark's commit also failed to mention renames:
s/MESA_FORMAT_ARGB2101010_UINT\b/MESA_FORMAT_B10G10R10A2_UINT/g
s/MESA_FORMAT_ABGR2101010\b/MESA_FORMAT_R10G10B10A2_UNORM/g
but those seem okay.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agomesa: remove duplicated init of MaxViewports
Maxence Le Doré [Sun, 26 Jan 2014 10:25:44 +0000 (11:25 +0100)]
mesa: remove duplicated init of MaxViewports

Already declared 5 lines before.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agogallium: add geometry shader output limits
Grigori Goronzy [Sun, 9 Feb 2014 21:56:20 +0000 (22:56 +0100)]
gallium: add geometry shader output limits

v2: adjust limits for radeonsi and llvmpipe
v3: add documentation

Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agomesa: Removed unnecessary check for NULL pointer when freeing memory
Siavash Eliasi [Thu, 30 Jan 2014 08:08:55 +0000 (11:38 +0330)]
mesa: Removed unnecessary check for NULL pointer when freeing memory

Note that it is OK to pass NULL pointers to this function since this commit:

mesa: modified _mesa_align_free() to accept NULL pointer
http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0cc59d68a9f5231e8e2111393a1834858820735

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agonv30: report 8 maximum inputs
Ilia Mirkin [Wed, 29 Jan 2014 17:36:13 +0000 (12:36 -0500)]
nv30: report 8 maximum inputs

nvfx_fragprog_assign_generic only allows for up to 10/8 texcoords for
nv40/nv30. This fixes compilation of the varying-packing tests.
Furthermore it appears that the last 2 inputs on nv4x don't seem to
work in those tests, so just report 8 everywhere for now.

Tested on NV42, NV44. NV4B appears to have additional problems.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 9.1 9.2 10.0 10.1 <mesa-stable@lists.freedesktop.org>
10 years agonv50/ir/ra: some register spilling fixes
Christoph Bumiller [Sat, 8 Feb 2014 18:32:54 +0000 (19:32 +0100)]
nv50/ir/ra: some register spilling fixes

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
10 years agomesa: update assertion in detach_shader() for geom shaders
Brian Paul [Sat, 8 Feb 2014 20:39:45 +0000 (13:39 -0700)]
mesa: update assertion in detach_shader() for geom shaders

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74723
Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
10 years agomesa: allocate gl_debug_state on demand
Brian Paul [Fri, 7 Feb 2014 01:21:58 +0000 (18:21 -0700)]
mesa: allocate gl_debug_state on demand

We don't need to allocate all the state related to GL_ARB_debug_output
until some aspect of that extension is actually needed.

The sizeof(gl_debug_state) is huge (~285KB on 64-bit systems), not even
counting the 54(!) hash tables and lists that it contains.  This change
reduces the size of gl_context alone from 431KB bytes to 145KB bytes on
64-bit systems and from 277KB bytes to 78KB bytes on 32-bit systems.

Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: trivial clean-ups in errors.c
Brian Paul [Fri, 7 Feb 2014 01:21:58 +0000 (18:21 -0700)]
mesa: trivial clean-ups in errors.c

Whitespace changes, 78-column rewrapping, comment clean-ups, add
some braces, etc.

Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agomesa: remove _mesa_ prefix from some static functions
Brian Paul [Fri, 7 Feb 2014 01:21:58 +0000 (18:21 -0700)]
mesa: remove _mesa_ prefix from some static functions

Reviewed-by: Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Label JIP and UIP in Broadwell shader disassembly.
Kenneth Graunke [Wed, 5 Feb 2014 09:47:10 +0000 (01:47 -0800)]
i965: Label JIP and UIP in Broadwell shader disassembly.

This makes it obvious which number is which.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Don't disassemble UIP field for Broadwell WHILE instructions.
Kenneth Graunke [Wed, 5 Feb 2014 09:35:50 +0000 (01:35 -0800)]
i965: Don't disassemble UIP field for Broadwell WHILE instructions.

The WHILE instruction doesn't have UIP.  It only has JIP.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Don't print source registers for Broadwell flow control.
Kenneth Graunke [Wed, 5 Feb 2014 09:32:39 +0000 (01:32 -0800)]
i965: Don't print source registers for Broadwell flow control.

The bits which normally contain the source register descriptions
actually contain the JIP/UIP jump targets, which we already printed.

Interpreting JIP/UIP as source registers results in some really creepy
looking output, like IF statements with acc14.4<0,1,0>UD sources.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agoi965: Fix fast depth clear values on Broadwell.
Kenneth Graunke [Fri, 7 Feb 2014 21:56:27 +0000 (13:56 -0800)]
i965: Fix fast depth clear values on Broadwell.

Broadwell's 3DSTATE_CLEAR_PARAMS packet expects a floating point value
regardless of format.  This means we need to stop converting it to
UNORM.

Storing the value as float would make sense, but since we already have a
uint32_t field, this patch continues shoehorning it into that.  In a
sense, this makes mt->depth_clear_value the DWord you emit in the
packet, rather than the clear value itself.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
10 years agonvc0: handle TGSI_SEMANTIC_LAYER
Christoph Bumiller [Fri, 7 Feb 2014 22:04:43 +0000 (23:04 +0100)]
nvc0: handle TGSI_SEMANTIC_LAYER

Cc: 10.1 <mesa-stable@lists.freedesktop.org>
10 years agonvc0: create the SW object
Christoph Bumiller [Fri, 7 Feb 2014 21:51:27 +0000 (22:51 +0100)]
nvc0: create the SW object

It's required for being able to use software methods now.

10 years agonvc0/ir/emit: hardcode vertex output stream to 0 for now
Christoph Bumiller [Fri, 7 Feb 2014 21:39:44 +0000 (22:39 +0100)]
nvc0/ir/emit: hardcode vertex output stream to 0 for now

10 years agoi965: Enable ARB_texture_gather for one component on Gen6.
Chris Forbes [Sun, 2 Feb 2014 09:00:18 +0000 (22:00 +1300)]
i965: Enable ARB_texture_gather for one component on Gen6.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/vec4: Emit shader w/a for Gen6 gather
Chris Forbes [Mon, 3 Feb 2014 09:15:41 +0000 (22:15 +1300)]
i965/vec4: Emit shader w/a for Gen6 gather

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965/fs: Emit shader w/a for Gen6 gather
Chris Forbes [Mon, 3 Feb 2014 09:15:16 +0000 (22:15 +1300)]
i965/fs: Emit shader w/a for Gen6 gather

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Add surface format overrides for Gen6 gather
Chris Forbes [Mon, 3 Feb 2014 09:14:45 +0000 (22:14 +1300)]
i965: Add surface format overrides for Gen6 gather

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Add Gen6 gather wa to sampler key
Chris Forbes [Mon, 3 Feb 2014 09:13:03 +0000 (22:13 +1300)]
i965: Add Gen6 gather wa to sampler key

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoglsl: Optimize triop_csel with all-true or all-false.
Eric Anholt [Fri, 1 Nov 2013 19:29:12 +0000 (12:29 -0700)]
glsl: Optimize triop_csel with all-true or all-false.

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Optimize various cases of fma (aka MAD).
Eric Anholt [Sat, 18 Jan 2014 19:06:16 +0000 (11:06 -0800)]
glsl: Optimize various cases of fma (aka MAD).

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Optimize lrp(x, x, coefficient) --> x.
Eric Anholt [Sat, 18 Jan 2014 19:00:51 +0000 (11:00 -0800)]
glsl: Optimize lrp(x, x, coefficient) --> x.

total instructions in shared programs: 1627754 -> 1624534 (-0.20%)
instructions in affected programs:     45748 -> 42528 (-7.04%)
GAINED:                                3
LOST:                                  0

(serious sam, humus domino demo)

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Optimize pow(x, 1) -> x.
Eric Anholt [Sat, 18 Jan 2014 18:57:29 +0000 (10:57 -0800)]
glsl: Optimize pow(x, 1) -> x.

total instructions in shared programs: 1627826 -> 1627754 (-0.00%)
instructions in affected programs:     6640 -> 6568 (-1.08%)
GAINED:                                0
LOST:                                  0

(HoN and savage2)

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Optimize log(exp(x)) and exp(log(x)) into x.
Eric Anholt [Sat, 18 Jan 2014 18:47:19 +0000 (10:47 -0800)]
glsl: Optimize log(exp(x)) and exp(log(x)) into x.

Reviewed-by: Matt Turner <mattst88@gmail.com>
10 years agoglsl: Optimize ~~x into x.
Eric Anholt [Sat, 18 Jan 2014 18:36:28 +0000 (10:36 -0800)]
glsl: Optimize ~~x into x.

v2: Fix pasteo of an extra abs being inserted (caught by many).  Rewrite
    to drop the silly switch statement.

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
10 years agoi965: Add some informative debug when the X Server botches DRI2 GetBuffers.
Eric Anholt [Tue, 31 Dec 2013 02:19:21 +0000 (18:19 -0800)]
i965: Add some informative debug when the X Server botches DRI2 GetBuffers.

We've had various bug reports over the years where miptrees are missing,
and when I screwed it up while adding DRI2 to the modesetting driver, I
figured I should put the info necessary for debug here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Remove redundant check in blitter-based glBlitFramebuffer().
Eric Anholt [Mon, 30 Sep 2013 22:19:54 +0000 (15:19 -0700)]
i965: Remove redundant check in blitter-based glBlitFramebuffer().

The intel_miptree_blit() code checks the format for us now, plus it
handles xrgb vs argb for us.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agoi965: Fix Gen8+ disassembly of half float subregister numbers.
Kenneth Graunke [Wed, 29 Jan 2014 22:12:51 +0000 (14:12 -0800)]
i965: Fix Gen8+ disassembly of half float subregister numbers.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoi965: Use the new brw_load_register_mem helper for draw indirect.
Kenneth Graunke [Thu, 30 Jan 2014 04:51:28 +0000 (20:51 -0800)]
i965: Use the new brw_load_register_mem helper for draw indirect.

This makes it work on Broadwell, too.

v2: Drop bogus double write to 3DPRIM_BASE_VERTEX register
    (caught by Chris Forbes).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: Implement a brw_load_register_mem helper function.
Kenneth Graunke [Thu, 30 Jan 2014 04:43:49 +0000 (20:43 -0800)]
i965: Implement a brw_load_register_mem helper function.

This saves some boilerplate and hides the OUT_RELOC/OUT_RELOC64
distinction.

Placing the function in intel_batchbuffer.c is rather arbitrary; there
wasn't really an obvious place for it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
10 years agoi965: Fix INTEL_DEBUG=vs for fixed-function/ARB programs.
Kenneth Graunke [Mon, 3 Feb 2014 19:13:48 +0000 (11:13 -0800)]
i965: Fix INTEL_DEBUG=vs for fixed-function/ARB programs.

Since commit 9cee3ff562f3e4b51bfd30338fd1ba7716ac5737, INTEL_DEBUG=vs
has caused a NULL pointer dereference for fixed-function/ARB programs.

In the vec4 generators, "prog" is a gl_program, and "shader_prog" is the
gl_shader_program.  This is different than the FS visitor.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agoglsl: Don't lose precision qualifiers when encountering "centroid".
Kenneth Graunke [Thu, 6 Feb 2014 05:42:00 +0000 (21:42 -0800)]
glsl: Don't lose precision qualifiers when encountering "centroid".

Mesa fails to retain the precision qualifier when parsing:

   #version 300 es
   centroid in mediump vec2 v;

Consider how the parser's type_qualifier production is applied.
First, the precision_qualifier rule creates a new ast_type_qualifier:

    <precision: mediump>

Then the storage_qualifier rule creates a second one:

    <flags: in>

and calls merge_qualifier() to fold in any previous qualifications,
returning:

    <flags: in, precision: mediump>

Finally, the auxiliary_storage_qualifier creates one for "centroid":

    <flags: centroid>

it then does $$ = $1 and $$.flags |= $2.flags, resulting in:

    <flags: centroid, in>

Since precision isn't stored in the flags bitfield, it is lost.  We need
to instead call merge_qualifier to combine all the fields.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reported-by: Kevin Rogovin <kevin.rogovin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
10 years agost/mesa: avoid sw fallback for getting/decompressing textures
Brian Paul [Fri, 7 Feb 2014 16:32:05 +0000 (09:32 -0700)]
st/mesa: avoid sw fallback for getting/decompressing textures

If st_GetTexImage() is to decompress the texture, avoid the fallback
path even if prefer_blit_based_texture_transfer = false.  For drivers
that returned PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER = 0, we
were always taking the fallback path for texture decompression rather
than rendering a quad.  The later is a lot faster.

Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agogallium/tgsi: correct typo propagated from NV_vertex_program1_1
Erik Faye-Lund [Fri, 7 Feb 2014 12:45:11 +0000 (13:45 +0100)]
gallium/tgsi: correct typo propagated from NV_vertex_program1_1

In the specification text of NV_vertex_program1_1, the upper
limit of the RCC instruction is written as 1.884467e+19 in
scientific notation, but as 0x5F800000 in binary. But the binary
version translates to 1.84467e+19 rather than 1.884467e+19 in
scientific notation.

Since the lower-limit equals 2^-64 and the binary version equals
2^+64, let's assume the value in scientific notation is a typo
and implement this using the value from the binary version
instead.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agogallium/tgsi: use CLAMP instead of open-coded clamps
Erik Faye-Lund [Fri, 7 Feb 2014 12:45:10 +0000 (13:45 +0100)]
gallium/tgsi: use CLAMP instead of open-coded clamps

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoegl: Unhide functionality in _eglInitSurface()
Juha-Pekka Heikkila [Fri, 7 Feb 2014 12:44:05 +0000 (14:44 +0200)]
egl: Unhide functionality in _eglInitSurface()

_eglInitResource() was used to memset entire _EGLSurface by
writing more than size of pointed target. This does work
as long as Resource is the first element in _EGLSurface,
this patch fixes such dependency.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
10 years agoegl: Unhide functionality in _eglInitContext()
Juha-Pekka Heikkila [Fri, 7 Feb 2014 12:44:04 +0000 (14:44 +0200)]
egl: Unhide functionality in _eglInitContext()

_eglInitResource() was used to memset entire _EGLContext by
writing more than size of pointed target. This does work
as long as Resource is the first element in _EGLContext,
this patch fixes such dependency.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>