mesa.git
12 years agomesa: remove unused gl_pixelmap::Map8[] array
Brian Paul [Fri, 10 Feb 2012 05:15:45 +0000 (22:15 -0700)]
mesa: remove unused gl_pixelmap::Map8[] array

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: stop using Map8[] tables in load_color_map_texture()
Brian Paul [Fri, 10 Feb 2012 05:15:45 +0000 (22:15 -0700)]
st/mesa: stop using Map8[] tables in load_color_map_texture()

Use the float tables instead.  Pixel maps are seldom used so this
shouldn't be a big deal.  Next, we can get rid of the gl_pixelmap::Map8
array.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: remove unused _mesa_map_ci8_to_rgba8()
Brian Paul [Fri, 10 Feb 2012 05:15:45 +0000 (22:15 -0700)]
mesa: remove unused _mesa_map_ci8_to_rgba8()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agomesa: fix error handling in get_tex_rgba_compressed()
Brian Paul [Thu, 9 Feb 2012 03:10:15 +0000 (20:10 -0700)]
mesa: fix error handling in get_tex_rgba_compressed()

12 years agomesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy()
Brian Paul [Thu, 9 Feb 2012 03:10:15 +0000 (20:10 -0700)]
mesa: use _mesa_format_matches_format_and_type() in get_tex_memcpy()

12 years agomesa: push row stride adjustment down into _mesa_decompress_image()
Brian Paul [Thu, 9 Feb 2012 03:10:15 +0000 (20:10 -0700)]
mesa: push row stride adjustment down into _mesa_decompress_image()

There's a mismatch in row strides for compressed textures between
what Driver.MapTextureImage() returns and what the software fetch-texel
functions use.  Move it down a layer.  The next step would be to fix
this in the fetch-texel functions.

12 years agomesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
mesa: replace GET_SHINE_TAB_ENTRY() macro with an inline function

12 years agomesa: make _mesa_invalidate_shine_table() static
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
mesa: make _mesa_invalidate_shine_table() static

12 years agomesa: remove gl_light::_SpotExpTable field
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
mesa: remove gl_light::_SpotExpTable field

Just use pow() instead.  Spot lights aren't too common and fixed-function
lighting isn't as important as it used to me.

This saves 32KB per context.  Each table was 4KB and there's 8 lights.

12 years agometa: replace abort() with _mesa_problem()
Brian Paul [Thu, 9 Feb 2012 03:11:58 +0000 (20:11 -0700)]
meta: replace abort() with _mesa_problem()

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: fix comment typo
Brian Paul [Wed, 8 Feb 2012 23:37:26 +0000 (16:37 -0700)]
mesa: fix comment typo

12 years agost/vdpau: use matrix filter to blur/sharpen video
Christian König [Wed, 8 Feb 2012 18:23:33 +0000 (19:23 +0100)]
st/vdpau: use matrix filter to blur/sharpen video

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: add a matrix/convolution filter
Christian König [Wed, 8 Feb 2012 17:02:11 +0000 (18:02 +0100)]
vl: add a matrix/convolution filter

Can be used for gaussian, mean, laplacian, emboss, sharpness...

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: use median filter for noise reduction
Christian König [Tue, 7 Feb 2012 17:03:46 +0000 (18:03 +0100)]
st/vdpau: use median filter for noise reduction

And while at it implement the rest of the feature
querying also.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: add a median filter for noise reduction
Christian König [Tue, 7 Feb 2012 17:00:41 +0000 (18:00 +0100)]
vl: add a median filter for noise reduction

This is a shader based median filter, generally
used for noise reduction, it could still need some
improvements, but should usually work out of the box.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoi965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.
Eric Anholt [Wed, 8 Feb 2012 23:12:56 +0000 (15:12 -0800)]
i965/gen7: Fix the length of the MULTISAMPLE state packet in the HiZ op.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/gen7: Fix the length of the DS state packet in the HiZ op.
Eric Anholt [Wed, 8 Feb 2012 23:10:12 +0000 (15:10 -0800)]
i965/gen7: Fix the length of the DS state packet in the HiZ op.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agoi965/gen7: Fix GPU hangs from the HiZ op.
Eric Anholt [Thu, 9 Feb 2012 18:08:00 +0000 (10:08 -0800)]
i965/gen7: Fix GPU hangs from the HiZ op.

The wm max threads is in the same dword as the dispatch enable.  The
hardware gets super angry if you set max threads to 0, even if you
aren't dispatching threads.

12 years agoglsl: Avoid excessive loop unrolling.
Mathias Fröhlich [Wed, 25 Jan 2012 16:35:01 +0000 (17:35 +0100)]
glsl: Avoid excessive loop unrolling.

Avoid unrollong loops that are either nested loops or
where the loop body times the unroll count is huge.

The change is far from being perfect but it extends the
loop unrolling decision heuristic by some additional
safeguard. In particular this cuts down compilation of
a shader precomputing atmospheric scattering integral
tables containing two nesting levels in a loop from
something way beyond some minutes (I never waited for
it to finish) to some fractions of a second.

This fixes piglit tests glsl-fs-unroll-explosion and
glsl-vs-unroll-explosion on r600g.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
12 years agomesa: fix maximum allowed proxy texture size condition
Anuj Phogat [Thu, 26 Jan 2012 03:05:45 +0000 (19:05 -0800)]
mesa: fix maximum allowed proxy texture size condition

width, height parameter in glTexImage2D() includes: texture image
width + 2 * border (if any). So when doing the texture size check
in _mesa_test_proxy_teximage() width and height should not exceed
maximum supported size for target texture type + 2 * border.
i.e. 1 << (ctx->Const.MaxTextureLevels - 1) + 2 * border

Texture border is anyway stripped out before it is given to intel
or gallium drivers.

This patch fixes Intel oglconform test case:
max_values negative.textureSize.textureCube
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44970

Note: This is a candidate for mesa 8.0 branch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: exit the update fragment samplers/textures loops early.
Dave Airlie [Wed, 8 Feb 2012 13:58:14 +0000 (13:58 +0000)]
st/mesa: exit the update fragment samplers/textures loops early.

If we have no more enabled samplers and we've reset all the previously
used ones, no need to keep going around this loop.

(just moved some stuff around to clean it up a bit).

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agost/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.
Dave Airlie [Wed, 8 Feb 2012 12:47:05 +0000 (12:47 +0000)]
st/mesa: fixup NDEBUG vs DEBUG causing debug path to get taken.

From what I can see we were taking the debug path all the time,
when we probably only want it for enable debug path.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agomesa: enable remap table when --enable-shared-glapi
Chia-I Wu [Mon, 6 Feb 2012 09:47:48 +0000 (17:47 +0800)]
mesa: enable remap table when --enable-shared-glapi

As libGL will use libglapi for function lookups, we need to enable the remap
table.

Tested-by: Brian Paul <brianp@vmware.com>
Tested-by: Matt Turner <mattst88@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45660
12 years agovbo: unmap vertex store before executing lists
Brian Paul [Tue, 7 Feb 2012 20:08:53 +0000 (13:08 -0700)]
vbo: unmap vertex store before executing lists

We don't want our VBOs mapped when we're drawing.  This change checks
if the vertex store VBO is mapped before we execute a list, unmaps it,
then remaps it after drawing.  This situation pops up when building a
nested display list in GL_COMPILE_AND_EXECUTE mode.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agogallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION
Christoph Bumiller [Mon, 6 Feb 2012 15:29:03 +0000 (16:29 +0100)]
gallium: add PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION

Just let the hardware do it if it can and avoid drivers having to
check for the special case on each draw call.

v2: update the draw module

12 years agodri: Emit a critical error if the swrast driver fails to load.
Carl Worth [Sat, 4 Feb 2012 00:25:38 +0000 (16:25 -0800)]
dri: Emit a critical error if the swrast driver fails to load.

Something has gone wrong if swrast is requested but cannot be
loaded. The user really should be made aware of this, (and instructed
to set LIBGL_DEBUG for more details).

The wording of this error message is updated from "reverting to
indirect rendering" to the more objectively descriptive "failed to
load driver: swrast". The former wording makes assumptions about what
the calling code will decide to do next, rather than simply describing
what went wrong within the current function. The new wording is
consistent with the critical errors recently added for hardware
drivers that fail to load.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodri: Emit a critical error if a named driver fails to load.
Carl Worth [Sat, 4 Feb 2012 00:25:38 +0000 (16:25 -0800)]
dri: Emit a critical error if a named driver fails to load.

Something has gone wrong if we were asked to load a driver of a
specific name, but it failed to load for some reason. The user really
should be made aware of this, (and instructed to set LIBGL_DEBUG for
more details).

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodri: Add a CriticalErrorMessageF macro.
Carl Worth [Sat, 4 Feb 2012 00:17:29 +0000 (16:17 -0800)]
dri: Add a CriticalErrorMessageF macro.

Sometimes an error is so sever that we want to print it even when the
user hasn't specifically requested debugging by setting LIBGL_DEBUG.

Add a CriticalErrorMessageF macro to be used for this case. (The error
message can still be slienced with the existing LIBGL_DEBUG=quiet).

For critical error messages we also direct the user to set the
LIBGL_DEBUG environment variable for more details.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodri: Clarify comments on InfoMessageF and ErrorMessageF macros.
Carl Worth [Sat, 4 Feb 2012 00:14:23 +0000 (16:14 -0800)]
dri: Clarify comments on InfoMessageF and ErrorMessageF macros.

The description of ErrorMessageF was misleading in the case of
LIBGL_DEBUG being unset, (the previous comment could be understood to
mean the error should be printed, but the code does not print in this
case).

InfoMessageF previously had no comment at all.

Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agoglsl: Fix Android build
Chad Versace [Wed, 8 Feb 2012 23:07:33 +0000 (15:07 -0800)]
glsl: Fix Android build

The build was broken by the line below, added in commit 4f82fed4.
  s_expression.cpp:26: #include <limits>

Mesa's half of the fix is to add 'external/astl/include' to the include
path. The other half of the fix requires implementing
numeric_limits<float>::infinity() in astl, for which I have patches
submitted upstream for review.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agor600g: fix handling of outputs as TEX addr sources
Christian König [Mon, 6 Feb 2012 19:56:10 +0000 (20:56 +0100)]
r600g: fix handling of outputs as TEX addr sources

Outputs should be treated in the same way as
inputs and temporaries here.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
12 years agoi965: Remove file i965/junk, accidentally added in 7b36c68
Chad Versace [Wed, 8 Feb 2012 17:18:46 +0000 (09:18 -0800)]
i965: Remove file i965/junk, accidentally added in 7b36c68

12 years agost/mesa: avoid vertex texture and sampler updates for 0 case
Dave Airlie [Tue, 7 Feb 2012 16:18:05 +0000 (16:18 +0000)]
st/mesa: avoid vertex texture and sampler updates for 0 case

If we had no vertex textures or samplers previously and we have none now,
don't bother doing the enables dance.

I was profiling nexuiz on noop and noticed these two functions in the
profile, this drops their usage from 0.86% to 0.03% and 0.23% to 0.03%
for texture and samplers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoi965: Remove broken symlink to intel_decode.c.
Kenneth Graunke [Wed, 8 Feb 2012 02:14:53 +0000 (18:14 -0800)]
i965: Remove broken symlink to intel_decode.c.

Eric removed intel_decode.c in 61b9ccd9e298ca1d3db55aee0cb2ff78662d6fa6.

12 years agoi965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.
Eric Anholt [Sat, 4 Feb 2012 13:05:46 +0000 (14:05 +0100)]
i965/fs: Implement GL_CLAMP behavior on texture rectangles on gen6+.

We were doing saturate-based clamping on the [0,width] or [0,height]
coordinate, which meant only the first pixel was addressable.

Fixes piglit ARB_texture_rectangle/texwrap-RECT-bordercolor

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965/fs: Move GL_CLAMP handling to coordinate setup.
Eric Anholt [Fri, 3 Feb 2012 18:06:08 +0000 (19:06 +0100)]
i965/fs: Move GL_CLAMP handling to coordinate setup.

We should be able to merge self-move instruction into the MRF move
anyway, and this simplifies things for the next commit.

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoi965: Fix HiZ change compiler warning.
Eric Anholt [Wed, 8 Feb 2012 00:03:17 +0000 (16:03 -0800)]
i965: Fix HiZ change compiler warning.

12 years agoi965: Rewrite the HiZ op
Chad Versace [Thu, 26 Jan 2012 19:01:36 +0000 (11:01 -0800)]
i965: Rewrite the HiZ op

The HiZ op was implemented as a meta-op. This patch reimplements it by
emitting a special HiZ batch. This fixes several known bugs, and likely
a lot of undiscovered ones too.

==== Why the HiZ meta-op needed to die ====

The HiZ op was implemented as a meta-op, which caused lots of trouble. All
other meta-ops occur as a result of some GL call (for example, glClear and
glGenerateMipmap), but the HiZ meta-op was special. It was called in
places that Mesa (in particular, the vbo and swrast modules) did not
expect---and were not prepared for---state changes to occur (for example:
glDraw; glCallList; within glBegin/End blocks; and within
swrast_prepare_render as a result of intel_miptree_map).

In an attempt to work around these unexpected state changes, I added two
hooks in i965:
  - A hook for glDraw, located in brw_predraw_resolve_buffers (which is
    called in the glDraw path). This hook detected if a predraw resolve
    meta-op had occurred, and would hackishly repropagate some GL state
    if necessary. This ensured that the meta-op state changes would not
    intefere with the vbo module's subsequent execution of glDraw.
  - A hook for glBegin, implemented by brwPrepareExecBegin. This hook
    resolved all buffers before entering
    a glBegin/End block, thus preventing an infinitely recurring call to
    vbo_exec_FlushVertices. The vbo module calls vbo_exec_FlushVertices to
    flush its vertex queue in response to GL state changes.

Unfortunately, these hooks were not sufficient. The meta-op state changes
still interacted badly with glPopAttrib (as discovered in bug 44927) and
with swrast rendering (as discovered by debugging gen6's swrast fallback
for glBitmap). I expect there are more undiscovered bugs. Rather than play
whack-a-mole in a minefield, the sane approach is to replace the HiZ
meta-op with something safer.

==== How it was killed ====

This patch consists of several logical components:
  1. Rewrite the HiZ op by replacing function gen6_resolve_slice with
     gen6_hiz_exec and gen7_hiz_exec. The new functions do not call
     a meta-op, but instead manually construct and emit a batch to "draw"
     the HiZ op's rectangle primitive. The new functions alter no GL
     state.
  2. Add fields to brw_context::hiz for the new HiZ op.
  3. Emit a workaround flush when toggling 3DSTATE_VS.VsFunctionEnable.
  4. Kill all dead HiZ code:
     - the function gen6_resolve_slice
     - the dirty flag BRW_NEW_HIZ
     - the dead fields in brw_context::hiz
     - the state packet manipulation triggered by the now removed
       brw_context::hiz::op
     - the meta-op workaround in brw_predraw_resolve_buffers (discussed
       above)
     - the meta-op workaround brwPrepareExecBegin (discussed above)

Note: This is a candidate for the 8.0 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43327
Reported-by: xunx.fang@intel.com
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44927
Reported-by: chao.a.chen@intel.com
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agointel: Avoid divide by zero for very small linear blits
Ian Romanick [Thu, 2 Feb 2012 23:32:45 +0000 (16:32 -0700)]
intel: Avoid divide by zero for very small linear blits

If size is small (such as 1),

   pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);

makes pitch = 0.  Then

   height = size / pitch;

causes a division-by-zero exception.  If pitch is zero, set height to
1 and avoid the division.

This fixes piglit's bin/getteximage-formats test and glean's
bufferObject test.

NOTE: This is a candidate for the 8.0 release branch.

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=44971

12 years agointel: Remove num_mapped_regions assertion from _intel_batchbuffer_flush
Ian Romanick [Wed, 1 Feb 2012 18:37:54 +0000 (11:37 -0700)]
intel: Remove num_mapped_regions assertion from _intel_batchbuffer_flush

There are cases where a buffer can be mapped while another buffer is
flushed.  This can happen in the CopyPixels meta-op path for piglit's
fbo-mipmap-copypix.  After some discussion with Eric, it seems this
assertion is no longer necessary, and it has always been too strict.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43328
Cc: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
12 years agogallium/gbm: r300 and r600 now depend on libdrm
Tobias Droste [Tue, 7 Feb 2012 15:27:11 +0000 (16:27 +0100)]
gallium/gbm: r300 and r600 now depend on libdrm

fixes undefined references in libradeonwinsys.a when linking

Signed-off-by: Tobias Droste <tdroste@gmx.de>
12 years agor600g: remove unused vars to silence warnings
Brian Paul [Tue, 7 Feb 2012 14:48:46 +0000 (07:48 -0700)]
r600g: remove unused vars to silence warnings

12 years agomesa: remove unused _mesa_error_check_format_type() function
Brian Paul [Tue, 7 Feb 2012 14:42:33 +0000 (07:42 -0700)]
mesa: remove unused _mesa_error_check_format_type() function

This was only used by glReadPixels and glDrawPixels.  Now those
functions do the corresponding error checks.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: stop using _mesa_error_check_format_type() in glReadPixels
Brian Paul [Tue, 7 Feb 2012 14:42:33 +0000 (07:42 -0700)]
mesa: stop using _mesa_error_check_format_type() in glReadPixels

Basically the same story as the previous commit.  But we were
already calling _mesa_source_buffer_exists() in ReadPixels().
Yeah, we were calling it twice.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: stop using _mesa_error_check_format_type() in glDrawPixels
Brian Paul [Tue, 7 Feb 2012 14:42:33 +0000 (07:42 -0700)]
mesa: stop using _mesa_error_check_format_type() in glDrawPixels

The _mesa_error_check_format_type() function does two things: check
that format/type is legal and check that the destination (or source
buffer for glReadPixels) actually exists.  Just move the relevant
parts of that into _mesa_DrawPixels().

We'll do a similar change in glReadPixels then get rid of the function
altogether.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: remove redundant format/type checks in glReadPixels()
Brian Paul [Tue, 7 Feb 2012 14:42:33 +0000 (07:42 -0700)]
mesa: remove redundant format/type checks in glReadPixels()

These are done in _mesa_error_check_format_and_type().

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: remove redundant format/type checks in glGetTexImage()
Brian Paul [Tue, 7 Feb 2012 14:42:33 +0000 (07:42 -0700)]
mesa: remove redundant format/type checks in glGetTexImage()

The _mesa_error_check_format_and_type() function will catch all those
cases now.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agomesa: new _mesa_error_check_format_and_type() function
Brian Paul [Tue, 7 Feb 2012 14:42:33 +0000 (07:42 -0700)]
mesa: new _mesa_error_check_format_and_type() function

This replaces the _mesa_is_legal_format_and_type() function.

According to the spec, some invalid format/type combinations to
glDrawPixels, ReadPixels and glTexImage should generate
GL_INVALID_ENUM but others should generate GL_INVALID_OPERATION.

With the old function we didn't make that distinction and generated
GL_INVALID_ENUM errors instead of GL_INVALID_OPERATION.  The new
function returns one of those errors or GL_NO_ERROR.

This will also let us remove some redundant format/type checks in
follow-on commit.

v2: add more checks for ARB_texture_rgb10_a2ui at the top of
_mesa_error_check_format_and_type() per Ian.

Signed-off-by: Brian Paul <brianp@vmware.com>
12 years agoscons: fix typo in package version
Dave Airlie [Tue, 7 Feb 2012 14:26:16 +0000 (14:26 +0000)]
scons: fix typo in package version

pointed out on irc by GArik_

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoradeon: only init surface manage on r600
Dave Airlie [Tue, 7 Feb 2012 14:19:28 +0000 (14:19 +0000)]
radeon: only init surface manage on r600

r300 fails to init the manager and then fails to init.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoscons: Require same pkg-config versions as configure.
José Fonseca [Tue, 7 Feb 2012 11:17:35 +0000 (11:17 +0000)]
scons: Require same pkg-config versions as configure.

12 years agoscons: r300/r600 now depends on libdrm.
José Fonseca [Tue, 7 Feb 2012 11:16:35 +0000 (11:16 +0000)]
scons: r300/r600 now depends on libdrm.

As they now indirectly include on libdrm/radeon_surface.h.

12 years agomesa: support more format/type combos in _mesa_dump_image()
Brian Paul [Tue, 7 Feb 2012 00:56:43 +0000 (17:56 -0700)]
mesa: support more format/type combos in _mesa_dump_image()

12 years agoutil: fix typo in debug_printf_once comment
Brian Paul [Tue, 7 Feb 2012 00:56:43 +0000 (17:56 -0700)]
util: fix typo in debug_printf_once comment

12 years agor600g: add support for common surface allocator for tiling v13
Jerome Glisse [Mon, 30 Jan 2012 22:22:13 +0000 (17:22 -0500)]
r600g: add support for common surface allocator for tiling v13

Tiled surface have all kind of alignment constraint that needs to
be met. Instead of having all this code duplicated btw ddx and
mesa use common code in libdrm_radeon this also ensure that both
ddx and mesa compute those alignment in the same way.

v2 fix evergreen
v3 fix compressed texture and workaround cube texture issue by
   disabling 2D array mode for cubemap (need to check if r7xx and
   newer are also affected by the issue)
v4 fix texture array
v5 fix evergreen and newer, split surface values computation from
   mipmap tree generation so that we can get them directly from the
   ddx
v6 final fix to evergreen tile split value
v7 fix mipmap offset to avoid to use random value, use color view
   depth view to address different layer as hardware is doing some
   magic rotation depending on the layer
v8 fix COLOR_VIEW on r6xx for linear array mode, use COLOR_VIEW on
   evergreen, align bytes per pixel to a multiple of a dword
v9 fix handling of stencil on evergreen, half fix for compressed
   texture
v10 fix evergreen compressed texture proper support for stencil
    tile split. Fix stencil issue when array mode was clear by
    the kernel, always program stencil bo. On evergreen depth
    buffer bo need to be big enough to hold depth buffer + stencil
    buffer as even with stencil disabled things get written there.
v11 rebase on top of mesa, fix pitch issue with 1d surface on evergreen,
    old ddx overestimate those. Fix linear case when pitch*height < 64.
    Fix r300g.
v12 Fix linear case when pitch*height < 64 for old path, adapt to
    libdrm API change
v13 add libdrm check

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
12 years agoHave __glImageSize handle format GL_DEPTH_STENCIL_NV the same way as the server does
Jon TURNEY [Thu, 9 Sep 2010 12:43:11 +0000 (13:43 +0100)]
Have __glImageSize handle format GL_DEPTH_STENCIL_NV the same way as the server does

There is a mismatch between the way the X server and GLX library
calculates the image size for format GL_DEPTH_STENCIL(|_NV|_EXT)

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

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
12 years agost/vdpau: use dst surface size if clip width/height is zero
Christian König [Thu, 2 Feb 2012 16:10:58 +0000 (17:10 +0100)]
st/vdpau: use dst surface size if clip width/height is zero

Just another fix for gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement vlVdpOutputSurfaceQueryCapabilities
Christian König [Thu, 2 Feb 2012 13:02:52 +0000 (14:02 +0100)]
st/vdpau: implement vlVdpOutputSurfaceQueryCapabilities

Fixing some problems with gstreamer.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
12 years agonv50: fix bad assertion on Elements(phi->src) in regalloc
Christoph Bumiller [Mon, 6 Feb 2012 11:15:17 +0000 (12:15 +0100)]
nv50: fix bad assertion on Elements(phi->src) in regalloc

The array is phi->src, phi->src[i] is just a pointer.

12 years agodri: Don't build libdricommon.la if we don't need it
Jon TURNEY [Thu, 2 Feb 2012 10:39:04 +0000 (10:39 +0000)]
dri: Don't build libdricommon.la if we don't need it

Refine 80aa78142d12b21dd7d4f0edc786af98a159a80f "dri: make sure to build libdricommon.la"
so we don't build libdricommon if we aren't building a dri driver which needs it (i.e.
if we are just building swrast)

In particular, this restores the ability to build the swrast dri driver without having to
have a xf86drm.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
12 years agovl: add VL_MAX_SURFACES define
Christian König [Wed, 25 Jan 2012 12:58:57 +0000 (13:58 +0100)]
vl: add VL_MAX_SURFACES define

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: rename VL_MAX_PLANES to VL_NUM_COMPONENTS
Christian König [Wed, 25 Jan 2012 12:34:07 +0000 (13:34 +0100)]
vl: rename VL_MAX_PLANES to VL_NUM_COMPONENTS

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: prefix size defines with VL_
Christian König [Wed, 25 Jan 2012 10:53:00 +0000 (11:53 +0100)]
vl: prefix size defines with VL_

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: remove assert on unknown video profile
Christian König [Wed, 1 Feb 2012 11:37:44 +0000 (12:37 +0100)]
vl: remove assert on unknown video profile

It's perfectly valid to ask for an unknown
profile and get unknown code as a result.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/xvmc: respect caps when creating video buffers
Christian König [Wed, 1 Feb 2012 23:07:43 +0000 (00:07 +0100)]
st/xvmc: respect caps when creating video buffers

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: use interlacing capabilities
Christian König [Wed, 1 Feb 2012 22:50:34 +0000 (23:50 +0100)]
st/vdpau: use interlacing capabilities

Recreate video buffer if need arises.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/vdpau: implement uploads to interlaced video buffers
Christian König [Mon, 30 Jan 2012 17:04:50 +0000 (18:04 +0100)]
st/vdpau: implement uploads to interlaced video buffers

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: add interlacing capabilities
Christian König [Wed, 1 Feb 2012 22:38:45 +0000 (23:38 +0100)]
vl: add interlacing capabilities

Let the driver control interlaced or progressive
format of video buffers.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: add a simple weave deinterlacer
Christian König [Mon, 23 Jan 2012 20:28:34 +0000 (21:28 +0100)]
vl: add a simple weave deinterlacer

Well it's not so simple, since it does
deinterlacing and scaling at the same time.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/video_buffer: fix interlaced surface ordering
Christian König [Thu, 26 Jan 2012 14:30:53 +0000 (15:30 +0100)]
vl/video_buffer: fix interlaced surface ordering

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/video_buffer: fix height of interlaced video buffers
Christian König [Mon, 30 Jan 2012 16:51:53 +0000 (17:51 +0100)]
vl/video_buffer: fix height of interlaced video buffers

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agomesa: check_index_bounds off-by-one fix
Roland Scheidegger [Mon, 6 Feb 2012 00:04:28 +0000 (01:04 +0100)]
mesa: check_index_bounds off-by-one fix

in check_index_bounds the comparison needs to be "greater equal" since
contrary to the name _MaxElement is the count of the array (this matches
similar code in vbo_exec_DrawRangeElementsBaseVertex).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Fix xcb-dri2 link flags leaking into LIBS.
Eric Anholt [Fri, 3 Feb 2012 04:28:14 +0000 (05:28 +0100)]
mesa: Fix xcb-dri2 link flags leaking into LIBS.

Fixes the build of builtin_compiler on my 32-bit build where xcb-dri2
is in a custom prefix but the custom prefix flags weren't available.
It shouldn't have been in LIBS anyway.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agointel: check for LLC support when reading maps
Eugeni Dodonov [Wed, 1 Feb 2012 20:24:23 +0000 (18:24 -0200)]
intel: check for LLC support when reading maps

This checks for advertised LLC support by the GPU instead of relying on
the GPU generation for detection.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agointel: verify if hardware has LLC support
Eugeni Dodonov [Wed, 1 Feb 2012 20:06:53 +0000 (18:06 -0200)]
intel: verify if hardware has LLC support

Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In
case the libdrm version does not supports this check, fallback to older
way of detecting it which assumed that GPUs newer than GEN6 have it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodraw: fix fog coord export.
Dave Airlie [Sat, 28 Jan 2012 18:29:18 +0000 (18:29 +0000)]
draw: fix fog coord export.

This does what we do in the hw drivers, and only export the X.

fixes the fogcoord.dp* tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agovbo: fix a building error
Chih-Wei Huang [Thu, 2 Feb 2012 12:23:57 +0000 (20:23 +0800)]
vbo: fix a building error

Signed-off-by: Marek Olšák <maraeo@gmail.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agollvmpipe: Make more resilient to out-of-memory situations.
José Fonseca [Wed, 9 Nov 2011 19:29:37 +0000 (19:29 +0000)]
llvmpipe: Make more resilient to out-of-memory situations.

Most of the code was alright, but we were missing a few paths.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agollvmpipe: clear storage for newly allocated resources
Keith Whitwell [Wed, 22 Dec 2010 14:04:42 +0000 (14:04 +0000)]
llvmpipe: clear storage for newly allocated resources

Was previously being done in a state-tracker, but in a way which was
difficult for some drivers to optimize.  Push down to this level and
make it the individual drivers responsibility.

12 years agointel: FBOs with texture border are unsupported
Ian Romanick [Wed, 1 Feb 2012 17:18:13 +0000 (10:18 -0700)]
intel: FBOs with texture border are unsupported

FBOs differ from textures in a significant way.  With textures, we can
strip the border and get correct rendering except when the application
fetches texels outside [0,1].

With an FBO, the pixel at (0,0) is in the border.  The
ARB_framebuffer_object spec says:

    "If the attached image is a texture image, then the window
    coordinates (x[w], y[w]) correspond to the texel (i, j, k), from
    figure 3.10 as follows:

                           i = (x[w] - b)

                           j = (y[w] - b)

                           k = (layer - b)

    where <b> is the texture image's border width..."

Since the border doesn't exist, we can never render any pixels in the
correct location.  Just mark these FBOs FRAMEBUFFER_UNSUPPORTED.

NOTE: This is a candidate for the 8.0 branch.

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

12 years agogallium/dri: Handle xserver that doesn't send needless DRI2 invalidate events
Ville Syrjala [Wed, 1 Feb 2012 03:10:04 +0000 (05:10 +0200)]
gallium/dri: Handle xserver that doesn't send needless DRI2 invalidate events

Ever since xserver commit 531869448d07e00ae241120b59f3aaaa5709d59c,
the server no longer sends invalidate events to clients, unless they
have performed a GetBuffers request since the drawable was last
invalidated.

If the drawable gets invalidated immediately after the GetBuffers
request was processed by the X server, it's possible that Xlib
will process the invalidate event while waiting for the GetBuffers
reply. So the server, thinking the client knows that the buffers
are invalid, is waiting for another GetBuffers request before
sending any more invalidate events. The client, on the other hand,
believes the buffers to be valid, and thus is expecting to receive
another invalidate event before it has to send another GetBuffers
request. The end result is that the client never again sends
a GetBuffers request.

To avoid this problem, take a snapshot of the lastStamp before
doing GetBuffers, and retry if the snapshot and the current
lastStamp no longer match after the GetBuffers reply has been
processed.

Signed-off-by: Ville Syrjälä <syrjala@sci.fi>
Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoglsl: Add error case for switch() with two default cases.
Eric Anholt [Mon, 30 Jan 2012 17:50:35 +0000 (09:50 -0800)]
glsl: Add error case for switch() with two default cases.

Fixes piglit switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Throw an error when faced with a duplicated switch() case label.
Eric Anholt [Mon, 30 Jan 2012 16:50:14 +0000 (08:50 -0800)]
glsl: Throw an error when faced with a duplicated switch() case label.

The error message I chose matches gcc's error.  Fixes piglit
switch-case-duplicated.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Add other missing error location information for switch statements.
Eric Anholt [Mon, 30 Jan 2012 17:46:09 +0000 (09:46 -0800)]
glsl: Add other missing error location information for switch statements.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Add missing location info to case labels.
Eric Anholt [Mon, 30 Jan 2012 17:41:55 +0000 (09:41 -0800)]
glsl: Add missing location info to case labels.

Otherwise, the upcoming error messages said the location was 0:0(0).

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Throw the required error when a case label is a non-constant.
Eric Anholt [Sat, 28 Jan 2012 19:43:22 +0000 (11:43 -0800)]
glsl: Throw the required error when a case label is a non-constant.

It's not quite spelled out in the spec text, but the grammar indicates
that only constant values are allowed as switch() case labels (and
only constant values make sense, anyway).

Fixes piglit glsl-1.30/compiler/switch-statement/switch-case-uniform-int.vert.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoglsl: Save and restore the whole switch state for nesting.
Eric Anholt [Sat, 28 Jan 2012 19:26:02 +0000 (11:26 -0800)]
glsl: Save and restore the whole switch state for nesting.

This stuffs them all in a struct for sanity.  Fixes piglit
glsl-1.30/execution/switch/fs-uniform-nested.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agodri: Add Unigine Tropics as an app that requires the GLSL warn workaround.
Eric Anholt [Mon, 30 Jan 2012 21:30:53 +0000 (13:30 -0800)]
dri: Add Unigine Tropics as an app that requires the GLSL warn workaround.

I wasn't seeing it be needed because of the previous bug.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agodri: Fix typo in xml file that made all applications use the workaround.
Eric Anholt [Mon, 30 Jan 2012 21:29:07 +0000 (13:29 -0800)]
dri: Fix typo in xml file that made all applications use the workaround.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
12 years agomesa: Fix the error message function names for glFlushMappedBufferRange().
Eric Anholt [Mon, 30 Jan 2012 21:20:27 +0000 (13:20 -0800)]
mesa: Fix the error message function names for glFlushMappedBufferRange().

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: Fix bad-enum/no-buffer error handling for buffer object functions.
Eric Anholt [Thu, 26 Jan 2012 00:30:26 +0000 (16:30 -0800)]
mesa: Fix bad-enum/no-buffer error handling for buffer object functions.

For all the extension entrypoints using the get_buffer() helper, they
wanted the same error handling.  In some cases, the error was doing
the same error return whether target was a bad enum, or a user buffer
wasn't bound.

(Actually, GL_ARB_map_buffer_range doesn't specify the error for a zero
buffer being bound for MapBufferRange, though it does for
FlushMappedBufferRange.  This appears to be an oversight).

Fixes piglit GL_ARB_copy_buffer/negative-bound-zero.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agoglsl: move array_sizing_visitor class outside of link_intrastage_shaders()
Brian Paul [Fri, 3 Feb 2012 03:10:40 +0000 (20:10 -0700)]
glsl: move array_sizing_visitor class outside of link_intrastage_shaders()

To silence warnings with gcc 4.4.x on Linux and llvm-g++ 4.2 on Mac.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agogallium/postprocess: move declarations before code
Brian Paul [Thu, 2 Feb 2012 22:14:04 +0000 (15:14 -0700)]
gallium/postprocess: move declarations before code

To fix MSVC build.

12 years agogallium/postprocess: Just to be safe, reference all buffers from outside
Lauri Kasanen [Tue, 24 Jan 2012 19:37:56 +0000 (21:37 +0200)]
gallium/postprocess: Just to be safe, reference all buffers from outside

Even though it should be safe to use them for one frame, better be sure.
Suggested by Michael Dänzer.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
12 years agogallium/postprocess: Fix depth logic
Lauri Kasanen [Tue, 24 Jan 2012 19:37:07 +0000 (21:37 +0200)]
gallium/postprocess: Fix depth logic

This prevents a possible lapse of the depth buffer - the situation where
the app and pp have different depth buffers.

NOTE: This is a candidate for the 8.0 stable branch.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
12 years agoglsl: Avoid ralloc_stealing a long-lived object to a short-lived parent
Carl Worth [Thu, 2 Feb 2012 19:29:51 +0000 (11:29 -0800)]
glsl: Avoid ralloc_stealing a long-lived object to a short-lived parent

In commit 6ecee54a9aecc120cb68b02f7e14dcac86b9eca2 a call to
talloc_reference was replaced with a call to talloc_steal. This was in
preparation for moving to ralloc which doesn't support reference
counting.

The justification for talloc_steal within token_list_append in that
commit is that the tokens are being copied already. But the copies are
shallow, so this does not work.

Fortunately, the lifetime of these tokens is easy to understand. A
token list for "replacements" is created and stored in a hash table
when a function-like macro is defined. This list will live until the
macro is #undefed (if ever).

Meanwhile, a shallow copy of the list is created when the macro is
used and the list expanded. This copy is short-lived, so is unsuitable
as a new parent.

So we can just let the original, longer-lived owner continue to own
the underlying objects and things will work.

This fixes bug #45082:

"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
failed." when using a macro in GLSL
https://bugs.freedesktop.org/show_bug.cgi?id=45082

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for stable release branches.

12 years agoglsl: Add glcpp tests for a macro used twice
Carl Worth [Thu, 2 Feb 2012 19:27:55 +0000 (11:27 -0800)]
glsl: Add glcpp tests for a macro used twice

This test cases exposes a bug as described in this bug report:

"ralloc.c:78: get_header: Assertion `info->canary == 0x5A1106'
failed." when using a macro in GLSL
https://bugs.freedesktop.org/show_bug.cgi?id=45082

Clearly, some memory is getting (incorrectly) freed on the first macro
invocation, leading to problems with the second macro invocation.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglcpp: Fix so that trailing punctuation does not prevent macro expansion
Carl Worth [Sat, 21 Jan 2012 17:24:11 +0000 (09:24 -0800)]
glcpp: Fix so that trailing punctuation does not prevent macro expansion

The trick here is that flex always chooses the rule that matches the most
text. So with a input text of "two:" which we want to be lexed as an
IDENTIFIER token "two" followed by an OTHER token ":" the previous OTHER
rule would match longer as a single token of "two:" which we don't want.

We prevent this by forcing the OTHER pattern to never match any
characters that appear in other constructs, (no letters, numbers, #,
_, whitespace, nor any punctuation that appear in CPP operators).

Fixes bug #44764:

GLSL preprocessor doesn't replace defines ending with ":"
https://bugs.freedesktop.org/show_bug.cgi?id=44764

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for stable release branches.

12 years agoglcpp: Add new test showing bug where a trailing ':' prevents macro expansion
Carl Worth [Sat, 21 Jan 2012 17:22:24 +0000 (09:22 -0800)]
glcpp: Add new test showing bug where a trailing ':' prevents macro expansion

This demonstrates a bug that was recently triggered in piglit.

Here is the original bug report (containing a test case almost identical
to this one):

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

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float
Ian Romanick [Thu, 2 Feb 2012 05:46:31 +0000 (22:46 -0700)]
mesa: Fix copy-and-paste error in _mesa_pack_rgba_span_float

GL_RG_INTEGER only has two components, not three.  I'll be surprised
if anyone ever tries to glReadPixels(..., GL_SHORT, GL_RG_INTEGER,
...).  This was found by inspection.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>