platform/upstream/mesa.git
12 years agoi915: Fix piglit fbo-nodepth-test on i830.
Eric Anholt [Fri, 2 Mar 2012 21:09:51 +0000 (13:09 -0800)]
i915: Fix piglit fbo-nodepth-test on i830.

This is a direct port of fc4fba52cf7e9616c70dd76b4d6bdba6582e157b from
i915, and fixes GPU hangs when running piglit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.

12 years agovl/compositor: fix shader in/out numbering
Christian König [Fri, 2 Mar 2012 15:07:18 +0000 (16:07 +0100)]
vl/compositor: fix shader in/out numbering

Michel pointed out that my assumption of a global
index namespace is incorrect and breaks r300g.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement OutputSurfaceQueryPutBitsYCbCrCapabilities
Christian König [Mon, 27 Feb 2012 11:13:14 +0000 (12:13 +0100)]
st/vdpau: implement OutputSurfaceQueryPutBitsYCbCrCapabilities

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement OutputSurfacePutBitsYCbCr
Christian König [Mon, 27 Feb 2012 11:06:28 +0000 (12:06 +0100)]
st/vdpau: implement OutputSurfacePutBitsYCbCr

v2: the csc_matrix is optional

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement VideoSurfaceGetBitsYCbCr
Christian König [Sun, 26 Feb 2012 14:00:00 +0000 (15:00 +0100)]
st/vdpau: implement VideoSurfaceGetBitsYCbCr

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement OutputSurfaceQueryGetPutBitsNativeCapabilities
Christian König [Sun, 26 Feb 2012 12:09:12 +0000 (13:09 +0100)]
st/vdpau: implement OutputSurfaceQueryGetPutBitsNativeCapabilities

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement OutputSurfaceGetBitsNative
Christian König [Sun, 26 Feb 2012 12:01:55 +0000 (13:01 +0100)]
st/vdpau: implement OutputSurfaceGetBitsNative

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement OutputSurfacePutBitsNative
Christian König [Sun, 26 Feb 2012 11:40:47 +0000 (12:40 +0100)]
st/vdpau: implement OutputSurfacePutBitsNative

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement OutputSurfaceQueryPutBitsIndexedCapabilities
Christian König [Sun, 26 Feb 2012 11:05:52 +0000 (12:05 +0100)]
st/vdpau: implement OutputSurfaceQueryPutBitsIndexedCapabilities

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: fix default swizzle for Output/Bitmap samplers
Christian König [Mon, 27 Feb 2012 15:50:01 +0000 (16:50 +0100)]
st/vdpau: fix default swizzle for Output/Bitmap samplers

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: add support for per vertex colors
Christian König [Mon, 27 Feb 2012 15:18:09 +0000 (16:18 +0100)]
st/vdpau: add support for per vertex colors

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement BitmapSurfaceQueryCapabilities
Christian König [Sun, 26 Feb 2012 10:37:53 +0000 (11:37 +0100)]
st/vdpau: implement BitmapSurfaceQueryCapabilities

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement OutputSurfaceRenderBitmapSurface
Christian König [Sun, 26 Feb 2012 10:33:55 +0000 (11:33 +0100)]
st/vdpau: implement OutputSurfaceRenderBitmapSurface

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement BitmapSurfaceGetParameters
Christian König [Sat, 25 Feb 2012 23:34:11 +0000 (00:34 +0100)]
st/vdpau: implement BitmapSurfaceGetParameters

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement BitmapSurfacePutBitsNative
Christian König [Sat, 25 Feb 2012 23:29:59 +0000 (00:29 +0100)]
st/vdpau: implement BitmapSurfacePutBitsNative

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement BitmapSurfaceCreate/Destroy
Christian König [Sat, 25 Feb 2012 23:05:49 +0000 (00:05 +0100)]
st/vdpau: implement BitmapSurfaceCreate/Destroy

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: avoid an unnessasary copy
Christian König [Sat, 25 Feb 2012 22:34:31 +0000 (23:34 +0100)]
st/vdpau: avoid an unnessasary copy

Delay the actual mixer rendering until we really
know which surface is the real destination.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/csc: simplify matrix handling
Christian König [Wed, 29 Feb 2012 14:12:42 +0000 (15:12 +0100)]
vl/csc: simplify matrix handling

A csc matrix is only 4x3 not 4x4, also define a VDPAU compatible type for it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/compositor: add support for per layer dst areas
Christian König [Wed, 29 Feb 2012 14:54:56 +0000 (15:54 +0100)]
vl/compositor: add support for per layer dst areas

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/compositor: add per vertex color suport
Christian König [Mon, 27 Feb 2012 15:07:51 +0000 (16:07 +0100)]
vl/compositor: add per vertex color suport

Used in subtitles, for example.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/compositor: replace pipe_video_rect with u_rect
Christian König [Sat, 25 Feb 2012 12:53:29 +0000 (13:53 +0100)]
vl/compositor: replace pipe_video_rect with u_rect

So we support things like flipping also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/compositor: split shaders and state
Christian König [Sat, 25 Feb 2012 12:09:17 +0000 (13:09 +0100)]
vl/compositor: split shaders and state

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoRevert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."
Vinson Lee [Thu, 1 Mar 2012 05:20:53 +0000 (21:20 -0800)]
Revert "gallivm: Change getExtent and readByte to non-const with llvm-3.1."

This reverts commit d5a6c172547d8964f4d4bb79637651decaf9deee.

llvm-3.1svn r151687 makes MemoryObject accessor members const again.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoRevert "st/mesa: don't unreference user attribs up front."
Brian Paul [Thu, 1 Mar 2012 14:20:16 +0000 (07:20 -0700)]
Revert "st/mesa: don't unreference user attribs up front."

This reverts commit 72931ca4b9fb1002f5b62b74f7f7f32e94e80fde.

This commit caused a few piglit regressions (quad-invariance, draw-batch,
etc) with the vmware svga driver.

12 years agovl: move dirty area handling into winsys abstraction
Christian König [Sat, 25 Feb 2012 11:26:37 +0000 (12:26 +0100)]
vl: move dirty area handling into winsys abstraction

Fixing uninitialized areas in SwapBuffers mode.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: hide X latency by using asynchronous requests
Christian König [Fri, 24 Feb 2012 15:47:52 +0000 (16:47 +0100)]
vl: hide X latency by using asynchronous requests

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: use SwapBuffers instead of CopyBuffers
Christian König [Fri, 24 Feb 2012 15:12:27 +0000 (16:12 +0100)]
vl: use SwapBuffers instead of CopyBuffers

This should speed things up a bit, but also shows
some bugs with the kernel implementation.

v2: require xcb-dri2 version 1.8

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/xvmc: remove dst buffer texture workaround
Christian König [Fri, 24 Feb 2012 14:33:54 +0000 (15:33 +0100)]
st/xvmc: remove dst buffer texture workaround

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: rewrite vl DRI backend using XCB
Christian König [Thu, 23 Feb 2012 10:13:57 +0000 (11:13 +0100)]
vl: rewrite vl DRI backend using XCB

v2: also set array_size of texture

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoegl: Don't include strings.h on Windows.
José Fonseca [Thu, 1 Mar 2012 06:37:18 +0000 (06:37 +0000)]
egl: Don't include strings.h on Windows.

strings.h is needed for the declaration of strcasecmp(), but only on
non-Windows platforms.

12 years agomesa: let GL3 buf obj queries not depend on opengl major version
Yuanhan Liu [Mon, 19 Sep 2011 10:25:54 +0000 (18:25 +0800)]
mesa: let GL3 buf obj queries not depend on opengl major version

While the ARB_map_buffer_range extension spec says nothing about these
queries -- they were added in GL 3.0 --, it seems like this could be an
error in the extension spec.  This is one of the extensions, like
ARB_framebuffer_object, that "back ports" OpenGL 3.0 functionality to
previous versions.  These extensions are supposed to provide identical
functionality to OpenGL 3.0.  The other cases of mismatches have been
determined to be bugs in the extension specs.

And tools like apitrace rely on such queries to function properly.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
Acked-by: Brian Paul <brianp@vmware.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agogallivm: Update comments and prototype of vector-selects.
José Fonseca [Sat, 18 Feb 2012 12:02:17 +0000 (12:02 +0000)]
gallivm: Update comments and prototype of vector-selects.

No runtime behavior change. As vector selects are still not very well
supported by LLVM.

12 years agodocs: remove mention of components no longer in main Mesa tree
Brian Paul [Thu, 1 Mar 2012 03:53:47 +0000 (20:53 -0700)]
docs: remove mention of components no longer in main Mesa tree

12 years agost/mesa: remove old assertion
Brian Paul [Thu, 1 Mar 2012 03:53:47 +0000 (20:53 -0700)]
st/mesa: remove old assertion

12 years agor300g: init chan=0 to silence warning
Brian Paul [Thu, 1 Mar 2012 03:53:46 +0000 (20:53 -0700)]
r300g: init chan=0 to silence warning

12 years agoi965: Disable PrimitiveID upload.
Kenneth Graunke [Mon, 27 Feb 2012 19:43:10 +0000 (11:43 -0800)]
i965: Disable PrimitiveID upload.

We currently don't support gl_PrimitiveID, and I believe asking the
hardware to generate it results in vertex cache invalidations.

This could result in slowdowns for applications that use gl_InstanceID,
which would be counter-productive.  Just turn it off for now.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Enable the GL_ARB_draw_instanced extension.
Kenneth Graunke [Thu, 9 Feb 2012 00:40:31 +0000 (16:40 -0800)]
i965: Enable the GL_ARB_draw_instanced extension.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Fix swizzles for system values such as gl_InstanceID.
Kenneth Graunke [Thu, 9 Feb 2012 00:59:39 +0000 (16:59 -0800)]
i965: Fix swizzles for system values such as gl_InstanceID.

visit(ir_variable *) sets dst_reg::writemask to the appropriate channel
for system values.  Unfortunately, visit(ir_dereference_variable *) then
calls swizzle_for_size, which for a float, sets the swizzle to .x.

This works for gl_VertexID, since we store it in the .x component (see
brw_draw_upload.c:732 - VID), but fails for gl_InstanceID (IID) since we
store it in the .y channel.

To fix this, avoid calling swizzle_for_size on ir_var_system_values.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Make gl_InstanceID available with GL_ARB_draw_instanced extension
Ian Romanick [Wed, 29 Feb 2012 16:29:39 +0000 (08:29 -0800)]
glsl: Make gl_InstanceID available with GL_ARB_draw_instanced extension

Originally ARB_draw_instanced only specified that ARB decorated name.
Since no vendor actually implemented that behavior and some apps use
the undecorated name, the extension now specifies that both names are
available.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
12 years agomesa: Add missing error check for first < 0 in glDrawArraysInstanced().
Eric Anholt [Tue, 28 Feb 2012 21:33:53 +0000 (13:33 -0800)]
mesa: Add missing error check for first < 0 in glDrawArraysInstanced().

Fixes piglit GL_ARB_draw_instanced/negative-arrays-first-negative.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Fix display lists for draw_elements_base_vertex with draw_instanced.
Eric Anholt [Tue, 28 Feb 2012 21:33:52 +0000 (13:33 -0800)]
mesa: Fix display lists for draw_elements_base_vertex with draw_instanced.

Fixes piglit GL_ARB_draw_elements_base_vertex/dlist-arb_draw_instanced

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Fix display list handling for GL_ARB_draw_instanced.
Eric Anholt [Tue, 28 Feb 2012 21:33:51 +0000 (13:33 -0800)]
mesa: Fix display list handling for GL_ARB_draw_instanced.

When you called them in a display list compile before, you would just
end up calling through NULL.

Fixes piglit GL_ARB_draw_instanced/dlist.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Fix typo in comment.
Eric Anholt [Tue, 28 Feb 2012 21:33:50 +0000 (13:33 -0800)]
mesa: Fix typo in comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Fix Gen6+ dynamic state upper bound on older kernels.
Kenneth Graunke [Wed, 29 Feb 2012 20:32:41 +0000 (12:32 -0800)]
i965: Fix Gen6+ dynamic state upper bound on older kernels.

Kernels prior to 271d81b84171d84723357ae6d172ec16b0d8139c (March 2011)
don't support relocations outside of the target buffer object.  Rather
than guarding this with a I915_PARAM_HAS_RELAXED_DELTA check, just
smash the bound to 0xfffff001 like we do on Ironlake.

This effectively gives us no upper bound check, just like we did prior
to commit 271d81b84171d84723357ae6d172ec16b0d8139c.

Daniel Vetter would also like to mention that this relies on the guard
page at the end of the GTT.

NOTE: This is a candidate for release branches.
Fixes a regression since 271d81b84171d84723357ae6d172ec16b0d8139c.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46766
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 years agoegl/drivers: Convert to automake.
Eric Anholt [Mon, 6 Feb 2012 11:12:53 +0000 (12:12 +0100)]
egl/drivers: Convert to automake.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoegl/main: Convert to automake.
Eric Anholt [Sun, 5 Feb 2012 09:46:13 +0000 (10:46 +0100)]
egl/main: Convert to automake.

The drivers/ walk-through-subdirs makefile is converted as well so I
didn't need to keep EGL_DRIVERS_DIRS along with the per-driver
HAVE_EGL_DRIVER_WHATEVER.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoegl: Clean up some flow of EGL platform handling.
Eric Anholt [Sun, 5 Feb 2012 06:54:38 +0000 (07:54 +0100)]
egl: Clean up some flow of EGL platform handling.

The default case code was set up in a separate way, while this makes
it more normal.  I wanted to add code to the explicit x11 platform and
default x11 platform cases in the next commit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoegl: Drop the non-builtin-drivers support.
Eric Anholt [Sun, 5 Feb 2012 06:06:56 +0000 (07:06 +0100)]
egl: Drop the non-builtin-drivers support.

The two drivers both did builtin mode, so drop the non-builtin build
system.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoegl: Drop _EGL_MAIN entrypoint obfuscation.
Eric Anholt [Sun, 5 Feb 2012 06:01:17 +0000 (07:01 +0100)]
egl: Drop _EGL_MAIN entrypoint obfuscation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglx: Convert to automake.
Eric Anholt [Sun, 5 Feb 2012 05:10:56 +0000 (06:10 +0100)]
glx: Convert to automake.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Push the shine table into the tnl module.
Mathias Fröhlich [Wed, 29 Feb 2012 17:19:35 +0000 (18:19 +0100)]
mesa: Push the shine table into the tnl module.

All users of the shine table outside of the tnl module
are gone. Move the implementation into the tnl module and
prefix the public functions with _tnl.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Do not invalidate shine tables in compute light positions.
Mathias Fröhlich [Wed, 29 Feb 2012 17:19:34 +0000 (18:19 +0100)]
mesa: Do not invalidate shine tables in compute light positions.

Since the shine tables are now only used in the tnl lighting stage, where
they are validated through the tnl driver function NotifyMaterialChange
called in tnl/t_vb_light.c, we can not omit calling
_mesa_validate_all_lighting_tables (which only validates the shine tables)
in main/light.c.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Avoid revalidating shine tables in _tnl_RasterPos.
Mathias Fröhlich [Wed, 29 Feb 2012 17:19:34 +0000 (18:19 +0100)]
mesa: Avoid revalidating shine tables in _tnl_RasterPos.

Now that _tnl_RasterPos no longer uses the shine tables, avoid
revalidating them.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Avoid using the shine table for _tnl_RasterPos
Mathias Fröhlich [Wed, 29 Feb 2012 17:19:34 +0000 (18:19 +0100)]
mesa: Avoid using the shine table for _tnl_RasterPos

Use direct computation of pow for computing the shininess
in _tnl_RasterPos. Since the _tnl_RasterPos function is still
used by plenty drivers that do only need the shine table for
_tnl_RasterPos but do not make use of swtnl computations, this
enables pushing down the shine table computation and validation
into the tnl module, which will happen in a followup change.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Avoid explicit invalidation of shine tables.
Mathias Fröhlich [Wed, 29 Feb 2012 17:19:34 +0000 (18:19 +0100)]
mesa: Avoid explicit invalidation of shine tables.

Since the shine tables are implicitly invalidated by having
a different shininess value than the current one, we can
omit the explicit invalidation of the shine table.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Remove gl_light_attrib::_Flags.
Mathias Fröhlich [Wed, 29 Feb 2012 17:19:33 +0000 (18:19 +0100)]
mesa: Remove gl_light_attrib::_Flags.

This variable is only used locally in _mesa_update_lighting.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agomesa: Remove _CosCutoffNeg from light state.
Mathias Fröhlich [Wed, 29 Feb 2012 17:19:33 +0000 (18:19 +0100)]
mesa: Remove _CosCutoffNeg from light state.

It is only used as a temporary variable during computation of
_CosCutoff. So, don't store it.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
12 years agoutil: replace format equality test with compatibility test in blit code
Brian Paul [Tue, 28 Feb 2012 14:48:34 +0000 (07:48 -0700)]
util: replace format equality test with compatibility test in blit code

This lets us use the resource_copy_region() path when blitting from
R8G8B8A8 to R8G8B8x8, for example.

v2: be smarter when src_format==dst_format

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoutil: better comment for util_is_format_compatible()
Brian Paul [Tue, 28 Feb 2012 14:45:17 +0000 (07:45 -0700)]
util: better comment for util_is_format_compatible()

12 years agomesa: use arrayObj var in more places in client_state()
Brian Paul [Tue, 28 Feb 2012 03:28:09 +0000 (20:28 -0700)]
mesa: use arrayObj var in more places in client_state()

12 years agomesa: asst. fixes for texture arrays and borders
Brian Paul [Tue, 28 Feb 2012 03:28:09 +0000 (20:28 -0700)]
mesa: asst. fixes for texture arrays and borders

For 1D array textures, there is no border on the height dimension.
For 2D array textures, there is no border on the depth dimension.

12 years agomesa: check for no state change in VertexAttribDivisor()
Brian Paul [Tue, 28 Feb 2012 03:28:09 +0000 (20:28 -0700)]
mesa: check for no state change in VertexAttribDivisor()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoutil: fix assertions in u_blitter.c code
Brian Paul [Tue, 28 Feb 2012 03:28:09 +0000 (20:28 -0700)]
util: fix assertions in u_blitter.c code

Assertions of the form assert(a && b) should be written as separate assertions
so that you can actually tell which part is false when there's a failure.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
12 years agomesa: reorder things in mtypes.h
Brian Paul [Tue, 28 Feb 2012 03:28:09 +0000 (20:28 -0700)]
mesa: reorder things in mtypes.h

Move structs, enums, etc so they're in more logical order.  In particular,
the shader and transform feedback-related structs/enums were pretty
scattered around.

12 years agosvga: fix max_lod clamping in update_tss_binding()
Brian Paul [Wed, 29 Feb 2012 14:52:18 +0000 (07:52 -0700)]
svga: fix max_lod clamping in update_tss_binding()

After biasing we need to clamp to be sure we don't exceed the number of
levels in the mipmap.  This fixes an assertion at svga_sampler_view.c:70

v2: simplify the biasing, clamping code per Jose's suggestion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agost/vdpau: fix use of *.o in Makefile.vdpau
Christian König [Tue, 21 Feb 2012 13:09:42 +0000 (14:09 +0100)]
st/vdpau: fix use of *.o in Makefile.vdpau

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/xvmc: fix use of *.o in Makefile.xvmc
Christian König [Tue, 21 Feb 2012 13:08:14 +0000 (14:08 +0100)]
st/xvmc: fix use of *.o in Makefile.xvmc

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoi965: Avoid blocking on the GPU for setting the HiZ op vertex data.
Eric Anholt [Mon, 27 Feb 2012 17:52:05 +0000 (09:52 -0800)]
i965: Avoid blocking on the GPU for setting the HiZ op vertex data.

We need to allocate new space every time to avoid blocking on the last
HiZ op completing.  There are two easy ways to do this:
brw_state_batch() and intel_upload_data().  brw_state_batch() is
simpler and avoids another buffer allocation.

Improves Unigine Tropics performance 0.376416% +/- 0.148722% (n=7).

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglcpp: Don't strlen() the output for every token being printed.
Kenneth Graunke [Fri, 10 Feb 2012 04:33:44 +0000 (20:33 -0800)]
glcpp: Don't strlen() the output for every token being printed.

The ralloc string appending functions were originally intended for
simple, non-hot-path uses like printing to an info log.

Cuts Unigine Tropics load time by around 20% (6 seconds).

v2: Avoid strlen() on every newline, too.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
12 years agoralloc: Make rewrite_tail increase "start" by the new text's length.
Kenneth Graunke [Fri, 10 Feb 2012 04:03:36 +0000 (20:03 -0800)]
ralloc: Make rewrite_tail increase "start" by the new text's length.

Both callers of rewrite_tail immediately compute the new total string
length by adding the (known) length of the existing string plus the
length of the newly appended text.  Unfortunately, callers generally
won't know the length of the new text, as it's printf-formatted.

Since ralloc already computes this length, it makes sense to add it in
and save the caller the effort.  This simplifies both existing callers,
but more importantly, will allow for cheap-appending in the next commit.

v2: The link_uniforms code needs both the old and new length.
    Apply the obvious fix (which sadly makes it less of a cleanup).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
12 years agogallivm: add major integer opcodes to the tgsi action handler
Dave Airlie [Mon, 6 Feb 2012 16:32:59 +0000 (16:32 +0000)]
gallivm: add major integer opcodes to the tgsi action handler

This adds support for all the opcodes needed for native integer
support with GLSL 1.20 enabled, and some of the ones for GLSL1.30
support.

I've split them between non-cpu and cpu along the same lines
Tom's code did for the other ones I think, but I'm open to review
on which ones should go where.

With instance ids fixed I get no regressions on my box here
with LLVM 2.8, will test with later LLVMs as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: drop deprecated opcodes
Dave Airlie [Tue, 28 Feb 2012 11:00:03 +0000 (11:00 +0000)]
gallivm: drop deprecated opcodes

These are integer opcodes not deprecated ones.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: only do rcp/mul for floating
Dave Airlie [Tue, 28 Feb 2012 11:23:04 +0000 (11:23 +0000)]
gallivm: only do rcp/mul for floating

rcp asserts on type.floating so don't go passing non-floating
things into it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agosvga: Advertise SVGA3D_DEVCAP_MAX_POINT_SIZE.
José Fonseca [Mon, 27 Feb 2012 11:12:12 +0000 (11:12 +0000)]
svga: Advertise SVGA3D_DEVCAP_MAX_POINT_SIZE.

Backends usually advertise a SVGA3D_DEVCAP_MAX_POINT_SIZE between 63 and
256, so an hardcoded max point size of 80 is often incorrect.

This limitation does not apply for anti-aliased points (as they are done
via draw module) but we still advertise the same limit for both, because
all others pipe drivers do.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Don't disable fast path for normalized types
Neil Roberts [Sun, 26 Feb 2012 01:33:40 +0000 (01:33 +0000)]
mesa: Don't disable fast path for normalized types

Mesa has a fast path for the generic fallback when using glReadPixels
for RGBA data which uses memcpy.  However it was really difficult to
hit this case because it would not be used if any transferOps are
enabled.  Any type apart from floating point or non-normalized integer
types (so any of the common types) would force enabling clamping so
the fast path could not be used.  This patch makes it ignore clamping
when determining whether to use the fast path if the data type of the
buffer is an unsigned normalized type because in that case clamping
will not have any effect anyway.

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

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agogallium: remove trailing comma to silence warning
Brian Paul [Tue, 28 Feb 2012 14:54:43 +0000 (07:54 -0700)]
gallium: remove trailing comma to silence warning

12 years agomesa: minor comment, whitespace fixes in teximage.c
Brian Paul [Tue, 28 Feb 2012 14:51:01 +0000 (07:51 -0700)]
mesa: minor comment, whitespace fixes in teximage.c

12 years agogallivm: add frem support to the lp_build_mod helper.
Dave Airlie [Tue, 28 Feb 2012 10:43:14 +0000 (10:43 +0000)]
gallivm: add frem support to the lp_build_mod helper.

for completeness.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: add bitarit xor and not ops.
Dave Airlie [Fri, 17 Feb 2012 19:02:21 +0000 (19:02 +0000)]
gallivm: add bitarit xor and not ops.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agost/mesa: don't unreference user attribs up front.
Dave Airlie [Thu, 9 Feb 2012 19:44:55 +0000 (19:44 +0000)]
st/mesa: don't unreference user attribs up front.

postpone unreferences until end of function, as the ones in use will
get naturally dereferenced.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa/vbo: inline vbo_sizeof_ib_type.
Dave Airlie [Thu, 9 Feb 2012 19:44:56 +0000 (19:44 +0000)]
mesa/vbo: inline vbo_sizeof_ib_type.

Can't see any reason this wouldn't be better off as an inline.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallivm: add integer and unsigned mod arit functions. (v2)
Dave Airlie [Fri, 17 Feb 2012 19:02:23 +0000 (19:02 +0000)]
gallivm: add integer and unsigned mod arit functions. (v2)

use a single entry point, as per Jose's suggestion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agotgsi: remove trailing comma to silence warning
Brian Paul [Tue, 28 Feb 2012 03:28:09 +0000 (20:28 -0700)]
tgsi: remove trailing comma to silence warning

12 years agoxlib: silence unused var warning
Brian Paul [Tue, 28 Feb 2012 03:28:09 +0000 (20:28 -0700)]
xlib: silence unused var warning

12 years agosvga: Remove unused SVGA_TEX_UNITS constant.
José Fonseca [Mon, 27 Feb 2012 18:52:00 +0000 (18:52 +0000)]
svga: Remove unused SVGA_TEX_UNITS constant.

12 years agosvga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.
José Fonseca [Mon, 27 Feb 2012 11:21:32 +0000 (11:21 +0000)]
svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.

Some backends may advertise more temps than SVGA3D_TEMPREG_MAX, but the
driver is hardwired to only support up to the value defined by
SVGA3D_TEMPREG_MAX, so clamp to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agor600g: use u_default_transfer_flush_region for all resource types
Marek Olšák [Sun, 26 Feb 2012 18:15:45 +0000 (19:15 +0100)]
r600g: use u_default_transfer_flush_region for all resource types

12 years agor600g: use u_default_transfer_inline_write for all resource types
Marek Olšák [Sun, 26 Feb 2012 18:00:26 +0000 (19:00 +0100)]
r600g: use u_default_transfer_inline_write for all resource types

12 years agogallium/util: add fast path for buffers in u_default_transfer_inline_write
Marek Olšák [Sun, 26 Feb 2012 17:56:51 +0000 (18:56 +0100)]
gallium/util: add fast path for buffers in u_default_transfer_inline_write

v2: fix indentation, add assertions

12 years agogallium/util: set correct usage flags in u_default_transfer_inline_write
Marek Olšák [Sun, 26 Feb 2012 17:48:42 +0000 (18:48 +0100)]
gallium/util: set correct usage flags in u_default_transfer_inline_write

The DISCARD flags should improve performance in drivers which handle them.

12 years agor600g: fix streamout cache flush for r600
Marek Olšák [Sun, 26 Feb 2012 16:07:52 +0000 (17:07 +0100)]
r600g: fix streamout cache flush for r600

Figured out by trial and error.

12 years agovl: fix a douple free in xsp winsys backend
Christian König [Mon, 27 Feb 2012 11:57:24 +0000 (12:57 +0100)]
vl: fix a douple free in xsp winsys backend

There are a couple of more bugs, but it is only
useful for debugging anyway.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: adjust matrix and median filter to removal of PIPE_SHADER_CAP_OUTPUT_READ
Christian König [Mon, 27 Feb 2012 11:53:49 +0000 (12:53 +0100)]
vl: adjust matrix and median filter to removal of PIPE_SHADER_CAP_OUTPUT_READ

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agor600g: cleanup r600_transfer_struct
Marek Olšák [Sun, 26 Feb 2012 18:44:45 +0000 (19:44 +0100)]
r600g: cleanup r600_transfer_struct

Especially rename staging_texture to staging and change its type
to r600_resource. I will reuse it for buffers later.

12 years agor600g: check for R600_STREAMOUT env var in winsys
Marek Olšák [Thu, 23 Feb 2012 23:38:33 +0000 (00:38 +0100)]
r600g: check for R600_STREAMOUT env var in winsys

12 years agor600g: move initialization of use_surface flag into screen_create
Marek Olšák [Fri, 24 Feb 2012 16:17:57 +0000 (17:17 +0100)]
r600g: move initialization of use_surface flag into screen_create

Also change the type to bool and give it a less ambiguous name.

12 years agor600g: properly check whether texture is busy in get_transfer
Marek Olšák [Fri, 24 Feb 2012 16:14:59 +0000 (17:14 +0100)]
r600g: properly check whether texture is busy in get_transfer

12 years agor600g: rename r600_resource_texture::depth to bool is_depth
Marek Olšák [Fri, 24 Feb 2012 16:13:19 +0000 (17:13 +0100)]
r600g: rename r600_resource_texture::depth to bool is_depth

It's used as a boolean.

12 years agogallium: remove PIPE_SHADER_CAP_OUTPUT_READ
Marek Olšák [Thu, 23 Feb 2012 22:44:36 +0000 (23:44 +0100)]
gallium: remove PIPE_SHADER_CAP_OUTPUT_READ

r600g is the only driver which has made use of it. The reason the CAP was
added was to fix some piglit tests when the GLSL pass lower_output_reads
didn't exist.

However, not removing output reads breaks the fallback for glClampColorARB,
which assumes outputs are not readable. The fix would be non-trivial
and my personal preference is to remove the CAP, considering that reading
outputs is uncommon and that we can now use lower_output_reads to fix
the issue that the CAP was supposed to workaround in the first place.

12 years agogallium/rtasm: properly detect SSE and SSE2
Marek Olšák [Fri, 24 Feb 2012 18:29:48 +0000 (19:29 +0100)]
gallium/rtasm: properly detect SSE and SSE2

This should fix crashes on ancient processors.