mesa.git
12 years agosvga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.
José Fonseca [Mon, 27 Feb 2012 11:21:32 +0000 (11:21 +0000)]
svga: Clamp advertised PIPE_SHADER_CAP_MAX_TEMPS to SVGA3D_TEMPREG_MAX.

Some backends may advertise more temps than SVGA3D_TEMPREG_MAX, but the
driver is hardwired to only support up to the value defined by
SVGA3D_TEMPREG_MAX, so clamp to it.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agor600g: use u_default_transfer_flush_region for all resource types
Marek Olšák [Sun, 26 Feb 2012 18:15:45 +0000 (19:15 +0100)]
r600g: use u_default_transfer_flush_region for all resource types

12 years agor600g: use u_default_transfer_inline_write for all resource types
Marek Olšák [Sun, 26 Feb 2012 18:00:26 +0000 (19:00 +0100)]
r600g: use u_default_transfer_inline_write for all resource types

12 years agogallium/util: add fast path for buffers in u_default_transfer_inline_write
Marek Olšák [Sun, 26 Feb 2012 17:56:51 +0000 (18:56 +0100)]
gallium/util: add fast path for buffers in u_default_transfer_inline_write

v2: fix indentation, add assertions

12 years agogallium/util: set correct usage flags in u_default_transfer_inline_write
Marek Olšák [Sun, 26 Feb 2012 17:48:42 +0000 (18:48 +0100)]
gallium/util: set correct usage flags in u_default_transfer_inline_write

The DISCARD flags should improve performance in drivers which handle them.

12 years agor600g: fix streamout cache flush for r600
Marek Olšák [Sun, 26 Feb 2012 16:07:52 +0000 (17:07 +0100)]
r600g: fix streamout cache flush for r600

Figured out by trial and error.

12 years agovl: fix a douple free in xsp winsys backend
Christian König [Mon, 27 Feb 2012 11:57:24 +0000 (12:57 +0100)]
vl: fix a douple free in xsp winsys backend

There are a couple of more bugs, but it is only
useful for debugging anyway.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: adjust matrix and median filter to removal of PIPE_SHADER_CAP_OUTPUT_READ
Christian König [Mon, 27 Feb 2012 11:53:49 +0000 (12:53 +0100)]
vl: adjust matrix and median filter to removal of PIPE_SHADER_CAP_OUTPUT_READ

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agor600g: cleanup r600_transfer_struct
Marek Olšák [Sun, 26 Feb 2012 18:44:45 +0000 (19:44 +0100)]
r600g: cleanup r600_transfer_struct

Especially rename staging_texture to staging and change its type
to r600_resource. I will reuse it for buffers later.

12 years agor600g: check for R600_STREAMOUT env var in winsys
Marek Olšák [Thu, 23 Feb 2012 23:38:33 +0000 (00:38 +0100)]
r600g: check for R600_STREAMOUT env var in winsys

12 years agor600g: move initialization of use_surface flag into screen_create
Marek Olšák [Fri, 24 Feb 2012 16:17:57 +0000 (17:17 +0100)]
r600g: move initialization of use_surface flag into screen_create

Also change the type to bool and give it a less ambiguous name.

12 years agor600g: properly check whether texture is busy in get_transfer
Marek Olšák [Fri, 24 Feb 2012 16:14:59 +0000 (17:14 +0100)]
r600g: properly check whether texture is busy in get_transfer

12 years agor600g: rename r600_resource_texture::depth to bool is_depth
Marek Olšák [Fri, 24 Feb 2012 16:13:19 +0000 (17:13 +0100)]
r600g: rename r600_resource_texture::depth to bool is_depth

It's used as a boolean.

12 years agogallium: remove PIPE_SHADER_CAP_OUTPUT_READ
Marek Olšák [Thu, 23 Feb 2012 22:44:36 +0000 (23:44 +0100)]
gallium: remove PIPE_SHADER_CAP_OUTPUT_READ

r600g is the only driver which has made use of it. The reason the CAP was
added was to fix some piglit tests when the GLSL pass lower_output_reads
didn't exist.

However, not removing output reads breaks the fallback for glClampColorARB,
which assumes outputs are not readable. The fix would be non-trivial
and my personal preference is to remove the CAP, considering that reading
outputs is uncommon and that we can now use lower_output_reads to fix
the issue that the CAP was supposed to workaround in the first place.

12 years agogallium/rtasm: properly detect SSE and SSE2
Marek Olšák [Fri, 24 Feb 2012 18:29:48 +0000 (19:29 +0100)]
gallium/rtasm: properly detect SSE and SSE2

This should fix crashes on ancient processors.

12 years agor300g: Use automake to generate Makefile v3
Tom Stellard [Mon, 20 Feb 2012 00:38:58 +0000 (19:38 -0500)]
r300g: Use automake to generate Makefile v3

v2:
  - s/$(top_builddir)/$(top_srcdir)/
  - Always generate Makefile.in

v3:
  - Fixes from Matt Turner
  - Use Mesa CFLAGS

12 years agor300g: Reorganize the compiler unit tests
Tom Stellard [Fri, 24 Feb 2012 14:00:01 +0000 (09:00 -0500)]
r300g: Reorganize the compiler unit tests

12 years agor300/compiler: Schedule KIL instructions before output writes
Tom Stellard [Sun, 26 Feb 2012 20:12:36 +0000 (15:12 -0500)]
r300/compiler: Schedule KIL instructions before output writes

12 years agor300/compiler: Use the smart scheduler for r300 cards
Tom Stellard [Tue, 14 Feb 2012 02:26:15 +0000 (21:26 -0500)]
r300/compiler: Use the smart scheduler for r300 cards

12 years agor300/compiler: Fix bug when lowering KILP on r300 cards
Tom Stellard [Tue, 14 Feb 2012 02:27:28 +0000 (21:27 -0500)]
r300/compiler: Fix bug when lowering KILP on r300 cards

KILP instruction inside IF blocks were being lowered to an unconditional
KIL.  Since r300 doesn't support branching, when the IF's were lowered
to conditional moves, the KIL would always be executed.  This is not a
problem with the mesa state tracker, because the GLSL compiler handles
lowering IF's, but this bug was appearing in the VDPAU state tracker,
which does not use the GLSL compiler.

Note: This is a candidate for the stable branches.

12 years agovl/compositor: fix a simple typo
Christian König [Sat, 25 Feb 2012 11:14:58 +0000 (12:14 +0100)]
vl/compositor: fix a simple typo

Otherwise the dirty area tracking won't work correctly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agost/xvmc: move xvmc state tracker out of xorg subdir
Christian König [Wed, 15 Feb 2012 16:30:58 +0000 (17:30 +0100)]
st/xvmc: move xvmc state tracker out of xorg subdir

The xvmc state tracker is completely seperate and
doesn't shares code or anything else with the
xorg state tracker.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: rework winsys interface
Christian König [Wed, 15 Feb 2012 16:20:50 +0000 (17:20 +0100)]
vl: rework winsys interface

Throw out all the old and now unneeded stuff.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: cleanup dri winsys abstraction
Christian König [Wed, 15 Feb 2012 13:57:35 +0000 (14:57 +0100)]
vl: cleanup dri winsys abstraction

There was way to much dead code in it.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agoscons: Don't build the assembly sources on Mac OS X.
Vinson Lee [Sun, 19 Feb 2012 07:43:03 +0000 (23:43 -0800)]
scons: Don't build the assembly sources on Mac OS X.

This patch allows the Mac OS X SCons build to complete. The assembly
sources contain psuedo-ops that not are supported on Mac OS X.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoi915g: Fix fallout from 8e4540ec2a82e72be491bc8fe23c10551d29a96c
Stéphane Marchesin [Fri, 24 Feb 2012 23:17:27 +0000 (15:17 -0800)]
i915g: Fix fallout from 8e4540ec2a82e72be491bc8fe23c10551d29a96c

Fixes piglit regressions from that change.

12 years agosvga: Fix stencil op mapping
Zack Rusin [Fri, 24 Feb 2012 19:26:41 +0000 (14:26 -0500)]
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>
12 years agosvga: fix use of SVGA3D_x vs. PIPE_FORMAT_x in svga_is_format_supported()
Brian Paul [Fri, 24 Feb 2012 16:46:44 +0000 (17:46 +0100)]
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>
12 years agomesa/gdi: include swrast.h to fix compilation
Brian Paul [Fri, 24 Feb 2012 16:27:35 +0000 (09:27 -0700)]
mesa/gdi: include swrast.h to fix compilation

12 years agost/mesa: initialize the MaxViewport, MaxRenderbufferSize constants
Brian Paul [Tue, 21 Feb 2012 15:26:30 +0000 (08:26 -0700)]
st/mesa: initialize the MaxViewport, MaxRenderbufferSize constants

Use the max 2D/rect texture size as the limit.  If that's not true
for some devices we'll need new PIPE_CAP_ queries.

12 years agomesa: move more swrast-related #defines out of core Mesa
Brian Paul [Mon, 20 Feb 2012 20:13:55 +0000 (13:13 -0700)]
mesa: move more swrast-related #defines out of core Mesa

12 years agomesa: remove STENCIL_BITS use
Brian Paul [Mon, 20 Feb 2012 20:01:17 +0000 (13:01 -0700)]
mesa: remove STENCIL_BITS use

12 years agoxlib: remove STENCIL_BITS
Brian Paul [Tue, 21 Feb 2012 15:01:05 +0000 (08:01 -0700)]
xlib: remove STENCIL_BITS

12 years agost/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS
Brian Paul [Mon, 20 Feb 2012 20:00:17 +0000 (13:00 -0700)]
st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS

Remove some Mesa/swrast stuff.

12 years agomesa: remove last of MAX_WIDTH, MAX_HEIGHT
Brian Paul [Mon, 20 Feb 2012 18:07:01 +0000 (11:07 -0700)]
mesa: remove last of MAX_WIDTH, MAX_HEIGHT

Define new MAX_VIEWPORT_WIDTH/HEIGHT and MAX_RENDERBUFFER_SIZE values
instead.

12 years agomesa: remove MAX_WIDTH from prog_execute.h
Brian Paul [Mon, 20 Feb 2012 18:07:01 +0000 (11:07 -0700)]
mesa: remove MAX_WIDTH from prog_execute.h

define a PROG_MAX_WIDTH var instead.  It has to match MAX_WIDTH in
swrast.  More elaborate refactoring could fix that (someday).

12 years agost/glx: remove MAX_WIDTH/HEIGHT usage
Brian Paul [Mon, 20 Feb 2012 18:07:01 +0000 (11:07 -0700)]
st/glx: remove MAX_WIDTH/HEIGHT usage

12 years agointel: remove MAX_WIDTH usage in intelInitContext()
Brian Paul [Mon, 20 Feb 2012 18:07:01 +0000 (11:07 -0700)]
intel: remove MAX_WIDTH usage in intelInitContext()

12 years agoswrast: check max renderbuffer size against SWRAST_MAX_WIDTH
Brian Paul [Mon, 20 Feb 2012 18:07:00 +0000 (11:07 -0700)]
swrast: check max renderbuffer size against SWRAST_MAX_WIDTH

12 years agoosmesa: use SWRAST_MAX_WIDTH/HEIGHT
Brian Paul [Mon, 20 Feb 2012 18:07:00 +0000 (11:07 -0700)]
osmesa: use SWRAST_MAX_WIDTH/HEIGHT

12 years agodri/swrast: use SWRAST_MAX_WIDTH/HEIGHT
Brian Paul [Mon, 20 Feb 2012 18:07:00 +0000 (11:07 -0700)]
dri/swrast: use SWRAST_MAX_WIDTH/HEIGHT

12 years agoxlib: use SWRAST_MAX_WIDTH/HEIGHT
Brian Paul [Mon, 20 Feb 2012 18:07:00 +0000 (11:07 -0700)]
xlib: use SWRAST_MAX_WIDTH/HEIGHT

12 years agoswrast: define, use SWRAST_MAX_WIDTH/HEIGHT
Brian Paul [Mon, 20 Feb 2012 18:07:00 +0000 (11:07 -0700)]
swrast: define, use SWRAST_MAX_WIDTH/HEIGHT

We'll get rid of MAX_WIDTH, MAX_HEIGHT soon.

12 years agomesa: remove some cruft from config.h
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
mesa: remove some cruft from config.h

12 years agomesa: minor comment clean-ups in config.h
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
mesa: minor comment clean-ups in config.h

12 years agomesa: remove WIN32 MAX_WIDTH work-around in config.h
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
mesa: remove WIN32 MAX_WIDTH work-around in config.h

There aren't any more stack-allocated arrays dimensioned by MAX_WIDTH
so there shouldn't be any more stack overflows.

12 years agoswrast: remove MAX_WIDTH array in s_span.c
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: remove MAX_WIDTH array in s_span.c

12 years agoswrast: simplify mask array code
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: simplify mask array code

12 years agoswrast: stop using MAX_WIDTH arrays in triangle code
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: stop using MAX_WIDTH arrays in triangle code

12 years agoswrast: remove MAX_WIDTH arrays in stencil code
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: remove MAX_WIDTH arrays in stencil code

Use some per-context temporary arrays instead.

12 years agoswrast: remove MAX_WIDTH arrays in s_drawpix.c
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: remove MAX_WIDTH arrays in s_drawpix.c

12 years agoswrast: remove MAX_WIDTH arrays in s_zoom.c
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: remove MAX_WIDTH arrays in s_zoom.c

12 years agoswrast: remove MAX_WIDTH arrays in s_depth.c
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: remove MAX_WIDTH arrays in s_depth.c

12 years agoswrast: remove MAX_WIDTH arrays in s_copypix.c
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
swrast: remove MAX_WIDTH arrays in s_copypix.c

12 years agomesa: move/fix MAX_WIDTH/HEIGHT-related assertions
Brian Paul [Mon, 20 Feb 2012 03:08:52 +0000 (20:08 -0700)]
mesa: move/fix MAX_WIDTH/HEIGHT-related assertions

Max texture and viewport size is only limited by MAX_WIDTH/HEIGHT for swrast.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agost/mesa: stop using MAX_WIDTH in st_cb_texture.c
Brian Paul [Mon, 20 Feb 2012 03:08:51 +0000 (20:08 -0700)]
st/mesa: stop using MAX_WIDTH in st_cb_texture.c

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agost/mesa: stop using MAX_WIDTH in st_cb_drawpixels.c
Brian Paul [Mon, 20 Feb 2012 03:08:51 +0000 (20:08 -0700)]
st/mesa: stop using MAX_WIDTH in st_cb_drawpixels.c

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: stop using MAX_WIDTH in glReadPixels code
Brian Paul [Mon, 20 Feb 2012 03:08:51 +0000 (20:08 -0700)]
mesa: stop using MAX_WIDTH in glReadPixels code

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: stop using MAX_WIDTH in texstore code
Brian Paul [Mon, 20 Feb 2012 03:08:51 +0000 (20:08 -0700)]
mesa: stop using MAX_WIDTH in texstore code

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agou_blitter: decrease minimum buffer range alignment to 4 for copy_buffer
Marek Olšák [Fri, 24 Feb 2012 01:25:25 +0000 (02:25 +0100)]
u_blitter: decrease minimum buffer range alignment to 4 for copy_buffer

12 years agou_blitter: check for invalid values in copy_buffer
Marek Olšák [Fri, 24 Feb 2012 01:24:22 +0000 (02:24 +0100)]
u_blitter: check for invalid values in copy_buffer

12 years agor600g: rework queries
Marek Olšák [Tue, 21 Feb 2012 23:25:55 +0000 (00:25 +0100)]
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>
12 years agor600g: cleanup magic numbers in set_xx_sampler
Marek Olšák [Tue, 21 Feb 2012 19:24:34 +0000 (20:24 +0100)]
r600g: cleanup magic numbers in set_xx_sampler

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: remove duplicated evergreen_context_ps_partial_flush
Marek Olšák [Tue, 21 Feb 2012 18:58:09 +0000 (19:58 +0100)]
r600g: remove duplicated evergreen_context_ps_partial_flush

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: remove duplicated evergreen_context_pipe_state_set_sampler
Marek Olšák [Tue, 21 Feb 2012 18:54:17 +0000 (19:54 +0100)]
r600g: remove duplicated evergreen_context_pipe_state_set_sampler

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: remove duplicated set_xx_resource functions
Marek Olšák [Tue, 21 Feb 2012 18:47:07 +0000 (19:47 +0100)]
r600g: remove duplicated set_xx_resource functions

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: remove duplicated function r600_state_sampler_init
Marek Olšák [Tue, 21 Feb 2012 18:40:22 +0000 (19:40 +0100)]
r600g: remove duplicated function r600_state_sampler_init

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: fixup name of evergreen-specific function
Marek Olšák [Tue, 21 Feb 2012 18:38:42 +0000 (19:38 +0100)]
r600g: fixup name of evergreen-specific function

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: simplify fail paths in create_context
Marek Olšák [Tue, 21 Feb 2012 18:03:14 +0000 (19:03 +0100)]
r600g: simplify fail paths in create_context

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agogallium/u_slab: fix possible crash in util_slab_destroy
Marek Olšák [Tue, 21 Feb 2012 17:40:11 +0000 (18:40 +0100)]
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>
12 years agor600g: fix possible crashes in destroy_context when failing in create_context
Marek Olšák [Tue, 21 Feb 2012 17:30:18 +0000 (18:30 +0100)]
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>
12 years agor600g: consolidate common context init code
Marek Olšák [Tue, 21 Feb 2012 17:08:32 +0000 (18:08 +0100)]
r600g: consolidate common context init code

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agor600g: define GROUP_FORCE_NEW_BLOCK in common header
Marek Olšák [Tue, 21 Feb 2012 16:49:29 +0000 (17:49 +0100)]
r600g: define GROUP_FORCE_NEW_BLOCK in common header

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
12 years agost/dri: Fix crash in st/dri from dri format commit
Jakob Bornecrantz [Thu, 23 Feb 2012 17:17:37 +0000 (18:17 +0100)]
st/dri: Fix crash in st/dri from dri format commit

Introduced with 8de5c355fa2bf0f30df2c7cf39aee01e793284bf, it would probably just crash.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jesse Barnes <jbarnes@virtousgeek.org>
12 years agoglapi: Fix incorrect enum value.
Paul Berry [Wed, 15 Feb 2012 18:35:10 +0000 (10:35 -0800)]
glapi: Fix incorrect enum value.

From http://www.opengl.org/registry/specs/ARB/seamless_cube_map.txt:

    Accepted by the <cap> parameter of Enable, Disable and IsEnabled,
    and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv
    and GetDoublev:

    TEXTURE_CUBE_MAP_SEAMLESS                   0x884F

This caused a change in enums.c, which is manually built from the .xml
files.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agoutil: add mutex lock in u_debug_memory.c code
Brian Paul [Thu, 16 Feb 2012 19:25:22 +0000 (12:25 -0700)]
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>
12 years agosvga: no-op sampler view referencing if no change
Brian Paul [Fri, 17 Feb 2012 17:18:55 +0000 (10:18 -0700)]
svga: no-op sampler view referencing if no change

Just to be safe with ref counting and avoid atomic operations.

12 years agosvga: use pipe_sampler_view_release() to avoid segfault
Brian Paul [Thu, 16 Feb 2012 19:23:16 +0000 (12:23 -0700)]
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>
12 years agost/wgl: check for hPbuffer=0 in wgl pbuffer functions
Brian Paul [Thu, 16 Feb 2012 19:20:57 +0000 (12:20 -0700)]
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>
12 years agost/wgl: Fix argument of stw_pixelformat_get_info().
José Fonseca [Wed, 8 Feb 2012 15:46:28 +0000 (15:46 +0000)]
st/wgl: Fix argument of stw_pixelformat_get_info().

stw_pixelformat_get_info takes zero based index, not a 1 based pixel
format number.

12 years agost/mesa: use pipe_sampler_view_release()
Brian Paul [Fri, 3 Feb 2012 18:10:40 +0000 (11:10 -0700)]
st/mesa: use pipe_sampler_view_release()

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agogallium: added pipe_sampler_view_release() function
Brian Paul [Fri, 3 Feb 2012 18:09:39 +0000 (11:09 -0700)]
gallium: added pipe_sampler_view_release() function

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agost/mesa: add floating point formats in st_new_renderbuffer_fb()
Brian Paul [Fri, 3 Feb 2012 18:08:50 +0000 (11:08 -0700)]
st/mesa: add floating point formats in st_new_renderbuffer_fb()

To allow creating floating point buffers / pbuffers.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agosvga: re-enable deleted surface caching
Brian Paul [Thu, 8 Dec 2011 00:11:00 +0000 (17:11 -0700)]
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>
12 years agosvga: implement surface cache size limit
Brian Paul [Wed, 7 Dec 2011 23:57:11 +0000 (16:57 -0700)]
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>
12 years agosvga: add svga_format_size() function
Brian Paul [Thu, 8 Dec 2011 00:05:48 +0000 (17:05 -0700)]
svga: add svga_format_size() function

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agosvga: use dummy shaders when translation fails
Brian Paul [Thu, 17 Nov 2011 23:40:02 +0000 (16:40 -0700)]
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>
12 years agosvga: move temp register index assertions
Brian Paul [Mon, 21 Nov 2011 21:53:46 +0000 (14:53 -0700)]
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>
12 years agosvga: check that we don't exceed temp register limit
Brian Paul [Thu, 17 Nov 2011 23:36:26 +0000 (16:36 -0700)]
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>
12 years agoscons: Update windows llvm libraries for version 3.0.
José Fonseca [Thu, 23 Feb 2012 11:50:42 +0000 (11:50 +0000)]
scons: Update windows llvm libraries for version 3.0.

12 years agoAdd a test for the compare opcode.
Alex Corscadden [Wed, 8 Sep 2010 17:42:41 +0000 (10:42 -0700)]
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.

12 years agor600g: Fix build when libdrm is installed to non-standard dir.
Satyajit Sarangi [Mon, 20 Feb 2012 06:17:56 +0000 (01:17 -0500)]
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>
12 years agoi915: Initialize swrast_texture_image structure fields.
Paul Berry [Fri, 17 Feb 2012 00:00:45 +0000 (16:00 -0800)]
i915: Initialize swrast_texture_image structure fields.

Commit 980f6f1 (mesa: move gl_texture_image::Width/Height/DepthScale
fields to swrast) moved the initialization of the Width, Height, and
DepthScale fields to _swrast_alloc_texture_image_buffer().  However,
i915 doesn't call this function because it performs its own buffer
allocation.  As a result, the Width, Height, and DepthScale fields
weren't getting initialized properly, and some operations requiring
swrast would fail.

This patch ensures that Width, Height, and DepthScale are properly
initialized by separating the code that sets them into a new function,
_swrast_init_texture_image(), which is called by
intel_alloc_texture_image_buffer() as well as
_swrast_alloc_texture_image_buffer().  It also moves the
initialization of _IsPowerOfTwo into this function.

Fixes piglit test fbo/fbo-cubemap on i915.

Partially fixes https://bugs.freedesktop.org/show_bug.cgi?id=41216

This is a candidate for the 8.0 branch.

Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agointel: bump DRI_IMAGE extension version to 3
Jesse Barnes [Wed, 22 Feb 2012 17:52:09 +0000 (09:52 -0800)]
intel: bump DRI_IMAGE extension version to 3

To indicate support for the format query.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
12 years agogbm: track buffer format through DRI drivers
Jesse Barnes [Tue, 21 Feb 2012 20:53:09 +0000 (12:53 -0800)]
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>
12 years agotests/graw: Add a bunch of tests.
José Fonseca [Wed, 22 Feb 2012 15:22:31 +0000 (15:22 +0000)]
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.

12 years agomesa: add special case in texstore.c for GL_LUMINANCE_ALPHA src image
Brian Paul [Thu, 17 Nov 2011 23:03:35 +0000 (16:03 -0700)]
mesa: add special case in texstore.c for GL_LUMINANCE_ALPHA src image

About a 10% improvement over the swizzle-copy path.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
12 years agogallium/cso: Put the comment about shader in the code for future reference.
José Fonseca [Wed, 22 Feb 2012 08:41:19 +0000 (08:41 +0000)]
gallium/cso: Put the comment about shader in the code for future reference.

12 years agoi965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.
Eric Anholt [Tue, 21 Feb 2012 21:17:40 +0000 (13:17 -0800)]
i965/gen6: Fix near-NULL deref in setting up GS binding table for non-XFB.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Correct the size of the state batch space allocated for binding tables.
Eric Anholt [Tue, 21 Feb 2012 21:05:57 +0000 (13:05 -0800)]
i965: Correct the size of the state batch space allocated for binding tables.

In the gen6 GS case, we were under-counting and so other state would
get smashed.  In the VS case, we were over-counting, so everything was
fine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Kenneth Graunke <kenneth@whitecape.org>