summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-03 13:35:41 +0100
committerDave Airlie <airlied@redhat.com>2012-05-03 13:35:41 +0100
commite8ee4282880331bf9b417d918ab082205077c63c (patch)
treeb840d9a146cded0975243c43075945224a456966
parent8994084af75bbf4c4a491565425c92fa6edfc105 (diff)
nouveau: do better at shared pixmap
-rw-r--r--src/nv50_exa.c3
-rw-r--r--src/nv_accel_common.c9
2 files changed, 9 insertions, 3 deletions
diff --git a/src/nv50_exa.c b/src/nv50_exa.c
index 81244d3..30605de 100644
--- a/src/nv50_exa.c
+++ b/src/nv50_exa.c
@@ -94,10 +94,11 @@ NV50EXAAcquireSurface2D(PixmapPtr ppix, int is_src, uint32_t fmt)
{
NV50EXA_LOCALS(ppix);
struct nouveau_bo *bo = nouveau_pixmap_bo(ppix);
+ struct nouveau_pixmap *nvpix = nouveau_pixmap(ppix);
int mthd = is_src ? NV50_2D_SRC_FORMAT : NV50_2D_DST_FORMAT;
uint32_t bo_flags;
- bo_flags = NOUVEAU_BO_VRAM;
+ bo_flags = nvpix->shared ? NOUVEAU_BO_GART : NOUVEAU_BO_VRAM;
bo_flags |= is_src ? NOUVEAU_BO_RD : NOUVEAU_BO_WR;
if (!nv50_style_tiled_pixmap(ppix)) {
diff --git a/src/nv_accel_common.c b/src/nv_accel_common.c
index 7d56093..d58a76a 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 & CREATE_PIXMAP_USAGE_SHARED);
union nouveau_bo_config cfg = {};
- int flags = NOUVEAU_BO_MAP | (bpp >= 8 ? NOUVEAU_BO_VRAM : 0);
+ int flags;
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);
}