xserver-xorg-video-intel: Changes to 'upstream-experimental'
NEWS | 71
configure.ac | 31
man/intel.man | 19
src/intel_device.c | 3
src/intel_module.c | 12
src/sna/Makefile.am | 4
src/sna/blt.c | 13
src/sna/brw/brw_eu_util.c | 126 -
src/sna/brw/brw_wm.c | 16
src/sna/fb/fbline.c | 14
src/sna/fb/fblinebits.h | 15
src/sna/gen2_render.c | 11
src/sna/gen3_render.c | 15
src/sna/gen4_common.c | 64
src/sna/gen4_common.h | 49
src/sna/gen4_render.c | 62
src/sna/gen5_render.c | 72
src/sna/gen6_common.c | 71
src/sna/gen6_common.h | 192 ++
src/sna/gen6_render.c | 231 --
src/sna/gen7_render.c | 277 ---
src/sna/kgem.c | 733 ++++++---
src/sna/kgem.h | 155 --
src/sna/sna.h | 57
src/sna/sna_accel.c | 3255 ++++++++++++++++++++++++++----------------
src/sna/sna_blt.c | 1263 ++++++++++++----
src/sna/sna_composite.c | 20
src/sna/sna_damage.c | 23
src/sna/sna_display.c | 652 ++++++--
src/sna/sna_dri.c | 21
src/sna/sna_glyphs.c | 235 +--
src/sna/sna_io.c | 1120 +++++++++-----
src/sna/sna_reg.h | 32
src/sna/sna_render.c | 2
src/sna/sna_render.h | 19
src/sna/sna_threads.c | 4
src/sna/sna_tiling.c | 320 ++++
src/sna/sna_trapezoids.c | 23
src/sna/sna_trapezoids_mono.c | 2
src/uxa/i915_video.c | 5
src/uxa/intel_driver.c | 3
src/uxa/intel_uxa.c | 3
test/Makefile.am | 2
tools/virtual.c | 227 ++
xvmc/i915_xvmc.c | 2
xvmc/i965_xvmc.c | 2
xvmc/intel_batchbuffer.c | 60
xvmc/intel_batchbuffer.h | 4
xvmc/intel_xvmc.c | 58
xvmc/xvmc_vld.c | 4
50 files changed, 6373 insertions(+), 3301 deletions(-)
New commits:
commit 7468a6b740af14d95e8f9bacd2e352ec98a9acf2
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Nov 12 14:43:28 2013 +0000
2.99.906 snapshot
diff --git a/NEWS b/NEWS
index 79cdf86..e4e980d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,45 @@
+Snapshot 2.99.906 (2013-11-13)
+==============================
+Several stability fixes required after the recent tweaking of the core
+mechanics to handle the updated TearFree and attempting to make static
+analyzers happy.
+
+ * Fix damage handling when rendering to a partially damaged GPU surface.
+ Regression in 2.99.905
+ https://bugs.freedesktop.org/show_bug.cgi?id=70527
+
+ * Use asprintf() instead of sprintf()
+ Regression in 2.99.905
+ https://bugs.freedesktop.org/show_bug.cgi?id=70835
+
+ * Improve accounting for fence overallocation on older gen2/3, and
+ improve the tiling mechanism to fit into the same aperture constraints
+ https://bugs.freedesktop.org/show_bug.cgi?id=70924
+
+ * Add an extra GPU flush on Sandybridge to fix some rare font corruption
+
+ * Rasterise lines through all clip boxes
+ https://bugs.freedesktop.org/show_bug.cgi?id=70802
+
+ * Fix regression from stricter handling of failures to move a GC to the GPU
+ Regression in 2.99.905
+ https://bugs.freedesktop.org/show_bug.cgi?id=71415
+
+ * Fix various fail along the memcpy_xor paths, including inadequate error
+ handling and integer overflow
+ https://bugs.freedesktop.org/show_bug.cgi?id=70527
+
+ * Fix outside-of-target stipple uploads
+ https://bugs.launchpad.net/bugs/1247785
+
+ * Fix clip detection for long glyphs
+ Incomplete bug fix (causing a regression) in 2.99.905
+ https://bugs.freedesktop.org/show_bug.cgi?id=70527
+
+ * Fix VSync for the render engine (Xv) on Haswell
+ https://bugs.freedesktop.org/show_bug.cgi?id=70527
+
+
Snapshot 2.99.905 (2013-10-23)
==============================
The highlight for this snapshot is the extension of TearFree to support
diff --git a/configure.ac b/configure.ac
index 539ad9b..0783d61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-intel],
- [2.99.905],
+ [2.99.906],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-intel])
AC_CONFIG_SRCDIR([Makefile.am])
commit 220a8e8b1425d08af7ac104540be16611279e807
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Nov 13 09:52:14 2013 +0000
Bump experimental ioctl command numbers
In the meantime a new ioctl has snuck in.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 7855884..8775d2b 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -129,7 +129,7 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags);
#define LOCAL_I915_EXEC_NO_RELOC (1<<11)
#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
-#define LOCAL_I915_GEM_CREATE2 0x32
+#define LOCAL_I915_GEM_CREATE2 0x33
#define LOCAL_IOCTL_I915_GEM_CREATE2 DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CREATE2, struct local_i915_gem_create2)
struct local_i915_gem_create2 {
uint64_t size;
@@ -145,7 +145,7 @@ struct local_i915_gem_create2 {
uint32_t handle;
};
-#define LOCAL_I915_GEM_USERPTR 0x33
+#define LOCAL_I915_GEM_USERPTR 0x34
#define LOCAL_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_USERPTR, struct local_i915_gem_userptr)
struct local_i915_gem_userptr {
uint64_t user_ptr;
commit 44c585a1d8c3b603a9c79bf7dfecf420575cfb61
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Nov 12 18:59:54 2013 +0000
sna: Discard cached upload proxy when writing to the pixmap via the CPU
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 983a5f3..30262c1 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1907,6 +1907,15 @@ _sna_pixmap_move_to_cpu(PixmapPtr pixmap, unsigned int flags)
kgem_bo_undo(&sna->kgem, priv->cpu_bo);
}
+ if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) {
+ DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
+ assert(DAMAGE_IS_ALL(priv->cpu_damage));
+ assert(!priv->pinned);
+ assert(!priv->mapped);
+ kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
+ priv->gpu_bo = NULL;
+ }
+
if (DAMAGE_IS_ALL(priv->cpu_damage)) {
DBG(("%s: CPU all-damaged\n", __FUNCTION__));
assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage));
@@ -2333,6 +2342,15 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
assert(priv->gpu_damage == NULL || priv->gpu_bo);
+ if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) {
+ DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
+ assert(DAMAGE_IS_ALL(priv->cpu_damage));
+ assert(!priv->pinned);
+ assert(!priv->mapped);
+ kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
+ priv->gpu_bo = NULL;
+ }
+
if (sna_damage_is_all(&priv->cpu_damage,
pixmap->drawable.width,
pixmap->drawable.height)) {
commit 20e318c292a4e1336093dfbc77cb44d099c80050
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Sun Nov 10 10:28:01 2013 +0000
intel-virtual-output: Manually adjust screen size
When we modify the outputs and end up with a different screen size, we
need to actually tell the display to resize with an explicit
XRRSetScreenSize.
Reported-by: Jethro Beekman <freedesktop-bugs@jbeekman.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71441
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/tools/virtual.c b/tools/virtual.c
index 504a68d..c3d7024 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -86,7 +86,10 @@ struct display {
Window root;
Visual *visual;
Damage damage;
+ long timestamp;
+ int width;
+ int height;
int depth;
XRenderPictFormat *root_format;
@@ -144,6 +147,7 @@ struct clone {
struct clone *active;
struct output src, dst;
+ long timestamp;
XShmSegmentInfo shm;
XImage image;
@@ -432,6 +436,12 @@ static int clone_update_modes__randr(struct clone *clone)
if (from_info == NULL)
goto err;
+ DBG(("%s(%s-%s): timestamp %ld (last %ld)\n", __func__,
+ DisplayString(clone->src.dpy), clone->src.name,
+ from_info->timestamp, clone->timestamp));
+ if (from_info->timestamp == clone->timestamp)
+ goto err;
+
to_res = _XRRGetScreenResourcesCurrent(clone->src.dpy, clone->src.window);
if (to_res == NULL)
goto err;
@@ -440,6 +450,30 @@ static int clone_update_modes__randr(struct clone *clone)
if (to_info == NULL)
goto err;
+ if (clone->dst.rr_crtc == from_info->crtc) {
+ for (i = 0; i < to_info->nmode; i++) {
+ XRRModeInfo *mode, *old;
+
+ mode = lookup_mode(to_res, to_info->modes[i]);
+ if (mode == NULL)
+ break;
+ for (j = 0; j < from_info->nmode; j++) {
+ old = lookup_mode(from_res, from_info->modes[j]);
+ if (old && mode_equal(mode, old)) {
+ mode = NULL;
+ break;
+ }
+ }
+ if (mode)
+ break;
+ }
+ if (i == from_info->nmode && i == to_info->nmode) {
+ DBG(("%s(%s-%s): no change in output\n", __func__,
+ DisplayString(clone->src.dpy), clone->src.name));
+ goto done;
+ }
+ }
+
clone->dst.rr_crtc = from_info->crtc;
/* Clear all current UserModes on the output, including any active ones */
@@ -495,12 +529,16 @@ static int clone_update_modes__randr(struct clone *clone)
m.name = buf;
id = XRRCreateMode(clone->src.dpy, clone->src.window, &m);
+ DBG(("%s(%s-%s): adding mode %ld: %s\n", __func__,
+ DisplayString(clone->src.dpy), clone->src.name, id, mode->name));
}
XRRAddOutputMode(clone->src.dpy, clone->src.rr_output, id);
}
XUngrabServer(clone->src.dpy);
+done:
ret = 0;
+ clone->timestamp = from_info->timestamp;
err:
if (to_info)
@@ -824,7 +862,7 @@ static void clone_update(struct clone *clone)
clone->rr_update = 0;
}
-static void context_update(struct context *ctx)
+static int context_update(struct context *ctx)
{
Display *dpy = ctx->display->dpy;
XRRScreenResources *res;
@@ -835,8 +873,15 @@ static void context_update(struct context *ctx)
res = _XRRGetScreenResourcesCurrent(dpy, ctx->display->root);
if (res == NULL)
- return;
+ return 0;
+ DBG(("%s timestamp %ld (last %ld)\n", DisplayString(dpy), res->timestamp, ctx->display->timestamp));
+ if (res->timestamp == ctx->display->timestamp) {
+ XRRFreeScreenResources(res);
+ return 0;
+ }
+
+ ctx->display->timestamp = res->timestamp;
for (n = 0; n < ctx->nclone; n++) {
struct output *output = &ctx->clones[n].src;
XRROutputInfo *o;
@@ -902,7 +947,7 @@ static void context_update(struct context *ctx)
DBG(("%s changed? %d\n", DisplayString(dpy), context_changed));
if (!context_changed)
- return;
+ return 0;
for (n = 1; n < ctx->ndisplay; n++) {
struct display *display = &ctx->display[n];
@@ -950,12 +995,42 @@ static void context_update(struct context *ctx)
continue;
XGrabServer(display->dpy);
+
+ DBG(("%s: current size %dx%d, need %dx%d\n",
+ DisplayString(display->dpy),
+ display->width, display->height,
+ x2, y2));
+
+ if (display->width != x2 || display->height != y2) {
+ /* When shrinking we have to manually resize the fb */
+ for (clone = display->clone; clone; clone = clone->next) {
+ struct output *dst = &clone->dst;
+
+ if (!dst->rr_crtc)
+ continue;
+
+ DBG(("%s: disabling output '%s'\n",
+ DisplayString(dst->dpy), dst->name));
+ XRRSetCrtcConfig(dst->dpy, res, dst->rr_crtc, CurrentTime,
+ 0, 0, None, RR_Rotate_0, NULL, 0);
+ dst->rr_crtc = 0;
+ dst->mode.id = 0;
+ }
+
+ DBG(("%s: XRRSetScreenSize %dx%d\n", DisplayString(display->dpy), x2, y2));
+ XRRSetScreenSize(display->dpy, display->root, x2, y2, x2 * 96 / 25.4, y2 * 96 / 25.4);
+ display->width = x2;
+ display->height = y2;
+ }
+
for (clone = display->clone; clone; clone = clone->next) {
struct output *src = &clone->src;
struct output *dst = &clone->dst;
XRROutputInfo *o;
+ XRRPanning panning;
struct clone *set;
RRCrtc rr_crtc;
+ Status ret;
DBG(("%s: copying configuration from %s (mode=%ld) to %s\n",
DisplayString(dst->dpy), src->name, (long)src->mode.id, dst->name));
@@ -1030,9 +1105,12 @@ err:
DBG(("%s: enabling output '%s' (%d,%d)x(%d,%d) on CRTC:%ld\n",
DisplayString(dst->dpy), dst->name,
dst->x, dst->y, dst->mode.width, dst->mode.height, (long)rr_crtc));
- XRRSetCrtcConfig(dst->dpy, res, rr_crtc, CurrentTime,
- dst->x, dst->y, dst->mode.id, dst->rotation,
- &dst->rr_output, 1);
+ ret = XRRSetCrtcConfig(dst->dpy, res, rr_crtc, CurrentTime,
+ dst->x, dst->y, dst->mode.id, dst->rotation,
+ &dst->rr_output, 1);
+ DBG(("%s-%s: XRRSetCrtcConfig %s\n", DisplayString(dst->dpy), dst->name, ret ? "failed" : "success"));
+ ret = XRRSetPanning(dst->dpy, res, rr_crtc, memset(&panning, 0, sizeof(panning)));
+ DBG(("%s-%s: XRRSetPanning %s\n", DisplayString(dst->dpy), dst->name, ret ? "failed" : "success"));
dst->rr_crtc = rr_crtc;
}
XUngrabServer(display->dpy);
@@ -1050,6 +1128,8 @@ err:
clone->active = ctx->active;
ctx->active = clone;
}
+
+ return 1;
}
static Cursor display_load_invisible_cursor(struct display *display)
@@ -1357,7 +1437,13 @@ static int clone_paint(struct clone *c)
DisplayString(c->dst.dpy), c->dst.name,
(long)c->dst.serial, (long)LastKnownRequestProcessed(c->dst.dpy)));
if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) {
- XPending(c->dst.dpy);
+ struct pollfd pfd;
+
+ pfd.fd = ConnectionNumber(c->dst.dpy);
+ pfd.events = POLLIN;
+ XEventsQueued(c->dst.dpy,
+ poll(&pfd, 1, 0) ? QueuedAfterReading : QueuedAfterFlush);
+
if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) {
c->dst.display->skip_clone++;
return EAGAIN;
@@ -1850,6 +1936,7 @@ static void display_init_randr_hpd(struct display *display)
if (!XRRQueryVersion(display->dpy, &major, &minor))
return;
+ DBG(("%s - randr version %d.%d\n", DisplayString(display->dpy), major, minor));
if (major > 1 || (major == 1 && minor >= 2))
XRRSelectInput(display->dpy, display->root, RROutputChangeNotifyMask);
}
@@ -1957,6 +2044,13 @@ static int last_display_add_clones__randr(struct context *ctx)
return ret;
}
+
+ if (o->crtc) {
+ DBG(("%s - disabling active output\n", DisplayString(display->dpy)));
+ XRRSetCrtcConfig(display->dpy, res, o->crtc, CurrentTime,
+ 0, 0, None, RR_Rotate_0, NULL, 0);
+ }
+
XRRFreeOutputInfo(o);
}
XRRFreeScreenResources(res);
@@ -2100,6 +2194,10 @@ static int last_display_add_clones(struct context *ctx)
{
struct display *display = last_display(ctx);
+ display->width = DisplayWidth(display->dpy, DefaultScreen(display->dpy));
+ display->height = DisplayHeight(display->dpy, DefaultScreen(display->dpy));
+ DBG(("%s - initial size %dx%d\n", DisplayString(display->dpy), display->width, display->height));
+
if (display->rr_active)
return last_display_add_clones__randr(ctx);
@@ -2636,7 +2734,7 @@ int main(int argc, char **argv)
int reconfigure = 0;
int rr_update = 0;
- DBG(("polling - enable timer? %d, nfd=%d\n", ctx.timer_active, ctx.nfd));
+ DBG(("polling - enable timer? %d, nfd=%d, ndisplay=%d\n", ctx.timer_active, ctx.nfd, ctx.ndisplay));
ret = poll(ctx.pfd + !ctx.timer_active, ctx.nfd - !ctx.timer_active, -1);
if (ret <= 0)
break;
@@ -2644,7 +2742,7 @@ int main(int argc, char **argv)
/* pfd[0] is the timer, pfd[1] is the local display, pfd[2] is the mouse, pfd[3+] are the remotes */
DBG(("poll reports %d fd awake\n", ret));
- if (ctx.pfd[1].revents) {
+ if (ctx.pfd[1].revents || XPending(ctx.display[0].dpy)) {
DBG(("%s woken up\n", DisplayString(ctx.display[0].dpy)));
do {
XNextEvent(ctx.display->dpy, &e);
@@ -2702,13 +2800,11 @@ int main(int argc, char **argv)
} else {
DBG(("unknown event %d\n", e.type));
}
- } while (XPending(ctx.display->dpy) || poll(&ctx.pfd[1], 1, 0) > 0);
-
- ret--;
+ } while (XEventsQueued(ctx.display->dpy, QueuedAfterReading));
}
- for (i = 1; ret && i < ctx.ndisplay; i++) {
- if (ctx.pfd[i+2].revents == 0)
+ for (i = 1; i < ctx.ndisplay; i++) {
+ if (ctx.pfd[i+2].revents == 0 && !XPending(ctx.display[i].dpy))
continue;
DBG(("%s woken up\n", DisplayString(ctx.display[i].dpy)));
@@ -2718,24 +2814,20 @@ int main(int argc, char **argv)
DBG(("%s received event %d\n", DisplayString(ctx.display[i].dpy), e.type));
if (ctx.display[i].rr_active && e.type == ctx.display[i].rr_event + RRNotify) {
XRRNotifyEvent *re = (XRRNotifyEvent *)&e;
+
+ DBG(("%s received RRNotify, type %d\n", DisplayString(ctx.display[i].dpy), re->subtype));
if (re->subtype == RRNotify_OutputChange) {
XRROutputPropertyNotifyEvent *ro = (XRROutputPropertyNotifyEvent *)re;
struct clone *clone;
+ DBG(("%s RRNotify_OutputChange, timestamp %ld\n", DisplayString(ctx.display[i].dpy), ro->timestamp));
for (clone = ctx.display[i].clone; clone; clone = clone->next) {
if (clone->dst.rr_output == ro->output)
rr_update = clone->rr_update = 1;
}
}
}
- } while (XPending(ctx.display[i].dpy) || poll(&ctx.pfd[i+2], 1, 0) > 0);
-
- ret--;
- }
-
- if (reconfigure) {
- context_update(&ctx);
- display_reset_damage(ctx.display);
+ } while (XEventsQueued(ctx.display[i].dpy, QueuedAfterReading));
}
if (rr_update) {
@@ -2743,6 +2835,9 @@ int main(int argc, char **argv)
clone_update(&ctx.clones[i]);
}
+ if (reconfigure && context_update(&ctx))
+ display_reset_damage(ctx.display);
+
XPending(ctx.record);
if (ctx.timer_active && read(ctx.timer, &count, sizeof(count)) > 0) {
commit 04d2cad65dbb07a2f03835a71fb7f5efc0235ea6
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Nov 12 14:36:38 2013 +0000
Add identification strings for new Atoms
All of the new Atom (Baytrail) products ship with "HD Graphics".
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/intel_module.c b/src/intel_module.c
index 72c028e..e4bd65b 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -204,9 +204,17 @@ static const SymTabRec intel_chipsets[] = {
{PCI_CHIP_HASWELL_CRW_E_GT1, "HD Graphics" }, /* ??? */
{PCI_CHIP_HASWELL_CRW_E_GT2, "HD Graphics" }, /* ??? */
{PCI_CHIP_HASWELL_CRW_E_GT3, "Iris(TM) Pro Graphics 5200" },
- {-1, NULL}
+
+ /* Valleyview (Baytail) */
+ {0x0f30, "HD Graphics"},
+ {0x0f31, "HD Graphics"},
+ {0x0f32, "HD Graphics"},
+ {0x0f33, "HD Graphics"},
+ {0x0155, "HD Graphics"},
+ {0x0157, "HD Graphics"},
+
+ {-1, NULL} /* Sentinel */
};
-#define NUM_CHIPSETS (sizeof(intel_chipsets) / sizeof(intel_chipsets[0]))
static const struct pci_id_match intel_device_match[] = {
#if UMS
commit a6bd3011710a3fd4cfe21a3d41a6ec9c929681bf
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Nov 12 13:15:25 2013 +0000
sna: Factor available memory into available aperture estimation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8226fd8..7855884 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1331,6 +1331,14 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen)
if (kgem->max_gpu_size > totalram / 4)
kgem->max_gpu_size = totalram / 4;
+ if (kgem->aperture_high > totalram / 2) {
+ kgem->aperture_high = totalram / 2;
+ kgem->aperture_low = kgem->aperture_high / 4;
+ DBG(("%s: reduced aperture watermaks to fit into ram; low=%d [%d], high=%d [%d]\n", __FUNCTION__,
+ kgem->aperture_low, kgem->aperture_low / (1024*1024),
+ kgem->aperture_high, kgem->aperture_high / (1024*1024)));
+ }
+
kgem->max_cpu_size = kgem->max_object_size;
half_gpu_max = kgem->max_gpu_size / 2;
commit 4493fb8d21fa013a074f7de66387e92ef23d191a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Tue Nov 12 00:05:11 2013 +0000
sna: Apply drawable offset to glyph bbox prior to checking for clipping
This is a correction to
commit ec0866e86d365ae3fd9790b1b263d49fc4981220
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Oct 16 22:39:54 2013 +0100
sna/glyphs: Fix computation of extents for long strings
in order for us to correctly detect when we need to clip.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71191
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index f2c1788..759e415 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -517,18 +517,36 @@ static void apply_damage_clipped_to_dst(struct sna_composite_op *op,
sna_damage_add_box(op->damage, &box);
}
+static inline bool region_matches_pixmap(const RegionRec *r, PixmapPtr pixmap)
+{
+ return (r->extents.x2 - r->extents.x1 >= pixmap->drawable.width &&
+ r->extents.y2 - r->extents.y1 >= pixmap->drawable.height);
+}
+
static inline bool clipped_glyphs(PicturePtr dst, int nlist, GlyphListPtr list, GlyphPtr *glyphs)
{
BoxRec box;
+ if (dst->pCompositeClip->data == NULL &&
+ region_matches_pixmap(dst->pCompositeClip,
+ get_drawable_pixmap(dst->pDrawable))) {
+ DBG(("%s: no, region matches drawable\n", __FUNCTION__));
+ return false;
+ }
+
glyph_extents(nlist, list, glyphs, &box);
+
+ box.x1 += dst->pDrawable->x;
+ box.x2 += dst->pDrawable->x;
+ box.y1 += dst->pDrawable->y;
+ box.y2 += dst->pDrawable->y;
+
DBG(("%s? glyph extents (%d, %d), (%d, %d), region (%d, %d), (%d, %d): %s\n",
__FUNCTION__, box.x1, box.y1, box.x2, box.y2,
- dst->pCompositeClip->extents.x1, dst->pCompositeClip->extents.y1, dst->pCompositeClip->extents.x2, dst->pCompositeClip->extents.y2,
- (box.x1 < dst->pCompositeClip->extents.x1 ||
- box.y1 < dst->pCompositeClip->extents.y1 ||
- box.x2 > dst->pCompositeClip->extents.x2 ||
- box.y2 > dst->pCompositeClip->extents.y2) ? "yes" : "no"));
+ dst->pCompositeClip->extents.x1, dst->pCompositeClip->extents.y1,
+ dst->pCompositeClip->extents.x2, dst->pCompositeClip->extents.y2,
+ pixman_region_contains_rectangle(dst->pCompositeClip,
+ &box) != PIXMAN_REGION_IN ? "yes" : "no"));
return pixman_region_contains_rectangle(dst->pCompositeClip,
&box) != PIXMAN_REGION_IN;
commit c489934ed732ed3d5a906939381c62a6bc1c38d5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Nov 11 14:56:22 2013 +0000
xvmc: Handle allocation failure around batch submission
If we fail to allocate a new batch, just stall and reuse the old one
rather than crashing.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/xvmc/i915_xvmc.c b/xvmc/i915_xvmc.c
index fbd4555..204d950 100644
--- a/xvmc/i915_xvmc.c
+++ b/xvmc/i915_xvmc.c
@@ -1207,7 +1207,7 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
}
}
- intelFlushBatch(TRUE);
+ intelFlushBatch();
i915_xvmc_free_render_state_buffers(pI915XvMC);
diff --git a/xvmc/i965_xvmc.c b/xvmc/i965_xvmc.c
index 1850480..198027f 100644
--- a/xvmc/i965_xvmc.c
+++ b/xvmc/i965_xvmc.c
@@ -841,7 +841,7 @@ static Status render_surface(Display * display,
}
}
}
- intelFlushBatch(TRUE);
+ intelFlushBatch();
UNLOCK_HARDWARE(intel_ctx->hw_context);
}
return Success;
diff --git a/xvmc/intel_batchbuffer.c b/xvmc/intel_batchbuffer.c
index 3fa16bb..b427d85 100644
--- a/xvmc/intel_batchbuffer.c
+++ b/xvmc/intel_batchbuffer.c
@@ -62,6 +62,15 @@ static void i965_end_batch(void)
xvmc_driver->batch.ptr += 4;
}
+static void reset_batch(void)
+{
+ dri_bo *bo = xvmc_driver->batch.buf;
+
+ xvmc_driver->batch.ptr = xvmc_driver->batch.init_ptr = bo->virtual;
+ xvmc_driver->batch.size = bo->size;
+ xvmc_driver->batch.space = bo->size - 8;
+}
+
Bool intelInitBatchBuffer(void)
{
if ((xvmc_driver->batch.buf =
@@ -71,59 +80,50 @@ Bool intelInitBatchBuffer(void)
return False;
}
- drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf);
+ if (drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf)) {
+ drm_intel_bo_unreference(xvmc_driver->batch.buf);
+ return False;
+ }
- xvmc_driver->batch.init_ptr = xvmc_driver->batch.buf->virtual;
- xvmc_driver->batch.size = BATCH_SIZE;
- xvmc_driver->batch.space = BATCH_SIZE;
- xvmc_driver->batch.ptr = xvmc_driver->batch.init_ptr;
+ reset_batch();
return True;
}
void intelFiniBatchBuffer(void)
{
- drm_intel_gem_bo_unmap_gtt(xvmc_driver->batch.buf);
+ if (xvmc_driver->batch.buf == NULL)
+ return;
drm_intel_bo_unreference(xvmc_driver->batch.buf);
}
-void intelFlushBatch(Bool refill)
+void intelFlushBatch(void)
{
- i965_end_batch();
+ dri_bo *bo;
- drm_intel_gem_bo_unmap_gtt(xvmc_driver->batch.buf);
+ i965_end_batch();
drm_intel_bo_exec(xvmc_driver->batch.buf,
xvmc_driver->batch.ptr - xvmc_driver->batch.init_ptr,
0, 0, 0);
- drm_intel_bo_unreference(xvmc_driver->batch.buf);
- if ((xvmc_driver->batch.buf =
- drm_intel_bo_alloc(xvmc_driver->bufmgr,
- "batch buffer", BATCH_SIZE, 0x1000)) == NULL) {
- fprintf(stderr, "unable to alloc batch buffer\n");
+ bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "batch buffer", BATCH_SIZE, 0x1000);
+ if (bo != NULL && drm_intel_gem_bo_map_gtt(bo) == 0) {
+ drm_intel_bo_unreference(xvmc_driver->batch.buf);
+ xvmc_driver->batch.buf = bo;
+ } else {
+ if (bo != NULL)
+ drm_intel_bo_unreference(bo);
+ drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf);
}
- drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf);
-
- xvmc_driver->batch.init_ptr = xvmc_driver->batch.buf->virtual;
- xvmc_driver->batch.size = BATCH_SIZE;
- xvmc_driver->batch.space = BATCH_SIZE;
- xvmc_driver->batch.ptr = xvmc_driver->batch.init_ptr;
-}
-
-void intelBatchbufferRequireSpace(int size)
-{
- assert(xvmc_driver->batch.ptr - xvmc_driver->batch.init_ptr + size <
- xvmc_driver->batch.size - 8);
- if (xvmc_driver->batch.ptr - xvmc_driver->batch.init_ptr + size
- >= xvmc_driver->batch.size - 8)
- intelFlushBatch(1);
+ reset_batch();
}
void intelBatchbufferData(const void *data, unsigned bytes, unsigned flags)
{
- intelBatchbufferRequireSpace(bytes);
+ assert(bytes <= xvmc_driver->batch.space);
memcpy(xvmc_driver->batch.ptr, data, bytes);
xvmc_driver->batch.ptr += bytes;
xvmc_driver->batch.space -= bytes;
diff --git a/xvmc/intel_batchbuffer.h b/xvmc/intel_batchbuffer.h
index 7fae6f7..c63ee5e 100644
--- a/xvmc/intel_batchbuffer.h
+++ b/xvmc/intel_batchbuffer.h
@@ -11,8 +11,6 @@ extern int VERBOSE;
#define BEGIN_BATCH(n) \
do { \
assert(xvmc_driver->batch.space >= (n) *4); \
- if (xvmc_driver->batch.space < (n)*4) \
- intelFlushBatch(TRUE); \
batch_ptr = xvmc_driver->batch.ptr; \
} while (0)
@@ -46,7 +44,7 @@ extern int VERBOSE;
xvmc_driver->batch.ptr = batch_ptr; \
} while(0)
-extern void intelFlushBatch(Bool);
+extern void intelFlushBatch(void);
extern void intelBatchbufferData(const void *, unsigned, unsigned);
extern Bool intelInitBatchBuffer(void);
extern void intelFiniBatchBuffer(void);
diff --git a/xvmc/intel_xvmc.c b/xvmc/intel_xvmc.c
index ff13d03..2a2c8b9 100644
--- a/xvmc/intel_xvmc.c
+++ b/xvmc/intel_xvmc.c
@@ -313,6 +313,16 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,
}
drm_intel_bufmgr_gem_enable_reuse(xvmc_driver->bufmgr);
+ if (!intelInitBatchBuffer()) {
+ XFree(priv_data);
+ context->privData = NULL;
+
+ dri_bufmgr_destroy(xvmc_driver->bufmgr);
+ xvmc_driver = NULL;
+
+ return BadAlloc;
+ }
+
/* call driver hook.
* driver hook should free priv_data after return if success.*/
ret =
@@ -320,14 +330,18 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,
priv_data);
if (ret) {
XVMC_ERR("driver create context failed\n");
+ intelFiniBatchBuffer();
+
XFree(priv_data);
context->privData = NULL;
+
+ dri_bufmgr_destroy(xvmc_driver->bufmgr);
xvmc_driver = NULL;
return ret;
}
+
pthread_mutex_init(&xvmc_driver->ctxmutex, NULL);
- intelInitBatchBuffer();
intel_xvmc_dump_open();
return Success;
diff --git a/xvmc/xvmc_vld.c b/xvmc/xvmc_vld.c
index e576294..4c684ff 100644
--- a/xvmc/xvmc_vld.c
+++ b/xvmc/xvmc_vld.c
@@ -1010,7 +1010,7 @@ static Status put_slice2(Display * display, XvMCContext * context,
cs_buffer();
vld_send_media_object(media_state.slice_data.bo,
nbytes, 0, mb_row, 6, 127, q_scale_code);
- intelFlushBatch(TRUE);
+ intelFlushBatch();
UNLOCK_HARDWARE(intel_ctx->hw_context);
return Success;
@@ -1207,7 +1207,7 @@ static Status render_surface(Display * display,
}
}
}
- intelFlushBatch(TRUE);
+ intelFlushBatch();
UNLOCK_HARDWARE(intel_ctx->hw_context);
return Success;
}
commit 3e93449b5492a4fc09401c23f8754655b63959b5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Nov 11 13:15:07 2013 +0000
intel-virtual-output: Fix format specifiers for Visual DBG
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/tools/virtual.c b/tools/virtual.c
index 602b84c..504a68d 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1467,7 +1467,7 @@ static int record_mouse(struct context *ctx)
static int bad_visual(Visual *visual, int depth)
{
- DBG(("%s? depth=%d, visual: class=%d, bits_per_rgb=%d, red_mask=%08x, green_mask=%08x, blue_mask=%08x\n",
+ DBG(("%s? depth=%d, visual: class=%d, bits_per_rgb=%d, red_mask=%08lx, green_mask=%08lx, blue_mask=%08lx\n",
__func__, depth,
visual->class,
visual->bits_per_rgb,
commit 31b5ff5889593337bf504dafa116a428bf1ffe9c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Nov 11 12:56:30 2013 +0000
intel-virtual-output: Fix cut'n'paste DBG error
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/tools/virtual.c b/tools/virtual.c
index 4da8309..602b84c 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1137,7 +1137,7 @@ static void display_flush_cursor(struct display *display)
}
DBG(("%s setting cursor position (%d, %d), visible? %d\n",
- DisplayString(c->dst.dpy), x, y, display->cursor_visible));
+ DisplayString(display->dpy), x, y, display->cursor_visible));
XWarpPointer(display->dpy, None, display->root, 0, 0, 0, 0, x, y);
cursor = None;
commit 29fcc15efabb5b1f7e1e0211da9714cf9e3cbd1c
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Nov 11 11:44:17 2013 +0000
sna: Assert that gc->funcs is never set to NULL
References: https://bugs.freedesktop.org/show_bug.cgi?id=71415
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 9cff1de..983a5f3 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3948,6 +3948,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
assert(gc->ops == (GCOps *)&sna_gc_ops);
gc->ops = (GCOps *)&sna_gc_ops__cpu;
+ assert(gc->funcs);
sgc->old_funcs = gc->funcs;
gc->funcs = (GCFuncs *)&sna_gc_funcs__cpu;
@@ -4010,6 +4011,7 @@ static void sna_gc_move_to_gpu(GCPtr gc)
gc->ops = (GCOps *)&sna_gc_ops;
gc->funcs = sna_gc(gc)->old_funcs;
+ assert(gc->funcs);
gc->pCompositeClip = sna_gc(gc)->priv;
assert(gc->pCompositeClip);
}
commit aa140ef1e62c349936be5f153e4be7688e129e63
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Nov 11 11:38:46 2013 +0000
sna: Add a couple more asserts to track a potential NULL gc->pCompositeClip
References: https://bugs.freedesktop.org/show_bug.cgi?id=71415
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b1dc2f7..9cff1de 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3942,6 +3942,8 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
long changes = sgc->changes;
DBG(("%s, changes=%lx\n", __FUNCTION__, changes));
+ assert(drawable);
+ assert(region);
assert(gc->ops == (GCOps *)&sna_gc_ops);
gc->ops = (GCOps *)&sna_gc_ops__cpu;
@@ -3949,6 +3951,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
sgc->old_funcs = gc->funcs;
gc->funcs = (GCFuncs *)&sna_gc_funcs__cpu;
+ assert(gc->pCompositeClip);
sgc->priv = gc->pCompositeClip;
gc->pCompositeClip = region;
@@ -3983,7 +3986,6 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc,
fbValidateGC(gc, changes, drawable);
- gc->serialNumber = drawable->serialNumber;
sgc->serial = drawable->serialNumber;
}
sgc->changes = 0;
@@ -4009,6 +4011,7 @@ static void sna_gc_move_to_gpu(GCPtr gc)
gc->ops = (GCOps *)&sna_gc_ops;
gc->funcs = sna_gc(gc)->old_funcs;
gc->pCompositeClip = sna_gc(gc)->priv;
+ assert(gc->pCompositeClip);
}
static inline bool clip_box(BoxPtr box, GCPtr gc)
@@ -4016,6 +4019,7 @@ static inline bool clip_box(BoxPtr box, GCPtr gc)
Reply to: