Commit Graph

15300 Commits

Author SHA1 Message Date
Christian König b34c35a524 vl: cleanup dri winsys abstraction
There was way to much dead code in it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-25 12:14:00 +01:00
Stéphane Marchesin 6512bc4e67 i915g: Fix fallout from 8e4540ec2a
Fixes piglit regressions from that change.
2012-02-24 15:17:27 -08:00
Zack Rusin 5d9bfc4d3f svga: Fix stencil op mapping
We were inverting the meaning of the stencil op flags: in svga/d3d
the normal incr/decr wraps and the SAT ops clamp.
This fixes piglit failures (at least stencil-twoside and stencil-wrap).
We should backport this everywhere we can.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-02-24 14:55:56 -05:00
Brian Paul e0095548c0 svga: fix use of SVGA3D_x vs. PIPE_FORMAT_x in svga_is_format_supported()
Two of the switch cases used PIPE_FORMAT_ tokens instead of SVGA3D_ tokens.
As it happens, the token values are equal for these formats so there's no
net change.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2012-02-24 10:15:37 -07:00
Brian Paul 5f60a00743 st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS
Remove some Mesa/swrast stuff.
2012-02-24 08:03:13 -07:00
Brian Paul 0a543eb5c4 st/glx: remove MAX_WIDTH/HEIGHT usage 2012-02-24 08:03:11 -07:00
Marek Olšák a0a9e56cfe u_blitter: decrease minimum buffer range alignment to 4 for copy_buffer 2012-02-24 02:28:59 +01:00
Marek Olšák 59fbd8c6be u_blitter: check for invalid values in copy_buffer 2012-02-24 02:28:54 +01:00
Marek Olšák df00dc3c81 r600g: rework queries
We always mapped the query buffer in begin_query, causing stalls
if the buffer was busy.

This commit reworks it such that the query buffer is only mapped
in get_query_result as it's supposed to be.

The query buffer is no longer treated as a ring buffer. Instead, the results
are just appended and when the buffer is full, we create a new one. One query
can have more than one query buffer, though that's a very rare case.
Begin_query releases all query buffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák 5b84a8c3c3 r600g: cleanup magic numbers in set_xx_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák 89293287b8 r600g: remove duplicated evergreen_context_ps_partial_flush
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák 84db8f9a22 r600g: remove duplicated evergreen_context_pipe_state_set_sampler
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák edc0ce292b r600g: remove duplicated set_xx_resource functions
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák 985bd5487e r600g: remove duplicated function r600_state_sampler_init
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák cf59ed3f23 r600g: fixup name of evergreen-specific function
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:56 +01:00
Marek Olšák 04d2828b03 r600g: simplify fail paths in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák 99d5c1a13b gallium/u_slab: fix possible crash in util_slab_destroy
It may happen if util_slab_create has not been called.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák 6a94c9dde0 r600g: fix possible crashes in destroy_context when failing in create_context
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák 9670e72f6e r600g: consolidate common context init code
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Marek Olšák f841b8a833 r600g: define GROUP_FORCE_NEW_BLOCK in common header
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-02-23 20:29:55 +01:00
Jakob Bornecrantz bed7b4aa5f st/dri: Fix crash in st/dri from dri format commit
Introduced with 8de5c355fa, it would probably just crash.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jesse Barnes <jbarnes@virtousgeek.org>
2012-02-23 19:16:58 +01:00
Brian Paul 4a72d859b4 util: add mutex lock in u_debug_memory.c code
The linked list of memory allocations was not protected by a mutex.
This lead to sporadic failures with multi-threaded apps.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:10 -07:00
Brian Paul 810584270d svga: no-op sampler view referencing if no change
Just to be safe with ref counting and avoid atomic operations.
2012-02-23 07:49:09 -07:00
Brian Paul 0fffaa512c svga: use pipe_sampler_view_release() to avoid segfault
This fixes another case of faulting when freeing a pipe_sampler_view
that belongs to a previously destroyed context.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:09 -07:00
Brian Paul be05388ce9 st/wgl: check for hPbuffer=0 in wgl pbuffer functions
Per the GL_WGL_pbuffer spec, generate ERROR_INVALID_HANDLE and
return FALSE (and don't segfault).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:08 -07:00
José Fonseca 9ffc8ea8f4 st/wgl: Fix argument of stw_pixelformat_get_info().
stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.
2012-02-23 07:49:08 -07:00
Brian Paul 4fdf42883f gallium: added pipe_sampler_view_release() function
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul 09d0fa5be8 svga: re-enable deleted surface caching
Basically, instead of immediately freeing deleted surfaces, hang onto
them in a cache to do quick re-allocation.  This helps when surfaces
are frequently destroyed and then reallocated a bit later.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:07 -07:00
Brian Paul 500e7c5860 svga: implement surface cache size limit
There was a SVGA_HOST_SURFACE_CACHE_BYTES symbol, but it was never
used.

Now when we go to add a newly deleted surface to the cache we check
if the cache size would be exceeded.  If so, try to free the least
recently "unused" surfaces until the cache is smaller.  If we can't
do that, simply don't cache the newly deleted surface.  The alternative
involves flushing and waiting and we don't want to do that.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul 32f669e7fc svga: add svga_format_size() function
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul 8a9cad6384 svga: use dummy shaders when translation fails
Before, if shader translation failed for any reason we'd keep trying
to translate the shader over and over again during state validation.
The dummy fragment shader emits solid red so that might be visual
clue that translation is failing.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul 4516fcc57f svga: move temp register index assertions
The assertion recently added in dst_register() was invalid because that
function is also (suprisingly) used to declare constant registers.

Move the assertion to the callers where we're really creating temp
registers and add some code to prevent emitting invalid temp register
indexes for release builds.

Also, update the comment for get_temp().  It didn't return -1 if it
ran out of registers and none of the callers checked for that.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:06 -07:00
Brian Paul f12f67c00a svga: check that we don't exceed temp register limit
And assert on the register index in dst_register().  The dest can
only be an output or temp reg and there's more of the later.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-02-23 07:49:05 -07:00
Alex Corscadden 1702d8bdd8 Add a test for the compare opcode.
This is a test for the compare opcode (CMP).  This should draw a green triangle
in the fs-test.
2012-02-23 12:29:29 +00:00
Satyajit Sarangi 132daa87fb r600g: Fix build when libdrm is installed to non-standard dir.
Signed-off-by: Satyajit Sarangi<kernel.saty@gmail.com>
Signed-off-by: Tom Stellard <tstellar@gmail.com>
2012-02-22 20:39:01 -05:00
Jesse Barnes 8de5c355fa gbm: track buffer format through DRI drivers
GBM needs the buffer format in order to communicate with DRM and clients
for things like scanout.

So track the DRI format requested in the various back ends and use it to
return the DRI format back to GBM when requested.  GBM will then map
this into the GBM surface type (which is in turn based on the DRM fb
format list).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2012-02-22 09:41:40 -08:00
José Fonseca d35d3d612a tests/graw: Add a bunch of tests.
These were rotting in an internal branch, but contain nothing confidential,
and would be much more useful if kept up-to-date with latest gallium
interface changes.

Several authors including Keith Whitwell, Zack Rusin, and Brian Paul.
2012-02-22 15:22:31 +00:00
José Fonseca 3dd7b53178 gallium/cso: Put the comment about shader in the code for future reference. 2012-02-22 08:41:19 +00:00
Marek Olšák 5d2de9232d r600g: move invariant register updates into start_cs for evergreen and cayman 2012-02-21 21:42:27 +01:00
Marek Olšák fbebd431ec r600g: move invariant register updates into start_cs for r6xx-r7xx 2012-02-21 21:42:27 +01:00
Marek Olšák e2809849ec r600g: add a depth misc state which depends on occlusion queries
This is a state which is derived from other states and is actually the first
state which doesn't correspond to any gallium state.

There are two state flags:
  bool occlusion_query_enabled
  bool flush_depthstencil_enabled

Additional flags can be added later if needed, e.g. bool hiz_enabled.
The emit function will have to figure out the register values by itself.

It basically just emits the registers when the state changes.
This commit also adds a few helper functions for writing registers directly
into a command stream.
2012-02-21 21:42:27 +01:00
Marek Olšák 8f5c172c85 r600g: consolidate the main draw code
The code was almost the same for r600 and eg. What can't be consolidated is
in the *_prepare functions.
2012-02-21 21:42:27 +01:00
Marek Olšák 182fd4c544 r600g: move all invariant state from draw_vbo into start_cs 2012-02-21 21:42:27 +01:00
Marek Olšák f126253040 r600g: turn init_config into a command buffer for starting a CS
This is the first pure command buffer. It contains CS initialization
packets and emits invariant state (i.e. the registers which never or rarely
change).

The affected registers are removed from *_hw_context.c, so that both ways
of emitting commands can co-exist.

v2: emit context_control in cayman's start_cs too
2012-02-21 21:42:27 +01:00
Marek Olšák 32f833e5a5 gallium/cso: kill off non-functional shader caching
Suggested by José.

We don't provide shader caching in CSO. Most of the time the api provides
object semantics for shaders anyway, and the cases where it doesn't
(eg mesa's internall-generated texenv programs), it will be up to
the state tracker to implement their own specialized caching.
2012-02-21 21:09:16 +01:00
Marek Olšák a6ef7f7ce4 gallium/util: remove u_simple_screen
Deprecated and unused.
2012-02-21 21:09:16 +01:00
Marek Olšák 96d882939d gallium: remove unused winsys pointers in pipe_screen and pipe_context
A winsys is already a private object of a driver.
2012-02-21 21:09:16 +01:00
Jerome Glisse e372e53ee0 radeon/r600g: fix virtual address space allocation
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-02-21 12:34:54 -05:00
José Fonseca 6fd62c998a llvmpipe: Remove lp_test_sincos.
Completely replaced by lp_test_arit.
2012-02-21 16:04:54 +00:00
Christian König 37f97e1753 vl: add support for bob deinterlacing
v2: return VDP_STATUS_INVALID_VIDEO_MIXER_PICTURE_STRUCTURE
    for unknown picture structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
2012-02-21 11:13:27 +01:00