platform/upstream/mesa.git
11 years agomesa: remove GLvertexformat::EvalMesh1(), EvalMesh2() 94/6394/1
Brian Paul [Thu, 2 May 2013 01:15:33 +0000 (19:15 -0600)]
mesa: remove GLvertexformat::EvalMesh1(), EvalMesh2()

See previous commit comments.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: remove GLvertexformat::Rectf() 93/6393/1
Brian Paul [Thu, 2 May 2013 01:15:33 +0000 (19:15 -0600)]
mesa: remove GLvertexformat::Rectf()

As with the glDraw* functions, this doesn't have to be in GLvertexformat.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: simplify dispatch for glDraw* functions 92/6392/1
Brian Paul [Thu, 2 May 2013 01:15:33 +0000 (19:15 -0600)]
mesa: simplify dispatch for glDraw* functions

Remove all the glDraw* functions from the GLvertexformat structure.
The point of that dispatch struct is to handle all the functions which
dispatch differently depending on whether we're inside glBegin/End.
glDraw* are never allowed inside glBegin/End so we can remove those
entries.

This simplifies the code paths and gets rid of quite a bit of code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agovbo: add new vbo_initialize_exec_dispatch(), vbo_initialize_save_dispatch() 91/6391/1
Brian Paul [Thu, 2 May 2013 01:15:33 +0000 (19:15 -0600)]
vbo: add new vbo_initialize_exec_dispatch(), vbo_initialize_save_dispatch()

First step in simplifying the vertex array / glDraw dispatch code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: remove _MESA_INIT_EVAL_VTXFMT() macro 90/6390/1
Brian Paul [Thu, 2 May 2013 01:15:33 +0000 (19:15 -0600)]
mesa: remove _MESA_INIT_EVAL_VTXFMT() macro

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: remove _MESA_INIT_ARRAYELT_VTXFMT() macro 89/6389/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: remove _MESA_INIT_ARRAYELT_VTXFMT() macro

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: remove _MESA_INIT_DLIST_VTXFMT() macro 88/6388/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: remove _MESA_INIT_DLIST_VTXFMT() macro

Just expand the code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: change _mesa_inside_dlist_begin_end() to handle PRIM_UNKNOWN 87/6387/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: change _mesa_inside_dlist_begin_end() to handle PRIM_UNKNOWN

If the currently compiled primitive state is PRIM_UNKNOWN we should
not return true from _mesa_inside_dlist_begin_end().  This lets us
simplify the calls to that function.

Note, the call to _mesa_inside_dlist_begin_end() in vbo_save_EndList()
should have probably been checking for PRIM_UNKNOWN too, but it wasn't.
So there's no code change change.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: add names of geometry shader prims in gl_enums.py 86/6386/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: add names of geometry shader prims in gl_enums.py

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agovbo: fix initial value of ctx->Driver.CurrentSavePrimitive 85/6385/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
vbo: fix initial value of ctx->Driver.CurrentSavePrimitive

This is set during context creation/initialization.  We know we're
not inside glBegin/glEnd at this point so use PRIM_OUTSIDE_BEGIN_END.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agovbo: fix error detection in vbo_save_playback_vertex_list() 84/6384/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
vbo: fix error detection in vbo_save_playback_vertex_list()

The old code didn't make sense.  The clause in question did the
same thing as the next else-if clause.  If we're already executing
a glBegin/End pair and we're starting a new primitive, that's an
error.

Fixes more failures in piglit gl-1.0-beginend-coverage test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: comments, formatting fixes in dlist code 83/6383/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: comments, formatting fixes in dlist code

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agovbo: remove redundant vfmt->Begin = _save_Begin assignment 82/6382/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
vbo: remove redundant vfmt->Begin = _save_Begin assignment

The same assignment appears later in the function.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: don't install glDraw* functions into the BeginEnd dispatch table 81/6381/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: don't install glDraw* functions into the BeginEnd dispatch table

Functions like glDrawArrays, glDrawElements, etc. are illegal between
glBegin/glEnd and should generate GL_INVALID_OPERATION.

Fixes several piglit gl-1.0-beginend-coverage failures.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agovbo: fix parameter validation for saving dlist glDraw* functions 80/6380/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
vbo: fix parameter validation for saving dlist glDraw* functions

The _save_OBE_DrawArrays/Elements/RangeElements() functions are
called when building a display list and we know we're outside
glBegin/End.

We shouldn't call the normal _mesa_validate_DrawArrays/Elements()
functions here because those functions only work properly in immediate
mode or during dlist execution.  At dlist compile time, we can't call
_mesa_update_state(), etc. and examine the current state since it won't
apply when the list is executed later.

Fixes several failures in piglit's gl-1.0-beginend-coverage test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: add missing error check in _mesa_EndList() 79/6379/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: add missing error check in _mesa_EndList()

If we're in GL_COMPILE_AND_EXECUTE mode and inside glBegin, calling
glEndList() should generate an error.

Fixes a failure in piglit's gl-1.0-beginend-coverage test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: remove unused PRIM_INSIDE_UNKNOWN_PRIM constant 78/6378/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: remove unused PRIM_INSIDE_UNKNOWN_PRIM constant

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: simplify save_Begin() error checking 77/6377/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: simplify save_Begin() error checking

The old code was hard to understand and not entirely correct.
Note that PRIM_INSIDE_UNKNOWN_PRIM is no longer set anywhere so
we'll be able to remove that next.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: refactor _mesa_valid_prim_mode() 76/6376/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: refactor _mesa_valid_prim_mode()

...in terms of new _mesa_is_valid_prim_mode().  We need a mode validater
function that doesn't depend on current state for the display list code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: fix CurrentSavePrimitive <= GL_POLYGON tests 75/6375/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: fix CurrentSavePrimitive <= GL_POLYGON tests

Use the new PRIM_MAX value instead so that new geometry shader primitive
types are accounted for.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: adjust PRIM_x constants for geometry shaders 74/6374/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: adjust PRIM_x constants for geometry shaders

These values pertain to display lists, and the new types of geometry
shader primitives can be used in display lists.

And add new PRIM_MAX constant for follow-on changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agomesa: fix save_ShadeModel() logic and add new comments 73/6373/1
Brian Paul [Thu, 2 May 2013 01:15:32 +0000 (19:15 -0600)]
mesa: fix save_ShadeModel() logic and add new comments

This removes the test for _mesa_inside_dlist_begin_end().
If ctx->Driver.CurrentSavePrimitive==PRIM_UNKNOWN (the initial value),
_mesa_inside_dlist_begin_end() will, confusingly, return TRUE.
So we didn't set the ctx->ListState.Current.ShadeModel value and it
remained in its indeterminate state.

This didn't effect correctness, but it defeated the intended optimization
of dropping redundant glShadeModel() state changes in order to
coalesce sequences of drawing commands.

Verified with new piglit gl-1.0-dlist-shademodel test.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm: Fix altivec intrinsics for 8xi16 add/sub 72/6372/1
Adam Jackson [Thu, 25 Apr 2013 19:45:38 +0000 (15:45 -0400)]
gallivm: Fix altivec intrinsics for 8xi16 add/sub

Signed-off-by: Adam Jackson <ajax@redhat.com>
11 years agor600/sb: Fix build failure with non-standard libdrm installation prefix 71/6371/1
Lauri Kasanen [Wed, 1 May 2013 16:35:07 +0000 (19:35 +0300)]
r600/sb: Fix build failure with non-standard libdrm installation prefix

Just like radeon/uvd, r600/sb fails to find the libdrm includes.

Signed-off-by: Lauri Kasanen <cand@gmx.com>
11 years agoradeon/uvd: Fix build failure with non-standard libdrm installation prefix 70/6370/1
Lauri Kasanen [Wed, 1 May 2013 16:26:06 +0000 (19:26 +0300)]
radeon/uvd: Fix build failure with non-standard libdrm installation prefix

Without this patch, radeon_uvd failed to find the libdrm includes:

In file included from radeon_uvd.c:48:
../../winsys/radeon/drm/radeon_winsys.h:44:35: error:
libdrm/radeon_surface.h: No such file or directory

Signed-off-by: Lauri Kasanen <cand@gmx.com>
11 years agomesa: implement glFramebufferTexture 69/6369/1
Jordan Justen [Thu, 18 Apr 2013 17:46:12 +0000 (10:46 -0700)]
mesa: implement glFramebufferTexture

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: add Layered field to framebuffers 68/6368/1
Jordan Justen [Thu, 18 Apr 2013 17:20:05 +0000 (10:20 -0700)]
mesa: add Layered field to framebuffers

When checking framebuffer completeness, we test each attachment.
We verify that all attachments are consistent in terms of layers.

1. They must all be layered, or all non-layered
2. If they are layered, they must match in depth

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: add renderbuffer attachment Layered field 67/6367/1
Jordan Justen [Thu, 18 Apr 2013 17:08:50 +0000 (10:08 -0700)]
mesa: add renderbuffer attachment Layered field

If glFramebufferTexture is used, then the framebuffer attachment is
layered.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: add renderbuffer Depth field 66/6366/1
Jordan Justen [Thu, 18 Apr 2013 17:05:51 +0000 (10:05 -0700)]
mesa: add renderbuffer Depth field

With glFramebufferTexture, a renderbuffer may support
all layers of the texture, so we need the depth of the
renderbuffer to check for consistency which is required
for framebuffer completeness.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: add usage examples to get-pick-list and shortlog scripts 65/6365/1
Andreas Boll [Thu, 18 Apr 2013 07:32:39 +0000 (09:32 +0200)]
mesa: add usage examples to get-pick-list and shortlog scripts

NOTE: This is a candidate for the stable branches.

11 years agodocs: add info about bugzilla_mesa.sh script 64/6364/1
Andreas Boll [Wed, 17 Apr 2013 16:45:15 +0000 (18:45 +0200)]
docs: add info about bugzilla_mesa.sh script

11 years agomesa: Add a script to generate the list of fixed bugs 63/6363/1
Andreas Boll [Wed, 17 Apr 2013 16:14:44 +0000 (18:14 +0200)]
mesa: Add a script to generate the list of fixed bugs

This list appears in the fixed bugs section of the release notes.

v2: Add usage examples

NOTE: This is a candidate for the stable branches.

11 years agoscons: remove IN_DRI_DRIVER 62/6362/1
Andreas Boll [Fri, 19 Apr 2013 21:20:01 +0000 (23:20 +0200)]
scons: remove IN_DRI_DRIVER

Not used anymore.

11 years agobuild: remove unused API_DEFINES 61/6361/1
Andreas Boll [Wed, 27 Feb 2013 09:10:14 +0000 (10:10 +0100)]
build: remove unused API_DEFINES

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoconfigure: remove IN_DRI_DRIVER 60/6360/1
Brian Paul [Tue, 26 Feb 2013 15:49:34 +0000 (08:49 -0700)]
configure: remove IN_DRI_DRIVER

Not used anymore.

v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - split patch into two patches
    - remove more unused code

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoconfigure: remove FEATURE_GL/ES1/ES2 59/6359/1
Brian Paul [Tue, 26 Feb 2013 15:49:34 +0000 (08:49 -0700)]
configure: remove FEATURE_GL/ES1/ES2

Not used anymore.

v2: Andreas Boll <andreas.boll.dev@gmail.com>
    - split patch into two patches

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agointel: use automake conditionals for defining FEATURE_{ES1,ES2} 58/6358/1
Andreas Boll [Fri, 19 Apr 2013 18:41:08 +0000 (20:41 +0200)]
intel: use automake conditionals for defining FEATURE_{ES1,ES2}

Removes the need of API_DEFINES.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoegl-static: use automake conditionals for defining FEATURE_{GL,ES1,ES2} 57/6357/1
Andreas Boll [Wed, 17 Apr 2013 09:16:27 +0000 (11:16 +0200)]
egl-static: use automake conditionals for defining FEATURE_{GL,ES1,ES2}

Removes the need of API_DEFINES.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agointel: remove executable bit from C file 56/6356/1
Andreas Boll [Fri, 19 Apr 2013 16:37:52 +0000 (18:37 +0200)]
intel: remove executable bit from C file

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agodocs: s/Aprile/April/ 55/6355/1
Brian Paul [Wed, 1 May 2013 19:17:21 +0000 (13:17 -0600)]
docs: s/Aprile/April/

11 years agodocs: fix 9.1.2 release notes 54/6354/1
Andreas Boll [Wed, 1 May 2013 19:00:54 +0000 (21:00 +0200)]
docs: fix 9.1.2 release notes

11 years agovbo: fix possible use-after-free segfault after a VAO is deleted 53/6353/1
Marek Olšák [Tue, 23 Apr 2013 23:29:26 +0000 (01:29 +0200)]
vbo: fix possible use-after-free segfault after a VAO is deleted

This like the fifth attempt to fix the issue.

Also with the new "validating" flag, we can set recalculate_inputs to FALSE
earlier in vbo_bind_arrays, because _mesa_update_state won't change it.

NOTE: This is a candidate for the stable branches.

v2: fixed a typo

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoi965/vs: Fix textureGrad() with shadow samplers on Haswell. 52/6352/1
Kenneth Graunke [Wed, 13 Feb 2013 05:51:17 +0000 (21:51 -0800)]
i965/vs: Fix textureGrad() with shadow samplers on Haswell.

The shadow comparitor needs to be loaded into the Z component of the
last DWord.

Fixes es3conform's shadow_execution_vert and oglconform's
shadow-grad advanced.textureGrad.1D tests on Haswell.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Lower textureGrad() for samplerCubeShadow. 51/6351/1
Kenneth Graunke [Wed, 13 Feb 2013 05:51:16 +0000 (21:51 -0800)]
i965: Lower textureGrad() for samplerCubeShadow.

According to the Ivybridge PRM, Volume 4 Part 1, page 130, in the
section for the sample_d message: "The r coordinate contains the faceid,
and the r gradients are ignored by hardware."

This doesn't match GLSL, which provides gradients for all of the
coordinates.  So we would need to do some math to compute the face ID
before using sample_d.  We currently don't have any code to do that.

However, we do have a lowering pass that converts textureGrad to
textureLod, which solves this problem.  Since textureGrad on three
components is sufficiently obscure, it's not a performance path.

For now, only handle samplerCubeShadow; we need tests for samplerCube
and samplerCubeArray.

Fixes es3conform's shadow_comparison_frag test on Haswell.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoradeon/uvd: fix quant scan order for mpeg2 50/6350/1
Christian König [Tue, 30 Apr 2013 17:38:24 +0000 (19:38 +0200)]
radeon/uvd: fix quant scan order for mpeg2

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agost/vdpau: fix background handling in the mixer 49/6349/1
Christian König [Tue, 30 Apr 2013 12:55:14 +0000 (14:55 +0200)]
st/vdpau: fix background handling in the mixer

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agovl/buffer: use 2D_ARRAY instead of 3D textures 48/6348/1
Christian König [Tue, 30 Apr 2013 12:40:40 +0000 (14:40 +0200)]
vl/buffer: use 2D_ARRAY instead of 3D textures

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agovl/compositor: cleanup background clearing 47/6347/1
Christian König [Mon, 29 Apr 2013 15:43:04 +0000 (17:43 +0200)]
vl/compositor: cleanup background clearing

Add an extra parameter to specify if we should clear the render target.

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agoswrast: add casts for ImageSlices pointer arithmetic 46/6346/1
Brian Paul [Tue, 30 Apr 2013 19:35:23 +0000 (13:35 -0600)]
swrast: add casts for ImageSlices pointer arithmetic

MSVC doesn't like pointer arithmetic with void * so use GLubyte *.

Reviewed-by: Jose Fonseca<jfonseca@vmware.com>
11 years agoilo: fix PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS 45/6345/1
Chia-I Wu [Wed, 1 May 2013 09:40:50 +0000 (17:40 +0800)]
ilo: fix PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS

On GEN7+, is->dev.has_gen7_sol_reset is required.

11 years agoilo: enable SO support on GEN7 44/6344/1
Chia-I Wu [Mon, 29 Apr 2013 00:47:33 +0000 (08:47 +0800)]
ilo: enable SO support on GEN7

11 years agoilo: reset SO write offsets for new SO targets 43/6343/1
Chia-I Wu [Sun, 28 Apr 2013 23:26:37 +0000 (07:26 +0800)]
ilo: reset SO write offsets for new SO targets

When the SO targets are changed and no appending is requested, we need to send
SOL_RESET on GEN7+.

11 years agoilo: correctly program SO states for GEN7 42/6342/1
Chia-I Wu [Sun, 28 Apr 2013 23:47:05 +0000 (07:47 +0800)]
ilo: correctly program SO states for GEN7

With the commands supported by GPE, we can finally program the states.

11 years agoilo: implement GEN7 SO GPE functions 41/6341/1
Chia-I Wu [Sun, 28 Apr 2013 19:27:29 +0000 (03:27 +0800)]
ilo: implement GEN7 SO GPE functions

They were just stubs before.

11 years agoilo: add gen6_pipeline_update_max_svbi() 40/6340/1
Chia-I Wu [Wed, 1 May 2013 08:58:10 +0000 (16:58 +0800)]
ilo: add gen6_pipeline_update_max_svbi()

Move max_svbi calculation to a helper function and make it available for other
GENs.

11 years agoilo: expose register indices of OUTs in ilo_shader 39/6339/1
Chia-I Wu [Mon, 29 Apr 2013 00:25:27 +0000 (08:25 +0800)]
ilo: expose register indices of OUTs in ilo_shader

pipe_stream_output_info tells us which of OUT[i] needs to be written out.
We need the info to map OUT[i] to VUE offset.

11 years agoilo: allow one-off flags to be specified for CP 38/6338/1
Chia-I Wu [Sun, 28 Apr 2013 23:22:00 +0000 (07:22 +0800)]
ilo: allow one-off flags to be specified for CP

It will be used for SOL_RESET on GEN7.

11 years agoilo: fix tiling/size for special-purpose resources 37/6337/1
Chia-I Wu [Tue, 30 Apr 2013 07:30:01 +0000 (15:30 +0800)]
ilo: fix tiling/size for special-purpose resources

We do not allocate such resources yet though.

11 years agoilo: use UMS layout for render targets 36/6336/1
Chia-I Wu [Tue, 30 Apr 2013 04:55:18 +0000 (12:55 +0800)]
ilo: use UMS layout for render targets

As we do not advertise MSAA support, this change should not make any
difference yet.

11 years agoilo: support and prefer compact array spacing 35/6335/1
Chia-I Wu [Tue, 30 Apr 2013 04:14:29 +0000 (12:14 +0800)]
ilo: support and prefer compact array spacing

There is no reason to waste the memory when the HW can support compact array
spacing (ARYSPC_LOD0).

11 years agoilo: move device limits to ilo_dev_info or to GPEs 34/6334/1
Chia-I Wu [Mon, 29 Apr 2013 02:56:36 +0000 (10:56 +0800)]
ilo: move device limits to ilo_dev_info or to GPEs

It seems a bit weird to have device limits in a context.

11 years agoilo: use ilo_dev_info in toy compiler 33/6333/1
Chia-I Wu [Mon, 29 Apr 2013 02:14:04 +0000 (10:14 +0800)]
ilo: use ilo_dev_info in toy compiler

We need only dev->gen, but it makes sense to expose other information to the
compiler.

11 years agoilo: use ilo_dev_info in GPE and 3D pipeline 32/6332/1
Chia-I Wu [Mon, 29 Apr 2013 01:58:51 +0000 (09:58 +0800)]
ilo: use ilo_dev_info in GPE and 3D pipeline

We need only dev->gen and dev->gt, but it makes sense to expose other
information to the pipeline.

11 years agoilo: add ilo_dev_info shared by the screen and contexts 31/6331/1
Chia-I Wu [Mon, 29 Apr 2013 01:41:11 +0000 (09:41 +0800)]
ilo: add ilo_dev_info shared by the screen and contexts

The struct is used to describe the device information, such as PCI ID, GEN,
GT, and etc.

11 years agoilo: fix indentation of ilo_gpe_gen*.h 30/6330/1
Chia-I Wu [Mon, 29 Apr 2013 02:03:59 +0000 (10:03 +0800)]
ilo: fix indentation of ilo_gpe_gen*.h

11 years agoglsl: Ignore redundant prototypes after a function's been defined. 29/6329/1
Kenneth Graunke [Tue, 30 Apr 2013 07:58:09 +0000 (00:58 -0700)]
glsl: Ignore redundant prototypes after a function's been defined.

Consider the following shader:

    vec4 f(vec4 v) { return v; }
    vec4 f(vec4 v);

The prototype exactly matches the signature of the earlier definition,
so there's absolutely no point in it.  However, it doesn't appear to
be illegal.  The GLSL 4.30 specification offers two relevant quotes:

"If a function name is declared twice with the same parameter types,
 then the return types and all qualifiers must also match, and it is the
 same function being declared."

"User-defined functions can have multiple declarations, but only one
 definition."

In this case the same function was declared twice, and there's only one
definition, which fits both pieces of text.  There doesn't appear to be
any text saying late prototypes are illegal, so presumably it's valid.

Unfortunately, it currently triggers an assertion failure:
ir_dereference_variable @ <p1> specifies undeclared variable `v' @ <p2>

When we process the second line, we look for an existing exact match so
we can enforce the one-definition rule.  We then leave sig set to that
existing function, and hit sig->replace_parameters(&hir_parameters),
unfortunately nuking our existing definition's parameters (which have
actual dereferences) with the prototype's bogus unused parameters.

Simply bailing out and ignoring such late prototypes is the safest
thing to do.

Fixes Piglit's late-proto.vert as well as 3DMark/Ice Storm for Android.

NOTE: This is a candidate for stable branches.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
11 years agodocs: Import 9.1.2 release notes, add news item. 28/6328/1
Ian Romanick [Tue, 30 Apr 2013 22:33:01 +0000 (15:33 -0700)]
docs: Import 9.1.2 release notes, add news item.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agobuild: Remove libws_xlib.la from GALLIUM_PIPE_LOADER_LIBS. 27/6327/1
Matt Turner [Mon, 22 Apr 2013 21:28:50 +0000 (14:28 -0700)]
build: Remove libws_xlib.la from GALLIUM_PIPE_LOADER_LIBS.

The three users of GALLIUM_PIPE_LOADER_LIBS (OpenCL, gallium-gbm,
gallium tests) don't appear to need libws_xlib.la.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agobuild: Remove libpipe_loader.la from GALLIUM_PIPE_LOADER_LIBS. 26/6326/1
Matt Turner [Mon, 22 Apr 2013 20:42:02 +0000 (13:42 -0700)]
build: Remove libpipe_loader.la from GALLIUM_PIPE_LOADER_LIBS.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agobuild: Remove HAVE_PIPE_LOADER_SW. 25/6325/1
Matt Turner [Mon, 22 Apr 2013 19:10:27 +0000 (12:10 -0700)]
build: Remove HAVE_PIPE_LOADER_SW.

It guarded the function prototype of pipe_loader_sw_probe, whose use (in
pipe_loader.c) and definition (in pipe_loader_sw.c) were not guarded.
Both are built into libpipe_loader.la if HAVE_LOADER_GALLIUM, which is
enable_gallium_loader in configure.ac.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agobuild: Remove libws_null.la from GALLIUM_PIPE_LOADER_LIBS. 24/6324/1
Matt Turner [Mon, 22 Apr 2013 19:07:13 +0000 (12:07 -0700)]
build: Remove libws_null.la from GALLIUM_PIPE_LOADER_LIBS.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agobuild: Rename PIPE_LOADER_HAVE_XCB to HAVE_PIPE_LOADER_XCB. 23/6323/1
Matt Turner [Mon, 22 Apr 2013 18:50:29 +0000 (11:50 -0700)]
build: Rename PIPE_LOADER_HAVE_XCB to HAVE_PIPE_LOADER_XCB.

For consistency, since we already have HAVE_PIPE_LOADER_{SW,DRM}.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoconfigure.ac: Remove unused HAVE_PIPE_LOADER_XLIB macro. 22/6322/1
Matt Turner [Mon, 22 Apr 2013 18:41:26 +0000 (11:41 -0700)]
configure.ac: Remove unused HAVE_PIPE_LOADER_XLIB macro.

Added in e1364530 but never used.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoi965: Stop passing num_samples to intel_miptree_alloc_hiz(). 21/6321/1
Paul Berry [Thu, 25 Apr 2013 17:57:48 +0000 (10:57 -0700)]
i965: Stop passing num_samples to intel_miptree_alloc_hiz().

The number of samples is already available in the miptree data
structure, so there's no need to pass it in.

I suspect this may fix a subtle bug because in one case
(intel_renderbuffer_update_wrapper) we were always passing zero for
num_samples, even though the buffer in question was not guaranteed to
be single-sampled.  But I wasn't able to find a failing test case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agodraw: don't crash if GS doesn't emit anything 20/6320/1
Zack Rusin [Sat, 27 Apr 2013 12:55:36 +0000 (08:55 -0400)]
draw: don't crash if GS doesn't emit anything

Technically it's legal for geometry shader to not emit any
vertices. It's silly, but perfectly legal, so lets make draw
stop crashing if it happens.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agoi965: Implement color clears using a simple shader in blorp. 19/6319/1
Eric Anholt [Tue, 19 Mar 2013 19:40:10 +0000 (12:40 -0700)]
i965: Implement color clears using a simple shader in blorp.

The upside is less CPU overhead in fiddling with GL error handling, the
ability to use the constant color write message in most cases, and no GLSL
clear shaders appearing in MESA_GLSL=dump output.  The downside is more
batch flushing and a total recompute of GL state at the end of blorp.
However, if we're ever going to use the fast color clear feature of CMS
surfaces, we'll need this anyway since it requires very special state
setup.

This increases the fail rate of some the GLES3conform ARB_sync tests,
because of the initial flush at the start of blorp.  The tests already
intermittently failed (because it's just a bad testing procedure), and we
can return it to its previous fail rate by fixing the initial flush.

Improves GLB2.7 performance 0.37% +/- 0.11% (n=71/70, outlier removed).

v2: Rename the key member, use the core helper for sRGB, and use
    BRW_MASK_* enums, fix comment and indentation (review by Paul).
v3: Rewrite a comment, drop a silly temporary variable (review by Ken)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: Make a Mesa core function for sRGB render encoding handling. 18/6318/1
Eric Anholt [Thu, 18 Apr 2013 16:20:55 +0000 (09:20 -0700)]
mesa: Make a Mesa core function for sRGB render encoding handling.

v2: const-qualify ctx, and add a comment about the function (recommended
    by Brian and Kenneth).

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
11 years agoi965: Don't flush the batch at the end of blorp. 17/6317/1
Eric Anholt [Fri, 8 Feb 2013 02:46:18 +0000 (18:46 -0800)]
i965: Don't flush the batch at the end of blorp.

Improves GLB2.7 performance 0.13% +/- 0.09% (n=104/105, outliers removed).
More importantly, once color glClear()s are done through blorp in the next
commit, this reduces regression in GLES3 conformance tests that rely on
queueing up many glClear()s and having the GPU report being still busy in
an ARB_sync query after that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agor600g/sb: remove unused code 16/6316/1
Vadim Girlin [Tue, 30 Apr 2013 17:01:10 +0000 (21:01 +0400)]
r600g/sb: remove unused code

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agor600g/sb: collect shader statistics 15/6315/1
Vadim Girlin [Tue, 30 Apr 2013 16:58:52 +0000 (20:58 +0400)]
r600g/sb: collect shader statistics

Collects various statistical information for each shader
and total stats for contexts.

Printed with R600_DEBUG=sb,sbstat

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agor600g/sb: don't propagate dead values in GVN pass 14/6314/1
Vadim Girlin [Tue, 30 Apr 2013 16:50:24 +0000 (20:50 +0400)]
r600g/sb: don't propagate dead values in GVN pass

In some cases we use value::gvn_source field to link values that
are known to be equal before gvn pass (e.g. results of DOT4 in different
slots of the same alu group), but then source value may become dead later
and this confuses further passes.

This patch resets value::gvn_source to NULL in the dce_cleanup pass
if it points to dead value.

Fixes segfault during shader optimization with ETQW.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agor600g/sb: use simple heuristic to limit register pressure 13/6313/1
Vadim Girlin [Sat, 27 Apr 2013 08:03:39 +0000 (12:03 +0400)]
r600g/sb: use simple heuristic to limit register pressure

It's not a complete register pressure tracking, yet it helps to prevent
register allocation problems in some cases where they were observed.

The problems are uncovered by false dependencies between fetch instructions
introduced by some recent changes in TGSI and/or default backend.
Sometimes we have code like this:

...
SAMPLE R5.xyzw, R5.xyzw
... store R5.xyzw somewhere
MOV R5.x, <next x coord>
MOV R5.y, <next y coord>
SAMPLE R5.xyzw, R5.xyzw
... <may be repeated a lot of times>

With 2D resources, z and w in SAMPLE src reg aren't used and can be simply
masked, but shader backend doesn't have this information, so it's
considered as data dependency by optimization algorithms.

11 years agor600g/sb: improve error checking in ra_coalesce pass 12/6312/1
Vadim Girlin [Tue, 23 Apr 2013 06:34:42 +0000 (10:34 +0400)]
r600g/sb: improve error checking in ra_coalesce pass

11 years agor600g/sb: use source bytecode in case of optimization errors 11/6311/1
Vadim Girlin [Tue, 23 Apr 2013 06:34:00 +0000 (10:34 +0400)]
r600g/sb: use source bytecode in case of optimization errors

11 years agor600g: plug in optimizing backend 10/6310/1
Vadim Girlin [Tue, 30 Apr 2013 16:53:15 +0000 (20:53 +0400)]
r600g: plug in optimizing backend

Optimization is enabled with "R600_DEBUG=sb".

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agor600g/sb: initial commit of the optimizing shader backend 09/6309/1
Vadim Girlin [Tue, 30 Apr 2013 16:51:36 +0000 (20:51 +0400)]
r600g/sb: initial commit of the optimizing shader backend

11 years agor600g: use enum type for domains field in struct r600_resource 08/6308/1
Vadim Girlin [Sun, 21 Apr 2013 15:10:32 +0000 (19:10 +0400)]
r600g: use enum type for domains field in struct r600_resource

This prevents the problems when the header is included in C++ code.

11 years agor600g: add new flags to isa instruction tables 07/6307/1
Vadim Girlin [Sun, 21 Apr 2013 15:11:36 +0000 (19:11 +0400)]
r600g: add new flags to isa instruction tables

11 years agor600g: always create reverse lookup isa tables 06/6306/1
Vadim Girlin [Fri, 1 Feb 2013 09:51:25 +0000 (13:51 +0400)]
r600g: always create reverse lookup isa tables

11 years agor600g: mask unused source components for SAMPLE 05/6305/1
Vadim Girlin [Thu, 25 Apr 2013 15:42:31 +0000 (19:42 +0400)]
r600g: mask unused source components for SAMPLE

This results in more clean shader code and may improve the quality of
optimized code produced by r600-sb due to eliminated false dependencies
in some cases.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agointel: Remove the last spans code! 04/6304/1
Eric Anholt [Fri, 19 Apr 2013 21:51:55 +0000 (14:51 -0700)]
intel: Remove the last spans code!

The remaining bits happen to do nothing that
_swrast_span_render_start()/finish() don't do.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agointel: Move the S8 offset calc function near its remaining usage. 03/6303/1
Eric Anholt [Fri, 19 Apr 2013 21:50:43 +0000 (14:50 -0700)]
intel: Move the S8 offset calc function near its remaining usage.

It's not really span code ever since we stopped using spans for S8.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agointel: Ensure renderbuffers are current when mapping them. 02/6302/1
Eric Anholt [Fri, 19 Apr 2013 21:47:28 +0000 (14:47 -0700)]
intel: Ensure renderbuffers are current when mapping them.

In the case of renering to windows in X, we would render to stale buffers
(or not render at all!) if you hit a MapRenderbuffer as the first thing
done to your window after new buffers are ready to be collected in DRI2.

I think this also covers the weird comment about irb->mt being missing
sometimes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Add a clarifying comment about rowStride of compressed textures. 01/6301/1
Eric Anholt [Fri, 19 Apr 2013 20:57:17 +0000 (13:57 -0700)]
mesa: Add a clarifying comment about rowStride of compressed textures.

I always forget how we do this for compressed textures.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Remove the Map field from texture images. 00/6300/1
Eric Anholt [Fri, 19 Apr 2013 20:00:02 +0000 (13:00 -0700)]
mesa: Remove the Map field from texture images.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoswrast: Always use MapTextureImage for mapping textures for swrast. 99/6299/1
Eric Anholt [Fri, 19 Apr 2013 20:10:55 +0000 (13:10 -0700)]
swrast: Always use MapTextureImage for mapping textures for swrast.

Now that everything goes through ImageSlices[], we can rely on the
driver's existing texture mapping function.

A big block of code goes away on Radeon that looks like it was to deal with
the validate that happened at SpanRenderStart, which no longer occurs since we
don't need validation for the MapTextureImage hook.

v2: Rewrite comment about ImageSlices, fix duplicated swImages, touch up
    unmap loop.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agonouveau: Replace swrast_texture_image->Map usage with ->Buffer. 98/6298/1
Eric Anholt [Sat, 20 Apr 2013 04:32:06 +0000 (21:32 -0700)]
nouveau: Replace swrast_texture_image->Map usage with ->Buffer.

This code is trying to deal with providing a map in the case that
AllocTexImageBuffer was called, which is hooked up to the swrast variant.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agonouveau: Just use MapTextureImage instead of duplicating the logic. 97/6297/1
Eric Anholt [Sat, 20 Apr 2013 05:05:21 +0000 (22:05 -0700)]
nouveau: Just use MapTextureImage instead of duplicating the logic.

MapTextureImage has the exact same logic, except it can also handle
swrast-allocated buffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoswrast: Make a teximage's stored RowStride be in terms of bytes per row. 96/6296/1
Eric Anholt [Fri, 19 Apr 2013 21:00:22 +0000 (14:00 -0700)]
swrast: Make a teximage's stored RowStride be in terms of bytes per row.

For hardware drivers with pitch alignment requirements, a
non-power-of-two-sized texture format won't end up being an integer number
of pixels per row.  Also, avoids having to change our units between
MapTextureImage's rowStride and swrast's RowStride.

This doesn't fully convert the compressed texel fetch path, but does make
sure we don't drop any bits (not that we'd expect to).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoswrast: Replace use of teximage Map in 1D/2D paths with ImageSlices[0]. 95/6295/1
Eric Anholt [Fri, 19 Apr 2013 19:51:20 +0000 (12:51 -0700)]
swrast: Replace use of teximage Map in 1D/2D paths with ImageSlices[0].

This gets us ready for the Map field to die.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>