xf86-video-intel: 3 commits - src/sna/gen2_render.c src/sna/gen3_render.c src/sna/gen4_render.c src/sna/sna_accel.c src/sna/sna_dri.c
Chris Wilson
ickle at kemper.freedesktop.org
Sat Sep 1 04:30:32 PDT 2012
src/sna/gen2_render.c | 1 +
src/sna/gen3_render.c | 2 ++
src/sna/gen4_render.c | 3 +++
src/sna/sna_accel.c | 4 +++-
src/sna/sna_dri.c | 3 ---
5 files changed, 9 insertions(+), 4 deletions(-)
New commits:
commit f837807cc257fbedd35fa6101dc0b4a57e5ad78d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Sep 1 10:36:09 2012 +0100
sna/dri: Remove busy-wait spin from vblank chaining of swapbuffers
The issue being that, due to the delay, the chained swap would miss its
intended vblank and so cause an unwanted reduction in frame throughput
and increase output latency even further. Since both client and server
have other rate-limiting processes in place, we can forgo the stall here
and still keep the clients in check.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54274
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 0210d73..77e4e26 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1268,9 +1268,6 @@ void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event)
break;
case DRI2_SWAP_THROTTLE:
- if (!sna_dri_blit_complete(sna, info))
- return;
-
DBG(("%s: %d complete, frame=%d tv=%d.%06d\n",
__FUNCTION__, info->type,
event->sequence, event->tv_sec, event->tv_usec));
commit b56e8c5105c858452ca4eabf15b298fc06dfd3c8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Sep 1 12:15:47 2012 +0100
sna: Nullify gpu_bo after free in case final release is deferred in destroy
As we may defer the actual release of the pixmap until after completion
of the last shm operation, we need to make sure in that case we mark the
GPU bo as released to prevent a use-after-free.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 7dad94b..7c598f1 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1073,8 +1073,10 @@ static Bool sna_destroy_pixmap(PixmapPtr pixmap)
sna = to_sna_from_pixmap(pixmap);
/* Always release the gpu bo back to the lower levels of caching */
- if (priv->gpu_bo)
+ if (priv->gpu_bo) {
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
+ priv->gpu_bo = NULL;
+ }
if (priv->shm && kgem_bo_is_busy(priv->cpu_bo)) {
sna_add_flush_pixmap(sna, priv, priv->cpu_bo);
commit c4d994014160d8c946af731196a908991c77d9f9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sat Sep 1 10:44:24 2012 +0100
sna/gen2+: Add the missing assertions in case the drawrect is invalid
Only the later gen had these useful assertions, add them to the rest
just in case.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index d2f6fe7..7d51823 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -543,6 +543,7 @@ gen2_get_batch(struct sna *sna)
static void gen2_emit_target(struct sna *sna, const struct sna_composite_op *op)
{
+ assert(!too_large(op->dst.width, op->dst.height));
assert(op->dst.bo->pitch >= 8 && op->dst.bo->pitch <= MAX_3D_PITCH);
assert(sna->render_state.gen2.vertex_offset == 0);
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index ab94bdb..c5ec9bc 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -1341,6 +1341,8 @@ static void gen3_emit_target(struct sna *sna,
{
struct gen3_render_state *state = &sna->render_state.gen3;
+ assert(!too_large(width, height));
+
/* BUF_INFO is an implicit flush, so skip if the target is unchanged. */
assert(bo->unique_id != 0);
if (bo->unique_id != state->current_dst) {
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index e732810..d8b76a1 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1283,6 +1283,9 @@ gen4_emit_drawing_rectangle(struct sna *sna, const struct sna_composite_op *op)
uint32_t limit = (op->dst.height - 1) << 16 | (op->dst.width - 1);
uint32_t offset = (uint16_t)op->dst.y << 16 | (uint16_t)op->dst.x;
+ assert(!too_large(op->dst.x, op->dst.y));
+ assert(!too_large(op->dst.width, op->dst.height));
+
if (sna->render_state.gen4.drawrect_limit == limit &&
sna->render_state.gen4.drawrect_offset == offset)
return;
More information about the xorg-commit
mailing list