diff options
author | Francisco Jerez <currojerez@riseup.net> | 2010-09-28 22:47:11 +0200 |
---|---|---|
committer | Francisco Jerez <currojerez@riseup.net> | 2010-10-12 04:10:04 +0200 |
commit | 1b9187c43a0c17600611edb9e299141748e87974 (patch) | |
tree | a58dc9fb7c988e8451f639ae07c3dbeb8e9dbcf6 /nouveau | |
parent | 96214860bb0a5e11e7d346351a1be248e3716144 (diff) |
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.c | 7 | ||||
-rw-r--r-- | nouveau/nouveau_bo.h | 6 | ||||
-rw-r--r-- | nouveau/nouveau_device.c | 5 | ||||
-rw-r--r-- | nouveau/nouveau_drmif.h | 1 |
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) nvbo->offset = arg->offset; nvbo->map_handle = arg->map_handle; nvbo->base.tile_mode = arg->tile_mode; - nvbo->base.tile_flags = arg->tile_flags; + /* XXX - flag inverted for backwards compatibility */ + nvbo->base.tile_flags = arg->tile_flags ^ NOUVEAU_GEM_TILE_NONCONTIG; return 0; } @@ -140,6 +141,10 @@ nouveau_bo_kalloc(struct nouveau_bo_priv *nvbo, struct nouveau_channel *chan) info->tile_mode = nvbo->base.tile_mode; info->tile_flags = nvbo->base.tile_flags; + /* XXX - flag inverted for backwards compatibility */ + info->tile_flags ^= NOUVEAU_GEM_TILE_NONCONTIG; + if (!nvdev->has_bo_usage) + info->tile_flags &= NOUVEAU_GEM_TILE_LAYOUT_MASK; ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GEM_NEW, &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 @@ #define NOUVEAU_BO_IFLUSH (1 << 15) #define NOUVEAU_BO_DUMMY (1 << 31) +#define NOUVEAU_BO_TILE_LAYOUT_MASK 0x0000ff00 +#define NOUVEAU_BO_TILE_16BPP 0x00000001 +#define NOUVEAU_BO_TILE_32BPP 0x00000002 +#define NOUVEAU_BO_TILE_ZETA 0x00000004 +#define NOUVEAU_BO_TILE_SCANOUT 0x00000008 + struct nouveau_bo { struct nouveau_device *device; 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, } nvdev->base.chipset = value; + ret = nouveau_device_get_param(&nvdev->base, + NOUVEAU_GETPARAM_HAS_BO_USAGE, &value); + if (!ret) + nvdev->has_bo_usage = value; + *dev = &nvdev->base; return 0; } 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 { drm_context_t ctx; drmLock *lock; int needs_close; + int has_bo_usage; }; #define nouveau_device(n) ((struct nouveau_device_priv *)(n)) |