mesa.git
12 years agost/mesa: 80-column wrapping
Brian Paul [Wed, 4 Jan 2012 21:15:19 +0000 (14:15 -0700)]
st/mesa: 80-column wrapping

12 years agoRevert "configure.ac: remove deprecated --with-driver="
Kenneth Graunke [Thu, 5 Jan 2012 07:49:18 +0000 (23:49 -0800)]
Revert "configure.ac: remove deprecated --with-driver="

This reverts commit 5a478976ae0bb12dd712648d5a9b988dd29c97ef.

It broke the build.  DRI drivers were no longer being installed by
`make install` (and probably not being built at all).  It appears to be
due to a few small, subtle mistakes, and the fix isn't clear enough to
simply commit without going through review.  In the meantime, revert it.

12 years agoglsl: rename VERSION to VERSION_TOK for automake
Matt Turner [Sat, 24 Dec 2011 00:21:05 +0000 (19:21 -0500)]
glsl: rename VERSION to VERSION_TOK for automake

Signed-off-by: Matt Turner <mattst88@gmail.com>
12 years agoconfigure.ac: bump AC_PREREQ to 2.60
Matt Turner [Sat, 24 Dec 2011 00:21:04 +0000 (19:21 -0500)]
configure.ac: bump AC_PREREQ to 2.60

All other xorg modules require at least 2.60 (released in 2006), so we
may as well increase it to match.  It's also doubtful anyone tests the
build with 2.59 (from 2003), so it may not even work anyway.

12 years agoconfigure.ac: remove deprecated --with-driver=
Matt Turner [Sat, 24 Dec 2011 00:21:03 +0000 (19:21 -0500)]
configure.ac: remove deprecated --with-driver=

See 9e7a4147.

12 years agoi965: Enable EXT_texture_integer by default
Ian Romanick [Thu, 5 Jan 2012 00:51:22 +0000 (16:51 -0800)]
i965: Enable EXT_texture_integer by default

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-with-reservations-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Add missing GL_RG_INTEGER cases
Ian Romanick [Thu, 5 Jan 2012 00:08:20 +0000 (16:08 -0800)]
mesa: Add missing GL_RG_INTEGER cases

Adds two missing '|| srcFormat == GL_RG_INTEGER' in assertions and a
bunch of missing pixel converions cases.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Fix infinite loop regression in intel_miptree_all_slices_resolve.
Kenneth Graunke [Wed, 4 Jan 2012 23:45:49 +0000 (15:45 -0800)]
i965: Fix infinite loop regression in intel_miptree_all_slices_resolve.

Commit 0ed11e333147e280208d9d0b3ff3f39970547643 fixed a "use after free"
bug by getting the next pointer before deleting the current node.

Unfortunately, it also made "next" never get updated if i->need != need.

Fixes infinite loops in piglit tests fbo-depth-array and fbo-depthtex.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965/vs: Use the proper dimensionality for the sampler result register.
Kenneth Graunke [Mon, 2 Jan 2012 23:51:58 +0000 (15:51 -0800)]
i965/vs: Use the proper dimensionality for the sampler result register.

textureSize() returns an int, ivec2, or ivec3, but never an ivec4.
Creating the destination register as an ivec4 triggered later failures,
even though the register did hold the proper values.

For example, piglit test vs-textureSize-compare calls textureSize on a
2D texture and compares the result to an expected value.  Unfortunately,
our generated code also tried to compare the third and fourth components
which were undefined, and failed.

Fixes piglit test vs-textureSize-compare as well as 19 subcases of
oglconform's glsl-bif-tex-size test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44339
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Add missing _NEW_TEXTURE dirty bit to brw_vs_prog state atom.
Kenneth Graunke [Wed, 4 Jan 2012 11:14:01 +0000 (03:14 -0800)]
i965: Add missing _NEW_TEXTURE dirty bit to brw_vs_prog state atom.

Commit d45814c925dd6c479cfd383b9b59458fc4359cf7 totally added a data
dependency on _NEW_TEXTURE, even including the comment, but didn't
actually add the dirty bit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Additional error checks for transform feedback.
Paul Berry [Fri, 30 Dec 2011 18:14:35 +0000 (10:14 -0800)]
mesa: Additional error checks for transform feedback.

From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is also generated by BeginTransformFeedbackEXT
    if no binding points would be used, either because no program object is
    active or because the active program object has specified no varying
    variables to record.

    ...

    The error INVALID_VALUE is generated by BindBufferRangeEXT or
    BindBufferOffsetEXT if <offset> is not word-aligned.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors no_prog_active
- EXT_transform_feedback/api-errors interleaved_no_varyings
- EXT_transform_feedback/api-errors separate_no_varyings
- EXT_transform_feedback/api-errors bind_offset_offset_1
- EXT_transform_feedback/api-errors bind_offset_offset_2
- EXT_transform_feedback/api-errors bind_offset_offset_3
- EXT_transform_feedback/api-errors bind_offset_offset_5

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Check that all buffers are bound in BeginTransformFeedback.
Paul Berry [Thu, 29 Dec 2011 23:55:01 +0000 (15:55 -0800)]
mesa: Check that all buffers are bound in BeginTransformFeedback.

From the EXT_transform_feedback spec:

    The error INVALID_OPERATION is generated by
    BeginTransformFeedbackEXT if any transform feedback buffer object
    binding point used in transform feedback mode does not have a
    buffer object bound.

This required adding a new NumBuffers field to the
gl_transform_feedback_info struct, to keep track of how many transform
feedback buffers are required by the current program.

Fixes Piglit tests:
- EXT_transform_feedback/api-errors interleaved_unbound
- EXT_transform_feedback/api-errors separate_unbound_0_1
- EXT_transform_feedback/api-errors separate_unbound_0_2
- EXT_transform_feedback/api-errors separate_unbound_1_2

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Fix typos in transform feedback error messages.
Paul Berry [Fri, 30 Dec 2011 19:02:31 +0000 (11:02 -0800)]
mesa: Fix typos in transform feedback error messages.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Don't use base type for bit-not when there's an error
Ian Romanick [Sat, 24 Dec 2011 01:16:43 +0000 (17:16 -0800)]
glsl: Don't use base type for bit-not when there's an error

Other parts of the compiler assume that expressions will have
well-formed types or the error type.  Just using the type of the thing
being operated on can cause expressions like ~3.14 or ~false to not
have a well-formed type.  This could then result in an assertion
failure in the context epxression handler.

If there is an error processing the expression, set the type of the IR
expression to error.

Fixes piglit's bit-not-0[789].frag tests.

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42755
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Vinson Lee <vlee@vmware.com>
12 years agoglx: More hacking around versions of XCB that lack GLX_ARB_create_context support
Ian Romanick [Tue, 3 Jan 2012 19:35:59 +0000 (11:35 -0800)]
glx: More hacking around versions of XCB that lack GLX_ARB_create_context support

Detect whether a new enough version of XCB is installed at configure
time.  If it is not, don't enable the extension and don't build the
unit tests.

v2: Move the AM_CONDIATION outside the case-statement so that it is
invoked even for non-GLX builds.  This prevents build failures with
osmesa, for example.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Robert Hooker <robert.hooker@canonical.com>
12 years agogallium/util: fix argument cast in x32_s8_get_tile_rgba() call
Brian Paul [Wed, 4 Jan 2012 20:34:54 +0000 (13:34 -0700)]
gallium/util: fix argument cast in x32_s8_get_tile_rgba() call

12 years agost/mesa: remove st_CompressedTexSubImage1D/2D/3D()
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: remove st_CompressedTexSubImage1D/2D/3D()

Just use the core Mesa functions instead.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: fix indentation in st_copy_texsubimage()
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: fix indentation in st_copy_texsubimage()

12 years agost/mesa: remove st_TexImage(), use core Mesa code instead
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: remove st_TexImage(), use core Mesa code instead

The core Mesa code does the equivalent memory allocation, image mapping,
storing and unmapping.  We just need to call prep_teximage() first to
handle the 'surface_based' stuff.

The other change is to always use the level=0 mipmap image when accessing
individual mipmap level images that are stored in resources/buffers.
Apparently, we were always using malloc'd memory for individual mipmap
images, not resource buffers, before.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: refactor gl_TexImage() code into prep_teximage()
Brian Paul [Wed, 4 Jan 2012 20:30:35 +0000 (13:30 -0700)]
st/mesa: refactor gl_TexImage() code into prep_teximage()

Preparation for st_TexImage() removal/refactoring.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agointel: Re-enable GL_OES_standard_derivatives on GEN4+
Ian Romanick [Mon, 2 Jan 2012 20:48:34 +0000 (12:48 -0800)]
intel: Re-enable GL_OES_standard_derivatives on GEN4+

This extension only needs to be disabled on GEN3.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Re-allow blitting glCopyBufferSubData() on gen >= 6.
Eric Anholt [Wed, 28 Dec 2011 01:16:10 +0000 (17:16 -0800)]
intel: Re-allow blitting glCopyBufferSubData() on gen >= 6.

This was disabled a year ago due to not having a story for handling
the blitter at the time.  We're fine with using the blitter now.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Fix pitch handling for linear blits.
Eric Anholt [Wed, 28 Dec 2011 01:22:30 +0000 (17:22 -0800)]
intel: Fix pitch handling for linear blits.

The new assert in intelEmitCopyBlit() gets angry if we don't align to
dwords.  Rather than make the assert have a special case for height ==
1 on the assumption that the hardware doesn't use it in that case,
just supply a correct pitch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43214
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Fix bad read/write flags on self-copies for glCopyBufferSubData().
Eric Anholt [Wed, 28 Dec 2011 00:42:44 +0000 (16:42 -0800)]
intel: Fix bad read/write flags on self-copies for glCopyBufferSubData().

We didn't consume these flags in any way that would produce a
functional difference, but we might have some day.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoRemove xmesa_xf86.h
Adam Jackson [Wed, 4 Jan 2012 16:32:38 +0000 (11:32 -0500)]
Remove xmesa_xf86.h

This was a leftover from libGLcore.

Signed-off-by: Adam Jackson <ajax@redhat.com>
12 years agodrisw: Fix drawable creation against non-default screens
Adam Jackson [Tue, 3 Jan 2012 19:39:28 +0000 (14:39 -0500)]
drisw: Fix drawable creation against non-default screens

We don't want to match the visual against the default screen.  If the
drawable is on a non-default screen then the appropriate visual might not
exist on the default screen.  Conversely, if the same visual is
available on multiple screens then simply selecting for the right VID is
sufficient, since the server has promised that the same visual is
compatible with multiple screens.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
12 years agomesa: remove unused _mesa_init_teximage_fields() target parameter
Brian Paul [Wed, 4 Jan 2012 00:48:12 +0000 (17:48 -0700)]
mesa: remove unused _mesa_init_teximage_fields() target parameter

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
12 years agovl/mpeg2: simple fix to get xine running again
Christian König [Wed, 4 Jan 2012 14:59:29 +0000 (15:59 +0100)]
vl/mpeg2: simple fix to get xine running again

Otherwise xines xxmc plugin will just display green blocks.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoff_fragment_shader: Don't generate swizzles for scalar combiner inputs
Ian Romanick [Fri, 23 Dec 2011 01:37:26 +0000 (17:37 -0800)]
ff_fragment_shader: Don't generate swizzles for scalar combiner inputs

There are a couple scenarios where the source could be zero and the
operand could be either SRC_ALPHA or ONE_MINUS_SRC_ALPHA.  For
example, if the source was ZERO.  This would result in something like
(0).w, and a later call to ir_validate would get angry.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42517

12 years agoFix read from pointer after free
Anuj Phogat [Wed, 4 Jan 2012 02:12:06 +0000 (18:12 -0800)]
Fix read from pointer after free

Coverity reported a read from pointer after free defect in
src/mesa/drivers/dri/intel/intel_mipmap_tree.c. Bug# 44205
In intel_miptree_all_slices_resolve() function, i = i->next was
executing after freeing i. I have defined a temporary variable
(next) to store the value of i->next before freeing i

Reported-by: Vinson Lee <vlee@vmware.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoconfigure.ac: fix typo from 3ef3ba4d2
Matt Turner [Wed, 4 Jan 2012 02:58:37 +0000 (21:58 -0500)]
configure.ac: fix typo from 3ef3ba4d2

12 years agost/mesa: use SINT/UINT formats for VertexAttribIPointer
Christoph Bumiller [Tue, 3 Jan 2012 22:00:31 +0000 (23:00 +0100)]
st/mesa: use SINT/UINT formats for VertexAttribIPointer

Reviewed-by: Dave Airlie <airlied@redhat.com>
v2: added assertion that packed formats are not pure integer

12 years agotgsi/softpipe: disable FAST_MATH
Dave Airlie [Tue, 3 Jan 2012 10:38:38 +0000 (10:38 +0000)]
tgsi/softpipe: disable FAST_MATH

In the interest of softpipe preferring correctness over speed and passing more
piglit tests, set this to off by default. For speed you really want llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agosoftpipe: remove the 32bits limitation on depth(-stencil) formats
Morgan Armand [Wed, 7 Dec 2011 20:30:48 +0000 (21:30 +0100)]
softpipe: remove the 32bits limitation on depth(-stencil) formats

This patch remove the 32bits limitation. As a side effect, it bring the support for the GL_ARB_depth_buffer_float extension.
No regression have been found on piglit, and all tests for GL_ARB_depth_buffer_float pass successfully.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallium: use Haiku provided debug_printf in OS.h
Alexander von Gluck [Tue, 3 Jan 2012 15:10:42 +0000 (08:10 -0700)]
gallium: use Haiku provided debug_printf in OS.h

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agoglsl_to_tgsi: v2 Invalidate and revalidate uniform backing storage
Vadim Girlin [Thu, 22 Dec 2011 14:35:35 +0000 (18:35 +0400)]
glsl_to_tgsi: v2 Invalidate and revalidate uniform backing storage

If glUniform1i and friends are going to dump data directly in
driver-allocated, the pointers have to be updated when the storage
moves.  This should fix the regressions seen with commit 7199096.

I'm not sure if this is the only place that needs this treatment.  I'm
a little uncertain about the various functions in st_glsl_to_tgsi that
modify the TGSI IR and try to propagate changes about that up to the
gl_program.  That seems sketchy to me.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
v2:

Revalidate when shader_program is not NULL.
Update the pointers for all _LinkedShaders.
Init glsl_to_tgsi_visitor::shader_program to NULL in the
get_pixel_transfer_visitor & get_bitmap_visitor.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
12 years agoglx: Hack around versions of XCB that lack GLX_ARB_create_context support
Ian Romanick [Tue, 3 Jan 2012 01:44:31 +0000 (17:44 -0800)]
glx: Hack around versions of XCB that lack GLX_ARB_create_context support

A lot of tests in 'make check' will fail under these circumstances,
but at least the build should work.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: XCB is no longer optional for GLX or DRI
Ian Romanick [Tue, 3 Jan 2012 01:44:30 +0000 (17:44 -0800)]
mesa: XCB is no longer optional for GLX or DRI

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agointel: include version.h in intel_screen.c to silence warning
Brian Paul [Mon, 2 Jan 2012 22:20:04 +0000 (15:20 -0700)]
intel: include version.h in intel_screen.c to silence warning

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodri_util: Fix order of error and data parameters to dri2CreateContextAttribs
Ian Romanick [Mon, 2 Jan 2012 21:38:11 +0000 (13:38 -0800)]
dri_util: Fix order of error and data parameters to dri2CreateContextAttribs

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agor600g: add missing colorswaps for r8 uint/sint.
Dave Airlie [Mon, 2 Jan 2012 20:44:30 +0000 (20:44 +0000)]
r600g: add missing colorswaps for r8 uint/sint.

fixes some warnings in GL3.0 tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agotests/glx: Add unit tests for GLX_ARB_create_context GLX protocol
Ian Romanick [Fri, 16 Dec 2011 02:45:27 +0000 (18:45 -0800)]
tests/glx: Add unit tests for GLX_ARB_create_context GLX protocol

This adds a new tests directory at the top-level and some extra build
infrastructure.  The tests use the Google C++ Testing Framework, and
they will only be built if configure can detect its availability.  The
tests are automatically wired-in to run with 'make check'.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoglx: Don't use 'new' as a function parameter name
Ian Romanick [Tue, 29 Nov 2011 01:47:59 +0000 (17:47 -0800)]
glx: Don't use 'new' as a function parameter name

Using 'new' as a function parameter name prevents including
glxclient.h the unit tests (future patch) that use the Google C++
Testing Framework.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Enable GLX_EXT_create_context_es2_profile
Ian Romanick [Fri, 2 Dec 2011 22:45:11 +0000 (14:45 -0800)]
glx: Enable GLX_EXT_create_context_es2_profile

This extension is only enabled if the underlying driver advertises
support for OpenGL ES 2.0.  This happens either through the getAPIMask
function in version 2 of the DRI2 extension or implicity through
version 2 of the DRISW extension.

Since there is no OpenGL ES 2.0 protocol, this extension is marked as
only available with direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodri2: Add plumbing to get context version requirements and flags to drivers
Ian Romanick [Thu, 1 Dec 2011 22:06:58 +0000 (14:06 -0800)]
dri2: Add plumbing to get context version requirements and flags to drivers

This adds support for DRI_DRI2 version 3 to all of the DRI2 drivers.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx/dri2: Implement glx_screen_vtable::create_context_attribs for DRISW contexts
Ian Romanick [Thu, 1 Dec 2011 22:05:13 +0000 (14:05 -0800)]
glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRISW contexts

This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRISW
version 3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx/dri: Add utility function dri2_convert_glx_attribs
Ian Romanick [Thu, 1 Dec 2011 21:52:53 +0000 (13:52 -0800)]
glx/dri: Add utility function dri2_convert_glx_attribs

This converts all of the GLX data from glXCreateContextAttribsARB to
the values expected by the DRI driver interfaces.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agost/mesa: Reject forward-looking contexts
Ian Romanick [Thu, 1 Dec 2011 19:31:28 +0000 (11:31 -0800)]
st/mesa: Reject forward-looking contexts

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodri_util: Mostly stub implementation of dri2CreateContextAttribs
Ian Romanick [Thu, 1 Dec 2011 02:05:36 +0000 (18:05 -0800)]
dri_util: Mostly stub implementation of dri2CreateContextAttribs

This adds the function and modifies dri2CreateNewContextForAPI to call
it.  At this point only version 2 of the DRI2 API is advertised to the
loader.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Add extension strings for GLX_ARB_create_context and GLX_ARB_create_context_profile
Ian Romanick [Wed, 30 Nov 2011 19:12:56 +0000 (11:12 -0800)]
glx: Add extension strings for GLX_ARB_create_context and GLX_ARB_create_context_profile

Note that these extensions are not automatically enabled for screens
capable of direct-rendering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Connect glXCreateContextAttribsARB to glXGetProcAddress
Ian Romanick [Wed, 30 Nov 2011 19:12:49 +0000 (11:12 -0800)]
glx: Connect glXCreateContextAttribsARB to glXGetProcAddress

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Initial implementation of glXCreateContextAttribsARB
Ian Romanick [Wed, 30 Nov 2011 18:33:37 +0000 (10:33 -0800)]
glx: Initial implementation of glXCreateContextAttribsARB

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contexts
Ian Romanick [Wed, 30 Nov 2011 21:15:08 +0000 (13:15 -0800)]
glx/dri2: Implement glx_screen_vtable::create_context_attribs for DRI2 contexts

This also enables GLX_ARB_create_context and
GLX_ARB_create_context_profile if the driver supports DRI_DRI2 version
3 or greater.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Implement glx_screen_vtable::create_context_attribs for indirect contexts
Ian Romanick [Wed, 30 Nov 2011 21:10:17 +0000 (13:10 -0800)]
glx: Implement glx_screen_vtable::create_context_attribs for indirect contexts

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Add glx_screen_vtable::create_context_attribs
Ian Romanick [Wed, 30 Nov 2011 21:06:59 +0000 (13:06 -0800)]
glx: Add glx_screen_vtable::create_context_attribs

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Use __glX_send_client_info with XCB
Ian Romanick [Tue, 29 Nov 2011 18:57:43 +0000 (10:57 -0800)]
glx: Use __glX_send_client_info with XCB

__glX_send_client_info only supports XCB, so use that instead of
__glXClientInfo when USE_XCB is defined.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglx: Add __glX_send_client_info super function
Ian Romanick [Tue, 29 Nov 2011 01:50:07 +0000 (17:50 -0800)]
glx: Add __glX_send_client_info super function

This function picks the correct client-info protocol (based on the
server's GLX version and set of extensions) and sends it to the
server.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl-to-tgsi: handle ir_unop_round_even
Christoph Bumiller [Mon, 2 Jan 2012 20:11:45 +0000 (21:11 +0100)]
glsl-to-tgsi: handle ir_unop_round_even

12 years agoglsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced()
Bryan Cain [Mon, 2 Jan 2012 20:07:38 +0000 (14:07 -0600)]
glsl_to_tgsi: fix handling of CONT and BRK in eliminate_dead_code_advanced()

12 years agoswrast: Remove dead code in _swrast_clear_depth_buffer()
Paul Berry [Thu, 29 Dec 2011 18:15:43 +0000 (10:15 -0800)]
swrast: Remove dead code in _swrast_clear_depth_buffer()

This code was generating the gcc warning:

  variable ‘clearValue’ set but not used [-Wunused-but-set-variable]

Reviewed-by: Brian Paul <brianp@vmare.com>
12 years agoradeon: move declarations before code
Brian Paul [Mon, 2 Jan 2012 18:55:40 +0000 (11:55 -0700)]
radeon: move declarations before code

12 years agoradeon: add casts to silence warnings
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
radeon: add casts to silence warnings

12 years agoradeon: remove unused tex image function prototypes
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
radeon: remove unused tex image function prototypes

12 years agomesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
mesa: remove the dstX/Y/Zoffset params to _mesa_texstore() functions

The were always zero.  When doing a sub-texture replacement we account
for the dstX/Y/Zoffsets when we map the texture image.  So no need to
pass them into the texstore code anymore.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: pass xoffset, yoffset = 0 to _mesa_texstore()
Brian Paul [Mon, 2 Jan 2012 18:55:39 +0000 (11:55 -0700)]
intel: pass xoffset, yoffset = 0 to _mesa_texstore()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Silence gcc warning about uninitialized "inst" in assert() case.
Eric Anholt [Fri, 30 Dec 2011 07:48:24 +0000 (23:48 -0800)]
i965: Silence gcc warning about uninitialized "inst" in assert() case.

12 years agoi965: Silence gcc warning from resizing EU store changes.
Eric Anholt [Fri, 30 Dec 2011 02:12:09 +0000 (18:12 -0800)]
i965: Silence gcc warning from resizing EU store changes.

12 years agovl: seperate shader buffers from components
Christian König [Thu, 22 Dec 2011 14:43:50 +0000 (15:43 +0100)]
vl: seperate shader buffers from components

Buffers for shader based decoding can now be
released without its component still being around.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Acked-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
12 years agor300g: inline r300_resource_set_properties
Marek Olšák [Sat, 31 Dec 2011 13:05:47 +0000 (14:05 +0100)]
r300g: inline r300_resource_set_properties

12 years agor300g: rework resource_copy_region, not changing pipe_resource
Marek Olšák [Thu, 29 Dec 2011 17:18:38 +0000 (18:18 +0100)]
r300g: rework resource_copy_region, not changing pipe_resource

Changing pipe_resource was wrong, because it can be used by other contexts
at the same time. This fixes the last possible race condition in r300g
that I know of.

This also fixes blitting NPOT compressed textures. Random pixels sometimes
appeared at the right-hand edge of the texture.

Finally, this removes r300_texture_desc::stride_in_pixels. It makes little
sense with sampler views and surfaces being able to override width0, height0,
and the format entirely.

12 years agou_blitter: expose functions for setting default views and surfaces for copying
Marek Olšák [Thu, 29 Dec 2011 17:07:22 +0000 (18:07 +0100)]
u_blitter: expose functions for setting default views and surfaces for copying

And more importantly, don't call u_sampler_view_default_template etc.
it was a source of bugs.

12 years agost_glsl_to_tgsi: translate interp mode for front/back color
Dave Airlie [Sat, 31 Dec 2011 13:48:19 +0000 (13:48 +0000)]
st_glsl_to_tgsi: translate interp mode for front/back color

this fixes a bunch of interpolation tests on softpipe at least.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agosoftpipe: reorder LIT to fix fp-lit-src-equals-dst
Dave Airlie [Sat, 31 Dec 2011 13:17:23 +0000 (13:17 +0000)]
softpipe: reorder LIT to fix fp-lit-src-equals-dst

This reorders the LIT operation like the r600 one to fix the
fp-lit-src-equals-dst piglit test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agollvmpipe: fix blending for intensity formats
Dave Airlie [Fri, 30 Dec 2011 20:10:26 +0000 (20:10 +0000)]
llvmpipe: fix blending for intensity formats

This fixes the piglit fbo-blending-formats test for standard, ARB_texture_float
and EXT_texture_snorm.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agost/mesa: remove stImage->base.Face/Level assignments in st_TexImage()
Brian Paul [Fri, 30 Dec 2011 23:39:24 +0000 (16:39 -0700)]
st/mesa: remove stImage->base.Face/Level assignments in st_TexImage()

This fixes a regresssion (broken cube maps) caused by the
ctx->Driver.TexImage parameter simplification commit.  The target var
is always GL_TEXTURE_CUBE_MAP at this point so the Face field was always
getting set to zero.

These field assignments aren't needed anyway since core Mesa sets them.

12 years agou_format: fix latc fetches.
Dave Airlie [Fri, 30 Dec 2011 21:17:07 +0000 (21:17 +0000)]
u_format: fix latc fetches.

This fixes the latc fetches for llvmpipe, fixes
fbo-generatemipmap-formats GL_ARB_texture_compression
fbo-generatemipmap-formats GL_ATI_texture_compression_3dc
fbo-generatemipmap-formats GL_EXT_texture_compression_latc

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@gmail.com>
12 years agou_format/rgtc: fix alpha values in returned texels.
Dave Airlie [Fri, 30 Dec 2011 20:29:08 +0000 (20:29 +0000)]
u_format/rgtc: fix alpha values in returned texels.

This fixes fbo-generatemipmap-formats GL_EXT_texture_compression_rgtc
on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoglsl: fix usage of potentially undefined data_end union
Alexander von Gluck [Fri, 30 Dec 2011 15:48:43 +0000 (08:48 -0700)]
glsl: fix usage of potentially undefined data_end union

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()
Brian Paul [Fri, 30 Dec 2011 15:38:49 +0000 (08:38 -0700)]
st/glx/xlib: check for null attrib_list in glXCreateContextAttribsARB()

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

12 years agomesa: simplify Driver.GetCompressedTexImage() parameters
Brian Paul [Fri, 30 Dec 2011 15:24:56 +0000 (08:24 -0700)]
mesa: simplify Driver.GetCompressedTexImage() parameters

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: simplify Driver.CompressedTex[Sub]Image function parameters
Brian Paul [Fri, 30 Dec 2011 15:24:56 +0000 (08:24 -0700)]
mesa: simplify Driver.CompressedTex[Sub]Image function parameters

As with previous commits, the target, level and texObj info can be
obtained through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: simplify Driver.TexImage() parameters
Brian Paul [Fri, 30 Dec 2011 15:24:55 +0000 (08:24 -0700)]
mesa: simplify Driver.TexImage() parameters

As with TexSubImage(), the target, level and texObj values can be obtained
through the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: simplify Driver.TexSubImage() parameters
Brian Paul [Fri, 30 Dec 2011 15:24:55 +0000 (08:24 -0700)]
mesa: simplify Driver.TexSubImage() parameters

There's no need to pass the target, level and texObj parameters since
they can be easily obtained from the texImage pointer.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agost/mesa: remove TexSubImage code, use core mesa routines instead.
Brian Paul [Fri, 30 Dec 2011 15:24:55 +0000 (08:24 -0700)]
st/mesa: remove TexSubImage code, use core mesa routines instead.

Since the move to Map/UnmapTextureImage, the core mesa routines are
equivalent to what the state tracker was doing.

The TexImage functions can be replaced too, but there's a few differences
that will need to be handled.

12 years agou_format: fix inv_swizzles generation
Dave Airlie [Fri, 30 Dec 2011 10:52:16 +0000 (10:52 +0000)]
u_format: fix inv_swizzles generation

inv_swizzles is used in lp_tile_soa.py to create lp_tile_soa.c, we overwrite swizzles if they are already set.

This results in the i8 format getting alpha instead of red, and the l8 format
getting blue instead of red.

Fixes fbo-alphatest-formats, fbo-alphatest-formats ARB_texture_float,
and fbo-alphatest-formats EXT_texture_snorm on llvmpipe.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: Manage fences per screen rather than per context.
Michel Dänzer [Fri, 30 Dec 2011 09:45:31 +0000 (10:45 +0100)]
r600g: Manage fences per screen rather than per context.

A fence is a screen object and can outlive the context it was created from.
The previous code would access freed memory in that case, resulting in
various problems.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=44151
       https://bugs.freedesktop.org/show_bug.cgi?id=44007

Probably fixes: https://bugs.freedesktop.org/show_bug.cgi?id=43993

NOTE: This is a candidate for the 7.11 branch.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agoi915g: Allocate tmp for KILP
Stéphane Marchesin [Fri, 30 Dec 2011 09:33:26 +0000 (01:33 -0800)]
i915g: Allocate tmp for KILP

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=44297

12 years agovbo: introduce vbo_sizeof_ib_type() function
Yuanhan Liu [Wed, 28 Dec 2011 05:54:42 +0000 (13:54 +0800)]
vbo: introduce vbo_sizeof_ib_type() function

introduce vbo_sizeof_ib_type() function to return the index data type
size. I see some place use switch(ib->type) to get the index data type,
which is sort of duplicate.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agollvmpipe: Remove useless draw_install_pstipple_stage call.
Stéphane Marchesin [Thu, 29 Dec 2011 01:34:56 +0000 (17:34 -0800)]
llvmpipe: Remove useless draw_install_pstipple_stage call.

It is #ifdef'd out, and is already called unconditionnaly a couple lines above.

Reviewed-By: Jose Fonseca <jfonseca@vmware.com>
12 years agointel: Fix memory leak in intel_miptree_create()
Chad Versace [Tue, 27 Dec 2011 18:10:05 +0000 (10:10 -0800)]
intel: Fix memory leak in intel_miptree_create()

On failure, intel_miptree_create() needs to *release* the miptree, not
just free it, so that the stencil_mt gets released too.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/fs: Allow constant propagation into IF with embedded compare.
Eric Anholt [Mon, 19 Dec 2011 17:20:57 +0000 (09:20 -0800)]
i965/fs: Allow constant propagation into IF with embedded compare.

This saves a couple of instructions on most programs with control
flow.  More interestingly, 6 shaders from unigine sanctuary now fit
into 16-wide without register spilling.

12 years agointel: Drop the batchbuffer flush on glRenderbufferStorage().
Eric Anholt [Sat, 17 Dec 2011 00:22:33 +0000 (16:22 -0800)]
intel: Drop the batchbuffer flush on glRenderbufferStorage().

There's nothing batchbuffer-related here.  State updates by the caller
will trigger re-emitting of any new hardware state.

12 years agointel: Drop the batchbuffer flush on glFramebufferRenderbuffer().
Eric Anholt [Fri, 16 Dec 2011 21:43:26 +0000 (13:43 -0800)]
intel: Drop the batchbuffer flush on glFramebufferRenderbuffer().

There should be nothing special about this call compared to other
callers of intel_draw_buffer().

12 years agointel: Make the batchbuffer flush debug more useful.
Eric Anholt [Fri, 16 Dec 2011 21:42:39 +0000 (13:42 -0800)]
intel: Make the batchbuffer flush debug more useful.

We were printing out the line triggering the flush, but a variety of
different causes just printed the line number for intel_flush()'s call
of intel_batchbuffer_flush().  Plumb the line numbers from the caller
of intel_flush() on through.

12 years agointel: Fix performance regression in Lightsmark since HiZ changes.
Eric Anholt [Fri, 16 Dec 2011 21:18:55 +0000 (13:18 -0800)]
intel: Fix performance regression in Lightsmark since HiZ changes.

Since the refactor in d7b33309fe160212f2eb73f471f3aedcb5d0b5c1, depth
in the miptree changed from 1 to 6, so we always decided it didn't
match, and we would relayout to something that would still not
"match".

Improves performance 23.8% (+/- 1.1%, n=4)

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

12 years agointel: Don't consider miptrees for other texture targets to match.
Eric Anholt [Wed, 21 Dec 2011 23:15:09 +0000 (15:15 -0800)]
intel: Don't consider miptrees for other texture targets to match.

We would have done a relayout at validate time, but it's senseless to
store into a miptree if it's going to force relayout.

12 years agomesa: Use __builtin_ffsll on Mac OS X.
Vinson Lee [Wed, 28 Dec 2011 08:36:51 +0000 (00:36 -0800)]
mesa: Use __builtin_ffsll on Mac OS X.

Fixes this GCC warning.
arrayobj.c: In function '_mesa_update_array_object_max_element':
arrayobj.c:310: warning: implicit declaration of function 'ffsll'

Signed-off-by: Vinson Lee <vlee@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoi915g: Add missing draw_flush call.
Stéphane Marchesin [Wed, 28 Dec 2011 20:35:41 +0000 (12:35 -0800)]
i915g: Add missing draw_flush call.

Fixes a bunch of corruption bugs, especially some missing clipped triangles.

12 years agomesa: Re-add main/bitset.h to fix classic nouveau build failure.
José Fonseca [Wed, 28 Dec 2011 11:03:34 +0000 (11:03 +0000)]
mesa: Re-add main/bitset.h to fix classic nouveau build failure.

bitset.h is still used by classic nouveau -- see `git grep '\<BITSET_'`
-- and the state stored is too big to fit in 64bit integers (it requires
approximately 87 bits), so there is no obvious alternative here.

This effecively reverts commit 196800d79829a420073f762fac90090a7b416d2d.

12 years agomesa: Remove now unused main/bitset.h.
Mathias Fröhlich [Wed, 28 Dec 2011 06:14:51 +0000 (07:14 +0100)]
mesa: Remove now unused main/bitset.h.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>