Commit Graph

49487 Commits

Author SHA1 Message Date
Brian Paul 938671397f 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>
2012-02-07 07:45:40 -07:00
Brian Paul b8f7eef4ef 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>
2012-02-07 07:45:38 -07:00
Brian Paul 6bed7a861d 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>
2012-02-07 07:42:33 -07:00
Brian Paul 675d44629c 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>
2012-02-07 07:42:33 -07:00
Brian Paul 8b3a517673 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>
2012-02-07 07:42:33 -07:00
Brian Paul 627b435dfe 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>
2012-02-07 07:42:33 -07:00
Dave Airlie 699e3b9821 scons: fix typo in package version
pointed out on irc by GArik_

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-02-07 14:26:48 +00:00
Dave Airlie ff60bd8058 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>
2012-02-07 14:20:09 +00:00
José Fonseca 2470e918cc scons: Require same pkg-config versions as configure. 2012-02-07 11:41:08 +00:00
José Fonseca f763ad5130 scons: r300/r600 now depends on libdrm.
As they now indirectly include on libdrm/radeon_surface.h.
2012-02-07 11:40:58 +00:00
Brian Paul aed51e3e6a mesa: support more format/type combos in _mesa_dump_image() 2012-02-06 17:56:43 -07:00
Brian Paul 4ab8403c25 util: fix typo in debug_printf_once comment 2012-02-06 17:56:43 -07:00
Jerome Glisse c0c979eebc 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>
2012-02-06 18:36:37 -05:00
Jon TURNEY 8937c166ef 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>
2012-02-06 23:00:44 +00:00
Christian König 814be043fa 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>
2012-02-06 21:29:40 +01:00
Christian König 97349dfa79 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>
2012-02-06 21:26:49 +01:00
Christoph Bumiller 189e6c7e81 nv50: fix bad assertion on Elements(phi->src) in regalloc
The array is phi->src, phi->src[i] is just a pointer.
2012-02-06 12:19:57 +01:00
Jon TURNEY ffc8494db5 dri: Don't build libdricommon.la if we don't need it
Refine 80aa78142d "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>
2012-02-06 11:10:51 +00:00
Christian König 9001682846 vl: add VL_MAX_SURFACES define
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König 8abbdb8865 vl: rename VL_MAX_PLANES to VL_NUM_COMPONENTS
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König 70a7695b4d vl: prefix size defines with VL_
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König 3ac959492d 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>
2012-02-06 10:35:59 +01:00
Christian König 14f47d164d st/xvmc: respect caps when creating video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:59 +01:00
Christian König 8f54929c5d st/vdpau: use interlacing capabilities
Recreate video buffer if need arises.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König 8bfadc802f st/vdpau: implement uploads to interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König f3f03c67e9 vl: add interlacing capabilities
Let the driver control interlaced or progressive
format of video buffers.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:35:58 +01:00
Christian König 3841d3fd13 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>
2012-02-06 10:35:05 +01:00
Christian König 9f9628c72b vl/video_buffer: fix interlaced surface ordering
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Christian König 4ccae0dfaa vl/video_buffer: fix height of interlaced video buffers
Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-06 10:34:57 +01:00
Roland Scheidegger 1f4a853b1e 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>
2012-02-06 01:04:28 +01:00
Eric Anholt b3c84a80cd 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>
2012-02-04 22:04:35 +01:00
Eugeni Dodonov 84e5f1c635 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>
2012-02-04 18:21:22 -02:00
Eugeni Dodonov 7def293204 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>
2012-02-04 18:21:22 -02:00
Dave Airlie fa2a76a21c 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>
2012-02-04 17:50:43 +00:00
Chih-Wei Huang f8be4f33d3 vbo: fix a building error
Signed-off-by: Marek Olšák <maraeo@gmail.com>

NOTE: This is a candidate for the 8.0 branch.
2012-02-04 08:59:09 +01:00
José Fonseca 8184228e8b 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>
2012-02-03 18:51:14 +00:00
Keith Whitwell 9a1fd9a37c 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.
2012-02-03 18:51:14 +00:00
Ian Romanick 87b4c9b322 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
2012-02-03 10:50:01 -07:00
Ville Syrjala 0fcc518964 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>
2012-02-03 12:02:58 +00:00
Eric Anholt 57e44371a5 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>
2012-02-03 11:07:04 +01:00
Eric Anholt 140632190c 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>
2012-02-03 11:07:02 +01:00
Eric Anholt 01a5a2c9d7 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>
2012-02-03 11:06:59 +01:00
Eric Anholt 663dcbbffe 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>
2012-02-03 11:06:57 +01:00
Eric Anholt 2c3e10e719 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>
2012-02-03 11:06:54 +01:00
Eric Anholt 22d81f154f 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>
2012-02-03 11:06:50 +01:00
Eric Anholt b8c9252570 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>
2012-02-03 09:26:32 +01:00
Eric Anholt 4dd2743d45 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>
2012-02-03 09:26:23 +01:00
Eric Anholt 27af00eac8 mesa: Fix the error message function names for glFlushMappedBufferRange().
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-03 09:24:05 +01:00
Eric Anholt f20fb80a91 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>
2012-02-03 09:24:02 +01:00
Brian Paul 84a1273e7f 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>
2012-02-02 20:10:51 -07:00