diff options
author | Chia-I Wu <[email protected]> | 2014-03-08 23:55:15 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2014-03-10 16:42:42 +0800 |
commit | 3e324f99d3b8f6b9da00c3f90719fba19e77ae7d (patch) | |
tree | a7070c24cf44c89a2aacef9353da430436d596b4 /src/gallium/drivers/ilo | |
parent | 76713ed5d64028a434c15f4eb6572b01e5acacca (diff) |
ilo: replace bo alloc flags by initial domains
The only alloc flag is INTEL_ALLOC_FOR_RENDER, which can as well be expressed
by specifying the initial write domain. The change makes it obvious that we
failed to set INTEL_ALLOC_FOR_RENDER in several places.
Diffstat (limited to 'src/gallium/drivers/ilo')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_3d.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_3d_pipeline.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_cp.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_query.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_resource.c | 19 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_resource.h | 2 |
6 files changed, 16 insertions, 14 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c index e9bf4100b1d..218849a20d9 100644 --- a/src/gallium/drivers/ilo/ilo_3d.c +++ b/src/gallium/drivers/ilo/ilo_3d.c @@ -662,7 +662,7 @@ upload_shaders(struct ilo_3d *hw3d, struct ilo_shader_cache *shc) intel_bo_unreference(hw3d->kernel.bo); hw3d->kernel.bo = intel_winsys_alloc_buffer(hw3d->cp->winsys, - "kernel bo", new_size, 0); + "kernel bo", new_size, INTEL_DOMAIN_CPU); if (!hw3d->kernel.bo) { ilo_err("failed to allocate kernel bo\n"); return false; diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline.c b/src/gallium/drivers/ilo/ilo_3d_pipeline.c index ca02b351370..17ac1e52434 100644 --- a/src/gallium/drivers/ilo/ilo_3d_pipeline.c +++ b/src/gallium/drivers/ilo/ilo_3d_pipeline.c @@ -95,7 +95,7 @@ ilo_3d_pipeline_create(struct ilo_cp *cp, const struct ilo_dev_info *dev) p->invalidate_flags = ILO_3D_PIPELINE_INVALIDATE_ALL; p->workaround_bo = intel_winsys_alloc_buffer(p->cp->winsys, - "PIPE_CONTROL workaround", 4096, 0); + "PIPE_CONTROL workaround", 4096, INTEL_DOMAIN_INSTRUCTION); if (!p->workaround_bo) { ilo_warn("failed to allocate PIPE_CONTROL workaround bo\n"); FREE(p); diff --git a/src/gallium/drivers/ilo/ilo_cp.c b/src/gallium/drivers/ilo/ilo_cp.c index e2e0ece78fe..cda58eb0a80 100644 --- a/src/gallium/drivers/ilo/ilo_cp.c +++ b/src/gallium/drivers/ilo/ilo_cp.c @@ -160,7 +160,7 @@ ilo_cp_realloc_bo(struct ilo_cp *cp) * won't point at the same address, which is needed for jmpbuf */ bo = intel_winsys_alloc_buffer(cp->winsys, - "batch buffer", cp->bo_size * 4, 0); + "batch buffer", cp->bo_size * 4, INTEL_DOMAIN_CPU); if (unlikely(!bo)) { /* reuse the old one */ bo = cp->bo; diff --git a/src/gallium/drivers/ilo/ilo_query.c b/src/gallium/drivers/ilo/ilo_query.c index 59a6b0686c3..6a7da7f2730 100644 --- a/src/gallium/drivers/ilo/ilo_query.c +++ b/src/gallium/drivers/ilo/ilo_query.c @@ -211,7 +211,8 @@ ilo_query_alloc_bo(struct ilo_query *q, int reg_count, int repeat_count, if (q->bo) intel_bo_unreference(q->bo); - q->bo = intel_winsys_alloc_buffer(winsys, name, size, 0); + q->bo = intel_winsys_alloc_buffer(winsys, + name, size, INTEL_DOMAIN_INSTRUCTION); q->reg_total = (q->bo) ? reg_total : 0; } diff --git a/src/gallium/drivers/ilo/ilo_resource.c b/src/gallium/drivers/ilo/ilo_resource.c index 46eaae65885..dbcc5f8a82e 100644 --- a/src/gallium/drivers/ilo/ilo_resource.c +++ b/src/gallium/drivers/ilo/ilo_resource.c @@ -997,9 +997,14 @@ tex_create_bo(struct ilo_texture *tex, &tiling, &pitch); } else { + const uint32_t initial_domain = + (tex->base.bind & (PIPE_BIND_DEPTH_STENCIL | + PIPE_BIND_RENDER_TARGET)) ? + INTEL_DOMAIN_RENDER : 0; + bo = intel_winsys_alloc_texture(is->winsys, name, tex->bo_width, tex->bo_height, tex->bo_cpp, - tex->tiling, tex->bo_flags, &pitch); + tex->tiling, initial_domain, &pitch); tiling = tex->tiling; } @@ -1090,7 +1095,7 @@ tex_create_hiz(struct ilo_texture *tex, const struct tex_layout *layout) tex->hiz.bo = intel_winsys_alloc_texture(is->winsys, "hiz texture", hz_width, hz_height, 1, - INTEL_TILING_Y, INTEL_ALLOC_FOR_RENDER, &pitch); + INTEL_TILING_Y, INTEL_DOMAIN_RENDER, &pitch); if (!tex->hiz.bo) return false; @@ -1209,10 +1214,6 @@ tex_create(struct pipe_screen *screen, tex->imported = (handle != NULL); - if (tex->base.bind & (PIPE_BIND_DEPTH_STENCIL | - PIPE_BIND_RENDER_TARGET)) - tex->bo_flags |= INTEL_ALLOC_FOR_RENDER; - tex_layout_init(&layout, screen, templ, tex->slices); switch (templ->target) { @@ -1316,6 +1317,9 @@ tex_estimate_size(struct pipe_screen *screen, static bool buf_create_bo(struct ilo_buffer *buf) { + const uint32_t initial_domain = + (buf->base.bind & PIPE_BIND_STREAM_OUTPUT) ? + INTEL_DOMAIN_RENDER : 0; struct ilo_screen *is = ilo_screen(buf->base.screen); const char *name; struct intel_bo *bo; @@ -1339,7 +1343,7 @@ buf_create_bo(struct ilo_buffer *buf) } bo = intel_winsys_alloc_buffer(is->winsys, - name, buf->bo_size, buf->bo_flags); + name, buf->bo_size, initial_domain); if (!bo) return false; @@ -1372,7 +1376,6 @@ buf_create(struct pipe_screen *screen, const struct pipe_resource *templ) pipe_reference_init(&buf->base.reference, 1); buf->bo_size = templ->width0; - buf->bo_flags = 0; /* * From the Sandy Bridge PRM, volume 1 part 1, page 118: diff --git a/src/gallium/drivers/ilo/ilo_resource.h b/src/gallium/drivers/ilo/ilo_resource.h index cba425c11dc..f11cd94d64b 100644 --- a/src/gallium/drivers/ilo/ilo_resource.h +++ b/src/gallium/drivers/ilo/ilo_resource.h @@ -81,7 +81,6 @@ struct ilo_buffer { struct intel_bo *bo; unsigned bo_size; - unsigned bo_flags; }; /** @@ -109,7 +108,6 @@ struct ilo_texture { struct pipe_resource base; bool imported; - unsigned bo_flags; enum pipe_format bo_format; struct intel_bo *bo; |