aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez2010-09-28 15:47:11 -0500
committerFrancisco Jerez2010-10-11 21:10:04 -0500
commit1b9187c43a0c17600611edb9e299141748e87974 (patch)
treea58dc9fb7c988e8451f639ae07c3dbeb8e9dbcf6 /nouveau
parent96214860bb0a5e11e7d346351a1be248e3716144 (diff)
downloadlibdrm-1b9187c43a0c17600611edb9e299141748e87974.tar.gz
libdrm-1b9187c43a0c17600611edb9e299141748e87974.tar.xz
libdrm-1b9187c43a0c17600611edb9e299141748e87974.zip
nouveau: Define buffer object usage flags.
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Acked-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/nouveau_bo.c7
-rw-r--r--nouveau/nouveau_bo.h6
-rw-r--r--nouveau/nouveau_device.c5
-rw-r--r--nouveau/nouveau_drmif.h1
4 files changed, 18 insertions, 1 deletions
diff --git a/nouveau/nouveau_bo.c b/nouveau/nouveau_bo.c
index 32b23b65..c1432b0b 100644
--- a/nouveau/nouveau_bo.c
+++ b/nouveau/nouveau_bo.c
@@ -52,7 +52,8 @@ nouveau_bo_info(struct nouveau_bo_priv *nvbo, struct drm_nouveau_gem_info *arg)
52 nvbo->offset = arg->offset; 52 nvbo->offset = arg->offset;
53 nvbo->map_handle = arg->map_handle; 53 nvbo->map_handle = arg->map_handle;
54 nvbo->base.tile_mode = arg->tile_mode; 54 nvbo->base.tile_mode = arg->tile_mode;
55 nvbo->base.tile_flags = arg->tile_flags; 55 /* XXX - flag inverted for backwards compatibility */
56 nvbo->base.tile_flags = arg->tile_flags ^ NOUVEAU_GEM_TILE_NONCONTIG;
56 return 0; 57 return 0;
57} 58}
58 59
@@ -140,6 +141,10 @@ nouveau_bo_kalloc(struct nouveau_bo_priv *nvbo, struct nouveau_channel *chan)
140 141
141 info->tile_mode = nvbo->base.tile_mode; 142 info->tile_mode = nvbo->base.tile_mode;
142 info->tile_flags = nvbo->base.tile_flags; 143 info->tile_flags = nvbo->base.tile_flags;
144 /* XXX - flag inverted for backwards compatibility */
145 info->tile_flags ^= NOUVEAU_GEM_TILE_NONCONTIG;
146 if (!nvdev->has_bo_usage)
147 info->tile_flags &= NOUVEAU_GEM_TILE_LAYOUT_MASK;
143 148
144 ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GEM_NEW, 149 ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GEM_NEW,
145 &req, sizeof(req)); 150 &req, sizeof(req));
diff --git a/nouveau/nouveau_bo.h b/nouveau/nouveau_bo.h
index 1e77ab0f..3a1f2d4a 100644
--- a/nouveau/nouveau_bo.h
+++ b/nouveau/nouveau_bo.h
@@ -39,6 +39,12 @@
39#define NOUVEAU_BO_IFLUSH (1 << 15) 39#define NOUVEAU_BO_IFLUSH (1 << 15)
40#define NOUVEAU_BO_DUMMY (1 << 31) 40#define NOUVEAU_BO_DUMMY (1 << 31)
41 41
42#define NOUVEAU_BO_TILE_LAYOUT_MASK 0x0000ff00
43#define NOUVEAU_BO_TILE_16BPP 0x00000001
44#define NOUVEAU_BO_TILE_32BPP 0x00000002
45#define NOUVEAU_BO_TILE_ZETA 0x00000004
46#define NOUVEAU_BO_TILE_SCANOUT 0x00000008
47
42struct nouveau_bo { 48struct nouveau_bo {
43 struct nouveau_device *device; 49 struct nouveau_device *device;
44 uint32_t handle; 50 uint32_t handle;
diff --git a/nouveau/nouveau_device.c b/nouveau/nouveau_device.c
index 9a091fba..2ffcba6f 100644
--- a/nouveau/nouveau_device.c
+++ b/nouveau/nouveau_device.c
@@ -95,6 +95,11 @@ nouveau_device_open_existing(struct nouveau_device **dev, int close,
95 } 95 }
96 nvdev->base.chipset = value; 96 nvdev->base.chipset = value;
97 97
98 ret = nouveau_device_get_param(&nvdev->base,
99 NOUVEAU_GETPARAM_HAS_BO_USAGE, &value);
100 if (!ret)
101 nvdev->has_bo_usage = value;
102
98 *dev = &nvdev->base; 103 *dev = &nvdev->base;
99 return 0; 104 return 0;
100} 105}
diff --git a/nouveau/nouveau_drmif.h b/nouveau/nouveau_drmif.h
index bc860d2e..ec226a22 100644
--- a/nouveau/nouveau_drmif.h
+++ b/nouveau/nouveau_drmif.h
@@ -35,6 +35,7 @@ struct nouveau_device_priv {
35 drm_context_t ctx; 35 drm_context_t ctx;
36 drmLock *lock; 36 drmLock *lock;
37 int needs_close; 37 int needs_close;
38 int has_bo_usage;
38}; 39};
39#define nouveau_device(n) ((struct nouveau_device_priv *)(n)) 40#define nouveau_device(n) ((struct nouveau_device_priv *)(n))
40 41