mesa.git
12 years agowayland: Stop using wl_buffer.damage
Kristian Høgsberg [Tue, 27 Mar 2012 12:09:32 +0000 (08:09 -0400)]
wayland: Stop using wl_buffer.damage

12 years agoAdd support for GL_EXT_unpack_subimage on GLES2
Neil Roberts [Wed, 21 Mar 2012 18:08:42 +0000 (18:08 +0000)]
Add support for GL_EXT_unpack_subimage on GLES2

This extension just permits GL_UNPACK_ROW_LENGTH, GL_UNPACK_SKIP_ROWS
and GL_UNPACK_SKIP_PIXELS to be passed to glPixelStore on GLES2 so it
is trivial to implement.

12 years agogles: Enable the GL_EXT_read_format_bgra extension
Benjamin Franzke [Sat, 24 Mar 2012 07:50:47 +0000 (08:50 +0100)]
gles: Enable the GL_EXT_read_format_bgra extension

Also fixes the usage of GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES,
which may be set to a BGRA format e.g. for a MESA_FORMAT_ARGB8888 fb.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agogles1: Enable GL_EXT_texture_format_BGRA8888 in APIspec
Benjamin Franzke [Sat, 24 Mar 2012 07:57:12 +0000 (08:57 +0100)]
gles1: Enable GL_EXT_texture_format_BGRA8888 in APIspec

The extension is already exposed for GLES1, but the APIspec
doesnt allow the usage of GL_BGRA_EXT in glTex(Sub)Image2D.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglapi: regenerate enums.c
Dylan Noblesmith [Mon, 26 Mar 2012 21:32:36 +0000 (21:32 +0000)]
glapi: regenerate enums.c

For previous four commits:

    glapi: add GL_ARB_texture_float
    glapi: add GL_ARB_depth_buffer_float
    glapi: add GL_ARB_texture_compression_rgtc
    glapi: add ARB_texture_rg

12 years agoglapi: add GL_ARB_texture_float
Dylan Noblesmith [Tue, 17 Jan 2012 02:12:19 +0000 (02:12 +0000)]
glapi: add GL_ARB_texture_float

And add some missing core GL 3.0 enums that came from this
extension, too.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglapi: add GL_ARB_depth_buffer_float
Dylan Noblesmith [Tue, 17 Jan 2012 02:03:21 +0000 (02:03 +0000)]
glapi: add GL_ARB_depth_buffer_float

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglapi: add GL_ARB_texture_compression_rgtc
Dylan Noblesmith [Mon, 16 Jan 2012 21:45:22 +0000 (21:45 +0000)]
glapi: add GL_ARB_texture_compression_rgtc

Noticed this was missing when writing the "glapi: sort ARB extensions
by number" commit, which at least shows it was effective.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglapi: add ARB_texture_rg
Dylan Noblesmith [Mon, 16 Jan 2012 21:41:54 +0000 (21:41 +0000)]
glapi: add ARB_texture_rg

Noticed it was missing based on the lack of a descriptive enum
name from this bug's error message:

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

This moves two enums out of GL3x.xml. Though since this and
GL_ARB_texture_compression_rgtc are both strict subsets of GL3,
both extensions should have had all their enums in that file
to begin with, not just two of them.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoregen for "glapi: sort ARB extensions by number"
Dylan Noblesmith [Mon, 26 Mar 2012 21:28:10 +0000 (21:28 +0000)]
regen for "glapi: sort ARB extensions by number"

12 years agoglapi: sort ARB extensions by number
Dylan Noblesmith [Mon, 16 Jan 2012 21:32:52 +0000 (21:32 +0000)]
glapi: sort ARB extensions by number

And add comments to fill in for extensions that aren't there.

Noticed the comment about "ARB extensions sorted by extension number"
didn't extend to the <xi:include> directives when it became clear
GL_ARB_texture_rg was missing, going by the error message seen here:

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

This makes it easier to notice in the future if an extension is missing
when it shouldn't be.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Fix memory leak in generate_mipmap_compressed.
Vinson Lee [Sat, 24 Mar 2012 06:11:09 +0000 (23:11 -0700)]
mesa: Fix memory leak in generate_mipmap_compressed.

Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: fix linker error message context for frag shader output.
Dave Airlie [Sun, 20 Nov 2011 19:56:35 +0000 (19:56 +0000)]
glsl: fix linker error message context for frag shader output.

A later error prints this properly, fix this case to do the same.

v2: remove attribute as per Ian's suggestion
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglapi: ARB_blend_func_extended support + regen. (v2)
Dave Airlie [Sat, 19 Nov 2011 13:17:07 +0000 (13:17 +0000)]
glapi: ARB_blend_func_extended support + regen. (v2)

This adds the xml file covering ARB_blend_func_extended.

v2: fix SRC1_ALPHA

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoglsl: Make ir_dereference_variable ctor assert the variable exists.
Kenneth Graunke [Tue, 13 Mar 2012 20:05:16 +0000 (13:05 -0700)]
glsl: Make ir_dereference_variable ctor assert the variable exists.

This also seems like a bad idea.  There were too many instances for me
to thoroughly scan the code as I did with the last two patches, but a
quick scan indicated that most callers newly allocate a variable,
dereference it, or NULL-check.  In some cases, it wasn't clear that the
value would be non-NULL, but they didn't check for error_type either.

At any rate, not checking for this is a bug, and assertions will trigger
it earlier and more reliably than returning error_type.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Explicitly NULL-check variables before making a dereference.
Kenneth Graunke [Tue, 13 Mar 2012 21:59:42 +0000 (14:59 -0700)]
glsl: Explicitly NULL-check variables before making a dereference.

The constructor currently returns a ir_dereference_variable of error
type when provided NULL, but that's about to change in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Make ir_dereference_record constructor assert the variable exists.
Kenneth Graunke [Tue, 13 Mar 2012 19:51:15 +0000 (12:51 -0700)]
glsl: Make ir_dereference_record constructor assert the variable exists.

Providing a NULL pointer to the ir_dereference_record() constructor
seems like a bad idea.  Currently, if provided NULL, it returns a
partially constructed value of error type.  However, none of the callers
are prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Make ir_dereference_array constructor assert the variable exists.
Kenneth Graunke [Tue, 13 Mar 2012 19:39:32 +0000 (12:39 -0700)]
glsl: Make ir_dereference_array constructor assert the variable exists.

Providing a NULL pointer to the ir_dereference_array() constructor seems
like a bad idea.  Currently, if provided NULL, it returns a partially
constructed value of error type.  However, none of the callers are
prepared to handle that scenario.

Code inspection shows that all callers do one of the following:
- Already NULL-check the argument prior to creating the dereference
- Already deference the argument (and thus would crash if it were NULL)
- Newly allocate the argument.

Thus, it should be safe to simply assert the value passed is not NULL.
This should also catch issues right away, rather than dying later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Comment that expression flattening is used for matrix operations.
Kenneth Graunke [Tue, 13 Mar 2012 18:42:26 +0000 (11:42 -0700)]
glsl: Comment that expression flattening is used for matrix operations.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agost/vdpau: clear video surface at least once
Christian König [Sat, 24 Mar 2012 12:11:25 +0000 (13:11 +0100)]
st/vdpau: clear video surface at least once

So if anything goes wrong we won't display a random image.

v2: flush before using the surface with the decoder.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: invert interlaced buffer checks
Christian König [Sat, 24 Mar 2012 12:08:01 +0000 (13:08 +0100)]
st/vdpau: invert interlaced buffer checks

That wasn't working as supposed.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agointel: fix TFP at 16-bpp
Dave Airlie [Fri, 23 Mar 2012 16:17:33 +0000 (16:17 +0000)]
intel: fix TFP at 16-bpp

don't ask why I had to debug this.

tested to fix g-s and kwin at 16-bpp on Ironlake.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodrisw: fix image stride calculation for 16-bit.
Dave Airlie [Thu, 22 Mar 2012 11:56:43 +0000 (11:56 +0000)]
drisw: fix image stride calculation for 16-bit.

If you ran g-s in 16-bpp we'd do a bunch of memory corruption.

now it just misrenders for some other reasons.

applies to stable.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: fix compiling warning from gcc 4.7
Dave Airlie [Tue, 13 Mar 2012 16:05:26 +0000 (16:05 +0000)]
glsl: fix compiling warning from gcc 4.7

ir_validate.cpp: In member function ‘virtual ir_visitor_status ir_validate::visit_leave(ir_swizzle*)’:
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::x’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::y’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::z’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]
ir_validate.cpp:458:66: warning: narrowing conversion of ‘ir->ir_swizzle::mask.ir_swizzle_mask::w’ from ‘unsigned int’ to ‘int’ inside { } is ill-formed in C++11 [-Wnarrowing]

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: initialise const force glsl extension warning in fake ctx
Dave Airlie [Tue, 13 Mar 2012 14:53:25 +0000 (14:53 +0000)]
glsl: initialise const force glsl extension warning in fake ctx

valgrind complained about an uninitialised value being used in
glsl_parser_extras.cpp, and this was the one it was giving out about.

Just initialise the value in the fakectx.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomakefile: add phony am--refresh target
Dave Airlie [Sun, 26 Feb 2012 20:20:19 +0000 (20:20 +0000)]
makefile: add phony am--refresh target

for some reason when I configure --with-dri-drivers="" the src/mesa/drivers/dri
Makefile tries to call the am--refresh target in the toplevel Makefile,
we don't have one, and I'm not sure what it should look like.

This makes things continue on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agodocs/GL3.txt: document ARB_blend_func_extended state
Dave Airlie [Sat, 24 Mar 2012 16:34:47 +0000 (16:34 +0000)]
docs/GL3.txt: document ARB_blend_func_extended state

I've written softpipe version in my tree, + gallium/mesa/glsl changes,
however r600 currently hangs the GPU.

12 years agoglx/drisw: avoid segfaults when we fail to get visual
Dave Airlie [Fri, 23 Mar 2012 18:37:16 +0000 (18:37 +0000)]
glx/drisw: avoid segfaults when we fail to get visual

piglit glx-tfp segfaults on llvmpipe when run vs a 16-bit radeon screen,

it now fails instead of segfaulting, much prettier.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: Fix memory leak in _mesa_get_uniform_location.
Vinson Lee [Fri, 23 Mar 2012 06:59:52 +0000 (23:59 -0700)]
mesa: Fix memory leak in _mesa_get_uniform_location.

Fixes Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agost/mesa: fix mipmap image size computation w.r.t. texture arrays
Brian Paul [Fri, 23 Mar 2012 14:16:58 +0000 (08:16 -0600)]
st/mesa: fix mipmap image size computation w.r.t. texture arrays

The image height or depth is the array_size for array textures.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47742

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agomesa: set numFaces=6 for cube maps in _mesa_test_texobj_completeness()
Brian Paul [Fri, 23 Mar 2012 14:16:32 +0000 (08:16 -0600)]
mesa: set numFaces=6 for cube maps in _mesa_test_texobj_completeness()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agointel: fix null dereference processing HiZ buffer
Dylan Noblesmith [Fri, 16 Mar 2012 18:38:49 +0000 (18:38 +0000)]
intel: fix null dereference processing HiZ buffer

Or technically, a near-null dereference.

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

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agodocs: fix html in bugs.html
Christopher Yeleighton [Thu, 22 Mar 2012 14:15:04 +0000 (08:15 -0600)]
docs: fix html in bugs.html

https://bugs.freedesktop.org/show_bug.cgi?id=47310
Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agost/vdpau: improve frame dumping functionality a bit
Christian König [Thu, 15 Mar 2012 10:14:47 +0000 (11:14 +0100)]
st/vdpau: improve frame dumping functionality a bit

Just a workaround until we get a real unit-
testing tool for VDPAU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: add VC-1 startcode if none is found in the stream
Christian König [Thu, 15 Mar 2012 10:58:37 +0000 (11:58 +0100)]
st/vdpau: add VC-1 startcode if none is found in the stream

v2: only advanced profile needs that.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoglx: Fix glXGetProcAddress() of global glX symbols post-automake conversion.
Eric Anholt [Tue, 20 Mar 2012 20:51:31 +0000 (13:51 -0700)]
glx: Fix glXGetProcAddress() of global glX symbols post-automake conversion.

When a GL LD_PRELOAD library like apitrace was used,
glXGetProcAddress() would return the preload's symbols instead of
libGL's symbol, leading to infinite recursion when the returned
function was called.  This didn't hit apitrace on most apps because
who calls glXGetProcAddress() on the global functions.

The -Bsymbolic, which was present in mklib before automake conversion,
causes the glxcmds.c:GLX_functions table to be resolved at link time,
so that LD_PRELOADs don't affect it any more.

Fixes crashes when running wine under apitrace.

Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Marek Olšák <maraeo@gmail.com>
12 years agost/mesa: set MaxUnrollIterations = 255
Brian Paul [Tue, 20 Mar 2012 23:43:52 +0000 (17:43 -0600)]
st/mesa: set MaxUnrollIterations = 255

The default was 32 for the EmitNoLoops=0 case.  This allows the oZone3D
soft shadows test to work properly with the vmware driver.  Jose reported
that SM3 supports up to 255 loop iterations.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoglsl: propagate MaxUnrollIterations to the optimizer's loop unroller
Brian Paul [Tue, 20 Mar 2012 23:43:12 +0000 (17:43 -0600)]
glsl: propagate MaxUnrollIterations to the optimizer's loop unroller

Instead of the hard-coded value of 32.  Note that MaxUnrollIterations
defaults to 32 so there's no net change.  But the gallium state tracker
can override this.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Make use of the new GPU-unsynchronized map functionality in libdrm.
Eric Anholt [Fri, 24 Feb 2012 23:54:32 +0000 (15:54 -0800)]
intel: Make use of the new GPU-unsynchronized map functionality in libdrm.

Improves Unigine Tropics performance at 1024x768 by 2.06236% +/-
0.50272% (n=11).

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Drop the tracking of bo_map vs bo_map_gtt for unmapping.
Eric Anholt [Fri, 24 Feb 2012 23:44:26 +0000 (15:44 -0800)]
intel: Drop the tracking of bo_map vs bo_map_gtt for unmapping.

drm_intel_bo_unmap() supports both in the current libdrm version.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Avoid flushing the batch for busy BOs for ARB_mbr with INVALIDATE_BUFFER.
Eric Anholt [Fri, 24 Feb 2012 23:05:02 +0000 (15:05 -0800)]
i965: Avoid flushing the batch for busy BOs for ARB_mbr with INVALIDATE_BUFFER.

Unigine Tropics uses INVALIDATE_BUFFER and not UNSYNCHRONIZED to reset
the buffer object when its streaming wraps.  Don't penalize it by
flushing the batch at the wrap point, just allocate a new BO and get
to using it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Handle devid overrides using libdrm.
Eric Anholt [Sat, 10 Mar 2012 00:27:35 +0000 (16:27 -0800)]
intel: Handle devid overrides using libdrm.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Ask libdrm to dump an AUB file if INTEL_DEBUG=aub.
Eric Anholt [Tue, 6 Mar 2012 23:31:42 +0000 (15:31 -0800)]
intel: Ask libdrm to dump an AUB file if INTEL_DEBUG=aub.

It also asks for BMPs in the aub file at SwapBuffers time.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Bump libdrm requirement to 2.4.32.
Eric Anholt [Fri, 16 Mar 2012 23:18:54 +0000 (16:18 -0700)]
intel: Bump libdrm requirement to 2.4.32.

We'll need this for AUB dumping and unsynchronized maps.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agodocs: Add 8.0.2 md5sums
Jakob Bornecrantz [Wed, 21 Mar 2012 19:19:45 +0000 (19:19 +0000)]
docs: Add 8.0.2 md5sums

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 0bf0ba44de0cde5e041c188b409513866b7f5ab2)

12 years agodocs: Add 8.0.2 release notes
Jakob Bornecrantz [Wed, 21 Mar 2012 16:51:06 +0000 (16:51 +0000)]
docs: Add 8.0.2 release notes

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 5f7204c3bbc070fce2f3351419a64362fe15a8c6)

12 years agomesa: Include mesa ES mapi generated files
Jakob Bornecrantz [Tue, 20 Mar 2012 13:24:50 +0000 (13:24 +0000)]
mesa: Include mesa ES mapi generated files

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
(cherry picked from commit 770f785a6f30e5295ababe44a8e9449ee0be640a)

12 years agoglsl: Don't require gl_Position to be written in GLSL 1.40.
Eric Anholt [Tue, 20 Mar 2012 05:43:27 +0000 (22:43 -0700)]
glsl: Don't require gl_Position to be written in GLSL 1.40.

Fixes piglit glsl-1.40/execution/tf-no-position.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomapi: Use -no-undefined libtool flag in src/mapi/shared-glapi/Makefile.am
Jon TURNEY [Tue, 20 Mar 2012 11:11:00 +0000 (11:11 +0000)]
mapi: Use -no-undefined libtool flag in src/mapi/shared-glapi/Makefile.am

Use -no-undefined to assure libtool that the library has no unresolved
symbols at link time, so that libtool will build a shared library on
platforms that require that all symbols are resolved when the library
is linked.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
12 years agodrirc: Add missing XML attributes that made the driconf application whine.
Eric Anholt [Tue, 20 Mar 2012 22:43:42 +0000 (15:43 -0700)]
drirc: Add missing XML attributes that made the driconf application whine.

These are used for pretty presentation of the application name in the
UI.

Tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agor600g: add support for TN (trinity) APUs
Alex Deucher [Tue, 20 Mar 2012 23:43:59 +0000 (19:43 -0400)]
r600g: add support for TN (trinity) APUs

Note: this is a candidate for the stable branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agoi965: Change the hiz-override env var to a driconf option.
Eric Anholt [Tue, 6 Mar 2012 19:05:20 +0000 (11:05 -0800)]
i965: Change the hiz-override env var to a driconf option.

The force-enable option is dropped, now that the hardware we were
concerned about has HiZ on by default.  Now, instead of doing
INTEL_HIZ=0 to test disabling hiz, you can set hiz=false.

v2: Disable separate stencil on gen6 when HIZ is turned off.
    (previously, this had to be done manually in addition).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
12 years agoi965: Drop the INTEL_FORCE_GS environment variable.
Eric Anholt [Tue, 20 Mar 2012 22:29:11 +0000 (15:29 -0700)]
i965: Drop the INTEL_FORCE_GS environment variable.

This was a debug option during gen6 transform feedback bringup (and a
similar one existed during gen4 bringup).  However, it looks like
we're done with that, and we don't anticipate it being used again,
either for geometry shaders or transform feedback.

Suggested by: Kenneth Graunke <kenneth@whitecape.org>

12 years agointel: Drop the INTEL_NO_BLIT debug environment variable.
Eric Anholt [Tue, 6 Mar 2012 18:37:48 +0000 (10:37 -0800)]
intel: Drop the INTEL_NO_BLIT debug environment variable.

This was added in the i915/i965 merge from the i915 driver, but I
don't recall it ever being used since then.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Drop the INTEL_STRICT_CONFORMANCE environment variable.
Eric Anholt [Mon, 5 Mar 2012 23:24:17 +0000 (15:24 -0800)]
intel: Drop the INTEL_STRICT_CONFORMANCE environment variable.

If you want to test the graphics driver, you want to test it under the
conditions that users will see, not some set of additional fallbacks.
If you want to test swrast, run the swrast driver (or no_rast=true)
instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Fix a case when mapping large texture fails
Anuj Phogat [Mon, 27 Feb 2012 19:09:29 +0000 (11:09 -0800)]
intel: Fix a case when mapping large texture fails

This patch handles a case when mapping a large texture fails
in drm_intel_gem_bo_map_gtt(). These changes avoid assertion
failure later in the driver as reported in following bugs:

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

Testing: No regressions in piglit quick.tests

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
12 years agoAdd Makefile to shared-glapi .gitignore
Kenneth Graunke [Tue, 20 Mar 2012 18:50:02 +0000 (11:50 -0700)]
Add Makefile to shared-glapi .gitignore

12 years agoAdd Makefile.in to toplevel .gitignore
Kenneth Graunke [Tue, 20 Mar 2012 18:44:48 +0000 (11:44 -0700)]
Add Makefile.in to toplevel .gitignore

To avoid redundancies, this patch also removes Makefile.in from the
other .gitignore files.

Acked-by: Eric Anholt <eric@anholt.net>
12 years agoAdd .deps/, .libs/, and *.la to toplevel .gitignore
Paul Berry [Thu, 15 Mar 2012 23:43:53 +0000 (16:43 -0700)]
Add .deps/, .libs/, and *.la to toplevel .gitignore

To avoid redundancies, this patch also removes .deps, .libs, and *.la
from .gitignore files in subdirectories.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: only test cube face widths in _mesa_test_texobj_completeness()
Brian Paul [Tue, 20 Mar 2012 13:46:47 +0000 (07:46 -0600)]
mesa: only test cube face widths in _mesa_test_texobj_completeness()

As Eric pointed out, we know the cube faces are square at this point
so we only need to test the texture widths for consistency.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agosoftpipe: set max cube texture size to 4Kx4K
Brian Paul [Sun, 18 Mar 2012 16:45:11 +0000 (10:45 -0600)]
softpipe: set max cube texture size to 4Kx4K

The max size was 16Kx16K so a 4 byte/pixel, six-sided cube would require
6 GBytes of memory.  If mipmapped, 8 GB.  Reduce the max size to 4K to
make the total size more reasonable.

Fixes a crash with the new piglit max-texture-size test.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
12 years agomesa: add integer texture completeness check
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: add integer texture completeness check

Per the spec, only nearest filtering is supported for integer textures.
Otherwise, the texture is incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: rework texture completeness testing
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: rework texture completeness testing

Instead of gl_texture_object::_Complete there are now two fields:
_BaseComplete and _MipmapComplete.  The former indicates whether the base
texture level is valid.  The later indicates whether the whole mipmap is
valid.

With sampler objects, a single texture can appear to be both complete and
incomplete at the same time.  See the GL_ARB_sampler_objects spec for more
details.  To implement this we now check if the texture is complete with
respect to a sampler state.

Another benefit of this is we no longer need to invalidate a texture's
completeness state when we change the minification/magnification filters
with glTexParameter().

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: add _mesa_is_mipmap_filter() helper
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: add _mesa_is_mipmap_filter() helper

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: use _mesa_dirty_texobj() in glTexParameter code
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: use _mesa_dirty_texobj() in glTexParameter code

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: use _mesa_dirty_texobj() function
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: use _mesa_dirty_texobj() function

To mark the texture object as incomplete.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: rewrite/consolidate code in _mesa_test_texobj_completeness()
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: rewrite/consolidate code in _mesa_test_texobj_completeness()

Merge the mipmap level checking code that was separate cases for 1D,
2D, 3D and CUBE before.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: use new baseImage var to simplify _mesa_test_texobj_completeness()
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: use new baseImage var to simplify _mesa_test_texobj_completeness()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: add comments in _mesa_test_texobj_completeness() related to the spec
Brian Paul [Sat, 17 Mar 2012 22:30:02 +0000 (16:30 -0600)]
mesa: add comments in _mesa_test_texobj_completeness() related to the spec

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: better debug message in _mesa_test_texobj_completeness()
Brian Paul [Sat, 17 Mar 2012 22:30:02 +0000 (16:30 -0600)]
mesa: better debug message in _mesa_test_texobj_completeness()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: move some code in _mesa_test_texobj_completeness()
Brian Paul [Sat, 17 Mar 2012 22:30:02 +0000 (16:30 -0600)]
mesa: move some code in _mesa_test_texobj_completeness()

Move the simple MaxLevel < BaseLevel test earlier to be closer to where
we error-check BaseLevel.  Also, use the local baseLevel var in more places.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: use switch(target) in _mesa_test_texobj_completeness()
Brian Paul [Sat, 17 Mar 2012 22:30:02 +0000 (16:30 -0600)]
mesa: use switch(target) in _mesa_test_texobj_completeness()

and add missing case for GL_TEXTURE_BUFFER.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()
Brian Paul [Sat, 17 Mar 2012 22:30:02 +0000 (16:30 -0600)]
mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: make _mesa_reference_sampler_object() an inline function
Brian Paul [Sat, 17 Mar 2012 22:30:03 +0000 (16:30 -0600)]
mesa: make _mesa_reference_sampler_object() an inline function

To make the no-change case faster, as we do for the other object-reference
functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoglsl: Don't include the deprecated structure types in GLSL 1.40.
Eric Anholt [Thu, 15 Mar 2012 16:29:47 +0000 (09:29 -0700)]
glsl: Don't include the deprecated structure types in GLSL 1.40.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Validate the drawing primitive against the transform feedback mode.
Eric Anholt [Wed, 14 Mar 2012 21:44:22 +0000 (14:44 -0700)]
mesa: Validate the drawing primitive against the transform feedback mode.

Fixes piglit GL_EXT_transform_feedback/negative-prims.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Fold error generation into _mesa_valid_prim_mode().
Eric Anholt [Wed, 14 Mar 2012 21:39:15 +0000 (14:39 -0700)]
mesa: Fold error generation into _mesa_valid_prim_mode().

We want to start emitting an INVALID_OPERATION from here for transform
feedback.  Note that this forced dlist.c to almost not use this
function, since it wants different behavior during dlist compile.
Just pull the non-TF, non-GS test out for compile, because:

1) TF doesn't matter in that case because there's no drawing.
2) I don't think we're going to see GSes and display lists in the same
   context, if we don't do GL_ARB_compatibility.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoshared-glapi: Convert to automake
Kristian Høgsberg [Fri, 16 Mar 2012 16:55:40 +0000 (12:55 -0400)]
shared-glapi: Convert to automake

This fixes a build problem where EGL links to libgbm.la, which encodes
a relative path to it's libglapi.so dependency.  The relative path
breaks when the linker tries to resolve it from src/egl/main instead
of src/gbm.  Typically we silently fall back to the system
libglapi.so, which is wrong and breaks when there isn't one.

Morale of the story: don't mix mklib and libtool.

12 years agor600g: fix r600_get_backend_mask() for virtual addresses
Alex Deucher [Mon, 19 Mar 2012 14:52:46 +0000 (10:52 -0400)]
r600g: fix r600_get_backend_mask() for virtual addresses

I don't think we should hit this path for virtual addresses,
but just in case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agoi915: fallback for NPOT cubemap texture
Yuanhan Liu [Wed, 29 Feb 2012 07:04:45 +0000 (15:04 +0800)]
i915: fallback for NPOT cubemap texture

Although some hardware support NPOT cubemap, but it seems we don't know
the right layout for NPOT cubemap. Thus seems we need do fallback for
other platforms as well.

See comments inline the code for more detailed info.

v2: give a more detailed info about why we need fallback for other
    platfroms as well.

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

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
12 years agor600g: fix point rendering
Marek Olšák [Mon, 19 Mar 2012 01:59:43 +0000 (02:59 +0100)]
r600g: fix point rendering

Accidentally broken in c7eaf274a9b7e3e5f4b060be2320.

12 years agost/mesa: add null pointer check in st_texture_image_map()
Brian Paul [Fri, 16 Mar 2012 15:31:13 +0000 (09:31 -0600)]
st/mesa: add null pointer check in st_texture_image_map()

If we failed to allocate a memory resource for the texture we'd crash
when we tried to map it.  Now we propogate the NULL back up to the
texstore code and generate GL_OUT_OF_MEMORY.

Fixes a crash with the upcoming piglit max-texture-size test.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agodocs: add info for installing dependencies on fedora
Alex Hultman [Fri, 16 Mar 2012 15:46:42 +0000 (09:46 -0600)]
docs: add info for installing dependencies on fedora

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agodri_util: add copyright/license blurb
Brian Paul [Fri, 16 Mar 2012 15:39:01 +0000 (09:39 -0600)]
dri_util: add copyright/license blurb

12 years agodarwin: Link against libxcb
Jeremy Huddleston [Sat, 17 Mar 2012 00:07:06 +0000 (17:07 -0700)]
darwin: Link against libxcb

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
12 years agodarwin: Build create_context.c
Jeremy Huddleston [Sat, 17 Mar 2012 00:03:54 +0000 (17:03 -0700)]
darwin: Build create_context.c

Fixes a build regression from: 588042a8ec4ea91a952c07a0768516fd590758f4

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
12 years agodarwin: config file cleanups
Jeremy Huddleston [Sat, 17 Mar 2012 00:01:01 +0000 (17:01 -0700)]
darwin: config file cleanups

Set our default compiler based on what our installed XCode prefers

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
12 years agoi965/fs: Jump from discard statements to the end of the program when done.
Eric Anholt [Mon, 19 Dec 2011 18:53:10 +0000 (10:53 -0800)]
i965/fs: Jump from discard statements to the end of the program when done.

From the GLSL 1.30 spec:

     The discard keyword is only allowed within fragment shaders. It
     can be used within a fragment shader to abandon the operation on
     the current fragment. This keyword causes the fragment to be
     discarded and no updates to any buffers will occur. Control flow
     exits the shader, and subsequent implicit or explicit derivatives
     are undefined when this control flow is non-uniform (meaning
     different fragments within the primitive take different control
     paths).

v2: Don't emit the final HALT if no other HALTs were emitted.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
12 years agoi965: Add disasm for gen6+ UIP/JIP on BREAK/CONT/HALT.
Eric Anholt [Mon, 12 Mar 2012 19:21:20 +0000 (12:21 -0700)]
i965: Add disasm for gen6+ UIP/JIP on BREAK/CONT/HALT.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Add GLSL 1.40 textureSize() implementations for sampler2DRect.
Eric Anholt [Mon, 12 Mar 2012 21:07:39 +0000 (14:07 -0700)]
glsl: Add GLSL 1.40 textureSize() implementations for sampler2DRect.

By setting lod to 0 in the builtin function implementation, we avoid
needing to update all the visitors to ignore LOD in this case, when
the hardware drivers actually want to ask for LOD 0 for rectangular
textures.

Fixes piglit spec/GLSL-1.40/textureSize-*Rect.

v2: Change style of looking for substrings.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Set up generated builtin functions handling for GLSL 1.40.
Eric Anholt [Mon, 12 Mar 2012 23:08:44 +0000 (16:08 -0700)]
glsl: Set up generated builtin functions handling for GLSL 1.40.

Otherwise, when we go to use ir_reader on the generated code, we won't
have the types present.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Add support for integer sampler2DRect variants in GLSL 1.40.
Eric Anholt [Mon, 12 Mar 2012 21:07:01 +0000 (14:07 -0700)]
glsl: Add support for integer sampler2DRect variants in GLSL 1.40.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Drop ftransform() from GLSL 1.40 profile.
Eric Anholt [Mon, 12 Mar 2012 20:43:13 +0000 (13:43 -0700)]
glsl: Drop ftransform() from GLSL 1.40 profile.

This is the one builtin function claimed to be dropped due to the
ARB_compatibility split.

Fixes piglit spec/GLSL-1.40/compiler/ftransform.vert

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Copy GLSL 1.30 builtin profile to GLSL 1.40.
Eric Anholt [Mon, 12 Mar 2012 20:42:29 +0000 (13:42 -0700)]
glsl: Copy GLSL 1.30 builtin profile to GLSL 1.40.

All that's changed is the #version changing to 140.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: When failing to compile some builtins, print the error.
Eric Anholt [Mon, 12 Mar 2012 22:47:06 +0000 (15:47 -0700)]
glsl: When failing to compile some builtins, print the error.

This makes the process slightly more debuggable, though it would be
nice if the build just failed immediately instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Let the builtin compiler process GLSL 1.40 shaders.
Eric Anholt [Mon, 12 Mar 2012 22:51:54 +0000 (15:51 -0700)]
glsl: Let the builtin compiler process GLSL 1.40 shaders.

This is required to put the new 1.40 builtins in place, since they
require new types.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Update builtin variables for GLSL 1.40.
Eric Anholt [Fri, 9 Mar 2012 19:38:34 +0000 (11:38 -0800)]
glsl: Update builtin variables for GLSL 1.40.

Mostly this is a matter of removing variables that have been moved to
the compatibility profile.  There's one addition: gl_InstanceID is
present in the core now.

This fixes the new piglit tests for GLSL 1.40 builtin variables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Hook up the current GLSL 1.30 types and builtins for 1.40.
Eric Anholt [Thu, 8 Mar 2012 21:49:15 +0000 (13:49 -0800)]
glsl: Hook up the current GLSL 1.30 types and builtins for 1.40.

This gets a basic #version 140 shader compiling.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Add support for parsing #version 140.
Eric Anholt [Thu, 8 Mar 2012 21:38:31 +0000 (13:38 -0800)]
glsl: Add support for parsing #version 140.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Enable SIMD16 mode for shaders with loops on Gen6+.
Kenneth Graunke [Mon, 9 Jan 2012 04:42:22 +0000 (20:42 -0800)]
i965: Enable SIMD16 mode for shaders with loops on Gen6+.

The hardware supports it; there's no reason not to.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>