profile/ivi/mesa.git
12 years agost/vdpau: recreate video buffer if format doesn't match
Christian König [Tue, 10 Jan 2012 13:40:39 +0000 (14:40 +0100)]
st/vdpau: recreate video buffer if format doesn't match

Recreate the video buffer in PutBitsYCbCr if the format doesn't match.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: reintroduce PIPE_VIDEO_CAP_PREFERED_FORMAT
Christian König [Tue, 10 Jan 2012 13:03:28 +0000 (14:03 +0100)]
vl: reintroduce PIPE_VIDEO_CAP_PREFERED_FORMAT

Create the video buffers in the format the driver preffers.
This temporary creates problems with decoder less VDPAU video playback.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: add h264 infrastructure
Christian König [Mon, 9 Jan 2012 13:48:40 +0000 (14:48 +0100)]
vl: add h264 infrastructure

No implementation so far, just the defines for
VDPAUs picture info structure.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl: move away from state like parameters
Christian König [Wed, 4 Jan 2012 13:46:33 +0000 (14:46 +0100)]
vl: move away from state like parameters

Again based on Maartens work, but keep begin_frame
and end_frame functions for now.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/video_buffer: add support for interlaced buffers
Christian König [Tue, 3 Jan 2012 23:51:40 +0000 (00:51 +0100)]
vl/video_buffer: add support for interlaced buffers

Add the infrastructure, but not the decode implementation.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/video_buffer: improve constructor
Christian König [Tue, 20 Dec 2011 16:19:19 +0000 (17:19 +0100)]
vl/video_buffer: improve constructor

Add a second extened constructor that takes plane
textures for the video buffer. Also provide a
function for texture templates.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agovl/video_buffer: use template style create params
Christian König [Mon, 2 Jan 2012 13:22:33 +0000 (14:22 +0100)]
vl/video_buffer: use template style create params

Just like in the rest of gallium, this reduces the
number of parameters significantly.

Signed-off-by: Christian König <deathsimple@vodafone.de>
12 years agor600g: vertex id support.
Dave Airlie [Sat, 14 Jan 2012 17:04:50 +0000 (17:04 +0000)]
r600g: vertex id support.

This requires GLSL 1.30 enabled, which requires integer types enabled,
so don't bother doing an INT to FLT conversion on it.

We should probably remove the instance id flt->int conversion when
turning on native integers.

this passes the three piglit tests with GLSL 1.30 forced on.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: make u2f trans only
Dave Airlie [Sun, 15 Jan 2012 07:55:08 +0000 (07:55 +0000)]
r600g: make u2f trans only

as per the r600 isa doc.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agonvfx: random cleanups of the state validation code
Lucas Stach [Tue, 10 Jan 2012 11:41:04 +0000 (12:41 +0100)]
nvfx: random cleanups of the state validation code

Signed-off-by: Lucas Stach <dev@lynxeye.de>
12 years agonvfx: drop render temporaries code
Lucas Stach [Tue, 10 Jan 2012 11:41:03 +0000 (12:41 +0100)]
nvfx: drop render temporaries code

This code is unneeded now, we don't use render temps any more.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
12 years agonvfx: rework state_fb code to get rid of render temps
Lucas Stach [Tue, 10 Jan 2012 11:41:02 +0000 (12:41 +0100)]
nvfx: rework state_fb code to get rid of render temps

This commit rewrites a lot of the state_fb code to support
rendering to targets not aligned to 64 byte.

This allows us to drop the render temporaries as unaligned
targets are the only use-case where they are really needed. The
temporaries code was used for a lot of things more, but apparently
those also work without temps.

There is one regression in piglit fbo-clear-formats, but this will
be fixed with the use of real hardware clears and doesn't matter in
practice as no real application tries to scissor clear a 2x2 pixel
render target.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
12 years agonvfx: say no to stream output caps
Lucas Stach [Tue, 10 Jan 2012 11:41:01 +0000 (12:41 +0100)]
nvfx: say no to stream output caps

nvfx doesn't support any kind of stream out, so silence the
unused cap warnings.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
12 years agomesa: update compute_version for GL3
Marek Olšák [Thu, 12 Jan 2012 02:54:09 +0000 (03:54 +0100)]
mesa: update compute_version for GL3

only check ARB_fbo, add shader_texture_lod as a requirement

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
12 years agogallium: improve the pipe_stream_output_info struct (v2)
Marek Olšák [Sat, 17 Dec 2011 22:12:45 +0000 (23:12 +0100)]
gallium: improve the pipe_stream_output_info struct (v2)

There are 3 changes:

1) stride is specified for each buffer, not just one, so that drivers don't
   have to derive it from the outputs

2) new per-output property dst_offset, which specifies the offset
   into the buffer in dwords where the output should be stored,
   so that drivers don't have to compute the offsets manually;
   this will also be useful for gl_SkipComponents
   from ARB_transform_feedback3

3) register_mask is removed, instead, there is start_component
   and num_components; register_mask with non-consecutive 1s
   doesn't make much sense (some hardware cannot do packing of components)

Christoph Bumiller: fixed nvc0.

v2: resolve merge conflicts in Draw and clean it up

12 years agor600g: add r600 version of UINT_TO_FLT conversion.
Dave Airlie [Sat, 14 Jan 2012 21:59:29 +0000 (21:59 +0000)]
r600g: add r600 version of UINT_TO_FLT conversion.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: fix r600 f2i to be trans only emitted.
Dave Airlie [Sat, 14 Jan 2012 19:55:17 +0000 (19:55 +0000)]
r600g: fix r600 f2i to be trans only emitted.

This fixes a lot of asserts about the trans unit being used already.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: add missing case for uint->flt conversion.
Dave Airlie [Sat, 14 Jan 2012 18:49:55 +0000 (18:49 +0000)]
r600g: add missing case for uint->flt conversion.

fixes some piglits like vs-decrement-uint.shader_test

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: add missing r32 uint/sint fbo formats.
Dave Airlie [Sat, 14 Jan 2012 17:32:14 +0000 (17:32 +0000)]
r600g: add missing r32 uint/sint fbo formats.

Fixes the GL3 required formats test.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agor600g: add support for virtual address space on cayman v11
Jerome Glisse [Fri, 2 Dec 2011 15:20:29 +0000 (10:20 -0500)]
r600g: add support for virtual address space on cayman v11

Virtual address space put the userspace in charge of their GPU
address space. It's up to userspace to bind bo into the virtual
address space. Command stream can them be executed using the
IB_VM chunck.

This patch add support for this configuration. It doesn't remove
the 64K ib size limit thought this limit can be extanded up to
1M for IB_VM chunk.

v2: fix rendering
v3: fix rendering when using index buffer
v4: make vm conditional on kernel support add basic va management
v5: catch the case when we already have va for a bo
v6: agd5f: update on top of ioctl changes
v7: agd5f: further ioctl updates
v8: indentation cleanup + fix non cayman
v9: rebase against lastest mesa + improvement from Marek & Michel
v10: fix cut/paste bug
v11: don't rely on updated radeon_drm.h

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
12 years agoscons: Fix libGL.so build.
Roland Scheidegger [Fri, 13 Jan 2012 21:37:18 +0000 (22:37 +0100)]
scons: Fix libGL.so build.

12 years agodocs: add links to xf86-video-vmware wiki pages
Brian Paul [Fri, 13 Jan 2012 20:45:58 +0000 (13:45 -0700)]
docs: add links to xf86-video-vmware wiki pages

12 years agoi965: Comment gen6_hiz_get_framebuffer_enum()
Chad Versace [Fri, 13 Jan 2012 18:26:01 +0000 (10:26 -0800)]
i965: Comment gen6_hiz_get_framebuffer_enum()

Make the comments precise. Explain why each branch is needed and correct.
Document the potential pitfall in the true-branch.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agogen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLES
Neil Roberts [Wed, 30 Nov 2011 22:29:21 +0000 (22:29 +0000)]
gen6_hiz: Don't bind GL_DRAW_FRAMEBUFFER on GLES

When using Mesa with a GLES API, calling _mesa_FramebufferRenderbuffer
with GL_DRAW_FRAMEBUFFER will report a 'user error' because
get_framebuffer_target validates that this enum from the framebuffer
blit extension is only used on GL. To work around it this patch makes
it use the GL_FRAMEBUFFER enum instead in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43418
Note: This is a candidate for the 8.0 branch.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
12 years agodocs: new page describing how to build, install VMware SVGA3D guest driver
Brian Paul [Fri, 13 Jan 2012 17:54:22 +0000 (10:54 -0700)]
docs: new page describing how to build, install VMware SVGA3D guest driver

12 years agomesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()
Brian Paul [Fri, 13 Jan 2012 16:41:35 +0000 (09:41 -0700)]
mesa: s/GLushort/GLubyte/ in pack_ubyte_AL44()

The AL44 format occupies one byte, not two.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoosmesa: fix renderbuffer format selection
Brian Paul [Fri, 13 Jan 2012 15:31:26 +0000 (08:31 -0700)]
osmesa: fix renderbuffer format selection

The gl_renderbuffer::Format field wasn't always set properly.  This
didn't matter much in the past but with the recent swrast/renderbuffer
mapping changes, core Mesa will be directly touching OSMesa colorbuffers
so using the right MESA_FORMAT_x value is important.

Unfortunately, there aren't MESA_FORMATs for all the possible OSmesa
format/type combinations, such as GL_FLOAT / OSMESA_ARGB.  If anyone
runs into these we can add new Mesa formats.

v2: add warnings for unsupported formats, fix ARGB_REV mix-up.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agodocs: freshen up the introduction page with Mesa 8.0 info, etc
Brian Paul [Fri, 13 Jan 2012 15:31:26 +0000 (08:31 -0700)]
docs: freshen up the introduction page with Mesa 8.0 info, etc

12 years agogallivm: Allow target specific intrinsics in lp_declare_intrinsic()
Tom Stellard [Thu, 5 Jan 2012 15:18:54 +0000 (10:18 -0500)]
gallivm: Allow target specific intrinsics in lp_declare_intrinsic()

Target specific intrinsics are also prefixed with llvm, so this assert
was preventing us from using them.

12 years agogbm: Add documentation for the public facing API
Rob Bradford [Tue, 20 Dec 2011 15:40:21 +0000 (15:40 +0000)]
gbm: Add documentation for the public facing API

12 years agodoxygen: Add link to the gbm documentation to the header
Rob Bradford [Tue, 20 Dec 2011 15:39:29 +0000 (15:39 +0000)]
doxygen: Add link to the gbm documentation to the header

12 years agodoxygen: Add doxygen file and build infrastructure for gbm
Rob Bradford [Tue, 20 Dec 2011 15:39:07 +0000 (15:39 +0000)]
doxygen: Add doxygen file and build infrastructure for gbm

12 years agoi965: Fix Coverity wrong sizeof argument defect.
Vinson Lee [Thu, 3 Nov 2011 07:36:27 +0000 (00:36 -0700)]
i965: Fix Coverity wrong sizeof argument defect.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42542
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965: Set pitch of pull constant buffers to 16.
Paul Berry [Mon, 9 Jan 2012 23:36:27 +0000 (15:36 -0800)]
i965: Set pitch of pull constant buffers to 16.

We always access pull constant buffers using the message types "OWord
Block Read" or "OWord Dual Block Read".  According to the Sandy Bridge
PRM, Vol 4 Part 1, pages 214 and 218, when using these messages:

    "the surface pitch is ignored, the surface is treated as a
    1-dimensional surface.  An element size (pitch) of 16 bytes is
    used to determine the size of the buffer for out-of-bounds
    checking if using the surface state model."

Previously we were setting the pitch for pull constant buffers to the
size of the whole constant buffer--this made no sense and would have
led to incorrect behavior if it were not for the fact that the pitch
is ignored.

For clarity, this patch sets the pitch for pull constant buffers to 16
bytes, consistent with the hardware's behavior.

v2: Clarify the meaning of the ignored values by writing them as (16 - 1).

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoi965 gen4-6: Fix off-by-one errors brw_create_constant_surface()
Paul Berry [Mon, 9 Jan 2012 22:45:04 +0000 (14:45 -0800)]
i965 gen4-6: Fix off-by-one errors brw_create_constant_surface()

Commit 9bdc44a52804a64219a0ca1a061b18596863e524 (i965: Replace struct
with bit shifting for WM pull constant surfaces) accidentally
introduced off-by-one errors into the calculation of the surface
width, height, and depth.  This patch restores the correct
computation.

The reason this wasn't noticed by Piglit tests is that the size of our
constant surfaces is always less than 2^20, therefore the off-by-one
error was causing the "depth" field of the surface to be set to all
1's.  The hardware interpreted this as an extremely large surface, so
overflow checking was effectively disabled.

No Piglit regressions on Sandy Bridge.

NOTE: This is a candidate for the 7.11 and 8.0 branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agonv50/ir: make use of TGSI_INTERPOLATE_COLOR
Christoph Bumiller [Thu, 12 Jan 2012 18:28:03 +0000 (19:28 +0100)]
nv50/ir: make use of TGSI_INTERPOLATE_COLOR

Flat SHADE_MODEL still overrides any non-flat interpolation
qualifier, but pulling that state out of the rasterizer cso
isn't really worth the effort, is it ?

NOTE: This is a candidate for the 8.0 branch.

12 years agonvc0: fix submission of VertexID and EdgeFlag in push mode
Christoph Bumiller [Thu, 12 Jan 2012 18:12:02 +0000 (19:12 +0100)]
nvc0: fix submission of VertexID and EdgeFlag in push mode

NOTE: This is a candidate for the 8.0 branch.

12 years agoosmesa: fix glReadPixels, etc
Brian Paul [Thu, 12 Jan 2012 18:52:22 +0000 (11:52 -0700)]
osmesa: fix glReadPixels, etc

Needed to implement the Map/UnmapRenderbuffer() driver hooks.
This fixes glRead/Draw/CopyPixels, etc.

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

Note: This is a candidate for the 8.0 branch.

Tested-by: Kevin Hobbs <hobbsk@ohiou.edu>
12 years agointel: move declaration before code
Brian Paul [Thu, 12 Jan 2012 18:41:42 +0000 (11:41 -0700)]
intel: move declaration before code

12 years agointel: fix mapping of malloc'd renderbuffers
Brian Paul [Sat, 7 Jan 2012 22:05:35 +0000 (15:05 -0700)]
intel: fix mapping of malloc'd renderbuffers

This fixes accum buffer operations.  The accumulation buffer is the
only malloc-based renderbuffer for the intel drivers.

v2: apply x/y offset to returned pointer

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Throw the required error for glCopyPixels from multisample FBO.
Eric Anholt [Wed, 11 Jan 2012 22:06:17 +0000 (14:06 -0800)]
mesa: Throw the required error for glCopyPixels from multisample FBO.

Fixes piglit EXT_framebuffer_multisample/negative-copypixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agomesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.
Eric Anholt [Wed, 11 Jan 2012 22:02:41 +0000 (14:02 -0800)]
mesa: Throw the required error for glCopyTex{Sub,}Image from multisample FBO.

Fixes piglit EXT_framebuffer_multisample/negative-copyteximage.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agomesa: Throw the required error for glReadPixels() from a multisampled FBO.
Eric Anholt [Wed, 11 Jan 2012 21:54:53 +0000 (13:54 -0800)]
mesa: Throw the required error for glReadPixels() from a multisampled FBO.

Fixes piglit EXT_framebuffer_multisample-negative-readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agomesa: Avoid short-circuiting realloc of renderbuffers to new sample count.
Eric Anholt [Wed, 11 Jan 2012 21:46:43 +0000 (13:46 -0800)]
mesa: Avoid short-circuiting realloc of renderbuffers to new sample count.

Fixes piglit EXT_framebuffer_multisample/renderbuffer-samples.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agometa: Add GL_RED/GL_RG support to meta CopyTexImage.
Eric Anholt [Tue, 10 Jan 2012 00:41:02 +0000 (16:41 -0800)]
meta: Add GL_RED/GL_RG support to meta CopyTexImage.

Fixes some _mesa_problem()s in oglconform.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.

12 years agoi965/gen7: Fix depth buffer rendering to tile offsets.
Eric Anholt [Wed, 11 Jan 2012 23:31:30 +0000 (15:31 -0800)]
i965/gen7: Fix depth buffer rendering to tile offsets.

Previously, we were saying that everything from the starting tile to
region width+height was part of the limits of our depthbuffer, even if
the tile was near the bottom of the depthbuffer.  This mean that our
range was not clipping to buffer buonds if the start tile was anything
but the start of the buffer.

In bebc91f0f3a1f2d19d36a7f1a4f7c992ace064e9, this was changed to
saying that we're just rendering to a region of the size of the
renderbuffer.  This is great -- we get a range that should actually
match what we want.  However, the hardware's range checking occurs
after the X/Y offset addition, so we were clipping out rendering to
small depth mip levels when an X/Y offset was present.  Just add
tile_x/y to the width in that case -- the WM won't produce negative
x/y values pre-offset, so we just need to get the left/bottom sides of
the region to cover our buffer.

Fixes the following Piglit regressions on gen7:
    spec/ARB_depth_buffer_float/fbo-clear-formats
    spec/ARB_depth_texture/fbo-clear-formats
    spec/EXT_packed_depth_stencil/fbo-clear-formats

NOTE: This is a candidate for the 8.0 branch.

12 years agomesa: remove incorrect (float) cast in mipmap do_row()
Brian Paul [Thu, 12 Jan 2012 16:55:40 +0000 (09:55 -0700)]
mesa: remove incorrect (float) cast in mipmap do_row()

The array holds GLuint values so remove the float cast.
Note, however, that to compute the average of four GLuints we really
want to do (a+b+c+d)/4 but that could overflow.  This change doesn't
address that for now.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agoswrast: use BITFIELD64_BIT() macro to fix MSVC warnings
Brian Paul [Thu, 12 Jan 2012 16:54:04 +0000 (09:54 -0700)]
swrast: use BITFIELD64_BIT() macro to fix MSVC warnings

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: fix ir_variable declaration
Brian Paul [Thu, 12 Jan 2012 16:53:07 +0000 (09:53 -0700)]
mesa: fix ir_variable declaration

ir_variable is a class, not a struct.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: fix incorrect float vs. int values in a few places
Brian Paul [Thu, 12 Jan 2012 16:51:21 +0000 (09:51 -0700)]
mesa: fix incorrect float vs. int values in a few places

In the first case, the newImage[] array contains GLuint values.
In the second case, the parameter type is GLuint, but the maxDepth
value is never used in this case (GL_FLOAT_32_UNSIGNED_INT_24_8_REV).
Pass ~OU just to be safe.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agometa: fix incorrect argument order in setup_texture_coords() call
Brian Paul [Thu, 12 Jan 2012 16:50:27 +0000 (09:50 -0700)]
meta: fix incorrect argument order in setup_texture_coords() call

And pass integer width, height values.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions
Brian Paul [Thu, 12 Jan 2012 16:17:23 +0000 (09:17 -0700)]
mesa: use _mesa_is_user_fbo() and _mesa_is_winsys_fbo() functions

Rather than testing the fbo's name against zero.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agomesa: whitespace, 80-column wrapping in buffers.c
Brian Paul [Mon, 9 Jan 2012 18:07:23 +0000 (11:07 -0700)]
mesa: whitespace, 80-column wrapping in buffers.c

12 years agomesa: remove obsolete comment on _mesa_dest_buffer_exists()
Brian Paul [Mon, 9 Jan 2012 16:38:06 +0000 (09:38 -0700)]
mesa: remove obsolete comment on _mesa_dest_buffer_exists()

12 years agost/mesa: whitespace fixes, 80-column wrapping
Brian Paul [Mon, 9 Jan 2012 16:30:13 +0000 (09:30 -0700)]
st/mesa: whitespace fixes, 80-column wrapping

12 years agomesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitions
Brian Paul [Thu, 12 Jan 2012 15:41:24 +0000 (08:41 -0700)]
mesa/gallium: add FFS_DEFINED to protect ffs() from multiple definitions

We include both imports.h and u_math.h in the state tracker.  This
leads to multiple, conflicting definitions of ffs() with MSVC.
Use FFS_DEFINED to skip the ffs() in u_math.h.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
12 years agost/mesa: re-order #includes in st_manager.c
Brian Paul [Thu, 12 Jan 2012 15:39:11 +0000 (08:39 -0700)]
st/mesa: re-order #includes in st_manager.c

include mesa headers before gallium headers to avoid problem with
ffs() being defined in u_math.h and then again in imports.h

The next commit will add some #ifdefs to prevent multiple definitions
of ffs().

12 years agosofpipe: remove extraneous semicolon
Brian Paul [Thu, 12 Jan 2012 15:30:52 +0000 (08:30 -0700)]
sofpipe: remove extraneous semicolon

12 years agost/mesa: fix struct vs. class compilation warning
Brian Paul [Thu, 12 Jan 2012 15:28:20 +0000 (08:28 -0700)]
st/mesa: fix struct vs. class compilation warning

glsl_to_tgsi_visitor is earlier defined as a class, not a struct.
Fixes MSVC warning.

NOTE: This is a candidate for the 8.0 branch.

12 years agor600g: don't advertise integers yet on r600.
Dave Airlie [Thu, 12 Jan 2012 15:05:15 +0000 (15:05 +0000)]
r600g: don't advertise integers yet on r600.

Still some work to be done before this is finished.

This is a candidate for 8.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agoconfigs: fix, simplify RADEON_LIBS, RADEON_CFLAGS
Brian Paul [Thu, 12 Jan 2012 14:53:22 +0000 (07:53 -0700)]
configs: fix, simplify RADEON_LIBS, RADEON_CFLAGS

Fixes build problems with the r200, radeon drivers.

NOTE: This is a candidate for the 8.0 branch.

12 years agomesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms
Brian Paul [Thu, 12 Jan 2012 14:30:48 +0000 (07:30 -0700)]
mesa: remove _mesa_ffs(), implement ffs() for non-GNU platforms

Call ffs() and ffsll() everywhere.  Define our own ffs(), ffsll()
functions when the platform doesn't have them.

v2: remove #ifdef _WIN32, __IBMC__, __IBMCPP_ tests inside ffs()
implementation.  The #else clause was recursive.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Alexander von Gluck <kallisti5@unixzen.com>
12 years agoconfigure: Add the svga gallium driver to the default gallium drivers
Thomas Hellstrom [Thu, 12 Jan 2012 11:10:53 +0000 (12:10 +0100)]
configure: Add the svga gallium driver to the default gallium drivers

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agost/xa: Bump version to 1.0.0 according to the README
Thomas Hellstrom [Thu, 12 Jan 2012 10:57:12 +0000 (11:57 +0100)]
st/xa: Bump version to 1.0.0 according to the README

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agosvga: Fix user clip planes.
José Fonseca [Wed, 11 Jan 2012 20:54:13 +0000 (20:54 +0000)]
svga: Fix user clip planes.

Dirty flags also need to be updated in face of recent interface change.

Fixes regression in compiz.

Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agosoftpipe: bump max texture array layers to 256.
Dave Airlie [Thu, 12 Jan 2012 10:13:37 +0000 (10:13 +0000)]
softpipe: bump max texture array layers to 256.

This as per GL3 specification.

Signed-off-by: Dave Airlie <airlied@redhat.com>
12 years agogallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device
Thomas Hellstrom [Tue, 10 Jan 2012 13:37:33 +0000 (14:37 +0100)]
gallium/svga: Pass the SVGA3D_SURFACE_HINT_RENDERTARGET flag to the device

Some hardware versions rely on it to render correctly.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agovbo: fix breakage from previous commit
Brian Paul [Thu, 12 Jan 2012 03:23:07 +0000 (20:23 -0700)]
vbo: fix breakage from previous commit

Don't know how that slipped by.

12 years agovbo: fix void * arithmetic compilation error on MSVC
Brian Paul [Thu, 12 Jan 2012 03:03:32 +0000 (20:03 -0700)]
vbo: fix void * arithmetic compilation error on MSVC

Also, call vbo_sizeof_ib_type() once and fix argument cast in
MapBufferRange() call.

12 years agodocs/GL3: consolidate FBO extensions into one ARB
Marek Olšák [Thu, 12 Jan 2012 02:52:06 +0000 (03:52 +0100)]
docs/GL3: consolidate FBO extensions into one ARB

12 years agodocs/GL3: document r300 extension support
Marek Olšák [Thu, 12 Jan 2012 02:27:27 +0000 (03:27 +0100)]
docs/GL3: document r300 extension support

12 years agodocs/GL3: document what's missing for GL3
Marek Olšák [Thu, 12 Jan 2012 02:26:09 +0000 (03:26 +0100)]
docs/GL3: document what's missing for GL3

12 years agovbo: introduce vbo_get_minmax_indices function
Yuanhan Liu [Sat, 31 Dec 2011 06:22:46 +0000 (14:22 +0800)]
vbo: introduce vbo_get_minmax_indices function

Introduce vbo_get_minmax_indices() function to handle the min/max index
computation for nr_prims(>= 1). The old code just compute the first
prim's min/max index; this would results an error rendering if user
called functions like glMultiDrawElements(). This patch servers as
fixing this issue.

As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made
vbo_get_minmax_index() static.

v2: per Roland's suggestion, put the indices address compuation into
    vbo_get_minmax_index() instead.

    Also do comination if possible to reduce map/unmap count

v3: per Brian's suggestion, use a pointer for start_prim to avoid
    structure copy per loop.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agomesa: remove const qualifier from fProg to silence warning
Brian Paul [Thu, 12 Jan 2012 01:19:37 +0000 (18:19 -0700)]
mesa: remove const qualifier from fProg to silence warning

The args to _mesa_reference_shader_program() can't be const.

12 years agomesa: include uniforms.h to silence warning, remove unused var
Brian Paul [Thu, 12 Jan 2012 01:19:09 +0000 (18:19 -0700)]
mesa: include uniforms.h to silence warning, remove unused var

12 years agomesa: Include glx tests Makefile.in in tarball
Jakob Bornecrantz [Wed, 11 Jan 2012 23:36:23 +0000 (00:36 +0100)]
mesa: Include glx tests Makefile.in in tarball

Fix suggested by Kenneth Graunke.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Kenneth Graunke <kenneth@whitescape.org>

12 years agoEnable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACK
Anuj Phogat [Fri, 6 Jan 2012 20:48:45 +0000 (12:48 -0800)]
Enable is_front_buffer_rendering variable in case of GL_FRONT_AND_BACK

glDrawBuffer(GL_FRONT_AND_BACK) results in to segmentation fault if
intel->is_front_buffer_rendering is not enabled with GL_FRONT_AND_BACK.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44153

Reported-by: Yi Sun <yi.sun@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
12 years agomesa: Remove unused opengl version macro
Jakob Bornecrantz [Wed, 11 Jan 2012 22:17:37 +0000 (23:17 +0100)]
mesa: Remove unused opengl version macro

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
12 years agorbug: Silence warning
Jakob Bornecrantz [Mon, 9 Jan 2012 13:53:42 +0000 (14:53 +0100)]
rbug: Silence warning

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by Brian Paul <brianp@vmware.com>

12 years agoi965: Don't use _mesa_ir_link_shader to do our dirty work
Ian Romanick [Sat, 7 Jan 2012 00:26:49 +0000 (16:26 -0800)]
i965: Don't use _mesa_ir_link_shader to do our dirty work

Instead, do the uniform setting and input / output mapping directly in
brw_link_shader.  Hurray for not generating Mesa IR!  However, once
the i965 driver stops calling _mesa_ir_link_shader, UsesClipDistance
and UsesKill are no longer set.

Ideally gen6_upload_vs_push_constants should use the
gl_shader_program, but I don't see a way to propagate the information
there.  The other alternative, since this is the only usage, is to
move gl_vertex_program::UsesClipDistance to brw_vertex_program.

The compile (and precompile) stages use UsesKill to determine the
cache key for the shader.  This is then used to determine whether or
not to compile the shader.  Calculating this data during compilation
is too late.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Eric Anholt <eric@anholt.net>
12 years agoi965: Don't calculate masks of used FS inputs
Ian Romanick [Fri, 6 Jan 2012 22:49:02 +0000 (14:49 -0800)]
i965: Don't calculate masks of used FS inputs

This previously enabled some optimizations in the fragment shader
(interpolation, etc.) if some input components were always 0.0 or
1.0.  However, this data was generated by analyzing Mesa IR.  The
next patch in this series removes generation of Mesa IR for GLSL
paths.  When we detect that case, just set the used mask to ~0 and
circumvent the optimizations.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agolinker: Calculate used samplers and shadow samplers in the linker
Ian Romanick [Tue, 15 Nov 2011 05:58:50 +0000 (21:58 -0800)]
linker: Calculate used samplers and shadow samplers in the linker

It used to be done in ir_to_mesa, and that was kind of a bad place.

I didn't change st_glsl_to_tgsi because there is some strange stuff
happening in the code that generates glDrawPixels shaders.  It looked
like this would break horribly if I touched anything.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agolinker: Calculate the sampler to texture target mapping during linking
Ian Romanick [Tue, 15 Nov 2011 02:12:16 +0000 (18:12 -0800)]
linker: Calculate the sampler to texture target mapping during linking

Track the calculated data in gl_shader_program instead of the
individual assembly shaders.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoglsl: Add glsl_type::sampler_index
Ian Romanick [Mon, 14 Nov 2011 22:02:09 +0000 (14:02 -0800)]
glsl: Add glsl_type::sampler_index

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Validate sampler settings using uniform storage
Ian Romanick [Mon, 14 Nov 2011 20:11:46 +0000 (12:11 -0800)]
mesa: Validate sampler settings using uniform storage

Rather than looking at the settings in individual assembly programs,
look at the settings in the top-level uniform values.  The old code
was flawed because examining each shader stage in isolation could
allow inconsitent usage across stages (e.g., bind unit 0 to a
sampler2D in the vertex shader and sampler1DShadow in the fragment
shader).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Track fixed-function fragment shader as a shader
Ian Romanick [Tue, 15 Nov 2011 20:01:18 +0000 (12:01 -0800)]
mesa: Track fixed-function fragment shader as a shader

Previously the fixed-function fragment shader was tracked as a
gl_program.  This means that it shows up in the driver as a Mesa IR
program instead of as a GLSL IR program.  If a driver doesn't generate
Mesa IR from the GLSL IR, that program is empty.  If the program is
empty there is either no rendering or a GPU hang.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Use static buffer for uniform name
Ian Romanick [Tue, 15 Nov 2011 00:52:05 +0000 (16:52 -0800)]
mesa: Use static buffer for uniform name

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agomesa: Use uniform interfaces in fixed-function fragment shader code
Ian Romanick [Mon, 14 Nov 2011 22:32:39 +0000 (14:32 -0800)]
mesa: Use uniform interfaces in fixed-function fragment shader code

Poking directly at the backing resources works only by luck.  Core
Mesa code should only know about the gl_uniform_storage structure.
Soon other code that looks at samplers will use the gl_uniform_storage
structures instead of the data in the gl_program.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agoClean up GL3 status
Matt Turner [Wed, 11 Jan 2012 20:29:51 +0000 (15:29 -0500)]
Clean up GL3 status

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
12 years agoconfigure.ac: use AC_PROG_SED
Matt Turner [Wed, 11 Jan 2012 06:05:56 +0000 (01:05 -0500)]
configure.ac: use AC_PROG_SED

It looks like AC_PROG_SED was added in 2.59b, and wasn't in the
original 2.59 in the original 2.59.  Presumably that's why, though
it could've been an oversight.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
12 years agoconfigure.ac: don't set HAVE_GTEST twice
Matt Turner [Wed, 11 Jan 2012 06:11:35 +0000 (01:11 -0500)]
configure.ac: don't set HAVE_GTEST twice

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
12 years agoi965: Don't reallocate push constant URB space on new VS programs.
Kenneth Graunke [Wed, 11 Jan 2012 19:44:02 +0000 (11:44 -0800)]
i965: Don't reallocate push constant URB space on new VS programs.

The gen7_urb atom depends on CACHE_NEW_VS_PROG and CACHE_NEW_GS_PROG,
causing gen7_upload_urb() to be called when switching to a new VS
program.

In addition to partitioning the URB space between the VS and GS,
gen7_upload_urb() also allocated space for VS and PS push constants.
Unfortunately, this meant that whenever CACHE_NEW_VS was flagged, we'd
reallocate the space for the PS push constants.  According to the BSpec,
after sending 3DSTATE_PUSH_CONSTANT_ALLOC_PS, we must reprogram
3DSTATE_CONSTANT_PS prior to the next 3DPRIMITIVE.

Since our URB allocation for push constants is entirely static, it makes
sense to split it out into its own atom that only subscribes to
BRW_NEW_CONTEXT.  This avoids reallocating the space and trashing
constants.

Fixes a rendering artifact in Extreme Tuxracer, where instead of a snow
trail, you'd get a bright red streak (affectionately known as the
"bloody penguin bug").

This also explains why adding VS-related dirty bits to gen7_ps_state
made the problem disappear: it made 3DSTATE_CONSTANT_PS be emitted after
every 3DSTATE_PUSH_CONSTANT_ALLOC_PS packet.

NOTE: This is a candidate for the 7.11 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38868
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
12 years agoglx/dri: Initialize api even if num_attribs == 0.
Kenneth Graunke [Wed, 11 Jan 2012 07:32:50 +0000 (23:32 -0800)]
glx/dri: Initialize api even if num_attribs == 0.

Both dri2_create_context_attribs and drisw_create_context_attribs call
dri2_convert_glx_attribs, expecting it to fill in *api on success.

However, when num_attribs == 0, it was returning true without setting
*api, causing the caller to use an uninitialized value.

Tested-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
12 years agosvga: don't reference count svga_sampler_view's texture
Brian Paul [Wed, 11 Jan 2012 18:52:23 +0000 (19:52 +0100)]
svga: don't reference count svga_sampler_view's texture

svga_sampler_view contains a pointer to a pipe_resource (base class of
svga_texture) and svga_texture contains a pointer to an svga_sampler_view.
This circular dependency prevented the objects from ever being freed when
they pointed to each other.  Make the svga_sampler_view::texture pointer
a "weak reference" (no reference counting) to break the dependency.

This is safe to do because the pipe_resource/texture always has a longer
lifespan than the sampler view so when svga_sampler_view stops referencing
the texture, the texture's refcount never hits zero.

Fixes a memory leak seen with google earth and other apps.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
12 years agoi965: Fix compiler warning from uninitialized "success" value.
Eric Anholt [Wed, 11 Jan 2012 20:07:15 +0000 (12:07 -0800)]
i965: Fix compiler warning from uninitialized "success" value.

This shouldn't happen, because the DDX should only load this driver if
IS_965.  But better to do something defined in that case.

12 years agoi965/gen7: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.
Eric Anholt [Mon, 2 Jan 2012 22:03:59 +0000 (14:03 -0800)]
i965/gen7: Fix segfault in transform feedback to DYNAMIC_DRAW buffers.

Fixes piglit EXT_transform_feedback/buffer-usage.

12 years agoi965/vs: Try to emit more components of constant vectors at once.
Eric Anholt [Fri, 6 Jan 2012 18:20:09 +0000 (10:20 -0800)]
i965/vs: Try to emit more components of constant vectors at once.

We were naively emitting each component at a time, even if we were
emitting the same value to multiple channels.  Improves on a codegen
regression from the old VS to the new VS on some unigine shaders
(because we emit constant vecs/matrices as immediates instead of
loading them as push constants, so we had over 4x the instructions for
using them).

shader-db results:
Total instructions: 58594 -> 58540
11/870 programs affected (1.3%)
765 -> 711 instructions in affected programs (7.1% reduction)

12 years agomesa: add _mesa_HashNumEntries() function
Brian Paul [Wed, 11 Jan 2012 19:58:43 +0000 (12:58 -0700)]
mesa: add _mesa_HashNumEntries() function

Useful when debugging to find the number of texture objects, shader
programs, etc.

12 years agost/wgl: Return NULL for NULL HDCs in wglGetExtensionsStringARB.
José Fonseca [Fri, 23 Dec 2011 02:57:29 +0000 (02:57 +0000)]
st/wgl: Return NULL for NULL HDCs in wglGetExtensionsStringARB.

WGL_ARB_extensions_string states that wglGetExtensionsStringARB should
return NULL for invalid HDCs.  And some applications rely on it.

Reviewed-By: "Keith Whitwell" <keithw@vmware.com>
12 years agollvmpipe: disable native integers
Dave Airlie [Wed, 11 Jan 2012 19:48:00 +0000 (19:48 +0000)]
llvmpipe: disable native integers

llvmpipe shouldn't be reporting native integer support.

Signed-off-by: Dave Airlie <airlied@redhat.com>