nv50: separate video logic from noalloc
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 10 Aug 2013 22:53:15 +0000 (18:53 -0400)
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>
Fri, 16 Aug 2013 07:48:26 +0000 (09:48 +0200)
The upcoming vp3 logic will want the video layout, but allocated by the
miptree.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_resource.h
src/gallium/drivers/nv50/nv84_video.c

index 28be76872f00e1d671aa68c7784750ed85f0f0ea..461710e11307585bc15f007a8a68cc0a87125293 100644 (file)
@@ -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);
index c520a72cfe047b392e71d3b1ffed54d1a37bfceb..b104404076fa6b3f208c4b9bb9796316c466dc9d 100644 (file)
@@ -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)
index 3602a6d179901492a3f5453e9a1c71efcd14f9a5..2167b024eb5bc99b99b37918f0a331b3a32bcc8f 100644 (file)
@@ -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;