diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-30 15:32:40 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-30 16:48:52 +0000 |
commit | 53fbc9f1760ee481cba1f6dceb9e7c97282a2976 (patch) | |
tree | 77ab04daca51090b0ac3e81e33932df5d6b596f2 /src/intel_dri.c | |
parent | 7667ad8432c032aec3a2aa004fc4dfc1877971b3 (diff) |
Don't replace the scanout bo through PutImage
As the bo may be pinned for either use by the scanout or through sharing
with another application, under those circumstances we cannot replace
the bo itself but must force the blit for PutImage.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31367
Reported-and-tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_dri.c')
-rw-r--r-- | src/intel_dri.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/intel_dri.c b/src/intel_dri.c index b7afffdb..dcd3a1ac 100644 --- a/src/intel_dri.c +++ b/src/intel_dri.c @@ -73,6 +73,22 @@ typedef struct { unsigned int attachment; } I830DRI2BufferPrivateRec, *I830DRI2BufferPrivatePtr; +static uint32_t pixmap_flink(PixmapPtr pixmap) +{ + struct intel_pixmap *priv = intel_get_pixmap_private(pixmap); + uint32_t name; + dri_bo *bo; + + if (priv->bo == NULL) + return 0; + + if (dri_bo_flink(bo, &name) != 0) + return 0; + + priv->pinned = 1; + return name; +} + static PixmapPtr get_front_buffer(DrawablePtr drawable) { ScreenPtr screen = drawable->pScreen; @@ -179,10 +195,9 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments, ScrnInfoPtr scrn = xf86Screens[screen->myNum]; intel_screen_private *intel = intel_get_screen_private(scrn); DRI2BufferPtr buffers; - dri_bo *bo; - int i; I830DRI2BufferPrivatePtr privates; PixmapPtr pixmap, pDepthPixmap; + int i; buffers = calloc(count, sizeof *buffers); if (buffers == NULL) @@ -251,8 +266,7 @@ I830DRI2CreateBuffers(DrawablePtr drawable, unsigned int *attachments, privates[i].pixmap = pixmap; privates[i].attachment = attachments[i]; - bo = intel_get_pixmap_bo(pixmap); - if (bo == NULL || dri_bo_flink(bo, &buffers[i].name) != 0) { + if ((buffers[i].name = pixmap_flink(pixmap)) == 0) { /* failed to name buffer */ screen->DestroyPixmap(pixmap); goto unwind; @@ -297,7 +311,6 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, ScrnInfoPtr scrn = xf86Screens[screen->myNum]; intel_screen_private *intel = intel_get_screen_private(scrn); DRI2Buffer2Ptr buffer; - dri_bo *bo; I830DRI2BufferPrivatePtr privates; PixmapPtr pixmap; @@ -358,8 +371,7 @@ I830DRI2CreateBuffer(DrawablePtr drawable, unsigned int attachment, privates->pixmap = pixmap; privates->attachment = attachment; - bo = intel_get_pixmap_bo(pixmap); - if (bo == NULL || dri_bo_flink(bo, &buffer->name) != 0) { + if ((buffer->name = pixmap_flink(pixmap)) == 0) { /* failed to name buffer */ screen->DestroyPixmap(pixmap); free(privates); |