Compare commits

...

46 Commits

Author SHA1 Message Date
Emil Velikov
4e1ca4a190 Increment version to 10.3.0-rc3
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-05 17:00:40 +01:00
Marek Olšák
06f1f1ea81 st/mesa: use 1.0f as boolean true on drivers without integer support
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82882

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 1a00f24751)
2014-09-05 16:32:48 +01:00
Marek Olšák
e842a02df3 mesa: set UniformBooleanTrue = 1.0f by default
because NativeIntegers is 0 by default.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82882

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit d67db73458)
2014-09-05 16:31:58 +01:00
Rob Clark
96bca3617c freedreno/ir3: fix potential null ptr deref
Fix potential segfault in debug code.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit c06afcede2)
2014-09-05 16:28:51 +01:00
Rob Clark
c221e96a13 freedreno/a2xx: fix segfault
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 306e421887)
2014-09-05 16:28:20 +01:00
Rob Clark
640ddefd96 freedreno/a3xx: handle first/last level properly
Fixes some assumptions about first_level being zero.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit bd3b096467)
2014-09-05 16:28:04 +01:00
Rob Clark
7cd0fa023e freedreno: implement pipe_flush_resource()
Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit b40a6c2b17)
2014-09-05 16:27:55 +01:00
Rob Clark
cd94c64421 freedreno: don't ignore src/dst level
Don't ignore src/dst_level in pipe_copy_region.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
(cherry picked from commit 478a08ebd2)
2014-09-05 16:06:36 +01:00
Jonathan Gray
e9923b2194 automake: check if the linker supports --dynamic-list
As older versions of gnu ld did not support --dynamic-list check to see
if it is supported before using it.  Non gnu linkers such the apple one
likely lack this option as well.

Fixes the build on OpenBSD which has binutils 2.15 and 2.17.
The --dynamic-list option seems to been have introduced sometime after
binutils 2.17 was released as it is present in 2.18.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 635477dc4b)
2014-09-05 15:45:46 +01:00
Andreas Pokorny
2e56334a2a kms-swrast: Support Prime fd handling
Allows using prime fds as display target and from display target.
Test for PRIME capability after initializing kms_swrast screen.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Andreas Pokorny <andreas.pokorny@canonical.com>
(cherry picked from commit 8bcd57a46c)
2014-09-05 15:45:46 +01:00
Marek Olšák
ead7f72a2c r600g,radeonsi: make sure there's enough CS space before resuming queries
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83432

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 3dbf55c1be)
2014-09-05 15:45:45 +01:00
Marek Olšák
139d176f54 mesa: invalidate draw state in glPopClientAttrib
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82538

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 374f3e9e19)
2014-09-05 15:45:45 +01:00
Thomas Hellstrom
941b2ae35f winsys/svga: Fix incorrect type usage in IOCTL v2
While similar in layout, the size of the SVGA3dSize type may be smaller than
the struct drm_vmw_size type that is part of the ioctl interface. The kernel
driver could accordingly overwrite a memory area following the size variable
on the stack. Typically that would be another local variable, causing
breakage in, for example, ubuntu 12.04.5 where the handle local variable
becomes overwritten.

v2: Fix whitespace errors

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Cc: "10.1 10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2d6206140a)
2014-09-05 15:45:45 +01:00
Kenneth Graunke
4b38838ef4 i965: Handle ir_triop_csel in emit_bool_to_cond_code().
ir_triop_csel can return a boolean expression, so we need to handle it
here; we simply forgot when we added it.

Fixes Piglit's EXT_shader_integer_mix/{vs,fs}-mix-if-bool.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8270b048cf)
2014-09-05 15:43:08 +01:00
tiffany
3fdd08c9b4 glsl: fix assertion which fails for unsigned array indices.
According to the GLSL 1.40 spec, section 5.7 Structure and Array Operations:

"Array elements are accessed using an expression whose type is int or uint."

Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit cfc42db592)
2014-09-05 14:44:22 +01:00
Jason Ekstrand
f8ff31e528 i965/copy_image: Divide the x offsets by block width when using the blitter
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 11ee9a4d99)
2014-09-05 14:43:53 +01:00
Jason Ekstrand
ab53a29892 i965/copy_image: Use the correct block dimension
Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 499acf6e4a)
2014-09-05 14:42:56 +01:00
Jason Ekstrand
4073e96a3b meta/copy_image: Use the correct texture level when creating views
Previously, we were accidentally assuming that the level of both textures
was 0.  Now we actually use the correct level in our hacked texture view.
This doesn't 100% fix the meta path because the texture type is getting
lost somewhere in the pipeline.  However, it actually copies to/from the
correct layer now.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit b608cd7fbf)
2014-09-05 14:42:36 +01:00
Jason Ekstrand
4eed41b967 i965/copy_image: Use the correct texture level
Previously, we were using the source images level for both source and
destination.  Also, we weren't taking the MinLevel from a potential texture
view into account.  This commit fixes both problems.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82804
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit fcb6d5b9ef)
2014-09-05 14:41:47 +01:00
Marek Olšák
c546523b4d r600g: fix alpha-test with HyperZ enabled, fixing L4D2 tree corruption
*_update_db_shader_control depends on the alpha test state. The problem was
it was in a block which is only entered if the pixel shader is changed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74863

Cc: mesa-stable@lists.freedesktop.org
Tested-by: Benjamin Bellec <b.bellec@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 8abdc3c4a9)
2014-09-05 14:40:45 +01:00
Kristian Høgsberg
282a3098e6 meta: Make MESA_META_DRAW_BUFFERS restore properly
A meta begin/end pair with MESA_META_DRAW_BUFFERS will change visible GL
state.  We recreate the draw buffer enums from the buffer bitfield, which
changes GL_BACK to GL_BACK_LEFT (and GL_FRONT to GL_FRONT_LEFT).

This commit modifes the save/restore logic to instead copy the buffer enums
from the gl_framebuffer and then set them on restore using
_mesa_drawbuffers().

It's not clear how this breaks the benchmark in 82796, but fixing meta to not
leak the state change fixes the regression.

No piglit regressions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82796
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8f55174fbd)
2014-09-05 14:36:43 +01:00
Emil Velikov
ec4a333c37 Revert "mesa: fix make tarballs"
This reverts commit 0fbb9a599d.

Rather than adding hacks around the issue drop the sources from the
final tarball, and re-add them back with 'make dist'. This fixes a
problem when running parallel 'make install' fails as it recreates
sources and triggers partial recompilation.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83355
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
(cherry picked from commit 5a4e0f3873)
2014-09-05 14:04:52 +01:00
Dave Airlie
35bb6b058c i965: add missing parens in vec4 visitor
coverity reported this, Matt said it look like missing parens,
not bad identing, so lets try that.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 94a909ec2d)
2014-09-05 14:04:48 +01:00
Ilia Mirkin
24e226d0f5 nv50: attach the buffer bo to the miptree structures
The current code... makes no sense. Use nouveau_bo_ref to attach the bo
to the exposed resource so as to have the proper lifetime guarantees.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2c44043313)
2014-09-05 14:04:48 +01:00
Ilia Mirkin
39ad62ce51 nv50: mt address may not be the underlying bo's start address
With VP2, nv50_miptree is faked because the underlying bo's have to be
laid out in a certain way. This is done by adjusting the address. Make
sure that blits (and everything else for consistency) use the mt address
rather than the bo address as a base.

This fixes retrieving chroma plane with VDPAU.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82255
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 9d52e551a5)
2014-09-05 14:04:48 +01:00
Ilia Mirkin
f2b2309281 nv50: set the miptree address when clearing bo's in vp2 init
The mt address is about to be used more, make sure it's set
appropriately.

Reported-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 2528d402b9)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
a4b3c4e3ec nv50/ir: avoid creating instructions that can't be emitted
When constant folding a MAD operation, we first fold the multiply and
generate an ADD. However we do so without making sure that the immediate
can be handled in the saturate case. If it can't, load the immediate in
a separate instruction.

Reported-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 6c2b079231)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
01dda9d0bd nvc0: don't make 1d staging textures linear
Experimentally, the sampler doesn't appear to like these, neither as
buffer nor as rect textures. So remove 1D from the list of texture types
to make linear when used for staging.

This fixes the OSD in mplayer for VDPAU.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 115d9a5525)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
49cd42aab1 nv50: zero out unbound samplers
Samplers are only defined up to num_samplers, so set all samplers above
nr to NULL so that we don't try to read them again later.

Tested-by: Christian Ruppert <idl0r@qasl.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 362cd26960)
2014-09-05 14:04:47 +01:00
Ilia Mirkin
eaa9e14ce5 nvc0/ir: avoid infinite recursion when finding first uses of tex
In certain circumstances, findFirstUses could end up doubling back on
instructions it had already processed, resulting in an infinite
recursion. Avoid this by keeping track of already-visited instructions.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83079
Tested-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c4bb436f76)
2014-09-05 14:04:46 +01:00
Marek Olšák
58be4ab741 r600g: fix layered clear
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit d159c5e3e0)
2014-09-05 14:04:46 +01:00
Marek Olšák
447785af9d glsl_to_tgsi: allocate and enlarge arrays for temporaries on demand
This fixes crashes if the number of temporaries is greater than 4096.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66184

v2: added fail paths for realloc failures

Cc: 10.2 10.3 mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 482def592f)
2014-09-05 14:04:46 +01:00
Emil Velikov
390a9f6cb7 Increment version to 10.3.0-rc2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 00:23:50 +01:00
Emil Velikov
0fbb9a599d mesa: fix make tarballs
Current method of generating distribution tar-balls involves manually
invoking make + target name in the appropriate places. This temporary
solution is used until we get 'make dist' working.

Currently it does not work, as in order to have the target (which is
also a filename) available in the final Makefile we need to add a PHONY
target + use the correct target name.

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 88cbe3908f)
2014-09-01 00:23:45 +01:00
Matt Turner
2310a4b4cf i965/vec4: Update register coalescing test.
In commit 04895f5c I added support for reswizzling writemasks. This test
was checking that we didn't support this.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82881
(cherry picked from commit 8b5ac1df17)
2014-08-31 19:12:42 +01:00
Kenneth Graunke
8ef3d4fe03 i965: Add 2x MSAA support to Broadwell fast clear code.
According to the cited documentation section (but in the newer docs),
x_scaledown is the same for 2x and 4x MSAA.

+47 piglits.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83081
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e34a363a78)
2014-08-31 19:07:04 +01:00
Christian König
0c67167370 radeon/uvd: fix field handling on R6XX style UVD
The first UVD generation can only do frame based output.

Signed-off-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit 80771e47b6)
Nominated-by: Alex Deucher <alexdeucher@gmail.com>
2014-08-28 23:01:44 +01:00
Christian König
60f136eed9 vl/compositor: set the scissor before clearing the render target
Otherwise we clear areas that shouldn't be cleared.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 03a99ba9e4)
2014-08-26 21:04:00 +01:00
Christian König
d2fb1da46d st/vdpau: fix vlVdpOutputSurfaceRender(Output|Bitmap)Surface
Correctly handle that the source_surface is only optional.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80561

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit b73c20759f)
2014-08-26 21:03:47 +01:00
Carl Worth
627d31dc36 glcpp: Don't use alternation in the lookahead for empty pragmas.
We've found that there's a buffer overrun bug in flex that's triggered by
using alternation in a lookahead pattern.

Fortunately, we don't need to match the exact {NEWLINE} expression to
detect an empty pragma. It suffices to verify that there are no non-space
characters before any newline character. So we can use a simple [\r\n] to
get the desired behavior while avoiding the flex bug.

Fixes the regression of piglit's 17000-consecutive-chars-identifier test,
(which has been crashing since commit
04e40fd337 ).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82472
Signed-off-by: Carl Worth <cworth@cworth.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

CC: <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 23163df24c)
2014-08-25 22:32:10 +01:00
Carl Worth
e4f54d8b47 Makefile: Switch from md5sums to sha256sums
We switched to these several stable releases ago, (since the MD5 algorithm has
been broken for some time), but only now did I get around to fixing this in
the Makefile rather than just performing this step manually.

CC: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 46d03d37bf)
2014-08-25 22:31:44 +01:00
Alex Deucher
2edc941e75 radeonsi: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 153df68834)
2014-08-25 22:31:19 +01:00
Alex Deucher
eb96819386 radeonsi: add new CIK pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit f50b6b4895)
2014-08-25 22:31:04 +01:00
Kenneth Graunke
f2a1b7d508 i965: Disable try_emit_b2f_of_compare on Gen4-6.
The optimization relies on CMP setting the destination to 0, which is
equivalent to 0.0f.  However, early platforms only set the least
significant byte, leaving the other bits undefined.  So, we must disable
the optimization on those platforms.

Oddly, Sandybridge wasn't reported as broken.  The PRM states that it
only sets the LSB, but the internal documentation says that it follows
the IVB behavior.  Since it wasn't reported as broken, we believe it
really does follow the IVB behavior.

v2: Allow the optimization on Sandybridge (requested by Matt).

+32 piglits on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?=79963
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 97d03b9366)
2014-08-22 11:43:25 -07:00
Matt Turner
53728f60aa i965: Fix JIP/UIP calculations.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82846
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82929
(cherry picked from commit d77f5603a5)
2014-08-22 09:31:22 -07:00
Carl Worth
04c3c03682 Increment version to 10.3.0-rc1 2014-08-21 08:36:46 -07:00
47 changed files with 537 additions and 227 deletions

View File

@@ -64,14 +64,13 @@ IGNORE_FILES = \
parsers: configure
$(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp glcpp/glcpp-lex.c glcpp/glcpp-parse.c glcpp/glcpp-parse.h
$(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
# Everything for new a Mesa release:
ARCHIVES = $(PACKAGE_NAME).tar.gz \
$(PACKAGE_NAME).tar.bz2 \
$(PACKAGE_NAME).zip
tarballs: md5
tarballs: checksums
rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
manifest.txt: .git
@@ -98,9 +97,9 @@ $(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
md5: $(ARCHIVES)
@-md5sum $(PACKAGE_NAME).tar.gz
@-md5sum $(PACKAGE_NAME).tar.bz2
@-md5sum $(PACKAGE_NAME).zip
checksums: $(ARCHIVES)
@-sha256sum $(PACKAGE_NAME).tar.gz
@-sha256sum $(PACKAGE_NAME).tar.bz2
@-sha256sum $(PACKAGE_NAME).zip
.PHONY: tarballs md5

View File

@@ -1 +1 @@
10.3.0-devel
10.3.0-rc3

View File

@@ -355,6 +355,24 @@ AC_LINK_IFELSE(
LDFLAGS=$save_LDFLAGS
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
dnl
dnl Check if linker supports dynamic list files
dnl
AC_MSG_CHECKING([if the linker supports --dynamic-list])
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--dynamic-list=conftest.dyn"
cat > conftest.dyn <<EOF
{
radeon_drm_winsys_create;
};
EOF
AC_LINK_IFELSE(
[AC_LANG_SOURCE([int main() { return 0;}])],
[have_ld_dynamic_list=yes;AC_MSG_RESULT(yes)],
[have_ld_dynamic_list=no; AC_MSG_RESULT(no)])
LDFLAGS=$save_LDFLAGS
AM_CONDITIONAL(HAVE_LD_DYNAMIC_LIST, test "$have_ld_dynamic_list" = "yes")
dnl
dnl compatibility symlinks
dnl

View File

@@ -38,6 +38,7 @@ CHIPSET(0x6828, VERDE_6828, VERDE)
CHIPSET(0x6829, VERDE_6829, VERDE)
CHIPSET(0x682A, VERDE_682A, VERDE)
CHIPSET(0x682B, VERDE_682B, VERDE)
CHIPSET(0x682C, VERDE_682C, VERDE)
CHIPSET(0x682D, VERDE_682D, VERDE)
CHIPSET(0x682F, VERDE_682F, VERDE)
CHIPSET(0x6830, VERDE_6830, VERDE)
@@ -54,8 +55,11 @@ CHIPSET(0x6600, OLAND_6600, OLAND)
CHIPSET(0x6601, OLAND_6601, OLAND)
CHIPSET(0x6602, OLAND_6602, OLAND)
CHIPSET(0x6603, OLAND_6603, OLAND)
CHIPSET(0x6604, OLAND_6604, OLAND)
CHIPSET(0x6605, OLAND_6605, OLAND)
CHIPSET(0x6606, OLAND_6606, OLAND)
CHIPSET(0x6607, OLAND_6607, OLAND)
CHIPSET(0x6608, OLAND_6608, OLAND)
CHIPSET(0x6610, OLAND_6610, OLAND)
CHIPSET(0x6611, OLAND_6611, OLAND)
CHIPSET(0x6613, OLAND_6613, OLAND)
@@ -73,6 +77,8 @@ CHIPSET(0x666F, HAINAN_666F, HAINAN)
CHIPSET(0x6640, BONAIRE_6640, BONAIRE)
CHIPSET(0x6641, BONAIRE_6641, BONAIRE)
CHIPSET(0x6646, BONAIRE_6646, BONAIRE)
CHIPSET(0x6647, BONAIRE_6647, BONAIRE)
CHIPSET(0x6649, BONAIRE_6649, BONAIRE)
CHIPSET(0x6650, BONAIRE_6650, BONAIRE)
CHIPSET(0x6651, BONAIRE_6651, BONAIRE)
@@ -132,6 +138,7 @@ CHIPSET(0x1313, KAVERI_1313, KAVERI)
CHIPSET(0x1315, KAVERI_1315, KAVERI)
CHIPSET(0x1316, KAVERI_1316, KAVERI)
CHIPSET(0x1317, KAVERI_1317, KAVERI)
CHIPSET(0x1318, KAVERI_1318, KAVERI)
CHIPSET(0x131B, KAVERI_131B, KAVERI)
CHIPSET(0x131C, KAVERI_131C, KAVERI)
CHIPSET(0x131D, KAVERI_131D, KAVERI)

View File

@@ -1060,6 +1060,7 @@ vl_compositor_render(struct vl_compositor_state *s,
s->scissor.maxx = dst_surface->width;
s->scissor.maxy = dst_surface->height;
}
c->pipe->set_scissor_states(c->pipe, 0, 1, &s->scissor);
gen_vertex_data(c, s, dirty_area);
@@ -1072,7 +1073,6 @@ vl_compositor_render(struct vl_compositor_state *s,
dirty_area->x1 = dirty_area->y1 = MIN_DIRTY;
}
c->pipe->set_scissor_states(c->pipe, 0, 1, &s->scissor);
c->pipe->set_framebuffer_state(c->pipe, &c->fb_state);
c->pipe->bind_vs_state(c->pipe, c->vs);
c->pipe->set_vertex_buffers(c->pipe, 0, 1, &c->vertex_buf);

View File

@@ -98,6 +98,7 @@ fd2_context_create(struct pipe_screen *pscreen, void *priv)
pctx = &fd2_ctx->base.base;
fd2_ctx->base.dev = fd_device_ref(screen->dev);
fd2_ctx->base.screen = fd_screen(pscreen);
pctx->destroy = fd2_context_destroy;
pctx->create_blend_state = fd2_blend_state_create;

View File

@@ -215,14 +215,19 @@ emit_textures(struct fd_ringbuffer *ring,
OUT_RING(ring, CP_LOAD_STATE_1_STATE_TYPE(ST_CONSTANTS) |
CP_LOAD_STATE_1_EXT_SRC_ADDR(0));
for (i = 0; i < tex->num_textures; i++) {
static const struct fd3_pipe_sampler_view dummy_view = {};
static const struct fd3_pipe_sampler_view dummy_view = {
.base.u.tex.first_level = 1,
};
const struct fd3_pipe_sampler_view *view = tex->textures[i] ?
fd3_pipe_sampler_view(tex->textures[i]) :
&dummy_view;
struct fd_resource *rsc = view->tex_resource;
unsigned start = view->base.u.tex.first_level;
unsigned end = view->base.u.tex.last_level;
for (j = 0; j < view->mipaddrs; j++) {
struct fd_resource_slice *slice = fd_resource_slice(rsc, j);
for (j = 0; j < (end - start + 1); j++) {
struct fd_resource_slice *slice =
fd_resource_slice(rsc, j + start);
OUT_RELOC(ring, rsc->bo, slice->offset, 0, 0);
}

View File

@@ -144,7 +144,8 @@ fd3_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
{
struct fd3_pipe_sampler_view *so = CALLOC_STRUCT(fd3_pipe_sampler_view);
struct fd_resource *rsc = fd_resource(prsc);
unsigned miplevels = cso->u.tex.last_level - cso->u.tex.first_level;
unsigned lvl = cso->u.tex.first_level;
unsigned miplevels = cso->u.tex.last_level - lvl;
if (!so)
return NULL;
@@ -156,7 +157,6 @@ fd3_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
so->base.context = pctx;
so->tex_resource = rsc;
so->mipaddrs = 1 + miplevels;
so->texconst0 =
A3XX_TEX_CONST_0_TYPE(tex_type(prsc->target)) |
@@ -170,11 +170,11 @@ fd3_sampler_view_create(struct pipe_context *pctx, struct pipe_resource *prsc,
so->texconst1 =
A3XX_TEX_CONST_1_FETCHSIZE(fd3_pipe2fetchsize(cso->format)) |
A3XX_TEX_CONST_1_WIDTH(prsc->width0) |
A3XX_TEX_CONST_1_HEIGHT(prsc->height0);
A3XX_TEX_CONST_1_WIDTH(u_minify(prsc->width0, lvl)) |
A3XX_TEX_CONST_1_HEIGHT(u_minify(prsc->height0, lvl));
/* when emitted, A3XX_TEX_CONST_2_INDX() must be OR'd in: */
so->texconst2 =
A3XX_TEX_CONST_2_PITCH(rsc->slices[0].pitch * rsc->cpp);
A3XX_TEX_CONST_2_PITCH(rsc->slices[lvl].pitch * rsc->cpp);
so->texconst3 = 0x00000000; /* ??? */
return &so->base;

View File

@@ -51,7 +51,6 @@ fd3_sampler_stateobj(struct pipe_sampler_state *samp)
struct fd3_pipe_sampler_view {
struct pipe_sampler_view base;
struct fd_resource *tex_resource;
uint32_t mipaddrs;
uint32_t texconst0, texconst1, texconst2, texconst3;
};

View File

@@ -304,7 +304,36 @@ fail:
return NULL;
}
static bool render_blit(struct pipe_context *pctx, struct pipe_blit_info *info);
static void fd_blitter_pipe_begin(struct fd_context *ctx);
static void fd_blitter_pipe_end(struct fd_context *ctx);
/**
* _copy_region using pipe (3d engine)
*/
static bool
fd_blitter_pipe_copy_region(struct fd_context *ctx,
struct pipe_resource *dst,
unsigned dst_level,
unsigned dstx, unsigned dsty, unsigned dstz,
struct pipe_resource *src,
unsigned src_level,
const struct pipe_box *src_box)
{
/* not until we allow rendertargets to be buffers */
if (dst->target == PIPE_BUFFER || src->target == PIPE_BUFFER)
return false;
if (!util_blitter_is_copy_supported(ctx->blitter, dst, src))
return false;
fd_blitter_pipe_begin(ctx);
util_blitter_copy_texture(ctx->blitter,
dst, dst_level, dstx, dsty, dstz,
src, src_level, src_box);
fd_blitter_pipe_end(ctx);
return true;
}
/**
* Copy a block of pixels from one resource to another.
@@ -320,40 +349,33 @@ fd_resource_copy_region(struct pipe_context *pctx,
unsigned src_level,
const struct pipe_box *src_box)
{
struct fd_context *ctx = fd_context(pctx);
/* TODO if we have 2d core, or other DMA engine that could be used
* for simple copies and reasonably easily synchronized with the 3d
* core, this is where we'd plug it in..
*/
struct pipe_blit_info info = {
.dst = {
.resource = dst,
.box = {
.x = dstx,
.y = dsty,
.z = dstz,
.width = src_box->width,
.height = src_box->height,
.depth = src_box->depth,
},
.format = util_format_linear(dst->format),
},
.src = {
.resource = src,
.box = *src_box,
.format = util_format_linear(src->format),
},
.mask = PIPE_MASK_RGBA,
.filter = PIPE_TEX_FILTER_NEAREST,
};
render_blit(pctx, &info);
/* try blit on 3d pipe: */
if (fd_blitter_pipe_copy_region(ctx,
dst, dst_level, dstx, dsty, dstz,
src, src_level, src_box))
return;
/* else fallback to pure sw: */
util_resource_copy_region(pctx,
dst, dst_level, dstx, dsty, dstz,
src, src_level, src_box);
}
/* Optimal hardware path for blitting pixels.
/**
* Optimal hardware path for blitting pixels.
* Scaling, format conversion, up- and downsampling (resolve) are allowed.
*/
static void
fd_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
{
struct fd_context *ctx = fd_context(pctx);
struct pipe_blit_info info = *blit_info;
if (info.src.resource->nr_samples > 1 &&
@@ -373,21 +395,21 @@ fd_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
info.mask &= ~PIPE_MASK_S;
}
render_blit(pctx, &info);
}
static bool
render_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
{
struct fd_context *ctx = fd_context(pctx);
if (!util_blitter_is_blit_supported(ctx->blitter, info)) {
if (!util_blitter_is_blit_supported(ctx->blitter, &info)) {
DBG("blit unsupported %s -> %s",
util_format_short_name(info->src.resource->format),
util_format_short_name(info->dst.resource->format));
return false;
util_format_short_name(info.src.resource->format),
util_format_short_name(info.dst.resource->format));
return;
}
fd_blitter_pipe_begin(ctx);
util_blitter_blit(ctx->blitter, &info);
fd_blitter_pipe_end(ctx);
}
static void
fd_blitter_pipe_begin(struct fd_context *ctx)
{
util_blitter_save_vertex_buffer_slot(ctx->blitter, ctx->vertexbuf.vb);
util_blitter_save_vertex_elements(ctx->blitter, ctx->vtx);
util_blitter_save_vertex_shader(ctx->blitter, ctx->prog.vp);
@@ -407,15 +429,21 @@ render_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
ctx->fragtex.num_textures, ctx->fragtex.textures);
fd_hw_query_set_stage(ctx, ctx->ring, FD_STAGE_BLIT);
util_blitter_blit(ctx->blitter, info);
fd_hw_query_set_stage(ctx, ctx->ring, FD_STAGE_NULL);
return true;
}
static void
fd_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
fd_blitter_pipe_end(struct fd_context *ctx)
{
fd_hw_query_set_stage(ctx, ctx->ring, FD_STAGE_NULL);
}
static void
fd_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
{
struct fd_resource *rsc = fd_resource(prsc);
if (rsc->dirty)
fd_context_render(pctx);
}
void

View File

@@ -322,7 +322,8 @@ static void ir3_block_dump(struct ir3_dump_ctx *ctx,
/* draw instruction graph: */
for (i = 0; i < block->noutputs; i++)
dump_instr(ctx, block->outputs[i]);
if (block->outputs[i])
dump_instr(ctx, block->outputs[i]);
/* draw outputs: */
fprintf(ctx->f, "output%lx [shape=record,label=\"outputs", PTRID(block));

View File

@@ -174,15 +174,31 @@ NVC0LegalizePostRA::findOverwritingDefs(const Instruction *texi,
}
void
NVC0LegalizePostRA::findFirstUses(const Instruction *texi,
const Instruction *insn,
std::list<TexUse> &uses)
NVC0LegalizePostRA::findFirstUses(
const Instruction *texi,
const Instruction *insn,
std::list<TexUse> &uses,
std::tr1::unordered_set<const Instruction *>& visited)
{
for (int d = 0; insn->defExists(d); ++d) {
Value *v = insn->getDef(d);
for (Value::UseIterator u = v->uses.begin(); u != v->uses.end(); ++u) {
Instruction *usei = (*u)->getInsn();
/* XXX HACK ALERT XXX
*
* This shouldn't have to be here, we should always be making forward
* progress by looking at the uses. However this somehow does not
* appear to be the case. Probably because this is being done right
* after RA, when the defs/uses lists have been messed with by node
* merging. This should probably be moved to being done right before
* RA. But this will do for now.
*/
if (visited.find(usei) != visited.end())
continue;
visited.insert(usei);
if (usei->op == OP_PHI || usei->op == OP_UNION) {
// need a barrier before WAW cases
for (int s = 0; usei->srcExists(s); ++s) {
@@ -197,11 +213,11 @@ NVC0LegalizePostRA::findFirstUses(const Instruction *texi,
usei->op == OP_PHI ||
usei->op == OP_UNION) {
// these uses don't manifest in the machine code
findFirstUses(texi, usei, uses);
findFirstUses(texi, usei, uses, visited);
} else
if (usei->op == OP_MOV && usei->getDef(0)->equals(usei->getSrc(0)) &&
usei->subOp != NV50_IR_SUBOP_MOV_FINAL) {
findFirstUses(texi, usei, uses);
findFirstUses(texi, usei, uses, visited);
} else {
addTexUse(uses, usei, insn);
}
@@ -257,8 +273,10 @@ NVC0LegalizePostRA::insertTextureBarriers(Function *fn)
uses = new std::list<TexUse>[texes.size()];
if (!uses)
return false;
for (size_t i = 0; i < texes.size(); ++i)
findFirstUses(texes[i], texes[i], uses[i]);
for (size_t i = 0; i < texes.size(); ++i) {
std::tr1::unordered_set<const Instruction *> visited;
findFirstUses(texes[i], texes[i], uses[i], visited);
}
// determine the barrier level at each use
for (size_t i = 0; i < texes.size(); ++i) {

View File

@@ -20,6 +20,8 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <tr1/unordered_set>
#include "codegen/nv50_ir.h"
#include "codegen/nv50_ir_build_util.h"
@@ -69,7 +71,8 @@ private:
bool insertTextureBarriers(Function *);
inline bool insnDominatedBy(const Instruction *, const Instruction *) const;
void findFirstUses(const Instruction *tex, const Instruction *def,
std::list<TexUse>&);
std::list<TexUse>&,
std::tr1::unordered_set<const Instruction *>&);
void findOverwritingDefs(const Instruction *tex, Instruction *insn,
const BasicBlock *term,
std::list<TexUse>&);

View File

@@ -567,6 +567,10 @@ ConstantFolding::expr(Instruction *i,
ImmediateValue src0;
if (i->src(0).getImmediate(src0))
expr(i, src0, *i->getSrc(1)->asImm());
if (i->saturate && !prog->getTarget()->isSatSupported(i)) {
bld.setPosition(i, false);
i->setSrc(1, bld.loadImm(NULL, res.data.u32));
}
} else {
i->op = i->saturate ? OP_SAT : OP_MOV; /* SAT handled by unary() */
}

View File

@@ -585,9 +585,12 @@ nv50_stage_sampler_states_bind(struct nv50_context *nv50, int s,
nv50_screen_tsc_unlock(nv50->screen, old);
}
assert(nv50->num_samplers[s] <= PIPE_MAX_SAMPLERS);
for (; i < nv50->num_samplers[s]; ++i)
if (nv50->samplers[s][i])
for (; i < nv50->num_samplers[s]; ++i) {
if (nv50->samplers[s][i]) {
nv50_screen_tsc_unlock(nv50->screen, nv50->samplers[s][i]);
nv50->samplers[s][i] = NULL;
}
}
nv50->num_samplers[s] = nr;

View File

@@ -54,8 +54,8 @@ nv50_validate_fb(struct nv50_context *nv50)
assert(mt->layout_3d || !array_mode || array_size == 1);
BEGIN_NV04(push, NV50_3D(RT_ADDRESS_HIGH(i)), 5);
PUSH_DATAh(push, bo->offset + sf->offset);
PUSH_DATA (push, bo->offset + sf->offset);
PUSH_DATAh(push, mt->base.address + sf->offset);
PUSH_DATA (push, mt->base.address + sf->offset);
PUSH_DATA (push, nv50_format_table[sf->base.format].rt);
if (likely(nouveau_bo_memtype(bo))) {
PUSH_DATA (push, mt->level[sf->base.u.tex.level].tile_mode);
@@ -97,8 +97,8 @@ nv50_validate_fb(struct nv50_context *nv50)
int unk = mt->base.base.target == PIPE_TEXTURE_3D || sf->depth == 1;
BEGIN_NV04(push, NV50_3D(ZETA_ADDRESS_HIGH), 5);
PUSH_DATAh(push, bo->offset + sf->offset);
PUSH_DATA (push, bo->offset + sf->offset);
PUSH_DATAh(push, mt->base.address + sf->offset);
PUSH_DATA (push, mt->base.address + sf->offset);
PUSH_DATA (push, nv50_format_table[fb->zsbuf->format].rt);
PUSH_DATA (push, mt->level[sf->base.u.tex.level].tile_mode);
PUSH_DATA (push, mt->layer_stride >> 2);

View File

@@ -114,8 +114,8 @@ nv50_2d_texture_set(struct nouveau_pushbuf *push, int dst,
PUSH_DATA (push, mt->level[level].pitch);
PUSH_DATA (push, width);
PUSH_DATA (push, height);
PUSH_DATAh(push, bo->offset + offset);
PUSH_DATA (push, bo->offset + offset);
PUSH_DATAh(push, mt->base.address + offset);
PUSH_DATA (push, mt->base.address + offset);
} else {
BEGIN_NV04(push, SUBC_2D(mthd), 5);
PUSH_DATA (push, format);
@@ -126,8 +126,8 @@ nv50_2d_texture_set(struct nouveau_pushbuf *push, int dst,
BEGIN_NV04(push, SUBC_2D(mthd + 0x18), 4);
PUSH_DATA (push, width);
PUSH_DATA (push, height);
PUSH_DATAh(push, bo->offset + offset);
PUSH_DATA (push, bo->offset + offset);
PUSH_DATAh(push, mt->base.address + offset);
PUSH_DATA (push, mt->base.address + offset);
}
#if 0
@@ -299,8 +299,8 @@ nv50_clear_render_target(struct pipe_context *pipe,
BEGIN_NV04(push, NV50_3D(RT_CONTROL), 1);
PUSH_DATA (push, 1);
BEGIN_NV04(push, NV50_3D(RT_ADDRESS_HIGH(0)), 5);
PUSH_DATAh(push, bo->offset + sf->offset);
PUSH_DATA (push, bo->offset + sf->offset);
PUSH_DATAh(push, mt->base.address + sf->offset);
PUSH_DATA (push, mt->base.address + sf->offset);
PUSH_DATA (push, nv50_format_table[dst->format].rt);
PUSH_DATA (push, mt->level[sf->base.u.tex.level].tile_mode);
PUSH_DATA (push, mt->layer_stride >> 2);
@@ -381,8 +381,8 @@ nv50_clear_depth_stencil(struct pipe_context *pipe,
nv50->scissors_dirty |= 1;
BEGIN_NV04(push, NV50_3D(ZETA_ADDRESS_HIGH), 5);
PUSH_DATAh(push, bo->offset + sf->offset);
PUSH_DATA (push, bo->offset + sf->offset);
PUSH_DATAh(push, mt->base.address + sf->offset);
PUSH_DATA (push, mt->base.address + sf->offset);
PUSH_DATA (push, nv50_format_table[dst->format].rt);
PUSH_DATA (push, mt->level[sf->base.u.tex.level].tile_mode);
PUSH_DATA (push, mt->layer_stride >> 2);

View File

@@ -24,6 +24,8 @@ nv50_m2mf_rect_setup(struct nv50_m2mf_rect *rect,
rect->bo = mt->base.bo;
rect->domain = mt->base.domain;
rect->base = mt->level[l].offset;
if (mt->base.bo->offset != mt->base.address)
rect->base += mt->base.address - mt->base.bo->offset;
rect->pitch = mt->level[l].pitch;
if (util_format_is_plain(res->format)) {
rect->width = w << mt->ms_x;

View File

@@ -482,12 +482,14 @@ nv84_create_decoder(struct pipe_context *context,
mip.level[0].pitch = surf.width * 4;
mip.base.domain = NOUVEAU_BO_VRAM;
mip.base.bo = dec->mbring;
mip.base.address = dec->mbring->offset;
context->clear_render_target(context, &surf.base, &color, 0, 0, 64, 4760);
surf.offset = dec->vpring->size / 2 - 0x1000;
surf.width = 1024;
surf.height = 1;
mip.level[0].pitch = surf.width * 4;
mip.base.bo = dec->vpring;
mip.base.address = dec->vpring->offset;
context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1);
surf.offset = dec->vpring->size - 0x1000;
context->clear_render_target(context, &surf.base, &color, 0, 0, 1024, 1);
@@ -683,17 +685,14 @@ nv84_video_buffer_create(struct pipe_context *pipe,
bo_size, &cfg, &buffer->full))
goto error;
mt0->base.bo = buffer->interlaced;
nouveau_bo_ref(buffer->interlaced, &mt0->base.bo);
mt0->base.domain = NOUVEAU_BO_VRAM;
mt0->base.offset = 0;
mt0->base.address = buffer->interlaced->offset + mt0->base.offset;
nouveau_bo_ref(buffer->interlaced, &empty);
mt0->base.address = buffer->interlaced->offset;
mt1->base.bo = buffer->interlaced;
nouveau_bo_ref(buffer->interlaced, &mt1->base.bo);
mt1->base.domain = NOUVEAU_BO_VRAM;
mt1->base.offset = mt0->layer_stride * 2;
mt1->base.address = buffer->interlaced->offset + mt1->base.offset;
nouveau_bo_ref(buffer->interlaced, &empty);
mt1->base.offset = mt0->total_size;
mt1->base.address = buffer->interlaced->offset + mt0->total_size;
memset(&sv_templ, 0, sizeof(sv_templ));
for (component = 0, i = 0; i < 2; ++i ) {

View File

@@ -261,7 +261,6 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
if (pt->usage == PIPE_USAGE_STAGING) {
switch (pt->target) {
case PIPE_TEXTURE_1D:
case PIPE_TEXTURE_2D:
case PIPE_TEXTURE_RECT:
if (pt->last_level == 0 &&

View File

@@ -440,7 +440,8 @@ static void r600_clear(struct pipe_context *ctx, unsigned buffers,
}
r600_blitter_begin(ctx, R600_CLEAR);
util_blitter_clear(rctx->blitter, fb->width, fb->height, 1,
util_blitter_clear(rctx->blitter, fb->width, fb->height,
util_framebuffer_get_num_layers(fb),
buffers, color, depth, stencil);
r600_blitter_end(ctx);

View File

@@ -1245,12 +1245,6 @@ static bool r600_update_derived_state(struct r600_context *rctx)
}
}
if (rctx->b.chip_class >= EVERGREEN) {
evergreen_update_db_shader_control(rctx);
} else {
r600_update_db_shader_control(rctx);
}
if (unlikely(!ps_dirty && rctx->ps_shader && rctx->rasterizer &&
((rctx->rasterizer->sprite_coord_enable != rctx->ps_shader->current->sprite_coord_enable) ||
(rctx->rasterizer->flatshade != rctx->ps_shader->current->flatshade)))) {
@@ -1264,6 +1258,12 @@ static bool r600_update_derived_state(struct r600_context *rctx)
update_shader_atom(ctx, &rctx->pixel_shader, rctx->ps_shader->current);
}
if (rctx->b.chip_class >= EVERGREEN) {
evergreen_update_db_shader_control(rctx);
} else {
r600_update_db_shader_control(rctx);
}
/* on R600 we stuff masks + txq info into one constant buffer */
/* on evergreen we only need a txq info one */
if (rctx->b.chip_class < EVERGREEN) {

View File

@@ -807,12 +807,40 @@ void r600_suspend_nontimer_queries(struct r600_common_context *ctx)
assert(ctx->num_cs_dw_nontimer_queries_suspend == 0);
}
static unsigned r600_queries_num_cs_dw_for_resuming(struct r600_common_context *ctx)
{
struct r600_query *query;
unsigned num_dw = 0;
LIST_FOR_EACH_ENTRY(query, &ctx->active_nontimer_queries, list) {
/* begin + end */
num_dw += query->num_cs_dw * 2;
/* Workaround for the fact that
* num_cs_dw_nontimer_queries_suspend is incremented for every
* resumed query, which raises the bar in need_cs_space for
* queries about to be resumed.
*/
num_dw += query->num_cs_dw;
}
/* primitives generated query */
num_dw += ctx->streamout.enable_atom.num_dw;
/* guess for ZPASS enable or PERFECT_ZPASS_COUNT enable updates */
num_dw += 13;
return num_dw;
}
void r600_resume_nontimer_queries(struct r600_common_context *ctx)
{
struct r600_query *query;
assert(ctx->num_cs_dw_nontimer_queries_suspend == 0);
/* Check CS space here. Resuming must not be interrupted by flushes. */
ctx->need_gfx_cs_space(&ctx->b,
r600_queries_num_cs_dw_for_resuming(ctx), TRUE);
LIST_FOR_EACH_ENTRY(query, &ctx->active_nontimer_queries, list) {
r600_emit_query_begin(ctx, query);
}

View File

@@ -251,8 +251,11 @@ int rvid_get_video_param(struct pipe_screen *screen,
profile != PIPE_VIDEO_PROFILE_VC1_MAIN;
case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
/* and MPEG2 only with shaders */
return codec != PIPE_VIDEO_FORMAT_MPEG12;
/* MPEG2 only with shaders and no support for
interlacing on R6xx style UVD */
return codec != PIPE_VIDEO_FORMAT_MPEG12 &&
/* TODO: RV770 might actually work */
rscreen->family > CHIP_RV770;
default:
break;
}

View File

@@ -1328,6 +1328,7 @@ dri_kms_init_screen(__DRIscreen * sPriv)
const __DRIconfig **configs;
struct dri_screen *screen;
struct pipe_screen *pscreen = NULL;
uint64_t cap;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
@@ -1339,6 +1340,13 @@ dri_kms_init_screen(__DRIscreen * sPriv)
sPriv->driverPrivate = (void *)screen;
pscreen = kms_swrast_create_screen(screen->fd);
if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, &cap) == 0 &&
(cap & DRM_PRIME_CAP_IMPORT)) {
dri2ImageExtension.createImageFromFds = dri2_from_fds;
dri2ImageExtension.createImageFromDmaBufs = dri2_from_dma_bufs;
}
sPriv->extensions = dri_screen_extensions;
/* dri_init_screen_helper checks pscreen for us */

View File

@@ -42,6 +42,8 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
VdpGetProcAddress **get_proc_address)
{
struct pipe_screen *pscreen;
struct pipe_resource *res, res_tmpl;
struct pipe_sampler_view sv_tmpl;
vlVdpDevice *dev = NULL;
VdpStatus ret;
@@ -79,6 +81,43 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
goto no_context;
}
memset(&res_tmpl, 0, sizeof(res_tmpl));
res_tmpl.target = PIPE_TEXTURE_2D;
res_tmpl.format = PIPE_FORMAT_R8G8B8A8_UNORM;
res_tmpl.width0 = 1;
res_tmpl.height0 = 1;
res_tmpl.depth0 = 1;
res_tmpl.array_size = 1;
res_tmpl.bind = PIPE_BIND_SAMPLER_VIEW;
res_tmpl.usage = PIPE_USAGE_DEFAULT;
if (!CheckSurfaceParams(pscreen, &res_tmpl)) {
ret = VDP_STATUS_NO_IMPLEMENTATION;
goto no_resource;
}
res = pscreen->resource_create(pscreen, &res_tmpl);
if (!res) {
ret = VDP_STATUS_RESOURCES;
goto no_resource;
}
memset(&sv_tmpl, 0, sizeof(sv_tmpl));
u_sampler_view_default_template(&sv_tmpl, res, res->format);
sv_tmpl.swizzle_r = PIPE_SWIZZLE_ONE;
sv_tmpl.swizzle_g = PIPE_SWIZZLE_ONE;
sv_tmpl.swizzle_b = PIPE_SWIZZLE_ONE;
sv_tmpl.swizzle_a = PIPE_SWIZZLE_ONE;
dev->dummy_sv = dev->context->create_sampler_view(dev->context, res, &sv_tmpl);
pipe_resource_reference(&res, NULL);
if (!dev->dummy_sv) {
ret = VDP_STATUS_RESOURCES;
goto no_resource;
}
*device = vlAddDataHTAB(dev);
if (*device == 0) {
ret = VDP_STATUS_ERROR;
@@ -93,8 +132,9 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
return VDP_STATUS_OK;
no_handle:
pipe_sampler_view_reference(&dev->dummy_sv, NULL);
no_resource:
dev->context->destroy(dev->context);
/* Destroy vscreen */
no_context:
vl_screen_destroy(dev->vscreen);
no_vscreen:
@@ -185,6 +225,7 @@ vlVdpDeviceFree(vlVdpDevice *dev)
{
pipe_mutex_destroy(dev->mutex);
vl_compositor_cleanup(&dev->compositor);
pipe_sampler_view_reference(&dev->dummy_sv, NULL);
dev->context->destroy(dev->context);
vl_screen_destroy(dev->vscreen);
FREE(dev);

View File

@@ -624,9 +624,9 @@ vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
uint32_t flags)
{
vlVdpOutputSurface *dst_vlsurface;
vlVdpOutputSurface *src_vlsurface;
struct pipe_context *context;
struct pipe_sampler_view *src_sv;
struct vl_compositor *compositor;
struct vl_compositor_state *cstate;
@@ -639,12 +639,19 @@ vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
if (!dst_vlsurface)
return VDP_STATUS_INVALID_HANDLE;
src_vlsurface = vlGetDataHTAB(source_surface);
if (!src_vlsurface)
return VDP_STATUS_INVALID_HANDLE;
if (source_surface == VDP_INVALID_HANDLE) {
src_sv = dst_vlsurface->device->dummy_sv;
if (dst_vlsurface->device != src_vlsurface->device)
return VDP_STATUS_HANDLE_DEVICE_MISMATCH;
} else {
vlVdpOutputSurface *src_vlsurface = vlGetDataHTAB(source_surface);
if (!src_vlsurface)
return VDP_STATUS_INVALID_HANDLE;
if (dst_vlsurface->device != src_vlsurface->device)
return VDP_STATUS_HANDLE_DEVICE_MISMATCH;
src_sv = src_vlsurface->sampler_view;
}
pipe_mutex_lock(dst_vlsurface->device->mutex);
vlVdpResolveDelayedRendering(dst_vlsurface->device, NULL, NULL);
@@ -657,7 +664,7 @@ vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
vl_compositor_clear_layers(cstate);
vl_compositor_set_layer_blend(cstate, 0, blend, false);
vl_compositor_set_rgba_layer(cstate, compositor, 0, src_vlsurface->sampler_view,
vl_compositor_set_rgba_layer(cstate, compositor, 0, src_sv,
RectToPipe(source_rect, &src_rect), NULL,
ColorsToPipe(colors, flags, vlcolors));
STATIC_ASSERT(VL_COMPOSITOR_ROTATE_0 == VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
@@ -688,9 +695,9 @@ vlVdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface,
uint32_t flags)
{
vlVdpOutputSurface *dst_vlsurface;
vlVdpBitmapSurface *src_vlsurface;
struct pipe_context *context;
struct pipe_sampler_view *src_sv;
struct vl_compositor *compositor;
struct vl_compositor_state *cstate;
@@ -703,12 +710,19 @@ vlVdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface,
if (!dst_vlsurface)
return VDP_STATUS_INVALID_HANDLE;
src_vlsurface = vlGetDataHTAB(source_surface);
if (!src_vlsurface)
return VDP_STATUS_INVALID_HANDLE;
if (source_surface == VDP_INVALID_HANDLE) {
src_sv = dst_vlsurface->device->dummy_sv;
if (dst_vlsurface->device != src_vlsurface->device)
return VDP_STATUS_HANDLE_DEVICE_MISMATCH;
} else {
vlVdpBitmapSurface *src_vlsurface = vlGetDataHTAB(source_surface);
if (!src_vlsurface)
return VDP_STATUS_INVALID_HANDLE;
if (dst_vlsurface->device != src_vlsurface->device)
return VDP_STATUS_HANDLE_DEVICE_MISMATCH;
src_sv = src_vlsurface->sampler_view;
}
context = dst_vlsurface->device->context;
compositor = &dst_vlsurface->device->compositor;
@@ -721,7 +735,7 @@ vlVdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface,
vl_compositor_clear_layers(cstate);
vl_compositor_set_layer_blend(cstate, 0, blend, false);
vl_compositor_set_rgba_layer(cstate, compositor, 0, src_vlsurface->sampler_view,
vl_compositor_set_rgba_layer(cstate, compositor, 0, src_sv,
RectToPipe(source_rect, &src_rect), NULL,
ColorsToPipe(colors, flags, vlcolors));
vl_compositor_set_layer_rotation(cstate, 0, flags & 3);

View File

@@ -348,6 +348,7 @@ typedef struct
struct vl_screen *vscreen;
struct pipe_context *context;
struct vl_compositor compositor;
struct pipe_sampler_view *dummy_sv;
pipe_mutex mutex;
struct {

View File

@@ -26,7 +26,6 @@ gallium_dri_la_LDFLAGS = \
-shrext .so \
-module \
-avoid-version \
-Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn \
$(GC_SECTIONS)
if HAVE_LD_VERSION_SCRIPT
@@ -34,6 +33,11 @@ gallium_dri_la_LDFLAGS += \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/dri/dri.sym
endif # HAVE_LD_VERSION_SCRIPT
if HAVE_LD_DYNAMIC_LIST
gallium_dri_la_LDFLAGS += \
-Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
endif # HAVE_LD_DYNAMIC_LIST
gallium_dri_la_LIBADD = \
$(top_builddir)/src/mesa/libmesagallium.la \
$(top_builddir)/src/mesa/drivers/dri/common/libdricommon.la \

View File

@@ -15,7 +15,6 @@ libvdpau_gallium_la_LDFLAGS = \
-module \
-no-undefined \
-version-number $(VDPAU_MAJOR):$(VDPAU_MINOR) \
-Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
@@ -24,6 +23,11 @@ libvdpau_gallium_la_LDFLAGS += \
-Wl,--version-script=$(top_srcdir)/src/gallium/targets/vdpau/vdpau.sym
endif # HAVE_LD_VERSION_SCRIPT
if HAVE_LD_DYNAMIC_LIST
libvdpau_gallium_la_LDFLAGS += \
-Wl,--dynamic-list=$(top_srcdir)/src/gallium/targets/dri-vdpau.dyn
endif # HAVE_LD_DYNAMIC_LIST
libvdpau_gallium_la_LIBADD = \
$(top_builddir)/src/gallium/state_trackers/vdpau/libvdpautracker.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \

View File

@@ -238,7 +238,7 @@ out_mip:
static struct svga_winsys_surface *
vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
struct winsys_handle *whandle,
struct winsys_handle *whandle,
SVGA3dSurfaceFormat *format)
{
struct vmw_svga_winsys_surface *vsrf;
@@ -248,7 +248,8 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
struct drm_vmw_surface_arg *req = &arg.req;
struct drm_vmw_surface_create_req *rep = &arg.rep;
uint32_t handle = 0;
SVGA3dSize size;
struct drm_vmw_size size;
SVGA3dSize base_size;
int ret;
int i;
@@ -274,7 +275,7 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
memset(&arg, 0, sizeof(arg));
req->sid = handle;
rep->size_addr = (size_t)&size;
rep->size_addr = (unsigned long)&size;
ret = drmCommandWriteRead(vws->ioctl.drm_fd, DRM_VMW_REF_SURFACE,
&arg, sizeof(arg));
@@ -324,7 +325,11 @@ vmw_drm_surface_from_handle(struct svga_winsys_screen *sws,
*format = rep->format;
/* Estimate usage, for early flushing. */
vsrf->size = svga3dsurface_get_serialized_size(rep->format, size,
base_size.width = size.width;
base_size.height = size.height;
base_size.depth = size.depth;
vsrf->size = svga3dsurface_get_serialized_size(rep->format, base_size,
rep->mip_levels[0],
FALSE);

View File

@@ -38,6 +38,7 @@
#include <sys/mman.h>
#include <unistd.h>
#include <dlfcn.h>
#include <fcntl.h>
#include <xf86drm.h>
#include "pipe/p_compiler.h"
@@ -121,7 +122,7 @@ kms_sw_displaytarget_create(struct sw_winsys *ws,
int ret;
kms_sw_dt = CALLOC_STRUCT(kms_sw_displaytarget);
if(!kms_sw_dt)
if (!kms_sw_dt)
goto no_dt;
kms_sw_dt->ref_count = 1;
@@ -210,6 +211,38 @@ kms_sw_displaytarget_map(struct sw_winsys *ws,
return kms_sw_dt->mapped;
}
static struct kms_sw_displaytarget *
kms_sw_displaytarget_add_from_prime(struct kms_sw_winsys *kms_sw, int fd)
{
uint32_t handle = -1;
struct kms_sw_displaytarget * kms_sw_dt;
int ret;
ret = drmPrimeFDToHandle(kms_sw->fd, fd, &handle);
if (ret)
return NULL;
kms_sw_dt = CALLOC_STRUCT(kms_sw_displaytarget);
if (!kms_sw_dt)
return NULL;
kms_sw_dt->ref_count = 1;
kms_sw_dt->handle = handle;
kms_sw_dt->size = lseek(fd, 0, SEEK_END);
if (kms_sw_dt->size == (off_t)-1) {
FREE(kms_sw_dt);
return NULL;
}
lseek(fd, 0, SEEK_SET);
list_add(&kms_sw_dt->link, &kms_sw->bo_list);
return kms_sw_dt;
}
static void
kms_sw_displaytarget_unmap(struct sw_winsys *ws,
struct sw_displaytarget *dt)
@@ -231,17 +264,34 @@ kms_sw_displaytarget_from_handle(struct sw_winsys *ws,
struct kms_sw_winsys *kms_sw = kms_sw_winsys(ws);
struct kms_sw_displaytarget *kms_sw_dt;
assert(whandle->type == DRM_API_HANDLE_TYPE_KMS);
assert(whandle->type == DRM_API_HANDLE_TYPE_KMS ||
whandle->type == DRM_API_HANDLE_TYPE_FD);
LIST_FOR_EACH_ENTRY(kms_sw_dt, &kms_sw->bo_list, link) {
if (kms_sw_dt->handle == whandle->handle) {
switch(whandle->type) {
case DRM_API_HANDLE_TYPE_FD:
kms_sw_dt = kms_sw_displaytarget_add_from_prime(kms_sw, whandle->handle);
if (kms_sw_dt) {
kms_sw_dt->ref_count++;
DEBUG("KMS-DEBUG: imported buffer %u (size %u)\n", kms_sw_dt->handle, kms_sw_dt->size);
kms_sw_dt->width = templ->width0;
kms_sw_dt->height = templ->height0;
kms_sw_dt->stride = whandle->stride;
*stride = kms_sw_dt->stride;
return (struct sw_displaytarget *)kms_sw_dt;
}
return (struct sw_displaytarget *)kms_sw_dt;
case DRM_API_HANDLE_TYPE_KMS:
LIST_FOR_EACH_ENTRY(kms_sw_dt, &kms_sw->bo_list, link) {
if (kms_sw_dt->handle == whandle->handle) {
kms_sw_dt->ref_count++;
DEBUG("KMS-DEBUG: imported buffer %u (size %u)\n", kms_sw_dt->handle, kms_sw_dt->size);
*stride = kms_sw_dt->stride;
return (struct sw_displaytarget *)kms_sw_dt;
}
}
/* fallthrough */
default:
break;
}
assert(0);
@@ -253,16 +303,26 @@ kms_sw_displaytarget_get_handle(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
{
struct kms_sw_winsys *kms_sw = kms_sw_winsys(winsys);
struct kms_sw_displaytarget *kms_sw_dt = kms_sw_displaytarget(dt);
if (whandle->type == DRM_API_HANDLE_TYPE_KMS) {
switch(whandle->type) {
case DRM_API_HANDLE_TYPE_KMS:
whandle->handle = kms_sw_dt->handle;
whandle->stride = kms_sw_dt->stride;
} else {
return TRUE;
case DRM_API_HANDLE_TYPE_FD:
if (!drmPrimeHandleToFD(kms_sw->fd, kms_sw_dt->handle,
DRM_CLOEXEC, &whandle->handle)) {
whandle->stride = kms_sw_dt->stride;
return TRUE;
}
/* fallthrough */
default:
whandle->handle = 0;
whandle->stride = 0;
return FALSE;
}
return TRUE;
}
static void
@@ -315,4 +375,4 @@ kms_dri_create_winsys(int fd)
return &ws->base;
}
/* vim: set sw=3 ts=8 sts=3 expandtab: */
/* vim: set sw=3 ts=8 sts=3 expandtab: */

View File

@@ -289,8 +289,14 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
}
/* Swallow empty #pragma directives, (to avoid confusing the
* downstream compiler). */
<HASH>pragma{HSPACE}*/{NEWLINE} {
* downstream compiler).
*
* Note: We use a simple regular expression for the lookahead
* here. Specifically, we cannot use the complete {NEWLINE} expression
* since it uses alternation and we've found that there's a flex bug
* where using alternation in the lookahead portion of a pattern
* triggers a buffer overrun. */
<HASH>pragma{HSPACE}*/[\r\n] {
BEGIN INITIAL;
}

View File

@@ -76,7 +76,7 @@ compare_index_block(exec_list *instructions, ir_variable *index,
ir_rvalue *broadcast_index = new(mem_ctx) ir_dereference_variable(index);
assert(index->type->is_scalar());
assert(index->type->base_type == GLSL_TYPE_INT);
assert(index->type->base_type == GLSL_TYPE_INT || index->type->base_type == GLSL_TYPE_UINT);
assert(components >= 1 && components <= 4);
if (components > 1) {

View File

@@ -396,25 +396,6 @@ _mesa_meta_init(struct gl_context *ctx)
ctx->Meta = CALLOC_STRUCT(gl_meta_state);
}
static GLenum
gl_buffer_index_to_drawbuffers_enum(gl_buffer_index bufindex)
{
assert(bufindex < BUFFER_COUNT);
if (bufindex >= BUFFER_COLOR0)
return GL_COLOR_ATTACHMENT0 + bufindex - BUFFER_COLOR0;
else if (bufindex == BUFFER_FRONT_LEFT)
return GL_FRONT_LEFT;
else if (bufindex == BUFFER_FRONT_RIGHT)
return GL_FRONT_RIGHT;
else if (bufindex == BUFFER_BACK_LEFT)
return GL_BACK_LEFT;
else if (bufindex == BUFFER_BACK_RIGHT)
return GL_BACK_RIGHT;
return GL_NONE;
}
/**
* Free context meta-op state.
* To be called once during context destruction.
@@ -806,20 +787,9 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
}
if (state & MESA_META_DRAW_BUFFERS) {
int buf, real_color_buffers = 0;
memset(save->ColorDrawBuffers, 0, sizeof(save->ColorDrawBuffers));
for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) {
int buf_index = ctx->DrawBuffer->_ColorDrawBufferIndexes[buf];
if (buf_index == -1)
continue;
save->ColorDrawBuffers[buf] =
gl_buffer_index_to_drawbuffers_enum(buf_index);
if (++real_color_buffers >= ctx->DrawBuffer->_NumColorDrawBuffers)
break;
}
struct gl_framebuffer *fb = ctx->DrawBuffer;
memcpy(save->ColorDrawBuffers, fb->ColorDrawBuffer,
sizeof(save->ColorDrawBuffers));
}
/* misc */
@@ -1224,7 +1194,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_BindRenderbuffer(GL_RENDERBUFFER, save->RenderbufferName);
if (state & MESA_META_DRAW_BUFFERS) {
_mesa_DrawBuffers(ctx->Const.MaxDrawBuffers, save->ColorDrawBuffers);
_mesa_drawbuffers(ctx, ctx->Const.MaxDrawBuffers, save->ColorDrawBuffers, NULL);
}
ctx->Meta->SaveStackDepth--;

View File

@@ -74,7 +74,7 @@ make_view(struct gl_context *ctx, struct gl_texture_image *tex_image,
tex_image->Depth,
0, internal_format, tex_format);
view_tex_obj->MinLevel = 0;
view_tex_obj->MinLevel = tex_image->Level;
view_tex_obj->NumLevels = 1;
view_tex_obj->MinLayer = tex_obj->MinLayer;
view_tex_obj->NumLayers = tex_obj->NumLayers;

View File

@@ -1029,19 +1029,17 @@ update_uip_jip(struct brw_context *brw, brw_inst *insn,
{
int scale = brw->gen >= 8 ? sizeof(brw_compact_inst) : 1;
int32_t jip = brw_inst_jip(brw, insn);
jip -= scale *
compacted_between(this_old_ip, this_old_ip + jip, compacted_counts);
brw_inst_set_jip(brw, insn, jip);
int32_t jip = brw_inst_jip(brw, insn) / scale;
jip -= compacted_between(this_old_ip, this_old_ip + jip, compacted_counts);
brw_inst_set_jip(brw, insn, jip * scale);
if (brw_inst_opcode(brw, insn) == BRW_OPCODE_ENDIF ||
brw_inst_opcode(brw, insn) == BRW_OPCODE_WHILE)
return;
int32_t uip = brw_inst_uip(brw, insn);
uip -= scale *
compacted_between(this_old_ip, this_old_ip + uip, compacted_counts);
brw_inst_set_uip(brw, insn, uip);
int32_t uip = brw_inst_uip(brw, insn) / scale;
uip -= compacted_between(this_old_ip, this_old_ip + uip, compacted_counts);
brw_inst_set_uip(brw, insn, uip * scale);
}
void

View File

@@ -2246,10 +2246,10 @@ fs_visitor::emit_bool_to_cond_code(ir_rvalue *ir)
return;
}
fs_reg op[2];
fs_reg op[3];
fs_inst *inst;
assert(expr->get_num_operands() <= 2);
assert(expr->get_num_operands() <= 3);
for (unsigned int i = 0; i < expr->get_num_operands(); i++) {
assert(expr->operands[i]->type->is_scalar());
@@ -2336,6 +2336,22 @@ fs_visitor::emit_bool_to_cond_code(ir_rvalue *ir)
brw_conditional_for_comparison(expr->operation)));
break;
case ir_triop_csel: {
/* Expand the boolean condition into the flag register. */
inst = emit(MOV(reg_null_d, op[0]));
inst->conditional_mod = BRW_CONDITIONAL_NZ;
/* Select which boolean to return. */
fs_reg temp(this, expr->operands[1]->type);
inst = emit(SEL(temp, op[1], op[2]));
inst->predicate = BRW_PREDICATE_NORMAL;
/* Expand the result to a condition code. */
inst = emit(MOV(reg_null_d, temp));
inst->conditional_mod = BRW_CONDITIONAL_NZ;
break;
}
default:
unreachable("not reached");
}

View File

@@ -282,6 +282,7 @@ get_fast_clear_rect(struct brw_context *brw, struct gl_framebuffer *fb,
* factor is 2 vertically and either 2 or 8 horizontally.
*/
switch (irb->mt->num_samples) {
case 2:
case 4:
x_scaledown = 8;
break;

View File

@@ -777,10 +777,10 @@ vec4_visitor::emit_bool_to_cond_code(ir_rvalue *ir,
*predicate = BRW_PREDICATE_NORMAL;
if (expr) {
src_reg op[2];
src_reg op[3];
vec4_instruction *inst;
assert(expr->get_num_operands() <= 2);
assert(expr->get_num_operands() <= 3);
for (unsigned int i = 0; i < expr->get_num_operands(); i++) {
expr->operands[i]->accept(this);
op[i] = this->result;
@@ -852,6 +852,22 @@ vec4_visitor::emit_bool_to_cond_code(ir_rvalue *ir,
brw_conditional_for_comparison(expr->operation)));
break;
case ir_triop_csel: {
/* Expand the boolean condition into the flag register. */
inst = emit(MOV(dst_null_d(), op[0]));
inst->conditional_mod = BRW_CONDITIONAL_NZ;
/* Select which boolean to return. */
dst_reg temp(this, expr->operands[1]->type);
inst = emit(BRW_OPCODE_SEL, temp, op[1], op[2]);
inst->predicate = BRW_PREDICATE_NORMAL;
/* Expand the result to a condition code. */
inst = emit(MOV(dst_null_d(), src_reg(temp)));
inst->conditional_mod = BRW_CONDITIONAL_NZ;
break;
}
default:
unreachable("not reached");
}
@@ -1135,6 +1151,13 @@ vec4_visitor::try_emit_mad(ir_expression *ir)
bool
vec4_visitor::try_emit_b2f_of_compare(ir_expression *ir)
{
/* This optimization relies on CMP setting the destination to 0 when
* false. Early hardware only sets the least significant bit, and
* leaves the other bits undefined. So we can't use it.
*/
if (brw->gen < 6)
return false;
ir_expression *const cmp = ir->operands[0]->as_expression();
if (cmp == NULL)
@@ -2589,7 +2612,7 @@ vec4_visitor::visit(ir_texture *ir)
} else if (ir->op == ir_txf_ms) {
emit(MOV(dst_reg(MRF, param_base + 1, sample_index_type, WRITEMASK_X),
sample_index));
if (brw->gen >= 7)
if (brw->gen >= 7) {
/* MCS data is in the first channel of `mcs`, but we need to get it into
* the .y channel of the second vec4 of params, so replicate .x across
* the whole vec4 and then mask off everything except .y
@@ -2597,6 +2620,7 @@ vec4_visitor::visit(ir_texture *ir)
mcs.swizzle = BRW_SWIZZLE_XXXX;
emit(MOV(dst_reg(MRF, param_base + 1, glsl_type::uint_type, WRITEMASK_Y),
mcs));
}
inst->mlen++;
} else if (ir->op == ir_txd) {
const glsl_type *type = lod_type;

View File

@@ -40,6 +40,7 @@ copy_image_with_blitter(struct brw_context *brw,
int src_width, int src_height)
{
GLuint bw, bh;
uint32_t src_image_x, src_image_y, dst_image_x, dst_image_y;
int cpp;
/* The blitter doesn't understand multisampling at all. */
@@ -70,43 +71,53 @@ copy_image_with_blitter(struct brw_context *brw,
return false;
}
intel_miptree_get_image_offset(src_mt, src_level, src_z,
&src_image_x, &src_image_y);
if (_mesa_is_format_compressed(src_mt->format)) {
_mesa_get_format_block_size(src_mt->format, &bw, &bh);
assert(src_x % bw == 0);
assert(src_y % bw == 0);
assert(src_y % bh == 0);
assert(src_width % bw == 0);
assert(src_height % bw == 0);
assert(src_height % bh == 0);
src_x /= (int)bw;
src_y /= (int)bw;
src_y /= (int)bh;
src_width /= (int)bw;
src_height /= (int)bw;
src_height /= (int)bh;
/* Inside of the miptree, the x offsets are stored in pixels while
* the y offsets are stored in blocks. We need to scale just the x
* offset.
*/
src_image_x /= bw;
cpp = _mesa_get_format_bytes(src_mt->format);
} else {
cpp = src_mt->cpp;
}
src_x += src_image_x;
src_y += src_image_y;
intel_miptree_get_image_offset(dst_mt, dst_level, dst_z,
&dst_image_x, &dst_image_y);
if (_mesa_is_format_compressed(dst_mt->format)) {
_mesa_get_format_block_size(dst_mt->format, &bw, &bh);
assert(dst_x % bw == 0);
assert(dst_y % bw == 0);
assert(dst_y % bh == 0);
dst_x /= (int)bw;
dst_y /= (int)bw;
dst_y /= (int)bh;
/* Inside of the miptree, the x offsets are stored in pixels while
* the y offsets are stored in blocks. We need to scale just the x
* offset.
*/
dst_image_x /= bw;
}
uint32_t src_image_x, src_image_y;
intel_miptree_get_image_offset(src_mt, src_level, src_z,
&src_image_x, &src_image_y);
src_x += src_image_x;
src_y += src_image_y;
uint32_t dst_image_x, dst_image_y;
intel_miptree_get_image_offset(dst_mt, dst_level, dst_z,
&dst_image_x, &dst_image_y);
dst_x += dst_image_x;
dst_y += dst_image_y;
@@ -243,9 +254,11 @@ intel_copy_image_sub_data(struct gl_context *ctx,
intel_miptree_all_slices_resolve_depth(brw, intel_dst_image->mt);
intel_miptree_resolve_color(brw, intel_dst_image->mt);
if (copy_image_with_blitter(brw, intel_src_image->mt, src_image->Level,
unsigned src_level = src_image->Level + src_image->TexObject->MinLevel;
unsigned dst_level = dst_image->Level + dst_image->TexObject->MinLevel;
if (copy_image_with_blitter(brw, intel_src_image->mt, src_level,
src_x, src_y, src_z,
intel_dst_image->mt, src_image->Level,
intel_dst_image->mt, dst_level,
dst_x, dst_y, dst_z,
src_width, src_height))
return;
@@ -253,9 +266,9 @@ intel_copy_image_sub_data(struct gl_context *ctx,
/* This is a worst-case scenario software fallback that maps the two
* textures and does a memcpy between them.
*/
copy_image_with_memcpy(brw, intel_src_image->mt, src_image->Level,
copy_image_with_memcpy(brw, intel_src_image->mt, src_level,
src_x, src_y, src_z,
intel_dst_image->mt, src_image->Level,
intel_dst_image->mt, dst_level,
dst_x, dst_y, dst_z,
src_width, src_height);
}

View File

@@ -241,8 +241,5 @@ TEST_F(register_coalesce_test, test_channel_mul_grf)
register_coalesce(v);
/* This path isn't supported yet in the reswizzling code, so we're checking
* that we haven't done anything bad to scalar non-DP[234]s.
*/
EXPECT_NE(mul->dst.reg, to.reg);
EXPECT_EQ(mul->dst.reg, to.reg);
}

View File

@@ -1488,6 +1488,10 @@ copy_array_attrib(struct gl_context *ctx,
/* skip ArrayBufferObj */
/* skip IndexBufferObj */
/* Invalidate draw state. It will be updated during the next draw. */
dest->DrawMethod = DRAW_NONE;
dest->_DrawArrays = NULL;
}
/**

View File

@@ -653,6 +653,9 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api)
/* GL_ARB_framebuffer_object */
consts->MaxSamples = 0;
/* GLSL default if NativeIntegers == FALSE */
consts->UniformBooleanTrue = FLT_AS_UINT(1.0f);
/* GL_ARB_sync */
consts->MaxServerWaitTimeout = 0x1fff7fffffffULL;

View File

@@ -184,6 +184,13 @@ static inline GLfloat UINT_AS_FLT(GLuint u)
return tmp.f;
}
static inline unsigned FLT_AS_UINT(float f)
{
fi_type tmp;
tmp.f = f;
return tmp.u;
}
/**
* Convert a floating point value to an unsigned fixed point value.
*

View File

@@ -34,6 +34,7 @@
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_screen.h"
#include "util/u_math.h"
#include "st_context.h"
#include "st_extensions.h"
@@ -274,8 +275,6 @@ void st_init_limits(struct pipe_screen *screen,
c->MinProgramTextureGatherOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXTURE_GATHER_OFFSET);
c->MaxProgramTextureGatherOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET);
c->UniformBooleanTrue = ~0;
c->MaxTransformFeedbackBuffers =
screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS);
c->MaxTransformFeedbackBuffers = MIN2(c->MaxTransformFeedbackBuffers, MAX_FEEDBACK_BUFFERS);
@@ -697,6 +696,8 @@ void st_init_extensions(struct pipe_screen *screen,
}
}
consts->UniformBooleanTrue = consts->NativeIntegers ? ~0 : fui(1.0f);
/* Below are the cases which cannot be moved into tables easily. */
if (!has_lib_dxtc && !options->force_s3tc_enable) {

View File

@@ -74,14 +74,6 @@ extern "C" {
(1 << PROGRAM_CONSTANT) | \
(1 << PROGRAM_UNIFORM))
/**
* Maximum number of temporary registers.
*
* It is too big for stack allocated arrays -- it will cause stack overflow on
* Windows and likely Mac OS X.
*/
#define MAX_TEMPS 4096
/**
* Maximum number of arrays
*/
@@ -3301,14 +3293,10 @@ get_src_arg_mask(st_dst_reg dst, st_src_reg src)
void
glsl_to_tgsi_visitor::simplify_cmp(void)
{
unsigned *tempWrites;
int tempWritesSize = 0;
unsigned *tempWrites = NULL;
unsigned outputWrites[MAX_PROGRAM_OUTPUTS];
tempWrites = new unsigned[MAX_TEMPS];
if (!tempWrites) {
return;
}
memset(tempWrites, 0, sizeof(unsigned) * MAX_TEMPS);
memset(outputWrites, 0, sizeof(outputWrites));
foreach_in_list(glsl_to_tgsi_instruction, inst, &this->instructions) {
@@ -3330,7 +3318,19 @@ glsl_to_tgsi_visitor::simplify_cmp(void)
prevWriteMask = outputWrites[inst->dst.index];
outputWrites[inst->dst.index] |= inst->dst.writemask;
} else if (inst->dst.file == PROGRAM_TEMPORARY) {
assert(inst->dst.index < MAX_TEMPS);
if (inst->dst.index >= tempWritesSize) {
const int inc = 4096;
tempWrites = (unsigned*)
realloc(tempWrites,
(tempWritesSize + inc) * sizeof(unsigned));
if (!tempWrites)
return;
memset(tempWrites + tempWritesSize, 0, inc * sizeof(unsigned));
tempWritesSize += inc;
}
prevWriteMask = tempWrites[inst->dst.index];
tempWrites[inst->dst.index] |= inst->dst.writemask;
} else
@@ -3349,7 +3349,7 @@ glsl_to_tgsi_visitor::simplify_cmp(void)
}
}
delete [] tempWrites;
free(tempWrites);
}
/* Replaces all references to a temporary register index with another index. */
@@ -4158,7 +4158,9 @@ struct label {
struct st_translate {
struct ureg_program *ureg;
struct ureg_dst temps[MAX_TEMPS];
unsigned temps_size;
struct ureg_dst *temps;
struct ureg_dst arrays[MAX_ARRAYS];
struct ureg_src *constants;
struct ureg_src *immediates;
@@ -4299,7 +4301,19 @@ dst_register(struct st_translate *t,
return ureg_dst_undef();
case PROGRAM_TEMPORARY:
assert(index < Elements(t->temps));
/* Allocate space for temporaries on demand. */
if (index >= t->temps_size) {
const int inc = 4096;
t->temps = (struct ureg_dst*)
realloc(t->temps,
(t->temps_size + inc) * sizeof(struct ureg_dst));
if (!t->temps)
return ureg_dst_undef();
memset(t->temps + t->temps_size, 0, inc * sizeof(struct ureg_dst));
t->temps_size += inc;
}
if (ureg_dst_is_undef(t->temps[index]))
t->temps[index] = ureg_DECL_local_temporary(t->ureg);
@@ -5158,6 +5172,7 @@ st_translate_program(
out:
if (t) {
free(t->temps);
free(t->insn);
free(t->labels);
free(t->constants);