st/vdpau: implement OutputSurfaceGetBitsNative

Signed-off-by: Christian König <deathsimple@vodafone.de>
st/vdpau: implement OutputSurfaceQueryGetPutBitsNativeCapabilities

Signed-off-by: Christian König <deathsimple@vodafone.de>
st/vdpau: implement VideoSurfaceGetBitsYCbCr

Signed-off-by: Christian König <deathsimple@vodafone.de>
st/vdpau: implement OutputSurfacePutBitsYCbCr

v2: the csc_matrix is optional

Signed-off-by: Christian König <deathsimple@vodafone.de>
st/vdpau: implement OutputSurfaceQueryPutBitsYCbCrCapabilities

Signed-off-by: Christian König <deathsimple@vodafone.de>
vl/compositor: fix shader in/out numbering

Michel pointed out that my assumption of a global
index namespace is incorrect and breaks r300g.

Signed-off-by: Christian König <deathsimple@vodafone.de>
i915: Fix piglit fbo-nodepth-test on i830.

This is a direct port of fc4fba52cf7e9616c70dd76b4d6bdba6582e157b from
i915, and fixes GPU hangs when running piglit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
intel: Don't enable GL_ARB_draw_instanced pre-gen4.

swtnl doesn't handle this extension.
dri/i915: Fix off-by-one in i830 clip region size.

The hardware, like i915, uses an inclusive bounds on min and max for
the drawing rectangle, but we were providing a number for exclusive.
The number of bits used by the hardware only covers this value going
up to the maximum size, so when we programmed 2048 as the maximum
inclusive X, it saw a maximum X of 0 and clipped all rendering.  This
caused rendering failures in gnome-shell.

Fixes piglit fbo-maxsize.

v2: dropped changes to the blitter, which does use an exclusive x2, y2.
    [change by anholt]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45558
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
i830: Compute initial number of vertices from remaining batch space

In order to prevent an overflow of the batch buffer when emitting
triangles, we need to limit the initial primitive to fit within the
current batch. To do we need to measure the remaining space and thence
compute the maximum number of vertices that fit into that space.

Reported-by: Kurt Roeckx <kurt@roeckx.be>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
i915: Compute maximum number of verts using the actual batchbuffer size.

We were looking at the size of batch.map for how big the batchbuffer
was, but on 865 we just use a single-page batchbuffer due to hardware
limits.

v2: Removed check for sizeof map < bo->size, since that's always false.
    [change by anholt]
NOTE: This is a candidate for release branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41495
i915: Fix i830 polygon stipple from PBOs.

This is a direct port of the i915 patch in
a856da63247a4b403f6350914f732e14d1530ed1.

Fixes glean's pbo test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41372
Reviewed-by: Eric Anholt <eric@anholt.net>
NOTE: This is a candidate for release branches.
egl: Also put a symlink from libEGL.so in lib/ for now.

This fixes the egl_gallium.so driver build when no system libEGL.so is
present, since it's relying on the lib/ to build against until it gets
converted to automake.
vl: fix shader in/out numbering

Fix all the other wrong numberings.

Signed-off-by: Christian König <deathsimple@vodafone.de>
r300/compiler: Add support for inline literals

On R500 chips, shader instructions can take 7-bit (3-bit mantissa, 4-bit
exponent) floating point values as inputs in place of registers.
tnl: let _TNL_ATTRIB_POINTSIZE do not depend on ctx->VertexProgram._Enabled

We may specify the point size in a glsl vertex shader.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46311
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
i915: fix wrong rendering of gl_PointSize on Pineview

The current code would ignore the point size specified by gl_PointSize
builtin variable in vertex shader on Pineview. This patch servers as
fixing that.

This patch fixes the following issues on Pineview:
webglc: https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/tests/conformance/rendering/point-size.html
piglit: glsl-vs-point-size

NOTE: This is a candidate for stable release branches.

v2: pick Eric's nice tip for fixing this issue in hardware rendering.
v3: the last arg of EMIT_ATTR specify the size in _byte_. (Eric)

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Revert "gallium: add flag PIPE_TRANSFER_MAP_PERMANENTLY"

This reverts commit 0950086376b1c8b7fb89eda81ed7f2f06dee58bc.

It was decided to refactor the transfer API instead of adding workarounds
to address the performance issues.
r600g: move all query code into r600_query.c

And rename or inline functions where appropriate.
There is no reason to keep this stuff in r600_hw_context.c.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
r600g: release query buffers in destroy_query

This fixes a memory leak introduced with the rework.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>