mesa.git
12 years agoswrast: Fix memory leaks in blit_linear.
Vinson Lee [Sun, 1 Apr 2012 06:11:42 +0000 (23:11 -0700)]
swrast: Fix memory leaks in blit_linear.

Fixes Coverity resource leak defects.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.
Kenneth Graunke [Wed, 21 Sep 2011 00:58:45 +0000 (17:58 -0700)]
glsl: Demote 'type' from ir_instruction to ir_rvalue and ir_variable.

Variables have types, expression trees have types, but statements don't.
Rather than have a nonsensical field that stays NULL in the base class,
just move it to where it makes sense.

Fix up a few places that lazily used ir_instruction even though they
actually knew the particular subclass.

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 agoglsl: Remove ir_call::get_callee() and set_callee().
Kenneth Graunke [Wed, 21 Sep 2011 01:08:11 +0000 (18:08 -0700)]
glsl: Remove ir_call::get_callee() and set_callee().

Previously, set_callee() performed some assertions about the type of the
ir_call; protecting the bare pointer ensured these checks would be run.

However, ir_call no longer has a type, so the getter and setter methods
don't actually do anything useful.  Remove them in favor of accessing
callee directly, as is done with most other fields in our IR.

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 agoglsl: Convert ir_call to be a statement rather than a value.
Kenneth Graunke [Tue, 20 Mar 2012 22:56:37 +0000 (15:56 -0700)]
glsl: Convert ir_call to be a statement rather than a value.

Aside from ir_call, our IR is cleanly split into two classes:
- Statements (typeless; used for side effects, control flow)
- Values (deeply nestable, pure, typed expression trees)

Unfortunately, ir_call confused all this:
- For void functions, we placed ir_call directly in the instruction
  stream, treating it as an untyped statement.  Yet, it was a subclass
  of ir_rvalue, and no other ir_rvalue could be used in this way.
- For functions with a return value, ir_call could be placed in
  arbitrary expression trees.  While this fit naturally with the source
  language, it meant that expressions might not be pure, making it
  difficult to transform and optimize them.  To combat this, we always
  emitted ir_call directly in the RHS of an ir_assignment, only using
  a temporary variable in expression trees.  Many passes relied on this
  assumption; the acos and atan built-ins violated it.

This patch makes ir_call a statement (ir_instruction) rather than a
value (ir_rvalue).  Non-void calls now take a ir_dereference of a
variable, and store the return value there---effectively a call and
assignment rolled into one.  They cannot be embedded in expressions.

All expression trees are now pure, without exception.

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 agoglsl: Split out ir_reader's ability to read ir_dereference_variables.
Kenneth Graunke [Thu, 22 Sep 2011 21:29:53 +0000 (14:29 -0700)]
glsl: Split out ir_reader's ability to read ir_dereference_variables.

Most of the time, we just want to read an ir_dereference, so there's no
need to have these in separate functions.  However, the next patch will
want to read an ir_dereference_variable directly.

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 agoglsl: Move constant expression handling from calls to signatures.
Kenneth Graunke [Tue, 20 Sep 2011 07:14:05 +0000 (00:14 -0700)]
glsl: Move constant expression handling from calls to signatures.

When translating a call from AST to HIR, we need to decide whether it
can be evaluated to a constant before emitting any code (namely, the
temporary declaration, assignment, and call.)

Soon, ir_call will become a statement taking a dereference of where to
store the return value, rather than an rvalue to be used on the RHS of
an assignment.  It will be more convenient to try evaluation before
creating a call.  ir_function_signature seems like a reasonable place.

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 agoglsl: Use ir_rvalue to represent generic error_type values.
Kenneth Graunke [Thu, 22 Sep 2011 22:04:56 +0000 (15:04 -0700)]
glsl: Use ir_rvalue to represent generic error_type values.

Currently, ir_call can be used as either a statement (for void
functions) or a value (for non-void functions).  This is rather awkward,
as it's the only class that can be used in both forms.

A number of places use ir_call::get_error_instruction() to construct a
generic value of error_type.  If ir_call is to become a statement, it
can no longer serve this purpose.

Unfortunately, none of our classes are particularly well suited for
this, and creating a new one would be rather aggrandizing.  So, this
patch introduces ir_rvalue::error_value(), a static method that creates
an instance of the base class, ir_rvalue.  This has the nice property
that you can't accidentally try and access uninitialized fields (as it
doesn't have any).  The downside is that the base class is no longer
abstract.

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 agoglsl: Combine AST-level and IR-level parameter mode checking loops.
Kenneth Graunke [Thu, 29 Mar 2012 02:24:45 +0000 (19:24 -0700)]
glsl: Combine AST-level and IR-level parameter mode checking loops.

generate_call() and ast_function_expression::hir() both tried to verify
that 'out' and 'inout' parameters used l-values.  Irritatingly, it
turned out that this was not redundant; both checks caught -some- cases.

This patch combines the two into a single "complete" function that does
all the parameter mode checking.  It also adds a comment clarifying why
AST-level checking is necessary in the first place.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Split up function matching and call generation a bit more.
Kenneth Graunke [Wed, 28 Mar 2012 22:57:50 +0000 (15:57 -0700)]
glsl: Split up function matching and call generation a bit more.

We used to have one big function, match_signature_by_name, which found
a matching signature, performed out-parameter conversions, and generated
the ir_call.  As the code for matching against built-in functions became
more complicated, I split it internally, creating generate_call().

However, I left the same awkward interface.  This patch splits it into
three functions:
1. match_signature_by_name()

   This now takes a name, a list of parameters, the symbol table, and
   returns an ir_function_signature.  Simple and one purpose: matching.

2. no_matching_function_error()

   Generate the "no matching function" error and list of prototypes.
   This was complex enough that I felt it deserved its own function.

3. generate_call()

   Do the out-parameter conversion and generate the ir_call.  This
   could probably use more splitting.

The caller now has a more natural workflow: find a matching signature,
then either generate an error or a call.

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 agoglsl: Don't trust loop analysis in the presence of function calls.
Kenneth Graunke [Wed, 28 Mar 2012 21:00:42 +0000 (14:00 -0700)]
glsl: Don't trust loop analysis in the presence of function calls.

Function calls may have side effects that alter variables used inside
the loop.  In the fragment shader, they may even terminate the shader.
This means our analysis about loop-constant or induction variables may
be completely wrong.

In general it's impossible to determine whether they actually do or not
(due to the halting problem), so we'd need to perform conservative
static analysis.  For now, it's not worth the complexity: most functions
will be inlined, at which point we can unroll them successfully.

Fixes Piglit tests:
- shaders/glsl-fs-unroll-out-param
- shaders/glsl-fs-unroll-side-effect

NOTE: This is a candidate for release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965/aub: Dump a final bitmap from DestroyContext.
Kenneth Graunke [Fri, 30 Mar 2012 06:37:09 +0000 (23:37 -0700)]
i965/aub: Dump a final bitmap from DestroyContext.

Certain applications don't call SwapBuffers before exiting.  Yet, we'd
really like to see a bitmap containing the final rendered image even if
they choose never to present it.

In particular, Piglit tests (at least with -auto -fbo) fall into this
category.  Many of them failed to dump any images at all.

Dumping one final image at context destruction time seems to work.
We may wish to pursue a more elegant solution later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agor600g: unduplicate code for PS partial flush
Marek Olšák [Sun, 1 Apr 2012 17:19:21 +0000 (19:19 +0200)]
r600g: unduplicate code for PS partial flush

12 years agor600g: determine in advance if hw has vertex cache
Marek Olšák [Sat, 31 Mar 2012 21:44:31 +0000 (23:44 +0200)]
r600g: determine in advance if hw has vertex cache

12 years agor600g: optimize r600_resource_va
Marek Olšák [Fri, 30 Mar 2012 23:31:47 +0000 (01:31 +0200)]
r600g: optimize r600_resource_va

Avoid calling get_radeon_bo and inline it.

12 years agotargets/{xvmc,vdpau,va}: remove all objects on make clean
Marcin Slusarz [Sun, 1 Apr 2012 15:31:51 +0000 (17:31 +0200)]
targets/{xvmc,vdpau,va}: remove all objects on make clean

12 years agointel: add PCI IDs for Ivy Bridge GT2 server variant
Eugeni Dodonov [Sat, 31 Mar 2012 15:38:59 +0000 (12:38 -0300)]
intel: add PCI IDs for Ivy Bridge GT2 server variant

Those IDs are used by Bromolow.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agolinker: Fix memory leak in count_uniform_size::visit_field.
Vinson Lee [Sat, 31 Mar 2012 06:36:45 +0000 (23:36 -0700)]
linker: Fix memory leak in count_uniform_size::visit_field.

Fixes a Coverity resource leak defect.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: Add some PCI IDs for Haswell.
Kenneth Graunke [Mon, 19 Mar 2012 20:42:16 +0000 (13:42 -0700)]
intel: Add some PCI IDs for Haswell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Set "Shader Channel Select" fields in Haswell's SURFACE_STATE.
Kenneth Graunke [Thu, 20 Oct 2011 09:00:52 +0000 (02:00 -0700)]
i965: Set "Shader Channel Select" fields in Haswell's SURFACE_STATE.

These can be used to implement EXT_texture_swizzle without baking
state-dependent swizzle instructions into the shader and forcing
recompiles.

For now, just set them to pass-through mode, so everything continues to
work as it did on Ivybridge.  We can optimize this later.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Fill in Sample Mask in Haswell's 3DSTATE_PS.
Kenneth Graunke [Thu, 20 Oct 2011 09:00:43 +0000 (02:00 -0700)]
i965: Fill in Sample Mask in Haswell's 3DSTATE_PS.

We only need one sample, since we don't support multisampling yet.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Set "Stencil Buffer Enable" bit on Haswell.
Kenneth Graunke [Sat, 24 Sep 2011 08:45:18 +0000 (01:45 -0700)]
i965: Set "Stencil Buffer Enable" bit on Haswell.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Set Line Stipple enable bit in 3DSTATE_SF for Haswell.
Kenneth Graunke [Sat, 24 Sep 2011 07:42:23 +0000 (00:42 -0700)]
i965: Set Line Stipple enable bit in 3DSTATE_SF for Haswell.

Apparently this needs to be the same as in 3DSTATE_WM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Update max VS/PS threads shift offsets for Haswell.
Kenneth Graunke [Fri, 23 Sep 2011 00:12:50 +0000 (17:12 -0700)]
i965: Update max VS/PS threads shift offsets for Haswell.

These now start at bit 23 instead of bit 24/25.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Disable HiZ on Haswell for now.
Kenneth Graunke [Wed, 7 Mar 2012 18:16:00 +0000 (10:16 -0800)]
i965: Disable HiZ on Haswell for now.

Getting HiZ working means updating all the state packets for resolves
and clears.  It's not worth doing until we get the basics working.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Add initial IS_HASWELL() macros.
Kenneth Graunke [Sat, 13 Aug 2011 01:22:48 +0000 (18:22 -0700)]
i965: Add initial IS_HASWELL() macros.

For now, these all return 0, as I don't yet want to enable Haswell
support.  Eventually they will be filled in with proper PCI IDs.

Also add an is_haswell field similar to is_g4x to make it easy to
distinguish Gen7 and Gen7.5.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Avoid explicit accumulator operands in SIMD16 mode on Gen7.
Kenneth Graunke [Fri, 30 Mar 2012 20:58:06 +0000 (13:58 -0700)]
i965: Avoid explicit accumulator operands in SIMD16 mode on Gen7.

According to the BSpec ISA volume's "Accumulator Register" section:

"[DevIVB] SIMD16 execution on dwords is not allowed when accumulator is
 explicit source or destination operand."

Fixes piglit tests:
- fs-multiply-const-ivec4
- fs-multiply-const-uvec4
- fs-multiply-ivec4-const
- fs-multiply-uvec4-const

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agogallium/postprocess: document serious issue causing undefined behavior
Marek Olšák [Thu, 29 Mar 2012 19:28:55 +0000 (21:28 +0200)]
gallium/postprocess: document serious issue causing undefined behavior

12 years agor600g: cleanup after get_query_result change
Marek Olšák [Thu, 29 Mar 2012 14:45:44 +0000 (16:45 +0200)]
r600g: cleanup after get_query_result change

Finally, union r600_query_result can be removed.

12 years agor300g: cleanup after get_query_result change
Marek Olšák [Thu, 29 Mar 2012 14:38:53 +0000 (16:38 +0200)]
r300g: cleanup after get_query_result change

12 years agogallium/util: add helper function util_query_clear_result
Marek Olšák [Fri, 30 Mar 2012 15:07:45 +0000 (17:07 +0200)]
gallium/util: add helper function util_query_clear_result

12 years agogallium: adapt to get_query_result interface change
Marek Olšák [Tue, 27 Mar 2012 20:42:30 +0000 (22:42 +0200)]
gallium: adapt to get_query_result interface change

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agogallium: make get_query_result return union* and not void*
Marek Olšák [Tue, 27 Mar 2012 19:51:50 +0000 (21:51 +0200)]
gallium: make get_query_result return union* and not void*

This replaces the cryptic void* parameter with a union.
(based on union r600_query_result)

Users of this can still pass uint64* in it, but that cannot work for every
query type, obviously. Most importantly, the code now documents what should
be expected from get_query_result.

This also adds pipe_query_data_pipeline_statistics as per the D3D11 docs.

v2: fix indentation, add comments and use the doxygen style

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoconfigure: Add --with-llvm-shared-libs
Tom Stellard [Wed, 28 Mar 2012 02:24:39 +0000 (22:24 -0400)]
configure: Add --with-llvm-shared-libs

This option allows targets to link against the LLVM shared library
instead of the static libs.  With LLVM 2.9, his saves ~11 MB for each of
the r300 target libraries.

12 years agoshared-glapi: Include from builddir
Kristian Høgsberg [Thu, 29 Mar 2012 13:20:53 +0000 (09:20 -0400)]
shared-glapi: Include from builddir

Fixes out-of-tree builds.

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

12 years agogallivm: Fix method overriding in raw_debug_ostream.
Vinson Lee [Wed, 28 Mar 2012 04:51:17 +0000 (21:51 -0700)]
gallivm: Fix method overriding in raw_debug_ostream.

Use matching type qualifers to avoid method hiding.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoegl_dri2: use gbm_surface as the native window type in drm platform
Ander Conselvan de Oliveira [Wed, 25 Jan 2012 14:24:17 +0000 (16:24 +0200)]
egl_dri2: use gbm_surface as the native window type in drm platform

12 years agogbm: Create hooks for dri2_loader_extension in dri backend
Ander Conselvan de Oliveira [Wed, 25 Jan 2012 14:24:18 +0000 (16:24 +0200)]
gbm: Create hooks for dri2_loader_extension in dri backend

Pass a dri2_loader extension to the dri driver when gbm creates the dri
screen.  The implementation jumps through pointers in the gbm device
so that an EGL on GBM implementation can provide the real implementations.

12 years agogbm: Add gbm_surface interface
Ander Conselvan de Oliveira [Wed, 25 Jan 2012 14:24:14 +0000 (16:24 +0200)]
gbm: Add gbm_surface interface

The idea here is to be able to create an egl window surface from a
gbm_surface.  This avoids the need for the surfaceless extension and
lets the EGL platform handle buffer allocation, while keeping the user
in charge of somehow presenting the buffers (using kms page flipping,
for example).

gbm_surface_lock_front_buffer() locks a surface's front buffer and
returns a gbm bo representing it.  This bo should later be returned
to the gbm surface using gbm_surface_release_buffer().

12 years agodraw: fix missing immediates bug in polygon stipple code
Brian Paul [Fri, 23 Mar 2012 20:53:48 +0000 (14:53 -0600)]
draw: fix missing immediates bug in polygon stipple code

The function that counts the number of TGSI immediates also needs to
emit the immediates.  This fixes assorted failures when using polygon
stipple with fragment shaders that have their own immediates.

NOTE: This is a candidate for the 8.0 branch.

12 years agovl: move winsys helper out of winsys directory
Christian König [Mon, 26 Mar 2012 17:40:42 +0000 (19:40 +0200)]
vl: move winsys helper out of winsys directory

They aren't winsys of their own,
just help dealing with them.

v2: add some more comments in vl_winsys.h

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoUse -no-undefined libtool flag in src/glx/Makefile.am
Jon TURNEY [Tue, 13 Mar 2012 18:38:59 +0000 (18:38 +0000)]
Use -no-undefined libtool flag in src/glx/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 agointel: fix un-blanced map_refcount issue
Yuanhan Liu [Tue, 27 Mar 2012 07:41:52 +0000 (15:41 +0800)]
intel: fix un-blanced map_refcount issue

This is a regression introduced by commit cdcfd5, which forget to
increase the map_refcount for successfully-mapped region. Thus caused a
wrong non-blanced map_refcount.

This would fix the regression found in the two following webglc testcase
on Pineview platform:
   texture-npot.html
   gl-max-texture-dimensions.html

Cc: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
12 years agoglx:dri_common.c: check psc->driScreen->createDrawable return value
Wang YanQing [Tue, 20 Mar 2012 03:49:42 +0000 (11:49 +0800)]
glx:dri_common.c: check psc->driScreen->createDrawable return value

createDrawable may return NULL value, we should check it, or it will
make a segment failed.

[minor-indent-issue-fixed-by: Yuanhan Liu]

Signed-off-by: Wang YanQing <udknight@gmail.com>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
12 years agor600g: also disable transform feedback on cayman
Marek Olšák [Wed, 28 Mar 2012 00:21:03 +0000 (02:21 +0200)]
r600g: also disable transform feedback on cayman

It's said to cause troubles there.
The env var is R600_STREAMOUT again.

12 years agor600g: enable transform feedback on everything that isn't r700
Marek Olšák [Tue, 27 Mar 2012 19:00:49 +0000 (21:00 +0200)]
r600g: enable transform feedback on everything that isn't r700

Use R700_STREAMOUT=1 if you wanna hack transform feedback on r700.

12 years agost/egl: Also remove wl_buffer_damage in wayland backend
Benjamin Franzke [Tue, 27 Mar 2012 16:50:30 +0000 (18:50 +0200)]
st/egl: Also remove wl_buffer_damage in wayland backend

As commit 03eca9d92d407c71a59ff8a43067759769da0ae4 does for egl_dri2.

12 years agogallivm: Use InitializeNativeTargetDisassembler().
ojab [Tue, 27 Mar 2012 03:05:58 +0000 (07:05 +0400)]
gallivm: Use InitializeNativeTargetDisassembler().

To initialize only native LLVM Disassembler on LLVM >= 3.1.

Signed-off-by: José Fonseca <jfonseca@vmware.com>
12 years agoegl_dri2: make flush extension useable by drm platform
Ander Conselvan de Oliveira [Wed, 25 Jan 2012 14:24:15 +0000 (16:24 +0200)]
egl_dri2: make flush extension useable by drm platform

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)