nvfx: use common NOUVEAU_RESOURCE_FLAG_LINEAR define
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 30 Aug 2011 11:44:31 +0000 (13:44 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 30 Aug 2011 11:55:08 +0000 (13:55 +0200)
src/gallium/drivers/nouveau/nouveau_winsys.h
src/gallium/drivers/nvfx/nv30_fragtex.c
src/gallium/drivers/nvfx/nvfx_buffer.c
src/gallium/drivers/nvfx/nvfx_miptree.c
src/gallium/drivers/nvfx/nvfx_resource.h
src/gallium/drivers/nvfx/nvfx_state_fb.c
src/gallium/drivers/nvfx/nvfx_surface.c
src/gallium/drivers/nvfx/nvfx_transfer.c

index 37416f78bc1d707eb7199ccb4494600108a63042..553a5e632dfc41d94bcd829ea6ed55bf3fe87eaa 100644 (file)
@@ -17,7 +17,8 @@
 #define NV04_PFIFO_MAX_PACKET_LEN 2047
 #endif
 
-#define NOUVEAU_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
+#define NOUVEAU_RESOURCE_FLAG_LINEAR   (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
+#define NOUVEAU_RESOURCE_FLAG_DRV_PRIV (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
 
 static INLINE uint32_t
 nouveau_screen_transfer_flags(unsigned pipe)
index b609891d316424081576f0bfc889ab43231dcdbd..6fe5932df90c0d716d7c47a645eab3bd193d95ac 100644 (file)
@@ -58,7 +58,7 @@ nv30_sampler_view_init(struct pipe_context *pipe,
        if(pt->height0 <= 1 || util_format_is_compressed(sv->base.format))
                sv->u.nv30.rect = -1;
        else
-               sv->u.nv30.rect = !!(pt->flags & NVFX_RESOURCE_FLAG_LINEAR);
+               sv->u.nv30.rect = !!(pt->flags & NOUVEAU_RESOURCE_FLAG_LINEAR);
 
        sv->lod_offset = sv->base.u.tex.first_level - level;
        sv->max_lod_limit = sv->base.u.tex.last_level - level;
index b407429731f94f3d1ee6276972464be754523d44..76b7f4507c45f15485ccb79ff04d9134366809c6 100644 (file)
@@ -31,7 +31,7 @@ nvfx_buffer_create(struct pipe_screen *pscreen,
                return NULL;
 
        buffer->base.base = *template;
-       buffer->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
+       buffer->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
        pipe_reference_init(&buffer->base.base.reference, 1);
        buffer->base.base.screen = pscreen;
        buffer->size = util_format_get_stride(template->format, template->width0);
@@ -56,7 +56,8 @@ nvfx_user_buffer_create(struct pipe_screen *pscreen,
                return NULL;
 
        pipe_reference_init(&buffer->base.base.reference, 1);
-       buffer->base.base.flags = NVFX_RESOURCE_FLAG_LINEAR | NVFX_RESOURCE_FLAG_USER;
+       buffer->base.base.flags =
+               NOUVEAU_RESOURCE_FLAG_LINEAR | NVFX_RESOURCE_FLAG_USER;
        buffer->base.base.screen = pscreen;
        buffer->base.base.format = PIPE_FORMAT_R8_UNORM;
        buffer->base.base.usage = PIPE_USAGE_IMMUTABLE;
index 1be84b90a90171315a0be7160558ef81ff157f70..8695aa32e9bb4e71b40df15c833e6f2b4d9dd9ed 100644 (file)
@@ -33,13 +33,13 @@ nvfx_miptree_choose_format(struct nvfx_miptree *mt)
                || util_format_is_compressed(pt->format)
                || no_swizzle
        )
-               mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
+               mt->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
 
        /* non compressed formats with uniform pitch must be linear, and vice versa */
        if(!util_format_is_s3tc(pt->format)
-               && (uniform_pitch || mt->base.base.flags & NVFX_RESOURCE_FLAG_LINEAR))
+               && (uniform_pitch || mt->base.base.flags & NOUVEAU_RESOURCE_FLAG_LINEAR))
        {
-               mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
+               mt->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
                uniform_pitch = 1;
        }
 
@@ -175,7 +175,7 @@ nvfx_miptree_from_handle(struct pipe_screen *pscreen, const struct pipe_resource
         unsigned stride;
         if(whandle->stride) {
                mt->linear_pitch = whandle->stride;
-               mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
+               mt->base.base.flags |= NOUVEAU_RESOURCE_FLAG_LINEAR;
         } else
                nvfx_miptree_choose_format(mt);
 
index 070f89794429254e4b7a8493dc620d73473cf361..6e0493fea4c08418bd1cc9fcbc516c6ecfb3ad5f 100644 (file)
@@ -23,8 +23,7 @@ struct nvfx_resource *nvfx_resource(struct pipe_resource *resource)
        return (struct nvfx_resource *)resource;
 }
 
-#define NVFX_RESOURCE_FLAG_LINEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
-#define NVFX_RESOURCE_FLAG_USER (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
+#define NVFX_RESOURCE_FLAG_USER (NOUVEAU_RESOURCE_FLAG_DRV_PRIV << 0)
 
 /* is resource mapped into the GPU's address space (i.e. VRAM or GART) ? */
 static INLINE boolean
index f9fed94044a3efa14a8eb53a78ca129dd3f07895..dc4ab2f984e7ce47b3991abaa8a8bab1bdc3b451 100644 (file)
@@ -6,7 +6,7 @@ static inline boolean
 nvfx_surface_linear_renderable(struct pipe_surface* surf)
 {
        /* TODO: precompute this in nvfx_surface creation */
-       return (surf->texture->flags & NVFX_RESOURCE_FLAG_LINEAR)
+       return (surf->texture->flags & NOUVEAU_RESOURCE_FLAG_LINEAR)
                && !(((struct nvfx_surface*)surf)->offset & 63)
                && !(((struct nvfx_surface*)surf)->pitch & 63);
 }
index 04b0304b44f827089aca4ae6bad75eb23f200b31..91ca1c3750ec0c29890d1e1f3fdfb6867e74b21b 100644 (file)
@@ -102,7 +102,7 @@ nvfx_region_init_for_surface(struct nv04_region* rgn, struct nvfx_surface* surf,
                rgn->bo = ((struct nvfx_resource*)surf->base.base.texture)->bo;
                rgn->offset = surf->offset;
 
-               if(surf->base.base.texture->flags & NVFX_RESOURCE_FLAG_LINEAR)
+               if(surf->base.base.texture->flags & NOUVEAU_RESOURCE_FLAG_LINEAR)
                        rgn->pitch = surf->pitch;
                else
                {
@@ -137,7 +137,7 @@ nvfx_region_init_for_subresource(struct nv04_region* rgn, struct pipe_resource*
        rgn->x = x;
        rgn->y = y;
 
-       if(pt->flags & NVFX_RESOURCE_FLAG_LINEAR)
+       if(pt->flags & NOUVEAU_RESOURCE_FLAG_LINEAR)
        {
                rgn->pitch = nvfx_subresource_pitch(pt, level);
                rgn->z = 0;
@@ -438,7 +438,7 @@ nvfx_surface_create_temp(struct pipe_context* pipe, struct pipe_surface* surf)
        template.height0 = surf->height;
        template.depth0 = 1;
        template.nr_samples = surf->texture->nr_samples;
-       template.flags = NVFX_RESOURCE_FLAG_LINEAR;
+       template.flags = NOUVEAU_RESOURCE_FLAG_LINEAR;
 
        assert(!ns->temp && !util_dirty_surface_is_dirty(&ns->base));
 
index cc4b51ec1f8db06f16c62a317b1d980de03ee7c3..7a218b18c6404a636be51181ef921b329d21faa3 100644 (file)
@@ -56,7 +56,7 @@ nvfx_transfer_new(struct pipe_context *pipe,
        else
        {
                struct nvfx_staging_transfer* tx;
-               boolean direct = !nvfx_resource_on_gpu(pt) && pt->flags & NVFX_RESOURCE_FLAG_LINEAR;
+               boolean direct = !nvfx_resource_on_gpu(pt) && pt->flags & NOUVEAU_RESOURCE_FLAG_LINEAR;
 
                tx = CALLOC_STRUCT(nvfx_staging_transfer);
                if(!tx)