[Nouveau] [PATCH] nv50, nvc0: choose storage type after ms has been initialized

Ilia Mirkin imirkin at alum.mit.edu
Wed Mar 5 02:37:48 PST 2014


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

Noticed by inspection, untested. Would be interesting to see if this fixes
anything.

 src/gallium/drivers/nouveau/nv50/nv50_miptree.c | 4 ++--
 src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
index 513d8f9..6c6ef4e 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
@@ -329,13 +329,13 @@ nv50_miptree_create(struct pipe_screen *pscreen,
    if (pt->bind & PIPE_BIND_LINEAR)
       pt->flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
 
-   bo_config.nv50.memtype = nv50_mt_choose_storage_type(mt, TRUE);
-
    if (!nv50_miptree_init_ms_mode(mt)) {
       FREE(mt);
       return NULL;
    }
 
+   bo_config.nv50.memtype = nv50_mt_choose_storage_type(mt, TRUE);
+
    if (unlikely(pt->flags & NV50_RESOURCE_FLAG_VIDEO)) {
       nv50_miptree_init_layout_video(mt);
       if (pt->flags & NV50_RESOURCE_FLAG_NOALLOC) {
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
index 79c9390..59b9028 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_miptree.c
@@ -277,13 +277,13 @@ nvc0_miptree_create(struct pipe_screen *pscreen,
    if (pt->bind & PIPE_BIND_LINEAR)
       pt->flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
 
-   bo_config.nvc0.memtype = nvc0_mt_choose_storage_type(mt, compressed);
-
    if (!nvc0_miptree_init_ms_mode(mt)) {
       FREE(mt);
       return NULL;
    }
 
+   bo_config.nvc0.memtype = nvc0_mt_choose_storage_type(mt, compressed);
+
    if (unlikely(pt->flags & NVC0_RESOURCE_FLAG_VIDEO)) {
       nvc0_miptree_init_layout_video(mt);
    } else
-- 
1.8.3.2



More information about the Nouveau mailing list