gallium: remove PIPE_USAGE_STATIC
authorMarek Olšák <marek.olsak@amd.com>
Mon, 3 Feb 2014 02:42:17 +0000 (03:42 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 6 Feb 2014 16:37:34 +0000 (17:37 +0100)
Reviewed-by: Brian Paul <brianp@vmware.com>
52 files changed:
src/gallium/auxiliary/hud/font.c
src/gallium/auxiliary/postprocess/pp_mlaa.c
src/gallium/auxiliary/postprocess/pp_program.c
src/gallium/auxiliary/util/u_index_modify.c
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
src/gallium/auxiliary/vl/vl_vertex_buffers.c
src/gallium/auxiliary/vl/vl_video_buffer.c
src/gallium/auxiliary/vl/vl_winsys_dri.c
src/gallium/docs/source/screen.rst
src/gallium/drivers/nouveau/nouveau_buffer.c
src/gallium/drivers/nouveau/nouveau_video.c
src/gallium/drivers/r300/r300_blit.c
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c
src/gallium/drivers/r600/r600_uvd.c
src/gallium/drivers/radeon/r600_buffer_common.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/radeon/r600_texture.c
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_state_draw.c
src/gallium/drivers/radeonsi/si_uvd.c
src/gallium/drivers/svga/svga_draw_arrays.c
src/gallium/drivers/svga/svga_draw_elements.c
src/gallium/include/pipe/p_defines.h
src/gallium/state_trackers/vdpau/bitmap.c
src/gallium/state_trackers/vdpau/output.c
src/gallium/state_trackers/vega/renderer.c
src/gallium/state_trackers/xa/xa_renderer.c
src/gallium/state_trackers/xvmc/subpicture.c
src/gallium/tests/graw/fs-fragcoord.c
src/gallium/tests/graw/fs-frontface.c
src/gallium/tests/graw/fs-test.c
src/gallium/tests/graw/fs-write-z.c
src/gallium/tests/graw/gs-test.c
src/gallium/tests/graw/occlusion-query.c
src/gallium/tests/graw/quad-sample.c
src/gallium/tests/graw/quad-tex.c
src/gallium/tests/graw/shader-leak.c
src/gallium/tests/graw/tex-srgb.c
src/gallium/tests/graw/tex-swizzle.c
src/gallium/tests/graw/tri-gs.c
src/gallium/tests/graw/tri-instanced.c
src/gallium/tests/graw/tri-large.c
src/gallium/tests/graw/tri.c
src/gallium/tests/graw/vs-test.c
src/gallium/tests/trivial/quad-tex.c
src/gallium/tests/trivial/tri.c
src/mesa/state_tracker/st_cb_bufferobjects.c

index 6747874eedc21cb577def43cdfcce4bb81491b91..03e35d945aa93ad1820b1182677ad187a8cb741b 100644 (file)
@@ -401,7 +401,7 @@ util_font_create_fixed_8x13(struct pipe_context *pipe,
    tex_templ.height0 = 256;
    tex_templ.depth0 = 1;
    tex_templ.array_size = 1;
-   tex_templ.usage = PIPE_USAGE_STATIC;
+   tex_templ.usage = PIPE_USAGE_DEFAULT;
    tex_templ.bind = PIPE_BIND_SAMPLER_VIEW;
 
    tex = screen->resource_create(screen, &tex_templ);
index 4f0c156f0b8b490daa09da611b12633bcfcfdc7b..9827b8c974951558cddf79079402197479e4da7e 100644 (file)
@@ -240,7 +240,7 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
 
    ppq->constbuf = pipe_buffer_create(ppq->p->screen,
                                       PIPE_BIND_CONSTANT_BUFFER,
-                                      PIPE_USAGE_STATIC,
+                                      PIPE_USAGE_DEFAULT,
                                       sizeof(constants));
    if (ppq->constbuf == NULL) {
       pp_debug("Failed to allocate constant buffer\n");
@@ -259,7 +259,7 @@ pp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
    res.format = PIPE_FORMAT_R8G8_UNORM;
    res.width0 = res.height0 = 165;
    res.bind = PIPE_BIND_SAMPLER_VIEW;
-   res.usage = PIPE_USAGE_STATIC;
+   res.usage = PIPE_USAGE_DEFAULT;
    res.depth0 = res.array_size = res.nr_samples = 1;
 
    if (!ppq->p->screen->is_format_supported(ppq->p->screen, res.format,
index 19275d742e5957caae06a3725ef1ad5a8ccd7861..91cc78177f68593fd2be2c673d442fdd2a6a8fa8 100644 (file)
@@ -78,7 +78,7 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
       };
 
       p->vbuf = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER,
-                                   PIPE_USAGE_STATIC, sizeof(verts));
+                                   PIPE_USAGE_DEFAULT, sizeof(verts));
       pipe_buffer_write(p->pipe, p->vbuf, 0, sizeof(verts), verts);
    }
 
index 5e3fd463eb4a33a808663f3da0e3a3ad736fda80..e13489482aec999385891cb8836cf9522f4cf9ac 100644 (file)
@@ -71,7 +71,7 @@ void util_shorten_ubyte_elts(struct pipe_context *context,
 
     new_elts = pipe_buffer_create(context->screen,
                                   PIPE_BIND_INDEX_BUFFER,
-                                  PIPE_USAGE_STATIC,
+                                  PIPE_USAGE_DEFAULT,
                                   2 * count);
 
     out_map = pipe_buffer_map(context, new_elts, PIPE_TRANSFER_WRITE,
@@ -130,7 +130,7 @@ void util_rebuild_ushort_elts(struct pipe_context *context,
 
     new_elts = pipe_buffer_create(context->screen,
                                   PIPE_BIND_INDEX_BUFFER,
-                                  PIPE_USAGE_STATIC,
+                                  PIPE_USAGE_DEFAULT,
                                   2 * count);
 
     out_map = pipe_buffer_map(context, new_elts,
@@ -189,7 +189,7 @@ void util_rebuild_uint_elts(struct pipe_context *context,
 
     new_elts = pipe_buffer_create(context->screen,
                                   PIPE_BIND_INDEX_BUFFER,
-                                  PIPE_USAGE_STATIC,
+                                  PIPE_USAGE_DEFAULT,
                                   2 * count);
 
     out_map = pipe_buffer_map(context, new_elts,
index 33b2a119356f8380a86f3c3a1983759a190ee07d..3cea0447f106a6ba9fea46fb48ca3894e1143bd3 100644 (file)
@@ -1064,7 +1064,7 @@ vl_compositor_init_state(struct vl_compositor_state *s, struct pipe_context *pip
    (
       pipe->screen,
       PIPE_BIND_CONSTANT_BUFFER,
-      PIPE_USAGE_STATIC,
+      PIPE_USAGE_DEFAULT,
       sizeof(csc_matrix)
    );
 
index 40dc2d5cd789dd1de9287f1efa6b9f1168e5d2d4..8579460e0700821a81d5462f576da5f6eb8d993b 100644 (file)
@@ -967,7 +967,7 @@ init_idct(struct vl_mpeg12_decoder *dec, const struct format_config* format_conf
    dec->idct_source = vl_video_buffer_create_ex
    (
       dec->context, &templat,
-      formats, 1, 1, PIPE_USAGE_STATIC
+      formats, 1, 1, PIPE_USAGE_DEFAULT
    );
 
    if (!dec->idct_source)
@@ -981,7 +981,7 @@ init_idct(struct vl_mpeg12_decoder *dec, const struct format_config* format_conf
    dec->mc_source = vl_video_buffer_create_ex
    (
       dec->context, &templat,
-      formats, nr_of_idct_render_targets, 1, PIPE_USAGE_STATIC
+      formats, nr_of_idct_render_targets, 1, PIPE_USAGE_DEFAULT
    );
 
    if (!dec->mc_source)
@@ -1032,7 +1032,7 @@ init_mc_source_widthout_idct(struct vl_mpeg12_decoder *dec, const struct format_
    dec->mc_source = vl_video_buffer_create_ex
    (
       dec->context, &templat,
-      formats, 1, 1, PIPE_USAGE_STATIC
+      formats, 1, 1, PIPE_USAGE_DEFAULT
    );
       
    return dec->mc_source != NULL;
index e3f0c4977543c6c84e8f2c6fad11547a18afaf15..13d3f8c30320d34857a8e26a795b707da06d4e4e 100644 (file)
@@ -53,7 +53,7 @@ vl_vb_upload_quads(struct pipe_context *pipe)
    (
       pipe->screen,
       PIPE_BIND_VERTEX_BUFFER,
-      PIPE_USAGE_STATIC,
+      PIPE_USAGE_DEFAULT,
       sizeof(struct vertex2f) * 4
    );
    quad.user_buffer = NULL;
@@ -98,7 +98,7 @@ vl_vb_upload_pos(struct pipe_context *pipe, unsigned width, unsigned height)
    (
       pipe->screen,
       PIPE_BIND_VERTEX_BUFFER,
-      PIPE_USAGE_STATIC,
+      PIPE_USAGE_DEFAULT,
       sizeof(struct vertex2s) * width * height
    );
    pos.user_buffer = NULL;
index 092a03192cc7ccd27ac51e980b97e7c634cdb44d..5e0ae0ecb8b9d5240dccd4f531f644b7ed9c0501 100644 (file)
@@ -427,7 +427,7 @@ vl_video_buffer_create(struct pipe_context *pipe,
    result = vl_video_buffer_create_ex
    (
       pipe, &templat, resource_formats,
-      1, tmpl->interlaced ? 2 : 1, PIPE_USAGE_STATIC
+      1, tmpl->interlaced ? 2 : 1, PIPE_USAGE_DEFAULT
    );
 
 
index 3e97c564f10c501a0c1574ae379dc27d032bd108..fb4aaadd48acb5a0b614e4b11ef53f6f87e044ee 100644 (file)
@@ -234,7 +234,7 @@ vl_screen_texture_from_drawable(struct vl_screen *vscreen, Drawable drawable)
    template.height0 = reply->height;
    template.depth0 = 1;
    template.array_size = 1;
-   template.usage = PIPE_USAGE_STATIC;
+   template.usage = PIPE_USAGE_DEFAULT;
    template.bind = PIPE_BIND_RENDER_TARGET;
    template.flags = 0;
 
index 0c9c2749dfe721235430d44115a6b162acffdf53..90e82786c924688baecbc161cf509a364877137e 100644 (file)
@@ -348,7 +348,6 @@ no matter which hint they got.
   not expected to be mapped or changed (even by the GPU) after the first upload.
 * ``PIPE_USAGE_DYNAMIC``: Expect frequent write-only CPU access. What is
   uploaded is expected to be used at least several times by the GPU.
-* ``PIPE_USAGE_STATIC``: Same as PIPE_USAGE_DEFAULT.
 * ``PIPE_USAGE_STREAM``: Expect frequent write-only CPU access. What is
   uploaded is expected to be used only once by the GPU.
 * ``PIPE_USAGE_STAGING``: Optimized for fast CPU access.
index 0b21530e19b53fd3b9c3d915818cee831f283cf6..5b0b93b4a62fdc2a39b4d5c840bcee7e342c2a40 100644 (file)
@@ -626,7 +626,6 @@ nouveau_buffer_create(struct pipe_screen *pscreen,
       switch (buffer->base.usage) {
       case PIPE_USAGE_DEFAULT:
       case PIPE_USAGE_IMMUTABLE:
-      case PIPE_USAGE_STATIC:
          buffer->domain = NOUVEAU_BO_VRAM;
          break;
       case PIPE_USAGE_DYNAMIC:
index f72a0967fc1fae2c647355ae5dd33a6d196b1c32..8795c9d3bc2238d056ab22e0139fa906e53854ea 100644 (file)
@@ -811,7 +811,7 @@ nouveau_video_buffer_create(struct pipe_context *pipe,
    templ.depth0 = 1;
    templ.array_size = 1;
    templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
-   templ.usage = PIPE_USAGE_STATIC;
+   templ.usage = PIPE_USAGE_DEFAULT;
    templ.flags = NOUVEAU_RESOURCE_FLAG_LINEAR;
 
    buffer->resources[0] = pipe->screen->resource_create(pipe->screen, &templ);
index 696a61dc5f57fc6f5b9d57ce8943b86118e69561..cc9ea8a8e0d6304b276ca26a9142ca5d7b6c1293 100644 (file)
@@ -772,7 +772,7 @@ static void r300_msaa_resolve(struct pipe_context *pipe,
     templ.height0 = info->src.resource->height0;
     templ.depth0 = 1;
     templ.array_size = 1;
-    templ.usage = PIPE_USAGE_STATIC;
+    templ.usage = PIPE_USAGE_DEFAULT;
     templ.flags = R300_RESOURCE_FORCE_MICROTILING;
 
     tmp = screen->resource_create(screen, &templ);
index 5627aafec593415463807fd7551cd52f3e3fabcb..e28dbfb4034182eb0b77eab99891190760bca8ff 100644 (file)
@@ -451,7 +451,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
         memset(&vb, 0, sizeof(vb));
         vb.target = PIPE_BUFFER;
         vb.format = PIPE_FORMAT_R8_UNORM;
-        vb.usage = PIPE_USAGE_STATIC;
+        vb.usage = PIPE_USAGE_DEFAULT;
         vb.width0 = sizeof(float) * 16;
         vb.height0 = 1;
         vb.depth0 = 1;
index cd54fb88785f8af6104d1f1ddc8511a3b718e087..2cf36778383b6a846551203ae2d55b49a578699a 100644 (file)
@@ -278,7 +278,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
        }
 
        rctx->allocator_fetch_shader = u_suballocator_create(&rctx->b.b, 64 * 1024, 256,
-                                                            0, PIPE_USAGE_STATIC, FALSE);
+                                                            0, PIPE_USAGE_DEFAULT, FALSE);
        if (!rctx->allocator_fetch_shader)
                goto fail;
 
@@ -647,7 +647,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
        templ.array_size = 1;
        templ.target = PIPE_TEXTURE_2D;
        templ.format = PIPE_FORMAT_R8G8B8A8_UNORM;
-       templ.usage = PIPE_USAGE_STATIC;
+       templ.usage = PIPE_USAGE_DEFAULT;
 
        struct r600_resource *res = r600_resource(rscreen->screen.resource_create(&rscreen->screen, &templ));
        unsigned char *map = ws->buffer_map(res->cs_buf, NULL, PIPE_TRANSFER_WRITE);
index 1b73ce302130d2cff9c61dd087a1ad6c33ec28cf..0dfd4260a82e48a4949e4fa06e0bb1457298bdaa 100644 (file)
@@ -1244,7 +1244,7 @@ static struct r600_resource *r600_buffer_create_helper(struct r600_screen *rscre
        buffer.target = PIPE_BUFFER;
        buffer.format = PIPE_FORMAT_R8_UNORM;
        buffer.bind = PIPE_BIND_CUSTOM;
-       buffer.usage = PIPE_USAGE_STATIC;
+       buffer.usage = PIPE_USAGE_DEFAULT;
        buffer.flags = 0;
        buffer.width0 = size;
        buffer.height0 = 1;
index 208c073a7a87b41199b95cab534b532244bcc83d..22f2b062a96f10efb02a9883a4aa6e74ce3a0bd6 100644 (file)
@@ -1109,14 +1109,14 @@ static void update_gs_block_state(struct r600_context *rctx, unsigned enable)
                        unsigned size = 0x1C000;
                        rctx->gs_rings.esgs_ring.buffer =
                                        pipe_buffer_create(rctx->b.b.screen, PIPE_BIND_CUSTOM,
-                                                       PIPE_USAGE_STATIC, size);
+                                                       PIPE_USAGE_DEFAULT, size);
                        rctx->gs_rings.esgs_ring.buffer_size = size;
 
                        size = 0x4000000;
 
                        rctx->gs_rings.gsvs_ring.buffer =
                                        pipe_buffer_create(rctx->b.b.screen, PIPE_BIND_CUSTOM,
-                                                       PIPE_USAGE_STATIC, size);
+                                                       PIPE_USAGE_DEFAULT, size);
                        rctx->gs_rings.gsvs_ring.buffer_size = size;
                }
 
index e0db492cf25a2fc9e96495710f7163c2341844f2..f42384c12ee3b9f7dc2a11175502765b0c7feb1c 100644 (file)
@@ -76,7 +76,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
        template.width = align(tmpl->width, VL_MACROBLOCK_WIDTH);
        template.height = align(tmpl->height / array_size, VL_MACROBLOCK_HEIGHT);
 
-       vl_video_buffer_template(&templ, &template, resource_formats[0], 1, array_size, PIPE_USAGE_STATIC, 0);
+       vl_video_buffer_template(&templ, &template, resource_formats[0], 1, array_size, PIPE_USAGE_DEFAULT, 0);
        if (ctx->b.chip_class < EVERGREEN || tmpl->interlaced)
                templ.bind = PIPE_BIND_LINEAR;
        resources[0] = (struct r600_texture *)
@@ -85,7 +85,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
                goto error;
 
        if (resource_formats[1] != PIPE_FORMAT_NONE) {
-               vl_video_buffer_template(&templ, &template, resource_formats[1], 1, array_size, PIPE_USAGE_STATIC, 1);
+               vl_video_buffer_template(&templ, &template, resource_formats[1], 1, array_size, PIPE_USAGE_DEFAULT, 1);
                if (ctx->b.chip_class < EVERGREEN || tmpl->interlaced)
                        templ.bind = PIPE_BIND_LINEAR;
                resources[1] = (struct r600_texture *)
@@ -95,7 +95,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
        }
 
        if (resource_formats[2] != PIPE_FORMAT_NONE) {
-               vl_video_buffer_template(&templ, &template, resource_formats[2], 1, array_size, PIPE_USAGE_STATIC, 2);
+               vl_video_buffer_template(&templ, &template, resource_formats[2], 1, array_size, PIPE_USAGE_DEFAULT, 2);
                if (ctx->b.chip_class < EVERGREEN || tmpl->interlaced)
                        templ.bind = PIPE_BIND_LINEAR;
                resources[2] = (struct r600_texture *)
index 59578e1ad5374b62e479ce8e8cdc633a997d7b47..068141c347d81e93de6ef10715d1d823e87d93ff 100644 (file)
@@ -115,7 +115,6 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
                res->domains = RADEON_DOMAIN_GTT;
                break;
        case PIPE_USAGE_DEFAULT:
-       case PIPE_USAGE_STATIC:
        case PIPE_USAGE_IMMUTABLE:
        default:
                /* Not listing GTT here improves performance in some apps. */
index b324d8e0f1789d39ba4141db07d16ab0b0231675..7af8124eb345dcba07a9472f99bf90070204c74c 100644 (file)
@@ -61,7 +61,7 @@ bool r600_common_context_init(struct r600_common_context *rctx,
        r600_query_init(rctx);
 
        rctx->allocator_so_filled_size = u_suballocator_create(&rctx->b, 4096, 4,
-                                                              0, PIPE_USAGE_STATIC, TRUE);
+                                                              0, PIPE_USAGE_DEFAULT, TRUE);
        if (!rctx->allocator_so_filled_size)
                return false;
 
index 84c3daa7728f14bec226aef1a827b9fa564cec2d..356e0af35b74602fc27c1cd0b97c0594eea079a7 100644 (file)
@@ -453,7 +453,7 @@ void r600_texture_init_cmask(struct r600_common_screen *rscreen,
 
        rtex->cmask_buffer = (struct r600_resource *)
                pipe_buffer_create(&rscreen->b, PIPE_BIND_CUSTOM,
-                                  PIPE_USAGE_STATIC, rtex->cmask.size);
+                                  PIPE_USAGE_DEFAULT, rtex->cmask.size);
        if (rtex->cmask_buffer == NULL) {
                rtex->cmask.size = 0;
        }
@@ -546,7 +546,7 @@ static void r600_texture_allocate_htile(struct r600_common_screen *rscreen,
        /* XXX don't allocate it separately */
        rtex->htile_buffer = (struct r600_resource*)
                             pipe_buffer_create(&rscreen->b, PIPE_BIND_CUSTOM,
-                                               PIPE_USAGE_STATIC, htile_size);
+                                               PIPE_USAGE_DEFAULT, htile_size);
        if (rtex->htile_buffer == NULL) {
                /* this is not a fatal error as we can still keep rendering
                 * without htile buffer */
@@ -827,7 +827,7 @@ bool r600_init_flushed_depth_texture(struct pipe_context *ctx,
        resource.array_size = texture->array_size;
        resource.last_level = texture->last_level;
        resource.nr_samples = texture->nr_samples;
-       resource.usage = staging ? PIPE_USAGE_STAGING : PIPE_USAGE_STATIC;
+       resource.usage = staging ? PIPE_USAGE_STAGING : PIPE_USAGE_DEFAULT;
        resource.bind = texture->bind & ~PIPE_BIND_DEPTH_STENCIL;
        resource.flags = texture->flags | R600_RESOURCE_FLAG_FLUSHED_DEPTH;
 
@@ -861,7 +861,7 @@ static void r600_init_temp_resource_from_box(struct pipe_resource *res,
        res->height0 = box->height;
        res->depth0 = 1;
        res->array_size = 1;
-       res->usage = flags & R600_RESOURCE_FLAG_TRANSFER ? PIPE_USAGE_STAGING : PIPE_USAGE_STATIC;
+       res->usage = flags & R600_RESOURCE_FLAG_TRANSFER ? PIPE_USAGE_STAGING : PIPE_USAGE_DEFAULT;
        res->flags = flags;
 
        /* We must set the correct texture target and dimensions for a 3D box. */
index f717371bb2a51866b24292a538c8168d2fbc24cf..d45bc8051292b787b17d68ea49aff903a8e75439 100644 (file)
@@ -126,7 +126,7 @@ static void si_init_descriptors(struct si_context *sctx,
 
        desc->buffer = (struct r600_resource*)
                pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
-                                  PIPE_USAGE_STATIC,
+                                  PIPE_USAGE_DEFAULT,
                                   SI_NUM_CONTEXTS * desc->context_size);
 
        r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx, desc->buffer, RADEON_USAGE_READWRITE);
index 14dfd30bfb07e62fd24be1565c417edb47b523c9..1c899269f0443ec22371379cec4fa9c11be20a92 100644 (file)
@@ -183,7 +183,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, void *
         * with a NULL buffer). We need to use a dummy buffer instead. */
        if (sctx->b.chip_class == CIK) {
                sctx->null_const_buf.buffer = pipe_buffer_create(screen, PIPE_BIND_CONSTANT_BUFFER,
-                                                                PIPE_USAGE_STATIC, 16);
+                                                                PIPE_USAGE_DEFAULT, 16);
                sctx->null_const_buf.buffer_size = sctx->null_const_buf.buffer->width0;
 
                for (shader = 0; shader < SI_NUM_SHADERS; shader++) {
index 7c8fe7669518d69ba2e5199868e81edc2c1f2a3d..480e3f8a52013be76312628d5bc4aa36e6131f7a 100644 (file)
@@ -548,13 +548,13 @@ static void si_init_gs_rings(struct si_context *sctx)
 
        sctx->esgs_ring.buffer =
                pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
-                                  PIPE_USAGE_STATIC, size);
+                                  PIPE_USAGE_DEFAULT, size);
        sctx->esgs_ring.buffer_size = size;
 
        size = 64 * 1024 * 1024;
        sctx->gsvs_ring.buffer =
                pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
-                                  PIPE_USAGE_STATIC, size);
+                                  PIPE_USAGE_DEFAULT, size);
        sctx->gsvs_ring.buffer_size = size;
 
        if (sctx->b.chip_class >= CIK) {
index 98f1340f6aa122396b15b0994b5ee529e74a3c96..241288f08bdda6f7eb8cc1f321ef290bca4d9050 100644 (file)
@@ -62,7 +62,7 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
        template.width = align(tmpl->width, VL_MACROBLOCK_WIDTH);
        template.height = align(tmpl->height / array_size, VL_MACROBLOCK_HEIGHT);
 
-       vl_video_buffer_template(&templ, &template, resource_formats[0], 1, array_size, PIPE_USAGE_STATIC, 0);
+       vl_video_buffer_template(&templ, &template, resource_formats[0], 1, array_size, PIPE_USAGE_DEFAULT, 0);
        /* TODO: get tiling working */
        templ.bind = PIPE_BIND_LINEAR;
        resources[0] = (struct r600_texture *)
@@ -71,7 +71,7 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
                goto error;
 
        if (resource_formats[1] != PIPE_FORMAT_NONE) {
-               vl_video_buffer_template(&templ, &template, resource_formats[1], 1, array_size, PIPE_USAGE_STATIC, 1);
+               vl_video_buffer_template(&templ, &template, resource_formats[1], 1, array_size, PIPE_USAGE_DEFAULT, 1);
                templ.bind = PIPE_BIND_LINEAR;
                resources[1] = (struct r600_texture *)
                        pipe->screen->resource_create(pipe->screen, &templ);
@@ -80,7 +80,7 @@ struct pipe_video_buffer *si_video_buffer_create(struct pipe_context *pipe,
        }
 
        if (resource_formats[2] != PIPE_FORMAT_NONE) {
-               vl_video_buffer_template(&templ, &template, resource_formats[2], 1, array_size, PIPE_USAGE_STATIC, 2);
+               vl_video_buffer_template(&templ, &template, resource_formats[2], 1, array_size, PIPE_USAGE_DEFAULT, 2);
                templ.bind = PIPE_BIND_LINEAR;
                resources[2] = (struct r600_texture *)
                        pipe->screen->resource_create(pipe->screen, &templ);
index 89a5dc1da779a688c0e982573578530de65be494..d4d77200f59880f83d0600bb3cc5ef0684c0fdf7 100644 (file)
@@ -50,7 +50,7 @@ generate_indices(struct svga_hwtnl *hwtnl,
    void *dst_map = NULL;
 
    dst = pipe_buffer_create(pipe->screen,
-                            PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STATIC, size);
+                            PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_DEFAULT, size);
    if (dst == NULL)
       goto fail;
 
index 411b8d9b9f1413bbe35853bc7855843e6261af93..3384095e6f5f95fe11c803a677940e8846ece8b3 100644 (file)
@@ -58,7 +58,7 @@ translate_indices(struct svga_hwtnl *hwtnl, struct pipe_resource *src,
    size = index_size * nr;
 
    dst = pipe_buffer_create(pipe->screen,
-                            PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STATIC, size);
+                            PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_DEFAULT, size);
    if (dst == NULL)
       goto fail;
 
index 853853809707a47216b7f0506e536c6b97ba735a..dbedd87a6d312c26c8f8e3bbaf5d36358ad289f7 100644 (file)
@@ -363,7 +363,6 @@ enum pipe_flush_flags {
 #define PIPE_USAGE_DYNAMIC        2 /* uploaded data is used multiple times */
 #define PIPE_USAGE_STREAM         3 /* uploaded data is used once */
 #define PIPE_USAGE_STAGING        4 /* fast CPU access */
-#define PIPE_USAGE_STATIC         5 /* same as DEFAULT, will be removed */
 
 
 /**
index 335c224f70078e33471a14591f3a933a323d63eb..a06892132e908dc2d318790626dc760dd6fd9cbd 100644 (file)
@@ -77,7 +77,7 @@ vlVdpBitmapSurfaceCreate(VdpDevice device,
    res_tmpl.depth0 = 1;
    res_tmpl.array_size = 1;
    res_tmpl.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
-   res_tmpl.usage = frequently_accessed ? PIPE_USAGE_DYNAMIC : PIPE_USAGE_STATIC;
+   res_tmpl.usage = frequently_accessed ? PIPE_USAGE_DYNAMIC : PIPE_USAGE_DEFAULT;
 
    pipe_mutex_lock(dev->mutex);
 
index aa7e997b591ddd178b5a69ff45eda50f8d6811ac..5882bb23ea8741fda380b4f262884a3d86621c34 100644 (file)
@@ -80,7 +80,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
    res_tmpl.depth0 = 1;
    res_tmpl.array_size = 1;
    res_tmpl.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
-   res_tmpl.usage = PIPE_USAGE_STATIC;
+   res_tmpl.usage = PIPE_USAGE_DEFAULT;
 
    pipe_mutex_lock(dev->mutex);
 
index 35795fc868230ee31248cd95b893d689a639a7b6..931924ca407bc32f7591f5fba37c815024ed2d7f 100644 (file)
@@ -173,7 +173,7 @@ static void renderer_set_mvp(struct renderer *renderer,
    pipe_resource_reference(&cbuf, NULL);
    cbuf = pipe_buffer_create(renderer->pipe->screen,
                              PIPE_BIND_CONSTANT_BUFFER,
-                             PIPE_USAGE_STATIC,
+                             PIPE_USAGE_DEFAULT,
                              sizeof(consts));
    if (cbuf) {
       pipe_buffer_write(renderer->pipe, cbuf,
@@ -476,7 +476,7 @@ static void renderer_set_custom_fs(struct renderer *renderer,
          pipe_resource_reference(&cbuf, NULL);
 
          cbuf = pipe_buffer_create(renderer->pipe->screen,
-               PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_STATIC,
+               PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_DEFAULT,
                const_buffer_len);
          pipe_buffer_write(renderer->pipe, cbuf, 0,
                const_buffer_len, const_buffer);
index b7755095a370902c386af628fea733d90eec471e..9ba78bed4df06c9a20aaefbfee7c404173e0ed9a 100644 (file)
@@ -380,7 +380,7 @@ renderer_set_constants(struct xa_context *r,
 
     pipe_resource_reference(cbuf, NULL);
     *cbuf = pipe_buffer_create(r->pipe->screen,
-                              PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_STATIC,
+                              PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_DEFAULT,
                               param_bytes);
 
     if (*cbuf) {
index 2a4bdbf5c4ece47cb49ac415c24f17cdd06308ee..34973998d01b1428f525bee0a78fde94a56999ce 100644 (file)
@@ -270,7 +270,7 @@ Status XvMCCreateSubpicture(Display *dpy, XvMCContext *context, XvMCSubpicture *
       tex_templ.format = PIPE_FORMAT_R8G8B8X8_UNORM;
       tex_templ.width0 = subpicture->num_palette_entries;
       tex_templ.height0 = 1;
-      tex_templ.usage = PIPE_USAGE_STATIC;
+      tex_templ.usage = PIPE_USAGE_DEFAULT;
 
       tex = pipe->screen->resource_create(pipe->screen, &tex_templ);
 
index 75225b6e8584b80daa4305d30902c7fd9b8217a3..9b85cf79fb28879cbd2b3e075624f738a60532ce 100644 (file)
@@ -70,7 +70,7 @@ set_vertices(void)
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index faa43f335c97e5daac0ba95eacb139aaa4e027bc..a0c8a2d5d63f39f89345a340c0174c521640c3f7 100644 (file)
@@ -92,7 +92,7 @@ set_vertices(void)
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 0560e31723e30bc3d26a7e107d0cdb6489d52327..e335bc6d46995ce0ac83840b55813255dbcc68a4 100644 (file)
@@ -177,7 +177,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 74ab2f475ba986e80fd2874c2ad26966bfc5bb2c..eabae6424a0b39c5227b2da44f11644e36265d88 100644 (file)
@@ -96,7 +96,7 @@ set_vertices(void)
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 879bf3e8324803ae13cb6155c5321403e2942cc1..c522a8f5c65254a68025d145e3651688e16f91aa 100644 (file)
@@ -255,13 +255,13 @@ static void set_vertices( void )
    if (draw_strip) {
       vbuf.buffer = pipe_buffer_create_with_data(ctx,
                                                  PIPE_BIND_VERTEX_BUFFER,
-                                                 PIPE_USAGE_STATIC,
+                                                 PIPE_USAGE_DEFAULT,
                                                  sizeof(vertices_strip),
                                                  vertices_strip);
    } else {
       vbuf.buffer = pipe_buffer_create_with_data(ctx,
                                                  PIPE_BIND_VERTEX_BUFFER,
-                                                 PIPE_USAGE_STATIC,
+                                                 PIPE_USAGE_DEFAULT,
                                                  sizeof(vertices),
                                                  vertices);
    }
index 51d6326c2baf27e5530522f515f4818917ebc5e7..f5227e33e9d55f0cde28b031b15a4de9a6f2aa23 100644 (file)
@@ -96,7 +96,7 @@ set_vertices(struct vertex *vertices, unsigned bytes)
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               bytes,
                                               vertices);
 
index 2e248a8a6f4b30d87372a86f597301faa2b50fc3..4d5a59769f3b237eda7d6b24f1503330641b8e6b 100644 (file)
@@ -103,7 +103,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 9e4407e442e9aa6d6d2c4a992201fc490206f92b..5f90166830f174a73c78ba48962bbf086f17ea35 100644 (file)
@@ -59,7 +59,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 754ada6cf10c3f0516abb4820453d937a434862e..fce3683bf3d8d8339d5d4c15be8ae27a36f2a8ab 100644 (file)
@@ -93,7 +93,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index dce91188ebe56d0cf071b0e2a5dded2ba5ef36e7..af989d72a2e39be506e57cb91daf8fa591a4f7b3 100644 (file)
@@ -75,7 +75,7 @@ set_vertices(struct vertex *verts, unsigned num_verts)
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               num_verts * sizeof(struct vertex),
                                               verts);
 
index 910a8ca3e45c6ad1252b12f7acbed3d218a3329e..e45b848b48e2506b6b79e712407c1d67cdb2ad35 100644 (file)
@@ -57,7 +57,7 @@ static void set_vertices(void)
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 24de12b723cee940565e7a191acd62bfada71707..ab92dd02325a5a34d152b922a7854dbc02cba58a 100644 (file)
@@ -94,7 +94,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 55bc3a551da1cf56864acffb06cca18154f77ec9..d7cad81b722b8300df35bd232252ed98b36efbab 100644 (file)
@@ -137,7 +137,7 @@ static void set_vertices( void )
    vbuf[0].buffer_offset = 0;
    vbuf[0].buffer = pipe_buffer_create_with_data(ctx,
                                                  PIPE_BIND_VERTEX_BUFFER,
-                                                 PIPE_USAGE_STATIC,
+                                                 PIPE_USAGE_DEFAULT,
                                                  sizeof(vertices),
                                                  vertices);
 
@@ -146,7 +146,7 @@ static void set_vertices( void )
    vbuf[1].buffer_offset = 0;
    vbuf[1].buffer = pipe_buffer_create_with_data(ctx,
                                                  PIPE_BIND_VERTEX_BUFFER,
-                                                 PIPE_USAGE_STATIC,
+                                                 PIPE_USAGE_DEFAULT,
                                                  sizeof(inst_data),
                                                  inst_data);
 
@@ -155,7 +155,7 @@ static void set_vertices( void )
    /* index data */
    ibuf.buffer = pipe_buffer_create_with_data(ctx,
                                               PIPE_BIND_INDEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(indices),
                                               indices);
    ibuf.offset = 0;
index 67d49b07bb06f40335809f8694314502b012bca8..4ccb7c526725156a43be5343ba842e761af4077a 100644 (file)
@@ -61,7 +61,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index f1d8142bd513bc7a4c2eb00aead032a154b9ad97..0968387e1e4b5ecb04aae59b4b18112e03a5631c 100644 (file)
@@ -58,7 +58,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(info.ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 0e9fc53e1b8e274e5f53d271de4f94634b379b7d..187759dcba46146d2df3646a8dc2296919132ad1 100644 (file)
@@ -176,7 +176,7 @@ static void set_vertices( void )
    vbuf.buffer_offset = 0;
    vbuf.buffer = pipe_buffer_create_with_data(ctx,
                                               PIPE_BIND_VERTEX_BUFFER,
-                                              PIPE_USAGE_STATIC,
+                                              PIPE_USAGE_DEFAULT,
                                               sizeof(vertices),
                                               vertices);
 
index 5ed741bdfd631b4b1bf72333a0b48abff130bff6..1d52aff34396235d98c41dec22a59a6ac3d1450c 100644 (file)
@@ -131,7 +131,7 @@ static void init_prog(struct program *p)
                };
 
                p->vbuf = pipe_buffer_create(p->screen, PIPE_BIND_VERTEX_BUFFER,
-                                            PIPE_USAGE_STATIC, sizeof(vertices));
+                                            PIPE_USAGE_DEFAULT, sizeof(vertices));
                pipe_buffer_write(p->pipe, p->vbuf, 0, sizeof(vertices), vertices);
        }
 
index f93c3f787106ef8c297e6b81f218f5dc1bfac8a9..062d45d2fa4989ab93739577e38cf99cdc6e9016 100644 (file)
@@ -122,7 +122,7 @@ static void init_prog(struct program *p)
                };
 
                p->vbuf = pipe_buffer_create(p->screen, PIPE_BIND_VERTEX_BUFFER,
-                                            PIPE_USAGE_STATIC, sizeof(vertices));
+                                            PIPE_USAGE_DEFAULT, sizeof(vertices));
                pipe_buffer_write(p->pipe, p->vbuf, 0, sizeof(vertices), vertices);
        }
 
index 7a410c219417a274bd445f25b3e032f28af4dd1d..c8f088dc82c3d9f2e499d5e9b0e22a791a067364 100644 (file)
@@ -229,7 +229,8 @@ st_bufferobj_data(struct gl_context *ctx,
    case GL_STATIC_DRAW:
    case GL_STATIC_READ:
    case GL_STATIC_COPY:
-      pipe_usage = PIPE_USAGE_STATIC;
+   default:
+      pipe_usage = PIPE_USAGE_DEFAULT;
       break;
    case GL_DYNAMIC_DRAW:
    case GL_DYNAMIC_READ:
@@ -241,8 +242,6 @@ st_bufferobj_data(struct gl_context *ctx,
    case GL_STREAM_COPY:
       pipe_usage = PIPE_USAGE_STREAM;
       break;
-   default:
-      pipe_usage = PIPE_USAGE_DEFAULT;
    }
 
    pipe_resource_reference( &st_obj->buffer, NULL );