nouveau: expose BO domain in the public API
PATCH 1/1 nouveau: expose BO domain in the public API
This can allow drivers to make better choices.
Since it is just a field appended to a struct, compatibility is preserved.
--- nouveau/nouveau_bo.c | 4 ++-- nouveau/nouveau_bo.h | 3 +++ nouveau/nouveau_private.h | 1 - nouveau/nouveau_pushbuf.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-)
nouveau/nouveau_bo.c +2 -2
@@ -47,7 +47,7 @@ static int nouveau_bo_info(struct nouveau_bo_priv *nvbo, struct drm_nouveau_gem_info *arg) { nvbo->handle = nvbo->base.handle = arg->handle; - nvbo->domain = arg->domain; + nvbo->base.domain = arg->domain; nvbo->size = arg->size; nvbo->offset = arg->offset; nvbo->map_handle = arg->map_handle;
@@ -534,7 +534,7 @@ nouveau_bo_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo) pbbo->valid_domains =NOUVEAU_GEM_DOMAIN_VRAM |NOUVEAU_GEM_DOMAIN_GART ; pbbo->read_domains =0 ; pbbo->write_domains =0 ; - pbbo->presumed.domain = nvbo->domain; + pbbo->presumed.domain = nvbo->base.domain; pbbo->presumed.offset = nvbo->offset; pbbo->presumed.valid =1 ;return pbbo;
nouveau/nouveau_bo.h +3 -0
@@ -48,6 +48,9 @@ struct nouveau_bo {uint32_t tile_mode;uint32_t tile_flags; + +/* last known information from kernel */ +uint32_t domain; };int
nouveau/nouveau_private.h +0 -1
@@ -122,7 +122,6 @@ struct nouveau_bo_priv {/* Last known information from kernel on buffer status */ uint64_t offset; -uint32_t domain; };#define nouveau_bo (n) ((struct nouveau_bo_priv *)(n))
nouveau/nouveau_pushbuf.c +1 -1
@@ -211,7 +211,7 @@ nouveau_pushbuf_bo_unref(struct nouveau_pushbuf_priv *nvpb, int index)return ;if (pbbo->presumed.valid ==0 ) { - nvbo->domain = pbbo->presumed.domain; + bo->domain = pbbo->presumed.domain; nvbo->offset = pbbo->presumed.offset; }
Signature · 1 line
1.7.0.4