summaryrefslogtreecommitdiff
path: root/driver/xf86-video-intel
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2014-02-14 19:38:41 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2014-02-14 19:38:41 +0000
commit78192b77bcc1631d33ceca7e29fd5555464d76b2 (patch)
tree3fb94423a0554bca9126e475097cb428c3439cfb /driver/xf86-video-intel
parent31049b1cf3eb649d2eb3d03f85443e0b0d5ef469 (diff)
Update to xf86-video-intel 2.99.910 (aka 3.0RC10) tested by jsg@ and me.
Diffstat (limited to 'driver/xf86-video-intel')
-rw-r--r--driver/xf86-video-intel/ChangeLog195
-rw-r--r--driver/xf86-video-intel/NEWS25
-rw-r--r--driver/xf86-video-intel/configure22
-rw-r--r--driver/xf86-video-intel/configure.ac2
-rw-r--r--driver/xf86-video-intel/src/sna/gen4_render.c13
-rw-r--r--driver/xf86-video-intel/src/sna/gen4_render.h2
-rw-r--r--driver/xf86-video-intel/src/sna/gen5_render.c6
-rw-r--r--driver/xf86-video-intel/src/sna/gen6_render.c11
-rw-r--r--driver/xf86-video-intel/src/sna/gen7_render.c2
-rw-r--r--driver/xf86-video-intel/src/sna/gen8_render.c2
-rw-r--r--driver/xf86-video-intel/src/sna/kgem.c14
-rw-r--r--driver/xf86-video-intel/src/sna/kgem.h10
-rw-r--r--driver/xf86-video-intel/src/sna/sna_accel.c301
-rw-r--r--driver/xf86-video-intel/src/sna/sna_glyphs.c3
-rw-r--r--driver/xf86-video-intel/src/uxa/intel_video.c3
15 files changed, 459 insertions, 152 deletions
diff --git a/driver/xf86-video-intel/ChangeLog b/driver/xf86-video-intel/ChangeLog
index 6e34eb58b..c911f273b 100644
--- a/driver/xf86-video-intel/ChangeLog
+++ b/driver/xf86-video-intel/ChangeLog
@@ -1,3 +1,198 @@
+commit 2fb2cd092dadba40b5ad2da57943c660a0c9bc14
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Mon Feb 10 09:35:11 2014 +0000
+
+ 2.99.910 snapshot
+
+commit 37d8566ee78c67647b159a96ddb2675d1506b967
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Feb 9 12:28:27 2014 +0000
+
+ sna/gen6: Restore stall dropped when not flushing instead
+
+ commit 82e6d41c2f4f343bd1854d3d8ee4b624b5d68971
+ Author: Chris Wilson <chris@chris-wilson.co.uk>
+ Date: Thu Oct 31 13:35:59 2013 +0000
+
+ sna/gen6: Tweak flush around CC state changes
+
+ Replaced the pipeline stall with a flush - but only when the target was
+ dirty. The missing stall however seems to be required as well.
+
+ v2: Actually emit the stall for all CC state changes [Ilia Mirkin]
+
+ Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72375
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 823382d28944a319c207f20ecef25ce1707a8021
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Feb 6 10:13:41 2014 +0000
+
+ sna: And clear drawable->id on reused pixmaps
+
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=74550
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 6fc46adb18a8410074c12d6e8979ef01813ebdf2
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Feb 6 09:24:17 2014 +0000
+
+ uxa: Do not expose TextureVideo Xv adapters when acceleration is disabled
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 1eadd1d0b1c8bcbf11eb7c0e112d1e424b63c25e
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Feb 6 09:04:30 2014 +0000
+
+ sna: Add some DBG to clarify the source pixmap (for tiles)
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 4d1a2ef9553c663bb97b56adde6f6b41241ff528
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Feb 6 08:29:20 2014 +0000
+
+ sna: Reset composite offsets when reusing freed pixmaps
+
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74550
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 79d2f96bdfa0d7ae1567bf4b57b4f86aae424f50
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Feb 5 15:30:30 2014 +0000
+
+ sna: Add some DBG around tiled blts
+
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=74550
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 02eceefa2909075aca0ba3df7fdba835079aeb78
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Feb 5 11:41:42 2014 +0000
+
+ sna: Pass read hints from move-to-cpu to wait_for_shadow
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit de73c5fd1cd4f948b8bd3582ae788f6f855c5b16
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Feb 4 20:57:24 2014 +0000
+
+ sna: Tweak assert_bo_retired() to be callable on cached bo
+
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=73406
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 0906769c1b92520351729c4d8f2ab684d3ddf2eb
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Feb 4 17:51:51 2014 +0000
+
+ sna: Rearrange assertion to ease use of substitute cached bo
+
+ Since we call kgem_bo_submit() along one path when synchronising a
+ cached bo (which is known to be inactive) but still want to keep the
+ assertion on the refcnt, simply rearrange the code to only assert on the
+ active path.
+
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=73406
+ Reported-by: Matti Hamalainen <ccr@tnsp.org>
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit fc001615ff78df4dab6ee0d5dd966b723326c358
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Feb 4 10:36:21 2014 +0000
+
+ sna/gen4: Disable use of pipecontrol invalidates again
+
+ One day, just not today, we may make gen4 work correctly, efficiently and
+ fast. Today, we can barely pick one.
+
+ References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit c6a21f0355447d398a8b857ad046cd27141d4744
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Feb 4 08:51:17 2014 +0000
+
+ sna/glyphs: Reset composite state between switching glyph formats
+
+ One path uses the mask channel, the other does not. We cannot rely on
+ overwriting all reused state in this case, and so we must clear the
+ composite state prior to use each time.
+
+ Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
+ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74494
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+ Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>
+
+commit 1cbc59a917e7352fc68aa0e26b1575cbd0ceab0d
+Author: Edward Sheldrake <ejsheldrake@gmail.com>
+Date: Mon Feb 3 09:34:33 2014 +0000
+
+ sna/gen4,5: Fix setting pipe control cache flush bits
+
+ Cache flush bits are on dword 0, not 1, on gen4 and gen5. Also texture
+ cache invalidate is only available from Cantiga onwards.
+
+commit 7f08250a8960f90f6bd34de8c4a17870703bfa60
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sun Feb 2 03:52:11 2014 +0000
+
+ sna: Reconstruct damage for the partially replaced discarded CPU bo
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 853588ad5be9407d2123f6055458ca84e72b8eb9
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Feb 1 21:55:09 2014 +0000
+
+ sna: If IGNORE_CPU is not set we must mark the move as MOVE_READ
+
+ Logic reversal in discarding CPU damage. An old bug revealed by the more
+ aggressive attempts to discard CPU damage.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 8b0748c57ee4c38ea98c4b6ca18cb2b99f8f9ed4
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Feb 1 21:54:43 2014 +0000
+
+ sna: Add some more DBG for choosing render targets
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit ed8d4f0ce3bff662d02063528df64d478ac0dc00
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Feb 1 21:38:47 2014 +0000
+
+ sna: Skip discarding CPU bo when using as a render target
+
+ The issue with unwanted serialisation does not affect the async
+ move-to-cpu of a render target.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 26613b046012f0ad968a15ab6bdfa8f6a6652e77
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Feb 1 21:37:41 2014 +0000
+
+ sna: Allow more inplace promotions of CPU to GPU bo
+
+ If the CPU bo is wholly damaged, then it makes an ideal candidate for
+ simply converting into the GPU bo.
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+commit 699b4fd3139d1d6d02911d6c8f193ead3445f613
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat Feb 1 20:13:53 2014 +0000
+
+ sna: Undo region translation before returning
+
+ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
commit 2c4b2ed558bec3b71077fb12cc4e008cccc819fa
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sat Feb 1 17:59:29 2014 +0000
diff --git a/driver/xf86-video-intel/NEWS b/driver/xf86-video-intel/NEWS
index 63655d39f..5700d3404 100644
--- a/driver/xf86-video-intel/NEWS
+++ b/driver/xf86-video-intel/NEWS
@@ -1,3 +1,28 @@
+Snapshot 2.99.910 (2013-02-10)
+==============================
+Another latent bug exposed by recent changes merit another snapshot for
+final testing.
+
+ * Only discard damage when overwriting the dirty CPU bo, instead
+ of discarding damage that will be shown!
+
+ * Reset operation state when switching between glyph caches.
+ https://bugs.freedesktop.org/show_bug.cgi?id=74494
+
+ * Fully reinitialise pixmaps allocated from the freed cache. Fixes
+ a potential issue (crash or misrendering) when using some compositors.
+ https://bugs.freedesktop.org/show_bug.cgi?id=74550
+
+ * Do not expose the TexturedVideo adaptor in UXA when it is disabled
+ either due to a hung GPU or explicitly disabled by the user.
+
+ * Restore the pipe stall when changing CC state on gen6, otherwise
+ the GPU may not flush intermediate results from all EU resulting
+ in render corruption (usually the occasional black box).
+ Regression from 2.99.906
+ https://bugs.freedesktop.org/show_bug.cgi?id=7237
+
+
Snapshot 2.99.909 (2013-02-01)
==============================
Pass the brown paper bag. Ridiculously stupid bug in last minute coding.
diff --git a/driver/xf86-video-intel/configure b/driver/xf86-video-intel/configure
index d81787e90..71a7cd0c2 100644
--- a/driver/xf86-video-intel/configure
+++ b/driver/xf86-video-intel/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xf86-video-intel 2.99.909.
+# Generated by GNU Autoconf 2.69 for xf86-video-intel 2.99.910.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xf86-video-intel'
PACKAGE_TARNAME='xf86-video-intel'
-PACKAGE_VERSION='2.99.909'
-PACKAGE_STRING='xf86-video-intel 2.99.909'
+PACKAGE_VERSION='2.99.910'
+PACKAGE_STRING='xf86-video-intel 2.99.910'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL=''
@@ -1470,7 +1470,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xf86-video-intel 2.99.909 to adapt to many kinds of systems.
+\`configure' configures xf86-video-intel 2.99.910 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1541,7 +1541,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-video-intel 2.99.909:";;
+ short | recursive ) echo "Configuration of xf86-video-intel 2.99.910:";;
esac
cat <<\_ACEOF
@@ -1741,7 +1741,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xf86-video-intel configure 2.99.909
+xf86-video-intel configure 2.99.910
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2156,7 +2156,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xf86-video-intel $as_me 2.99.909, which was
+It was created by xf86-video-intel $as_me 2.99.910, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2986,7 +2986,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-video-intel'
- VERSION='2.99.909'
+ VERSION='2.99.910'
cat >>confdefs.h <<_ACEOF
@@ -21505,7 +21505,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xf86-video-intel $as_me 2.99.909, which was
+This file was extended by xf86-video-intel $as_me 2.99.910, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21571,7 +21571,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-xf86-video-intel config.status 2.99.909
+xf86-video-intel config.status 2.99.910
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -23388,7 +23388,7 @@ else
fi
echo ""
-echo "xf86-video-intel 2.99.909 will be compiled with:"
+echo "xf86-video-intel 2.99.910 will be compiled with:"
echo " Acceleration backends:$accel_msg"
echo " Additional debugging support?$debug_msg"
echo " Support for Kernel Mode Setting? $KMS"
diff --git a/driver/xf86-video-intel/configure.ac b/driver/xf86-video-intel/configure.ac
index f7a6d32b7..a3114afb5 100644
--- a/driver/xf86-video-intel/configure.ac
+++ b/driver/xf86-video-intel/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-intel],
- [2.99.909],
+ [2.99.910],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-intel])
AC_CONFIG_SRCDIR([Makefile.am])
diff --git a/driver/xf86-video-intel/src/sna/gen4_render.c b/driver/xf86-video-intel/src/sna/gen4_render.c
index 1d164b6ea..ba9c9bc19 100644
--- a/driver/xf86-video-intel/src/sna/gen4_render.c
+++ b/driver/xf86-video-intel/src/sna/gen4_render.c
@@ -575,8 +575,10 @@ inline static void
gen4_emit_pipe_flush(struct sna *sna)
{
#if 1
- OUT_BATCH(GEN4_PIPE_CONTROL | (4 - 2));
- OUT_BATCH(GEN4_PIPE_CONTROL_WC_FLUSH);
+ OUT_BATCH(GEN4_PIPE_CONTROL |
+ GEN4_PIPE_CONTROL_WC_FLUSH |
+ (4 - 2));
+ OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
#else
@@ -601,8 +603,11 @@ inline static void
gen4_emit_pipe_invalidate(struct sna *sna)
{
#if 0
- OUT_BATCH(GEN4_PIPE_CONTROL | (4 - 2));
- OUT_BATCH(GEN4_PIPE_CONTROL_WC_FLUSH | GEN4_PIPE_CONTROL_TC_FLUSH);
+ OUT_BATCH(GEN4_PIPE_CONTROL |
+ GEN4_PIPE_CONTROL_WC_FLUSH |
+ (sna->kgem.gen >= 045 ? GEN4_PIPE_CONTROL_TC_FLUSH : 0) |
+ (4 - 2));
+ OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
#else
diff --git a/driver/xf86-video-intel/src/sna/gen4_render.h b/driver/xf86-video-intel/src/sna/gen4_render.h
index 53c7fc2f7..64d11e66c 100644
--- a/driver/xf86-video-intel/src/sna/gen4_render.h
+++ b/driver/xf86-video-intel/src/sna/gen4_render.h
@@ -112,7 +112,7 @@
#define GEN4_PIPE_CONTROL_DEPTH_STALL (1 << 13)
#define GEN4_PIPE_CONTROL_WC_FLUSH (1 << 12)
#define GEN4_PIPE_CONTROL_IS_FLUSH (1 << 11)
-#define GEN4_PIPE_CONTROL_TC_FLUSH (1 << 10)
+#define GEN4_PIPE_CONTROL_TC_FLUSH (1 << 10) /* ctg+ */
#define GEN4_PIPE_CONTROL_NOTIFY_ENABLE (1 << 8)
#define GEN4_PIPE_CONTROL_GLOBAL_GTT (1 << 2)
#define GEN4_PIPE_CONTROL_LOCAL_PGTT (0 << 2)
diff --git a/driver/xf86-video-intel/src/sna/gen5_render.c b/driver/xf86-video-intel/src/sna/gen5_render.c
index 8fb47cb61..25555e0e1 100644
--- a/driver/xf86-video-intel/src/sna/gen5_render.c
+++ b/driver/xf86-video-intel/src/sna/gen5_render.c
@@ -1016,8 +1016,10 @@ inline static void
gen5_emit_pipe_flush(struct sna *sna)
{
#if 0
- OUT_BATCH(GEN5_PIPE_CONTROL | (4 - 2));
- OUT_BATCH(GEN5_PIPE_CONTROL_WC_FLUSH);
+ OUT_BATCH(GEN5_PIPE_CONTROL |
+ GEN5_PIPE_CONTROL_WC_FLUSH |
+ (4 - 2));
+ OUT_BATCH(0);
OUT_BATCH(0);
OUT_BATCH(0);
#else
diff --git a/driver/xf86-video-intel/src/sna/gen6_render.c b/driver/xf86-video-intel/src/sna/gen6_render.c
index 08c9f7850..f36bf7967 100644
--- a/driver/xf86-video-intel/src/sna/gen6_render.c
+++ b/driver/xf86-video-intel/src/sna/gen6_render.c
@@ -870,15 +870,16 @@ gen6_emit_state(struct sna *sna,
assert(op->dst.bo->exec);
- need_flush =
- gen6_emit_cc(sna, GEN6_BLEND(op->u.gen6.flags)) &&
- wm_binding_table & 1;
+ need_stall = wm_binding_table & 1;
+ need_flush = false;
+ if (gen6_emit_cc(sna, GEN6_BLEND(op->u.gen6.flags)))
+ need_flush = need_stall;
gen6_emit_sampler(sna, GEN6_SAMPLER(op->u.gen6.flags));
gen6_emit_sf(sna, GEN6_VERTEX(op->u.gen6.flags) >> 2);
gen6_emit_wm(sna, GEN6_KERNEL(op->u.gen6.flags), GEN6_VERTEX(op->u.gen6.flags) >> 2);
gen6_emit_vertex_elements(sna, op);
- need_stall = gen6_emit_binding_table(sna, wm_binding_table & ~1);
+ need_stall |= gen6_emit_binding_table(sna, wm_binding_table & ~1);
if (gen6_emit_drawing_rectangle(sna, op))
need_stall = false;
if (need_flush || kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) {
@@ -1831,6 +1832,8 @@ gen6_composite_set_target(struct sna *sna,
BoxRec box;
unsigned int hint;
+ DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h));
+
op->dst.pixmap = get_drawable_pixmap(dst->pDrawable);
op->dst.format = dst->format;
op->dst.width = op->dst.pixmap->drawable.width;
diff --git a/driver/xf86-video-intel/src/sna/gen7_render.c b/driver/xf86-video-intel/src/sna/gen7_render.c
index 1574813ab..a90bd15a1 100644
--- a/driver/xf86-video-intel/src/sna/gen7_render.c
+++ b/driver/xf86-video-intel/src/sna/gen7_render.c
@@ -2111,6 +2111,8 @@ gen7_composite_set_target(struct sna *sna,
BoxRec box;
unsigned int hint;
+ DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h));
+
op->dst.pixmap = get_drawable_pixmap(dst->pDrawable);
op->dst.format = dst->format;
op->dst.width = op->dst.pixmap->drawable.width;
diff --git a/driver/xf86-video-intel/src/sna/gen8_render.c b/driver/xf86-video-intel/src/sna/gen8_render.c
index 5c718bc55..c096db1f8 100644
--- a/driver/xf86-video-intel/src/sna/gen8_render.c
+++ b/driver/xf86-video-intel/src/sna/gen8_render.c
@@ -1862,6 +1862,8 @@ gen8_composite_set_target(struct sna *sna,
BoxRec box;
unsigned int hint;
+ DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h));
+
op->dst.pixmap = get_drawable_pixmap(dst->pDrawable);
op->dst.format = dst->format;
op->dst.width = op->dst.pixmap->drawable.width;
diff --git a/driver/xf86-video-intel/src/sna/kgem.c b/driver/xf86-video-intel/src/sna/kgem.c
index f7404dfb7..cb64cacee 100644
--- a/driver/xf86-video-intel/src/sna/kgem.c
+++ b/driver/xf86-video-intel/src/sna/kgem.c
@@ -506,12 +506,13 @@ static void kgem_bo_retire(struct kgem *kgem, struct kgem_bo *bo)
if (bo->rq) {
__kgem_bo_clear_busy(bo);
kgem_retire(kgem);
+ assert_bo_retired(bo);
} else {
+ assert(bo->exec == NULL);
+ assert(list_is_empty(&bo->request));
assert(!bo->needs_flush);
ASSERT_IDLE(kgem, bo->handle);
}
-
- assert_bo_retired(bo);
}
static void kgem_bo_maybe_retire(struct kgem *kgem, struct kgem_bo *bo)
@@ -6743,14 +6744,19 @@ kgem_replace_bo(struct kgem *kgem,
return dst;
}
-bool kgem_bo_convert_to_gpu(struct kgem *kgem, struct kgem_bo *bo)
+bool kgem_bo_convert_to_gpu(struct kgem *kgem,
+ struct kgem_bo *bo,
+ unsigned flags)
{
- DBG(("%s: converting handle=%d from CPU to GPU\n", __FUNCTION__, bo->handle));
+ DBG(("%s: converting handle=%d from CPU to GPU, flags=%x\n", __FUNCTION__, bo->handle));
assert(bo->tiling == I915_TILING_NONE);
if (kgem->has_llc)
return true;
+ if (flags & MOVE_ASYNC_HINT && __kgem_bo_is_busy(kgem, bo))
+ return false;
+
assert(bo->snoop);
kgem_bo_submit(kgem, bo);
diff --git a/driver/xf86-video-intel/src/sna/kgem.h b/driver/xf86-video-intel/src/sna/kgem.h
index f670b604d..fdabd5046 100644
--- a/driver/xf86-video-intel/src/sna/kgem.h
+++ b/driver/xf86-video-intel/src/sna/kgem.h
@@ -301,7 +301,9 @@ struct kgem_bo *kgem_create_cpu_2d(struct kgem *kgem,
int bpp,
uint32_t flags);
-bool kgem_bo_convert_to_gpu(struct kgem *kgem, struct kgem_bo *bo);
+bool kgem_bo_convert_to_gpu(struct kgem *kgem,
+ struct kgem_bo *bo,
+ unsigned flags);
uint32_t kgem_bo_get_binding(struct kgem_bo *bo, uint32_t format);
void kgem_bo_set_binding(struct kgem_bo *bo, uint32_t format, uint16_t offset);
@@ -341,9 +343,11 @@ static inline void kgem_submit(struct kgem *kgem)
static inline void kgem_bo_submit(struct kgem *kgem, struct kgem_bo *bo)
{
+ if (bo->exec == NULL)
+ return;
+
assert(bo->refcnt);
- if (bo->exec)
- _kgem_submit(kgem);
+ _kgem_submit(kgem);
}
void kgem_scanout_flush(struct kgem *kgem, struct kgem_bo *bo);
diff --git a/driver/xf86-video-intel/src/sna/sna_accel.c b/driver/xf86-video-intel/src/sna/sna_accel.c
index aecae513f..391999721 100644
--- a/driver/xf86-video-intel/src/sna/sna_accel.c
+++ b/driver/xf86-video-intel/src/sna/sna_accel.c
@@ -846,19 +846,58 @@ __pop_freed_pixmap(struct sna *sna)
return pixmap;
}
-static PixmapPtr
-create_pixmap_hdr(struct sna *sna, int usage)
+inline static PixmapPtr
+create_pixmap_hdr(struct sna *sna, ScreenPtr screen,
+ int width, int height, int depth, int usage,
+ struct sna_pixmap **priv)
{
- PixmapPtr pixmap = __pop_freed_pixmap(sna);
+ PixmapPtr pixmap;
- pixmap->usage_hint = usage;
- pixmap->refcnt = 1;
- pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+ if (sna->freed_pixmap == NULL) {
+ pixmap = create_pixmap(sna, screen, 0, 0, depth, usage);
+ if (pixmap == NullPixmap)
+ return NullPixmap;
+
+ *priv = sna_pixmap_attach(pixmap);
+ if (!*priv) {
+ FreePixmap(pixmap);
+ return NullPixmap;
+ }
+ } else {
+ pixmap = __pop_freed_pixmap(sna);
+ *priv = _sna_pixmap_reset(pixmap);
+
+ assert(pixmap->drawable.type == DRAWABLE_PIXMAP);
+ assert(pixmap->drawable.class == 0);
+ assert(pixmap->drawable.pScreen == screen);
+ assert(pixmap->drawable.x == 0);
+ assert(pixmap->drawable.y == 0);
+
+ pixmap->drawable.id = 0;
+
+ pixmap->drawable.depth = depth;
+ pixmap->drawable.bitsPerPixel = bits_per_pixel(depth);
+ pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
+
+ pixmap->devKind = 0;
+ pixmap->devPrivate.ptr = NULL;
+
+#ifdef COMPOSITE
+ pixmap->screen_x = 0;
+ pixmap->screen_y = 0;
+#endif
#if DEBUG_MEMORY
- sna->debug_memory.pixmap_allocs++;
+ sna->debug_memory.pixmap_allocs++;
#endif
+ pixmap->refcnt = 1;
+ }
+
+ pixmap->drawable.width = width;
+ pixmap->drawable.height = height;
+ pixmap->usage_hint = usage;
+
return pixmap;
}
@@ -891,31 +930,9 @@ fallback:
return pixmap;
}
- if (sna->freed_pixmap) {
- pixmap = create_pixmap_hdr(sna, 0);
- priv = _sna_pixmap_reset(pixmap);
- } else {
- pixmap = create_pixmap(sna, screen, 0, 0, depth, 0);
- if (pixmap == NullPixmap)
- return NullPixmap;
-
- priv = sna_pixmap_attach(pixmap);
- if (!priv) {
- FreePixmap(pixmap);
- return NullPixmap;
- }
- }
-
- pixmap->drawable.width = width;
- pixmap->drawable.height = height;
- pixmap->drawable.depth = depth;
- pixmap->drawable.bitsPerPixel = bpp;
-
- DBG(("%s: serial=%ld, %dx%d\n",
- __FUNCTION__,
- pixmap->drawable.serialNumber,
- pixmap->drawable.width,
- pixmap->drawable.height));
+ pixmap = create_pixmap_hdr(sna, screen, width, height, depth, 0, &priv);
+ if (pixmap == NullPixmap)
+ goto fallback;
priv->cpu_bo = kgem_create_map(&sna->kgem, addr, pitch*height, false);
if (priv->cpu_bo == NULL) {
@@ -940,6 +957,13 @@ fallback:
pixmap->devKind = pitch;
pixmap->devPrivate.ptr = addr;
+
+ DBG(("%s: serial=%ld, %dx%d, usage=%d\n",
+ __FUNCTION__,
+ pixmap->drawable.serialNumber,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
+ pixmap->usage_hint));
return pixmap;
}
@@ -978,34 +1002,9 @@ sna_pixmap_create_scratch(ScreenPtr screen,
tiling = kgem_choose_tiling(&sna->kgem, tiling, width, height, bpp);
/* you promise never to access this via the cpu... */
- if (sna->freed_pixmap) {
- pixmap = create_pixmap_hdr(sna, CREATE_PIXMAP_USAGE_SCRATCH);
- priv = _sna_pixmap_reset(pixmap);
- } else {
- pixmap = create_pixmap(sna, screen, 0, 0, depth,
- CREATE_PIXMAP_USAGE_SCRATCH);
- if (pixmap == NullPixmap)
- return NullPixmap;
-
- priv = sna_pixmap_attach(pixmap);
- if (!priv) {
- FreePixmap(pixmap);
- return NullPixmap;
- }
- }
-
- pixmap->drawable.width = width;
- pixmap->drawable.height = height;
- pixmap->drawable.depth = depth;
- pixmap->drawable.bitsPerPixel = bpp;
- pixmap->devPrivate.ptr = NULL;
-
- DBG(("%s: serial=%ld, usage=%d, %dx%d\n",
- __FUNCTION__,
- pixmap->drawable.serialNumber,
- pixmap->usage_hint,
- pixmap->drawable.width,
- pixmap->drawable.height));
+ pixmap = create_pixmap_hdr(sna, screen, width, height, depth, CREATE_PIXMAP_USAGE_SCRATCH, &priv);
+ if (pixmap == NullPixmap)
+ return NullPixmap;
priv->stride = PixmapBytePad(width, depth);
priv->header = true;
@@ -1023,7 +1022,14 @@ sna_pixmap_create_scratch(ScreenPtr screen,
assert(to_sna_from_pixmap(pixmap) == sna);
assert(pixmap->drawable.pScreen == screen);
+ assert(pixmap->refcnt == 1);
+ DBG(("%s: serial=%ld, %dx%d, usage=%d\n",
+ __FUNCTION__,
+ pixmap->drawable.serialNumber,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
+ pixmap->usage_hint));
return pixmap;
}
@@ -1316,34 +1322,9 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
DBG(("%s: creating GPU pixmap %dx%d, stride=%d, flags=%x\n",
__FUNCTION__, width, height, pad, flags));
- if (sna->freed_pixmap) {
- pixmap = create_pixmap_hdr(sna, CREATE_PIXMAP_USAGE_SCRATCH);
- priv = _sna_pixmap_reset(pixmap);
- } else {
- pixmap = create_pixmap(sna, screen, 0, 0, depth, usage);
- if (pixmap == NullPixmap)
- return NullPixmap;
-
- priv = sna_pixmap_attach(pixmap);
- if (priv == NULL) {
- free(pixmap);
- goto fallback;
- }
- }
-
- DBG(("%s: serial=%ld, usage=%d, %dx%d\n",
- __FUNCTION__,
- pixmap->drawable.serialNumber,
- pixmap->usage_hint,
- pixmap->drawable.width,
- pixmap->drawable.height));
-
- pixmap->drawable.width = width;
- pixmap->drawable.height = height;
- pixmap->drawable.depth = depth;
- pixmap->drawable.bitsPerPixel = bits_per_pixel(depth);
- pixmap->devKind = pad;
- pixmap->devPrivate.ptr = NULL;
+ pixmap = create_pixmap_hdr(sna, screen, width, height, depth, usage, &priv);
+ if (pixmap == NullPixmap)
+ return NullPixmap;
priv->header = true;
ptr = NULL;
@@ -1355,7 +1336,14 @@ static PixmapPtr sna_create_pixmap(ScreenPtr screen,
assert(to_sna_from_pixmap(pixmap) == sna);
assert(pixmap->drawable.pScreen == screen);
+ assert(pixmap->refcnt == 1);
+ DBG(("%s: serial=%ld, %dx%d, usage=%d\n",
+ __FUNCTION__,
+ pixmap->drawable.serialNumber,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
+ pixmap->usage_hint));
return pixmap;
fallback:
@@ -1975,7 +1963,7 @@ _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned int flags)
goto done;
}
- if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, MOVE_READ)) {
+ if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, priv->gpu_damage ? flags & MOVE_READ: 0)) {
DBG(("%s: move-to-gpu override failed\n", __FUNCTION__));
return false;
}
@@ -2420,19 +2408,58 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
sna_damage_destroy(&priv->gpu_damage);
- if ((flags & MOVE_READ) == 0 &&
+ if ((flags & (MOVE_READ | MOVE_ASYNC_HINT)) == 0 &&
priv->cpu_bo && !priv->cpu_bo->flush &&
__kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) {
+ DBG(("%s: active CPU bo replacing\n", __FUNCTION__));
+ assert(!priv->shm);
+ assert(!IS_STATIC_PTR(priv->ptr));
+
if (!region_subsumes_pixmap(region, pixmap)) {
+ DBG(("%s: partial replacement\n", __FUNCTION__));
if (get_drawable_deltas(drawable, pixmap, &dx, &dy))
RegionTranslate(region, dx, dy);
- sna_damage_subtract(&priv->cpu_damage, region);
- if (sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) {
- sna_pixmap_free_cpu(sna, priv, false);
- sna_damage_add(&priv->cpu_damage, region);
+ if (sna->kgem.has_llc && !priv->pinned &&
+ sna_pixmap_choose_tiling(pixmap,
+ DEFAULT_TILING) == I915_TILING_NONE) {
+#ifdef DEBUG_MEMORY
+ sna->debug_memory.cpu_bo_allocs--;
+ sna->debug_memory.cpu_bo_bytes -= kgem_bo_size(priv->cpu_bo);
+#endif
+ DBG(("%s: promoting CPU bo to GPU bo\n", __FUNCTION__));
+ if (priv->gpu_bo)
+ sna_pixmap_free_gpu(sna, priv);
+ priv->gpu_bo = priv->cpu_bo;
+ priv->cpu_bo = NULL;
+ priv->ptr = NULL;
+ pixmap->devPrivate.ptr = NULL;
+
+ priv->gpu_damage = priv->cpu_damage;
+ priv->cpu_damage = NULL;
+
discard_gpu = false;
+ } else {
+ DBG(("%s: pushing surrounding damage to GPU bo\n", __FUNCTION__));
+ sna_damage_subtract(&priv->cpu_damage, region);
+ assert(priv->cpu_damage);
+ if (sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) {
+ sna_pixmap_free_cpu(sna, priv, false);
+ if (priv->flush)
+ sna_add_flush_pixmap(sna, priv, priv->gpu_bo);
+ discard_gpu = false;
+
+ assert(priv->cpu_damage == NULL);
+ sna_damage_all(&priv->gpu_damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height);
+ sna_damage_subtract(&priv->gpu_damage, region);
+ }
}
+ sna_damage_add(&priv->cpu_damage, region);
+
+ if (dx | dy)
+ RegionTranslate(region, -dx, -dy);
} else
sna_pixmap_free_cpu(sna, priv, false);
}
@@ -3660,7 +3687,7 @@ cpu_fail:
goto cpu_fail;
if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, &region,
- (flags & IGNORE_CPU ? MOVE_READ : 0) | MOVE_WRITE | MOVE_ASYNC_HINT)) {
+ (flags & IGNORE_CPU ? 0 : MOVE_READ) | MOVE_WRITE | MOVE_ASYNC_HINT)) {
DBG(("%s: failed to move-to-cpu, fallback\n", __FUNCTION__));
goto cpu_fail;
}
@@ -3720,26 +3747,11 @@ sna_pixmap_create_upload(ScreenPtr screen,
return create_pixmap(sna, screen, width, height, depth,
CREATE_PIXMAP_USAGE_SCRATCH);
- if (sna->freed_pixmap) {
- pixmap = create_pixmap_hdr(sna, CREATE_PIXMAP_USAGE_SCRATCH);
- priv = _sna_pixmap_reset(pixmap);
- } else {
- pixmap = create_pixmap(sna, screen, 0, 0, depth,
- CREATE_PIXMAP_USAGE_SCRATCH);
- if (!pixmap)
- return NullPixmap;
-
- priv = sna_pixmap_attach(pixmap);
- if (!priv) {
- FreePixmap(pixmap);
- return NullPixmap;
- }
- }
-
- pixmap->drawable.width = width;
- pixmap->drawable.height = height;
- pixmap->drawable.depth = depth;
- pixmap->drawable.bitsPerPixel = bits_per_pixel(depth);
+ pixmap = create_pixmap_hdr(sna, screen,
+ width, height, depth, CREATE_PIXMAP_USAGE_SCRATCH,
+ &priv);
+ if (!pixmap)
+ return NullPixmap;
priv->gpu_bo = kgem_create_buffer_2d(&sna->kgem,
width, height,
@@ -3768,11 +3780,12 @@ sna_pixmap_create_upload(ScreenPtr screen,
if (!kgem_buffer_is_inplace(priv->gpu_bo))
pixmap->usage_hint = 1;
- DBG(("%s: serial=%ld, usage=%d\n",
+ DBG(("%s: serial=%ld, %dx%d, usage=%d\n",
__FUNCTION__,
pixmap->drawable.serialNumber,
+ pixmap->drawable.width,
+ pixmap->drawable.height,
pixmap->usage_hint));
-
return pixmap;
}
@@ -3865,7 +3878,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
if (tiling == I915_TILING_NONE &&
priv->cpu_bo && !priv->shm &&
- kgem_bo_convert_to_gpu(&sna->kgem, priv->cpu_bo)) {
+ kgem_bo_convert_to_gpu(&sna->kgem, priv->cpu_bo, flags)) {
assert(!priv->mapped);
assert(!IS_STATIC_PTR(priv->ptr));
#ifdef DEBUG_MEMORY
@@ -3930,6 +3943,28 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
if (priv->cpu_damage == NULL)
goto done;
+ if (DAMAGE_IS_ALL(priv->cpu_damage) && priv->cpu_bo &&
+ !priv->pinned && !priv->shm &&
+ priv->gpu_bo->tiling == I915_TILING_NONE &&
+ kgem_bo_convert_to_gpu(&sna->kgem, priv->cpu_bo, flags)) {
+ assert(!priv->mapped);
+ assert(!IS_STATIC_PTR(priv->ptr));
+#ifdef DEBUG_MEMORY
+ sna->debug_memory.cpu_bo_allocs--;
+ sna->debug_memory.cpu_bo_bytes -= kgem_bo_size(priv->cpu_bo);
+#endif
+ sna_pixmap_free_gpu(sna, priv);
+ priv->gpu_bo = priv->cpu_bo;
+ priv->cpu_bo = NULL;
+ priv->ptr = NULL;
+ pixmap->devPrivate.ptr = NULL;
+ sna_damage_all(&priv->gpu_damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height);
+ sna_damage_destroy(&priv->cpu_damage);
+ goto done;
+ }
+
if (priv->shm) {
assert(!priv->flush);
sna_add_flush_pixmap(sna, priv, priv->cpu_bo);
@@ -11355,6 +11390,8 @@ sna_pixmap_get_source_bo(PixmapPtr pixmap)
{
struct sna_pixmap *priv = sna_pixmap(pixmap);
+ DBG(("%s(pixmap=%ld)\n", __FUNCTION__, pixmap->drawable.serialNumber));
+
if (priv == NULL) {
struct kgem_bo *upload;
struct sna *sna = to_sna_from_pixmap(pixmap);
@@ -11894,8 +11931,9 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
int tile_width, tile_height;
int16_t dx, dy;
- DBG(("%s x %d [(%d, %d)x(%d, %d)...]\n",
- __FUNCTION__, n, rect->x, rect->y, rect->width, rect->height));
+ DBG(("%s x %d [(%d, %d)x(%d, %d)...], clipped? %d\n",
+ __FUNCTION__, n, rect->x, rect->y, rect->width, rect->height,
+ clipped));
tile_width = tile->drawable.width;
tile_height = tile->drawable.height;
@@ -11953,6 +11991,8 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
}
get_drawable_deltas(drawable, pixmap, &dx, &dy);
+ DBG(("%s: drawable offset into pixmap(%ld) = (%d, %d)\n",
+ __FUNCTION__, pixmap->drawable.serialNumber, dx, dy));
if (!clipped) {
dx += drawable->x;
dy += drawable->y;
@@ -12009,6 +12049,8 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
if (clip.data == NULL) {
const BoxRec *box = &clip.extents;
+ DBG(("%s: single clip box [(%d, %d), (%d, %d)]",
+ __FUNCTION__, box->x1, box->y1, box->x2, box->y2));
while (n--) {
BoxRec r;
@@ -12018,6 +12060,13 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
r.y2 = bound(r.y1, rect->height);
rect++;
+ DBG(("%s: rectangle [(%d, %d), (%d, %d)]\n",
+ __FUNCTION__, r.x1, r.y1, r.x2, r.y2));
+ assert(r.x1 + dx >= 0);
+ assert(r.y1 + dy >= 0);
+ assert(r.x2 + dx <= pixmap->drawable.width);
+ assert(r.y2 + dy <= pixmap->drawable.height);
+
if (box_intersect(&r, box)) {
int height = r.y2 - r.y1;
int dst_y = r.y1;
@@ -12079,11 +12128,23 @@ sna_poly_fill_rect_tiled_blt(DrawablePtr drawable,
region.extents.y2 = bound(region.extents.y1, rect->height);
rect++;
+ DBG(("%s: rectangle [(%d, %d), (%d, %d)]\n",
+ __FUNCTION__,
+ region.extents.x1,
+ region.extents.y1,
+ region.extents.x2,
+ region.extents.y2));
+ assert(region.extents.x1 + dx >= 0);
+ assert(region.extents.y1 + dy >= 0);
+ assert(region.extents.x2 + dx <= pixmap->drawable.width);
+ assert(region.extents.y2 + dy <= pixmap->drawable.height);
+
region.data = NULL;
RegionIntersect(&region, &region, &clip);
nbox = RegionNumRects(&region);
box = RegionRects(&region);
+ DBG(("%s: split into %d boxes after clipping\n", __FUNCTION__, nbox));
while (nbox--) {
int height = box->y2 - box->y1;
int dst_y = box->y1;
diff --git a/driver/xf86-video-intel/src/sna/sna_glyphs.c b/driver/xf86-video-intel/src/sna/sna_glyphs.c
index d06d52a94..c72c5e5d6 100644
--- a/driver/xf86-video-intel/src/sna/sna_glyphs.c
+++ b/driver/xf86-video-intel/src/sna/sna_glyphs.c
@@ -1306,7 +1306,6 @@ next_image:
if (!clear_pixmap(sna, pixmap))
goto err_mask;
- memset(&tmp, 0, sizeof(tmp));
glyph_atlas = NULL;
do {
int n = list->len;
@@ -1346,6 +1345,8 @@ next_image:
__FUNCTION__,
(int)p->atlas->format,
(int)(format->depth << 24 | format->format)));
+
+ memset(&tmp, 0, sizeof(tmp));
if (p->atlas->format == (format->depth << 24 | format->format)) {
ok = sna->render.composite(sna, PictOpAdd,
p->atlas, NULL, mask,
diff --git a/driver/xf86-video-intel/src/uxa/intel_video.c b/driver/xf86-video-intel/src/uxa/intel_video.c
index d1b98d472..01919e37e 100644
--- a/driver/xf86-video-intel/src/uxa/intel_video.c
+++ b/driver/xf86-video-intel/src/uxa/intel_video.c
@@ -354,7 +354,8 @@ void I830InitVideo(ScreenPtr screen)
/* Set up textured video if we can do it at this depth and we are on
* supported hardware.
*/
- if (scrn->bitsPerPixel >= 16 &&
+ if (!intel->force_fallback &&
+ scrn->bitsPerPixel >= 16 &&
INTEL_INFO(intel)->gen >= 030) {
texturedAdaptor = I830SetupImageVideoTextured(screen);
if (texturedAdaptor != NULL) {