Commit Graph

61311 Commits

Author SHA1 Message Date
Rob Clark e35747b882 freedreno/a3xx/compiler: trans_cmp() sanity
Thanks to figuring out 32bit float render target, and adding regdump
test in fdre-a3xx, I can more easily play around with instructions to
figure out range of inputs/outputs/etc.  And from this I can conclude
that cmps.f works more like expected and I can do something much more
simple in trans_cmp() (compared to before which was more closely
emulating the instruction sequence of the blob compiler).

And using sel.b32 (binary 0/1) often makes more sense than sel.f32
(+/- float) or sel.u32 (+/- uint) as it can use the output directly
from cmps.f without needing the 'add.s tmp0, tmp0, -1'.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Rob Clark 89dc282581 freedreno: fix problems if no color buf bound
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-02-16 08:17:23 -05:00
Eric Anholt 1020d8937e meta: Don't try to enable FF texturing when we're using GLSL.
On a core context, this would throw an error.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-14 12:09:42 -08:00
Carl Worth a92581acf2 main: Avoid double-free of shader Label
As documented, the _mesa_free_shader_program_data function:

	"Frees all the data that hangs off a shader program object, but not
	the object itself."

This means that this function may be called multiple times on the same object,
(and has been observed to). Meanwhile, the shProg->Label field was not being
set to NULL after its free(). This led to a second call to free() of the same
address on the second call to this function.

Fix this by setting this field to NULL after free(), (just as with all other
calls to free() in this function).

Reviewed-by: Brian Paul <brianp@vmware.com>

CC: mesa-stable@lists.freedesktop.org
2014-02-14 11:45:48 -08:00
Brian Paul e4a5a9fd2f gallium/pipebuffer: change pb_cache_manager_create() size_factor to float
Requested by Marek.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 09:56:55 -07:00
Thomas Hellstrom 141e39a893 svga/winsys: Propagate surface shared information to the winsys
The linux winsys needs to know whether a surface is shared.
For guest-backed surfaces we need this information to avoid allocating a
mob out of the mob cache for shared surfaces, but instead allocate a shared
mob, that is never put in the mob cache, from the kernel.

Also previously, all surfaces were given the "shareable" attribute when
allocated from the kernel. This is too permissive for client-local surfaces.
Now that we have the needed info, only set the "shareable" attribute if the
client indicates that it needs to share the surface.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul fe6a854477 svga/winsys: implement GBS support
This is a squash commit of many commits by Thomas Hellstrom.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom 59e7c59621 gallium/util: Add flush/map debug utility code
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom 8af358d8bc gallium/pipebuffer: Add a cache buffer manager bypass mask
In some situations, it may be desirable to bypass the cache at buffer
creation but to insert the buffer in the cache at buffer destruction.
One such situation is where we already have a kernel representation of a
buffer that we want to use, but we also want to insert it in the cache when
it's freed up.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Thomas Hellstrom c9e9b1862b pipebuffer, winsys: Add a size match parameter to the cached buffer manager
In some situations it's important to restrict the sizes of buffers that the
cached buffer manager is allowed to return

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 3d1fd6df53 svga: update texture code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 72b0e959fc svga: update buffer code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul e0a6fb09bd svga: add new helper functions for GBS buffers
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 6476bcbc50 svga: remove a couple unneeded assertions
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul f8bbd8261d svga: adjust adjustment for point coordinates
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul d0c22a6d53 svga: track which textures are rendered to
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul c1e60a61e8 svga: add helpers for tracking rendering to textures
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul f84c830b14 svga: update shader code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 2f1fc8db10 svga: update constant buffer code for GBS
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 31dfefc47f svga: add svga_have_gb_objects/dma() functions
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 823fbfdca7 svga: add new GBS commands
And update some existing commands.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul d993ada50c svga: update svga_winsys interface for GBS
This adds new interface functions for guest-backed surfaces and
adds a mobid parameter to the surface_relocation() function.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 024711385e svga: update dumping code with new GBS commands, etc
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:44 -07:00
Brian Paul 2e0c90847f svga: split / update svga3d header files
The old svga3d_reg.h file is split into separate header files and we
add new items for guest-backed surfaces.

Plus some minor code fixes because of renamed symbols.

Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
2014-02-14 08:21:43 -07:00
Grigori Goronzy 6d1cecbfd7 st/vdpau: add support for DEINTERLACE_TEMPORAL
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-14 09:05:20 +01:00
Grigori Goronzy af34c3fd10 vl: add motion adaptive deinterlacer
Reviewed-by: Christian König <christian.koenig@amd.com>
2014-02-14 08:55:33 +01:00
Leo Liu f87dfc35bc st/omx/enc: fix scaling src alignment issue
Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-14 08:50:32 +01:00
Alex Deucher 01e6371149 radeon: reverse DBG_NO_HYPERZ logic
Change the flag to DBG_HYPERZ and reverse the logic
so setting the flag enabled the feature.  This disables
hyperz on r600g and radeonsi by default.  It can be
enabled by setting the env var.  There are just too
many issues with certain apps so leave it disabled for
now until we sort out the issues with the problematic
apps.

Bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=58660
https://bugs.freedesktop.org/show_bug.cgi?id=64471
https://bugs.freedesktop.org/show_bug.cgi?id=66352
https://bugs.freedesktop.org/show_bug.cgi?id=68799
https://bugs.freedesktop.org/show_bug.cgi?id=72685
https://bugs.freedesktop.org/show_bug.cgi?id=73088
https://bugs.freedesktop.org/show_bug.cgi?id=74428
https://bugs.freedesktop.org/show_bug.cgi?id=74803
https://bugs.freedesktop.org/show_bug.cgi?id=74863
https://bugs.freedesktop.org/show_bug.cgi?id=74892
https://bugzilla.kernel.org/show_bug.cgi?id=70411

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: "10.1" "10.0" <mesa-stable@lists.freedesktop.org>
Acked-by: Marek Olšák <marek.olsak@amd.com>
2014-02-13 20:55:54 -05:00
Tom Stellard 3c4bd95b62 pipe-loader: Add support for render nodes v2
v2:
   - Add missing call to pipe_loader_drm_release()
   - Fix render node macros
   - Drop render-node configure option
2014-02-13 19:53:15 -05:00
Tom Stellard 8481d208ce pipe-loader: Add auth_x parameter to pipe_loader_drm_probe_fd()
The caller can use this boolean parameter to tell the pipe-loader
to authenticate with the X server when probing a file descriptor.
2014-02-13 19:53:15 -05:00
Christian König 0320ba9988 st/omx/dec/h264: fix pic_order_cnt_type==2
Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-13 18:00:44 +01:00
Ilia Mirkin 0c8b165366 nouveau: fix chipset checks for nv1a by using the oclass instead
Commit f4ebcd133b ("dri/nouveau: NV17_3D class is not available for
NV1a chipset") fixed this partially by using the correct 3d class.
However there were a lot of checks left over comparing against the
chipset.

Reported-and-tested-by: John F. Godfrey <jfgodfrey@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: 9.2 10.0 10.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2014-02-13 11:06:41 -05:00
Christian König 0ef3ce4155 st/omx: initial OpenMAX H264 encoder v7
v2 (chk): fix eos handling
v3 (leo): implement scaling configuration support
v4 (leo): fix bitrate bug
v5 (chk): add workaround for bug in Bellagio
v6 (chk): fix div by 0 if framerate isn't known,
          user separate pipe object for scale and transfer,
          always flush the transfer pipe before encoding
v7 (chk): make suggested changes, cleanup a bit more,
          only advertise encoder on supported hardware

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
2014-02-13 11:11:24 +01:00
Christian König 9ff0cf903d radeon/vce: initial VCE support v8
v2 (chk): revert feedback buffer hack
v3 (slava): fixed bitstream size calculation
v4 (chk): always create buffers in the right domain
v5 (chk): flush async
v6 (chk): rework fw interface add version check
v7 (leo): implement cropping support
v8 (chk): add hw checks

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Slava Grigorev <slava.grigorev@amd.com>
2014-02-13 11:11:24 +01:00
Christian König cbdd052577 radeon/winsys: add VCE support v4
v2: add fw version query
v3: add README.VCE
v4: avoid error msg when kernel doesn't support it

Signed-off-by: Christian König <christian.koenig@amd.com>
2014-02-13 11:11:24 +01:00
Ilia Mirkin ef9a6ded10 nv50: mark scissors/viewports dirty on context switch
Commit 246ca4b001 ("nv50: implement multiple viewports/scissors, enable
ARB_viewport_array") added dirty tracking to scissors/viewports. However
it neglected to mark them all as dirty on a context switch. This fixes
an apparent regression in webgl in chrome, but probably in any
application that switches contexts.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2014-02-13 10:08:29 +01:00
Christian König 1ef7b9de06 gallium/vl: remove remaining softpipe video functions
Unused and unmaintained for quite a while.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-02-13 09:46:54 +01:00
Ilia Mirkin 18caef953f docs: add nv50 to the ARB_viewport_array list 2014-02-12 22:14:41 -05:00
Ilia Mirkin 246ca4b001 nv50: implement multiple viewports/scissors, enable ARB_viewport_array
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2014-02-12 21:47:36 -05:00
Ilia Mirkin a7012eede8 mesa/st: hardcode the viewport bounds range
The bound range is disconnected from the viewport dimensions. This is
the relevant bit from glViewportArray:

"""
The location of the viewport's bottom left corner, given by (x, y) is
clamped to be within the implementaiton-dependent viewport bounds range.
The viewport bounds range [min, max] can be determined by calling glGet
with argument GL_VIEWPORT_BOUNDS_RANGE. Viewport width and height are
silently clamped to a range that depends on the implementation. To query
this range, call glGet with argument GL_MAX_VIEWPORT_DIMS.
"""

Just set it to +/-16384, as that is the minimum required by
ARB_viewport_array and the value that all current drivers provide.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2014-02-13 12:44:36 +10:00
Brian Paul f0e967f212 scons: add meta_blit.c to src/mesa/SConscript 2014-02-12 17:46:11 -07:00
Eric Anholt 255bd9c0b8 meta: Add acceleration for depth glBlitFramebuffer().
Surprisingly, the GLSL shaders already wrote the sampled r value to
FragDepth.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51600
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-12 16:17:11 -08:00
Eric Anholt 067c7b67e8 meta: Use BindRenderbufferTexImage() for meta glBlitFramebuffer().
This avoids a CopyTexImage() on Intel i965 hardware without blorp.

v2: Move the !readAtt check up higher.
v3: Rebase on idr's changes, plus readAtt check is totally gone, and also
    fix a typo in a comment.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v2)
2014-02-12 16:17:11 -08:00
Eric Anholt f29c25fc1d i965: Add a driver hook for binding renderbuffers to textures.
This will let us use meta's acceleration from renderbuffers without having
to do a CopyTexImage first.

This is like what we do for TFP, but just taking an existing renderbuffer
and binding it to a texture with whatever its format was.  The
implementation won't work for stencil renderbuffers, and it only does
non-texture renderbuffers (but then, if you're using a texture
renderbuffer, you can just pull the texture object/level/slice out of the
renderbuffer, anyway).

v2: Don't forget to propagate NumSamples to the teximage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-02-12 16:17:11 -08:00
Eric Anholt 431decf16f meta: Do a massive unindent (and rename) of blitframebuffer_texture().
This function is only handling the color case.  We can just unindent as
long as we're willing to do the check for the bit outside of the
function.

v2: Rebase on idr's changes, drop readAtt check that's always non-null
    anyway (it's a pointer into to the statically-allocated attachments
    array in the renderbuffer).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:17:11 -08:00
Eric Anholt 3e4ccf499e meta: Move glBlitFramebuffer() to a separate file.
v2: Drop a bunch of unnecessary includes (by Kenneth), rebase on idr's
    changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:17:08 -08:00
Eric Anholt 81ddbdaaba meta: De-static some of meta's functions.
I want split some meta.c code off to a separate file, so these functions
can't be static any more.

v2: Rebase on idr's changes, also expose setup_blit_shader,
    blit_shader_table_cleanup, setup_vertex_objects,
    setup_ff_tnl_for_blit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 16:16:03 -08:00
Eric Anholt 2c8f182c86 meta: Move the meta structures to the meta header.
I'd like to split some of our code to separate files, since 4k lines and
growing is pretty unreasonable for all these separate operations.

v2: Rebase on idr's changes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2014-02-12 15:38:58 -08:00
Eric Anholt cd084aa297 meta: Fold the texture setup into setup_copypix_texture().
There was this funny argument passed to setup for "did alloc decide we
need to allocate new texture storage?", which goes away if we don't have
the caller do alloc as a separate step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00
Eric Anholt 397b2c3966 meta: Drop the src == dst restriction on meta glBlitFramebuffer().
From the GL_ARB_fbo spec:

    If the source and destination buffers are identical, and the
    source and destination rectangles overlap, the result of the blit
    operation is undefined.

As far as I know, that's the only thing that would have been of concern
for this.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-02-12 15:38:58 -08:00