summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-02-06 14:58:08 +1000
committerDave Airlie <airlied@redhat.com>2013-02-06 14:58:08 +1000
commit59fb3f0252e9b769c5877cfe83d8dbc51cdff232 (patch)
tree3d8b0b52002af045afce66e3dd88344918aed361
parent1fdd7db94b55c65ea62cc9eaefff620b20e9e4ea (diff)
downloadxorg-driver-xf86-video-nouveau-59fb3f0252e9b769c5877cfe83d8dbc51cdff232.tar.gz
nouveau: create shared pixmaps in GART
this creates the shared pixmaps in GART, and makes sure they are untiled. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--src/nouveau_exa.c3
-rw-r--r--src/nv_accel_common.c7
2 files changed, 9 insertions, 1 deletions
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
index 8191aeb..b8e9bef 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
@@ -139,6 +139,9 @@ nouveau_exa_create_pixmap(ScreenPtr pScreen, int width, int height, int depth,
return NULL;
}
+ if ((usage_hint & 0xffff) == CREATE_PIXMAP_USAGE_SHARED)
+ nvpix->shared = TRUE;
+
return nvpix;
}
diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c
index 57e52ff..e0d9938 100644
--- a/src/nv_accel_common.c
+++ b/src/nv_accel_common.c
@@ -35,10 +35,15 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
NVPtr pNv = NVPTR(scrn);
Bool scanout = (usage_hint & NOUVEAU_CREATE_PIXMAP_SCANOUT);
Bool tiled = (usage_hint & NOUVEAU_CREATE_PIXMAP_TILED);
+ Bool shared = ((usage_hint & 0xffff) == CREATE_PIXMAP_USAGE_SHARED);
union nouveau_bo_config cfg = {};
int flags = NOUVEAU_BO_MAP | (bpp >= 8 ? NOUVEAU_BO_VRAM : 0);
int cpp = bpp / 8, ret;
+ flags = NOUVEAU_BO_MAP;
+ if (bpp >= 8)
+ flags |= shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM;
+
if (pNv->Architecture >= NV_ARCH_50) {
if (scanout) {
if (pNv->tiled_scanout) {
@@ -48,7 +53,7 @@ nouveau_allocate_surface(ScrnInfoPtr scrn, int width, int height, int bpp,
*pitch = NOUVEAU_ALIGN(width * cpp, 256);
}
} else {
- if (bpp >= 8)
+ if (bpp >= 8 && !shared)
tiled = TRUE;
*pitch = NOUVEAU_ALIGN(width * cpp, 64);
}