Merge remote branch 'origin/7.8'
[mesa.git] / src / gallium / drivers / nv30 / nv30_miptree.c
index ea8a610fe69c99c00d3b9ec3427bc2ae599ac389..bfa27b632f70e24a5f759ddcaff10a2d6a46ecac 100644 (file)
@@ -5,7 +5,7 @@
 #include "util/u_math.h"
 
 #include "nv30_context.h"
-#include "../nv04/nv04_surface_2d.h"
+#include "../nouveau/nv04_surface_2d.h"
 
 static void
 nv30_miptree_layout(struct nv30_miptree *nv30mt)
@@ -18,7 +18,7 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt)
                                           PIPE_TEXTURE_USAGE_DEPTH_STENCIL |
                                           PIPE_TEXTURE_USAGE_RENDER_TARGET |
                                           PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
-                                          PIPE_TEXTURE_USAGE_PRIMARY);
+                                          PIPE_TEXTURE_USAGE_SCANOUT);
 
        if (pt->target == PIPE_TEXTURE_CUBE) {
                nr_faces = 6;
@@ -78,7 +78,7 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
            pt->height0 & (pt->height0 - 1))
                mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
        else
-       if (pt->tex_usage & (PIPE_TEXTURE_USAGE_PRIMARY |
+       if (pt->tex_usage & (PIPE_TEXTURE_USAGE_SCANOUT |
                             PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
                             PIPE_TEXTURE_USAGE_DEPTH_STENCIL))
                mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR;
@@ -88,11 +88,11 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt)
        else {
                switch (pt->format) {
                /* TODO: Figure out which formats can be swizzled */
-               case PIPE_FORMAT_A8R8G8B8_UNORM:
-               case PIPE_FORMAT_X8R8G8B8_UNORM:
+               case PIPE_FORMAT_B8G8R8A8_UNORM:
+               case PIPE_FORMAT_B8G8R8X8_UNORM:
                case PIPE_FORMAT_R16_SNORM:
-               case PIPE_FORMAT_R5G6B5_UNORM:
-               case PIPE_FORMAT_A8L8_UNORM:
+               case PIPE_FORMAT_B5G6R5_UNORM:
+               case PIPE_FORMAT_L8A8_UNORM:
                case PIPE_FORMAT_A8_UNORM:
                case PIPE_FORMAT_L8_UNORM:
                case PIPE_FORMAT_I8_UNORM:
@@ -232,8 +232,9 @@ void
 nv30_screen_init_miptree_functions(struct pipe_screen *pscreen)
 {
        pscreen->texture_create = nv30_miptree_create;
-       pscreen->texture_blanket = nv30_miptree_blanket;
        pscreen->texture_destroy = nv30_miptree_destroy;
        pscreen->get_tex_surface = nv30_miptree_surface_new;
        pscreen->tex_surface_destroy = nv30_miptree_surface_del;
+
+       nouveau_screen(pscreen)->texture_blanket = nv30_miptree_blanket;
 }