Mesa (master): nv50: separate video logic from noalloc

Maarten Lankhorst mlankhorst at kemper.freedesktop.org
Fri Aug 16 07:50:20 UTC 2013


Module: Mesa
Branch: master
Commit: b3f6f127f28737d034dcf1c12a9b66b88750e93b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b3f6f127f28737d034dcf1c12a9b66b88750e93b

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sat Aug 10 18:53:15 2013 -0400

nv50: separate video logic from noalloc

The upcoming vp3 logic will want the video layout, but allocated by the
miptree.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nv50/nv50_miptree.c  |    6 ++++--
 src/gallium/drivers/nv50/nv50_resource.h |    1 +
 src/gallium/drivers/nv50/nv84_video.c    |    2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 28be768..461710e 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -335,8 +335,10 @@ nv50_miptree_create(struct pipe_screen *pscreen,
 
    if (unlikely(pt->flags & NV50_RESOURCE_FLAG_VIDEO)) {
       nv50_miptree_init_layout_video(mt);
-      /* BO allocation done by client */
-      return pt;
+      if (pt->flags & NV50_RESOURCE_FLAG_NOALLOC) {
+         /* BO allocation done by client */
+         return pt;
+      }
    } else
    if (bo_config.nv50.memtype != 0) {
       nv50_miptree_init_layout_tiled(mt);
diff --git a/src/gallium/drivers/nv50/nv50_resource.h b/src/gallium/drivers/nv50/nv50_resource.h
index c520a72..b104404 100644
--- a/src/gallium/drivers/nv50/nv50_resource.h
+++ b/src/gallium/drivers/nv50/nv50_resource.h
@@ -17,6 +17,7 @@ void
 nv50_screen_init_resource_functions(struct pipe_screen *pscreen);
 
 #define NV50_RESOURCE_FLAG_VIDEO (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 0)
+#define NV50_RESOURCE_FLAG_NOALLOC (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 1)
 
 #define NV50_TILE_SHIFT_X(m) 6
 #define NV50_TILE_SHIFT_Y(m) ((((m) >> 4) & 0xf) + 2)
diff --git a/src/gallium/drivers/nv50/nv84_video.c b/src/gallium/drivers/nv50/nv84_video.c
index 3602a6d..2167b02 100644
--- a/src/gallium/drivers/nv50/nv84_video.c
+++ b/src/gallium/drivers/nv50/nv84_video.c
@@ -669,7 +669,7 @@ nv84_video_buffer_create(struct pipe_context *pipe,
    templ.format = PIPE_FORMAT_R8_UNORM;
    templ.width0 = align(template->width, 2);
    templ.height0 = align(template->height, 4) / 2;
-   templ.flags = NV50_RESOURCE_FLAG_VIDEO;
+   templ.flags = NV50_RESOURCE_FLAG_VIDEO | NV50_RESOURCE_FLAG_NOALLOC;
    templ.array_size = 2;
 
    cfg.nv50.tile_mode = 0x20;




More information about the mesa-commit mailing list