summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-06 11:28:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-06 11:28:49 +0100
commit39c4be2b0be66ed83bf059d3007f4143325e340d (patch)
tree34e56c5745ffb71e59500c8c8affbc9ae5c32359 /src
parent031fa1c1c1129e486a02ffb5b3b9071f03b60048 (diff)
uxa: Distinguish forms of pinning
This allows us to replace the prime bo to meet sharing requirements, but still maintain the integrity with other users. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/intel.h5
-rw-r--r--src/intel_dri.c2
-rw-r--r--src/intel_glamor.c2
-rw-r--r--src/intel_uxa.c6
4 files changed, 9 insertions, 6 deletions
diff --git a/src/intel.h b/src/intel.h
index 5b0c5df7..48ec386a 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -94,7 +94,10 @@ struct intel_pixmap {
int8_t busy :2;
uint8_t dirty :1;
uint8_t offscreen :1;
- uint8_t pinned :1;
+ uint8_t pinned :3;
+#define PIN_SCANOUT 0x1
+#define PIN_DRI 0x2
+#define PIN_GLAMOR 0x4
};
#if HAS_DEVPRIVATEKEYREC
diff --git a/src/intel_dri.c b/src/intel_dri.c
index a1bac9a8..8cab73f5 100644
--- a/src/intel_dri.c
+++ b/src/intel_dri.c
@@ -90,7 +90,7 @@ static uint32_t pixmap_flink(PixmapPtr pixmap)
if (dri_bo_flink(priv->bo, &name) != 0)
return 0;
- priv->pinned = 1;
+ priv->pinned |= PIN_DRI;
return name;
}
diff --git a/src/intel_glamor.c b/src/intel_glamor.c
index 53043dd2..55eb2de3 100644
--- a/src/intel_glamor.c
+++ b/src/intel_glamor.c
@@ -128,7 +128,7 @@ intel_glamor_create_textured_pixmap(PixmapPtr pixmap)
if (glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
priv->stride)) {
drm_intel_bo_disable_reuse(priv->bo);
- priv->pinned = 1;
+ priv->pinned |= PIN_GLAMOR;
return TRUE;
} else
return FALSE;
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 21481029..6d202c77 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -1158,7 +1158,7 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
pixmap = screen->GetScreenPixmap(screen);
intel_set_pixmap_bo(pixmap, bo);
- intel_get_pixmap_private(pixmap)->pinned = 1;
+ intel_get_pixmap_private(pixmap)->pinned |= PIN_SCANOUT;
screen->ModifyPixmapHeader(pixmap,
scrn->virtualX,
scrn->virtualY,
@@ -1191,7 +1191,7 @@ intel_uxa_share_pixmap_backing(PixmapPtr ppix, ScreenPtr slave, void **fd_handle
drm_intel_bo_get_tiling(bo, &tiling, &swizzle);
if (tiling == I915_TILING_X) {
- if (priv->pinned)
+ if (priv->pinned & ~PIN_DRI)
return FALSE;
tiling = I915_TILING_NONE;
@@ -1215,7 +1215,7 @@ intel_uxa_share_pixmap_backing(PixmapPtr ppix, ScreenPtr slave, void **fd_handle
}
drm_intel_bo_get_tiling(bo, &tiling, &swizzle);
drm_intel_bo_gem_export_to_prime(bo, &handle);
- priv->pinned = 1;
+ priv->pinned |= PIN_DRI;
*fd_handle = (void *)(long)handle;
return TRUE;