diff options
author | Chia-I Wu <[email protected]> | 2013-06-12 16:21:00 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2013-06-12 17:46:52 +0800 |
commit | cdfb2163c4cf6b54b6d8ba61f5460a29f58e3184 (patch) | |
tree | ab3a4dc322d583db7d279d2376bb36f9dd166c4f /src/gallium/drivers | |
parent | 6fe0453c339b6e894e0ee8d2200e7638a43ed21e (diff) |
ilo: get rid of function tables in winsys
We are moving toward making struct intel_bo alias drm_intel_bo. As a first
step, we cannot have function tables.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/ilo/Android.mk | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/Makefile.am | 2 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_3d.c | 18 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_3d_pipeline.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_3d_pipeline_dump.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_blit.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_context.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_cp.c | 32 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_cp.h | 4 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_query.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_resource.c | 22 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_screen.c | 16 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_shader.c | 8 | ||||
-rw-r--r-- | src/gallium/drivers/ilo/ilo_transfer.c | 40 |
14 files changed, 88 insertions, 90 deletions
diff --git a/src/gallium/drivers/ilo/Android.mk b/src/gallium/drivers/ilo/Android.mk index 5e70d3d2bc1..2b06663e2b6 100644 --- a/src/gallium/drivers/ilo/Android.mk +++ b/src/gallium/drivers/ilo/Android.mk @@ -29,7 +29,7 @@ include $(CLEAR_VARS) LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include \ - $(GALLIUM_TOP)/winsys/intel/drm + $(GALLIUM_TOP)/winsys/intel LOCAL_SRC_FILES := $(C_SOURCES) diff --git a/src/gallium/drivers/ilo/Makefile.am b/src/gallium/drivers/ilo/Makefile.am index 86901b0f847..10b3da3dfbd 100644 --- a/src/gallium/drivers/ilo/Makefile.am +++ b/src/gallium/drivers/ilo/Makefile.am @@ -28,7 +28,7 @@ noinst_LTLIBRARIES = libilo.la AM_CPPFLAGS = \ -Iinclude \ - -I$(top_srcdir)/src/gallium/winsys/intel/drm \ + -I$(top_srcdir)/src/gallium/winsys/intel \ $(GALLIUM_CFLAGS) AM_CFLAGS = \ diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c index e6ed4c9c50f..aba92a0375a 100644 --- a/src/gallium/drivers/ilo/ilo_3d.c +++ b/src/gallium/drivers/ilo/ilo_3d.c @@ -45,11 +45,11 @@ process_query_for_occlusion_counter(struct ilo_3d *hw3d, /* in pairs */ assert(q->reg_read % 2 == 0); - q->bo->map(q->bo, false); - vals = q->bo->get_virtual(q->bo); + intel_bo_map(q->bo, false); + vals = intel_bo_get_virtual(q->bo); for (i = 1; i < q->reg_read; i += 2) depth_count += vals[i] - vals[i - 1]; - q->bo->unmap(q->bo); + intel_bo_unmap(q->bo); /* accumulate so that the query can be resumed if wanted */ q->data.u64 += depth_count; @@ -70,10 +70,10 @@ process_query_for_timestamp(struct ilo_3d *hw3d, struct ilo_query *q) assert(q->reg_read == 1); - q->bo->map(q->bo, false); - vals = q->bo->get_virtual(q->bo); + intel_bo_map(q->bo, false); + vals = intel_bo_get_virtual(q->bo); timestamp = vals[0]; - q->bo->unmap(q->bo); + intel_bo_unmap(q->bo); q->data.u64 = timestamp_to_ns(timestamp); q->reg_read = 0; @@ -88,13 +88,13 @@ process_query_for_time_elapsed(struct ilo_3d *hw3d, struct ilo_query *q) /* in pairs */ assert(q->reg_read % 2 == 0); - q->bo->map(q->bo, false); - vals = q->bo->get_virtual(q->bo); + intel_bo_map(q->bo, false); + vals = intel_bo_get_virtual(q->bo); for (i = 1; i < q->reg_read; i += 2) elapsed += vals[i] - vals[i - 1]; - q->bo->unmap(q->bo); + intel_bo_unmap(q->bo); /* accumulate so that the query can be resumed if wanted */ q->data.u64 += timestamp_to_ns(elapsed); diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline.c b/src/gallium/drivers/ilo/ilo_3d_pipeline.c index 9c28be664cf..5b4dae9ae3c 100644 --- a/src/gallium/drivers/ilo/ilo_3d_pipeline.c +++ b/src/gallium/drivers/ilo/ilo_3d_pipeline.c @@ -92,7 +92,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 = p->cp->winsys->alloc_buffer(p->cp->winsys, + p->workaround_bo = intel_winsys_alloc_buffer(p->cp->winsys, "PIPE_CONTROL workaround", 4096, 0); if (!p->workaround_bo) { ilo_warn("failed to allocate PIPE_CONTROL workaround bo\n"); @@ -126,7 +126,7 @@ void ilo_3d_pipeline_destroy(struct ilo_3d_pipeline *p) { if (p->workaround_bo) - p->workaround_bo->unreference(p->workaround_bo); + intel_bo_unreference(p->workaround_bo); FREE(p); } @@ -184,7 +184,7 @@ ilo_3d_pipeline_emit_draw(struct ilo_3d_pipeline *p, p->emit_draw(p, ilo, info); ilo_cp_assert_no_implicit_flush(p->cp, false); - err = ilo->winsys->check_aperture_space(ilo->winsys, &p->cp->bo, 1); + err = intel_winsys_check_aperture_space(ilo->winsys, &p->cp->bo, 1); if (!err) { success = true; break; diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_dump.c b/src/gallium/drivers/ilo/ilo_3d_pipeline_dump.c index 852b224e77d..2276140471b 100644 --- a/src/gallium/drivers/ilo/ilo_3d_pipeline_dump.c +++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_dump.c @@ -521,7 +521,7 @@ static void init_brw(struct brw_context *brw, struct ilo_3d_pipeline *p) { brw->intel.gen = ILO_GEN_GET_MAJOR(p->dev->gen); - brw->intel.batch.bo_dst.virtual = p->cp->bo->get_virtual(p->cp->bo); + brw->intel.batch.bo_dst.virtual = intel_bo_get_virtual(p->cp->bo); brw->intel.batch.bo = &brw->intel.batch.bo_dst; } @@ -635,9 +635,9 @@ ilo_3d_pipeline_dump(struct ilo_3d_pipeline *p) ilo_cp_dump(p->cp); - err = p->cp->bo->map(p->cp->bo, false); + err = intel_bo_map(p->cp->bo, false); if (!err) { dump_3d_state(p); - p->cp->bo->unmap(p->cp->bo); + intel_bo_unmap(p->cp->bo); } } diff --git a/src/gallium/drivers/ilo/ilo_blit.c b/src/gallium/drivers/ilo/ilo_blit.c index 06a93c54739..39c47735912 100644 --- a/src/gallium/drivers/ilo/ilo_blit.c +++ b/src/gallium/drivers/ilo/ilo_blit.c @@ -324,7 +324,7 @@ tex_copy_region(struct ilo_context *ilo, aper_check[0] = ilo->cp->bo; aper_check[1] = dst->bo; aper_check[2] = src->bo; - if (ilo->winsys->check_aperture_space(ilo->winsys, aper_check, 3)) + if (intel_winsys_check_aperture_space(ilo->winsys, aper_check, 3)) ilo_cp_flush(ilo->cp); swctrl = 0x0; @@ -421,7 +421,7 @@ buf_copy_region(struct ilo_context *ilo, aper_check[0] = ilo->cp->bo; aper_check[1] = dst->bo; aper_check[2] = src->bo; - if (ilo->winsys->check_aperture_space(ilo->winsys, aper_check, 3)) + if (intel_winsys_check_aperture_space(ilo->winsys, aper_check, 3)) ilo_cp_flush(ilo->cp); while (size) { @@ -522,7 +522,7 @@ blitter_xy_color_blt(struct pipe_context *pipe, /* make room if necessary */ aper_check[0] = ilo->cp->bo; aper_check[1] = tex->bo; - if (ilo->winsys->check_aperture_space(ilo->winsys, aper_check, 2)) + if (intel_winsys_check_aperture_space(ilo->winsys, aper_check, 2)) ilo_cp_flush(ilo->cp); gen6_XY_COLOR_BLT(ilo, diff --git a/src/gallium/drivers/ilo/ilo_context.c b/src/gallium/drivers/ilo/ilo_context.c index 46d360a7b4a..c5067034a77 100644 --- a/src/gallium/drivers/ilo/ilo_context.c +++ b/src/gallium/drivers/ilo/ilo_context.c @@ -47,11 +47,11 @@ ilo_context_cp_flushed(struct ilo_cp *cp, void *data) struct ilo_context *ilo = ilo_context(data); if (ilo->last_cp_bo) - ilo->last_cp_bo->unreference(ilo->last_cp_bo); + intel_bo_unreference(ilo->last_cp_bo); /* remember the just flushed bo, on which fences could wait */ ilo->last_cp_bo = cp->bo; - ilo->last_cp_bo->reference(ilo->last_cp_bo); + intel_bo_reference(ilo->last_cp_bo); ilo_3d_cp_flushed(ilo->hw3d); } @@ -77,7 +77,7 @@ ilo_flush(struct pipe_context *pipe, fence->bo = ilo->cp->bo; if (fence->bo) - fence->bo->reference(fence->bo); + intel_bo_reference(fence->bo); } *f = (struct pipe_fence_handle *) fence; @@ -94,7 +94,7 @@ ilo_context_destroy(struct pipe_context *pipe) ilo_cleanup_states(ilo); if (ilo->last_cp_bo) - ilo->last_cp_bo->unreference(ilo->last_cp_bo); + intel_bo_unreference(ilo->last_cp_bo); util_slab_destroy(&ilo->transfer_mempool); diff --git a/src/gallium/drivers/ilo/ilo_cp.c b/src/gallium/drivers/ilo/ilo_cp.c index b29a014591c..82668df5e70 100644 --- a/src/gallium/drivers/ilo/ilo_cp.c +++ b/src/gallium/drivers/ilo/ilo_cp.c @@ -42,7 +42,7 @@ ilo_cp_dump(struct ilo_cp *cp) { ilo_printf("dumping %d bytes\n", cp->used * 4); if (cp->used) - cp->winsys->decode_commands(cp->winsys, cp->bo, cp->used * 4); + intel_winsys_decode_commands(cp->winsys, cp->bo, cp->used * 4); } /** @@ -60,7 +60,7 @@ ilo_cp_setjmp(struct ilo_cp *cp, struct ilo_cp_jmp_buf *jmp) jmp->used = cp->used; jmp->stolen = cp->stolen; /* save reloc count to rewind ilo_cp_write_bo() */ - jmp->reloc_count = cp->bo->get_reloc_count(cp->bo); + jmp->reloc_count = intel_bo_get_reloc_count(cp->bo); } /** @@ -77,7 +77,7 @@ ilo_cp_longjmp(struct ilo_cp *cp, const struct ilo_cp_jmp_buf *jmp) cp->size = jmp->size; cp->used = jmp->used; cp->stolen = jmp->stolen; - cp->bo->clear_relocs(cp->bo, jmp->reloc_count); + intel_bo_clear_relocs(cp->bo, jmp->reloc_count); } /** @@ -132,15 +132,15 @@ ilo_cp_upload_buffer(struct ilo_cp *cp) int err; if (!cp->sys) { - cp->bo->unmap(cp->bo); + intel_bo_unmap(cp->bo); return 0; } - err = cp->bo->pwrite(cp->bo, 0, cp->used * 4, cp->ptr); + err = intel_bo_pwrite(cp->bo, 0, cp->used * 4, cp->ptr); if (likely(!err && cp->stolen)) { const int offset = cp->bo_size - cp->stolen; - err = cp->bo->pwrite(cp->bo, offset * 4, + err = intel_bo_pwrite(cp->bo, offset * 4, cp->stolen * 4, &cp->ptr[offset]); } @@ -159,21 +159,21 @@ ilo_cp_realloc_bo(struct ilo_cp *cp) * allocate the new bo before unreferencing the old one so that they * won't point at the same address, which is needed for jmpbuf */ - bo = cp->winsys->alloc_buffer(cp->winsys, + bo = intel_winsys_alloc_buffer(cp->winsys, "batch buffer", cp->bo_size * 4, 0); if (unlikely(!bo)) { /* reuse the old one */ bo = cp->bo; - bo->reference(bo); + intel_bo_reference(bo); } if (cp->bo) - cp->bo->unreference(cp->bo); + intel_bo_unreference(cp->bo); cp->bo = bo; if (!cp->sys) { - cp->bo->map(cp->bo, true); - cp->ptr = cp->bo->get_virtual(cp->bo); + intel_bo_map(cp->bo, true); + cp->ptr = intel_bo_get_virtual(cp->bo); } } @@ -206,7 +206,7 @@ ilo_cp_exec_bo(struct ilo_cp *cp) flags |= cp->one_off_flags; if (likely(do_exec)) - err = cp->bo->exec(cp->bo, cp->used * 4, ctx, flags); + err = intel_bo_exec(cp->bo, cp->used * 4, ctx, flags); else err = 0; @@ -258,13 +258,13 @@ ilo_cp_destroy(struct ilo_cp *cp) { if (cp->bo) { if (!cp->sys) - cp->bo->unmap(cp->bo); + intel_bo_unmap(cp->bo); - cp->bo->unreference(cp->bo); + intel_bo_unreference(cp->bo); } if (cp->render_ctx) - cp->winsys->destroy_context(cp->winsys, cp->render_ctx); + intel_winsys_destroy_context(cp->winsys, cp->render_ctx); FREE(cp->sys); FREE(cp); @@ -283,7 +283,7 @@ ilo_cp_create(struct intel_winsys *winsys, bool direct_map) return NULL; cp->winsys = winsys; - cp->render_ctx = winsys->create_context(winsys); + cp->render_ctx = intel_winsys_create_context(winsys); cp->ring = ILO_CP_RING_RENDER; cp->no_implicit_flush = false; diff --git a/src/gallium/drivers/ilo/ilo_cp.h b/src/gallium/drivers/ilo/ilo_cp.h index 9df9a521caa..d551225a235 100644 --- a/src/gallium/drivers/ilo/ilo_cp.h +++ b/src/gallium/drivers/ilo/ilo_cp.h @@ -317,10 +317,10 @@ ilo_cp_write_bo(struct ilo_cp *cp, uint32_t val, struct intel_bo *bo, uint32_t read_domains, uint32_t write_domain) { if (bo) { - cp->bo->emit_reloc(cp->bo, cp->cmd_cur * 4, + intel_bo_emit_reloc(cp->bo, cp->cmd_cur * 4, bo, val, read_domains, write_domain); - ilo_cp_write(cp, val + bo->get_offset(bo)); + ilo_cp_write(cp, val + intel_bo_get_offset(bo)); } else { ilo_cp_write(cp, val); diff --git a/src/gallium/drivers/ilo/ilo_query.c b/src/gallium/drivers/ilo/ilo_query.c index f8d391a757c..6f2956ec6f4 100644 --- a/src/gallium/drivers/ilo/ilo_query.c +++ b/src/gallium/drivers/ilo/ilo_query.c @@ -101,7 +101,7 @@ ilo_destroy_query(struct pipe_context *pipe, struct pipe_query *query) struct ilo_query *q = ilo_query(query); if (q->bo) - q->bo->unreference(q->bo); + intel_bo_unreference(q->bo); FREE(q); } @@ -168,7 +168,7 @@ ilo_get_query_result(struct pipe_context *pipe, struct pipe_query *query, return false; if (q->bo) { - if (ilo->cp->bo->references(ilo->cp->bo, q->bo)) + if (intel_bo_references(ilo->cp->bo, q->bo)) ilo_cp_flush(ilo->cp); if (!wait && intel_bo_is_busy(q->bo)) @@ -209,9 +209,9 @@ ilo_query_alloc_bo(struct ilo_query *q, int reg_count, int repeat_count, const int size = reg_total * sizeof(uint64_t); if (q->bo) - q->bo->unreference(q->bo); + intel_bo_unreference(q->bo); - q->bo = winsys->alloc_buffer(winsys, name, size, 0); + q->bo = intel_winsys_alloc_buffer(winsys, name, size, 0); 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 85cff908800..1b291002489 100644 --- a/src/gallium/drivers/ilo/ilo_resource.c +++ b/src/gallium/drivers/ilo/ilo_resource.c @@ -900,11 +900,11 @@ tex_create_bo(struct ilo_texture *tex, } if (handle) { - bo = is->winsys->import_handle(is->winsys, name, + bo = intel_winsys_import_handle(is->winsys, name, tex->bo_width, tex->bo_height, tex->bo_cpp, handle); } else { - bo = is->winsys->alloc(is->winsys, name, + bo = intel_winsys_alloc(is->winsys, name, tex->bo_width, tex->bo_height, tex->bo_cpp, tex->tiling, tex->bo_flags); } @@ -913,13 +913,11 @@ tex_create_bo(struct ilo_texture *tex, return false; if (tex->bo) - tex->bo->unreference(tex->bo); + intel_bo_unreference(tex->bo); tex->bo = bo; - - /* winsys may decide to use a different tiling */ - tex->tiling = tex->bo->get_tiling(tex->bo); - tex->bo_stride = tex->bo->get_pitch(tex->bo); + tex->tiling = intel_bo_get_tiling(bo); + tex->bo_stride = intel_bo_get_pitch(bo); return true; } @@ -930,7 +928,7 @@ tex_destroy(struct ilo_texture *tex) if (tex->separate_s8) tex_destroy(tex->separate_s8); - tex->bo->unreference(tex->bo); + intel_bo_unreference(tex->bo); tex_free_slices(tex); FREE(tex); } @@ -1038,7 +1036,7 @@ tex_get_handle(struct ilo_texture *tex, struct winsys_handle *handle) { int err; - err = tex->bo->export_handle(tex->bo, handle); + err = intel_bo_export_handle(tex->bo, handle); return !err; } @@ -1094,13 +1092,13 @@ buf_create_bo(struct ilo_buffer *buf) break; } - bo = is->winsys->alloc_buffer(is->winsys, + bo = intel_winsys_alloc_buffer(is->winsys, name, buf->bo_size, buf->bo_flags); if (!bo) return false; if (buf->bo) - buf->bo->unreference(buf->bo); + intel_bo_unreference(buf->bo); buf->bo = bo; @@ -1110,7 +1108,7 @@ buf_create_bo(struct ilo_buffer *buf) static void buf_destroy(struct ilo_buffer *buf) { - buf->bo->unreference(buf->bo); + intel_bo_unreference(buf->bo); FREE(buf); } diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c index 4b4935c3b3a..9daf01ed8a1 100644 --- a/src/gallium/drivers/ilo/ilo_screen.c +++ b/src/gallium/drivers/ilo/ilo_screen.c @@ -533,7 +533,7 @@ ilo_get_timestamp(struct pipe_screen *screen) uint32_t dw[2]; } timestamp; - is->winsys->read_reg(is->winsys, TIMESTAMP, ×tamp.val); + intel_winsys_read_reg(is->winsys, TIMESTAMP, ×tamp.val); /* * From the Ivy Bridge PRM, volume 1 part 3, page 107: @@ -572,7 +572,7 @@ ilo_fence_reference(struct pipe_screen *screen, struct ilo_fence *old = *ptr; if (old->bo) - old->bo->unreference(old->bo); + intel_bo_unreference(old->bo); FREE(old); } @@ -587,7 +587,7 @@ ilo_fence_signalled(struct pipe_screen *screen, /* mark signalled if the bo is idle */ if (fence->bo && !intel_bo_is_busy(fence->bo)) { - fence->bo->unreference(fence->bo); + intel_bo_unreference(fence->bo); fence->bo = NULL; } @@ -607,11 +607,11 @@ ilo_fence_finish(struct pipe_screen *screen, return true; /* wait and see if it returns error */ - if (fence->bo->wait(fence->bo, wait_timeout)) + if (intel_bo_wait(fence->bo, wait_timeout)) return false; /* mark signalled */ - fence->bo->unreference(fence->bo); + intel_bo_unreference(fence->bo); fence->bo = NULL; return true; @@ -623,7 +623,7 @@ ilo_screen_destroy(struct pipe_screen *screen) struct ilo_screen *is = ilo_screen(screen); /* as it seems, winsys is owned by the screen */ - is->winsys->destroy(is->winsys); + intel_winsys_destroy(is->winsys); FREE(is); } @@ -714,9 +714,9 @@ ilo_screen_create(struct intel_winsys *ws) is->winsys = ws; - is->winsys->enable_reuse(is->winsys); + intel_winsys_enable_reuse(is->winsys); - info = is->winsys->get_info(is->winsys); + info = intel_winsys_get_info(is->winsys); if (!init_dev(&is->dev, info)) { FREE(is); return NULL; diff --git a/src/gallium/drivers/ilo/ilo_shader.c b/src/gallium/drivers/ilo/ilo_shader.c index 9c692f26e60..6d534d5a27e 100644 --- a/src/gallium/drivers/ilo/ilo_shader.c +++ b/src/gallium/drivers/ilo/ilo_shader.c @@ -498,9 +498,9 @@ static void ilo_shader_cache_reset(struct ilo_shader_cache *shc) { if (shc->bo) - shc->bo->unreference(shc->bo); + intel_bo_unreference(shc->bo); - shc->bo = shc->winsys->alloc_buffer(shc->winsys, + shc->bo = intel_winsys_alloc_buffer(shc->winsys, "shader cache", shc->size, 0); shc->busy = false; shc->cur = 0; @@ -540,7 +540,7 @@ void ilo_shader_cache_destroy(struct ilo_shader_cache *shc) { if (shc->bo) - shc->bo->unreference(shc->bo); + intel_bo_unreference(shc->bo); FREE(shc); } @@ -596,7 +596,7 @@ ilo_shader_cache_set(struct ilo_shader_cache *shc, if (shaders[i]->cache_seqno != shc->seqno) { /* kernels must be aligned to 64-byte */ shc->cur = align(shc->cur, 64); - shc->bo->pwrite(shc->bo, shc->cur, + intel_bo_pwrite(shc->bo, shc->cur, shaders[i]->kernel_size, shaders[i]->kernel); shaders[i]->cache_seqno = shc->seqno; diff --git a/src/gallium/drivers/ilo/ilo_transfer.c b/src/gallium/drivers/ilo/ilo_transfer.c index 5bdace2da81..d18dc8ca2ff 100644 --- a/src/gallium/drivers/ilo/ilo_transfer.c +++ b/src/gallium/drivers/ilo/ilo_transfer.c @@ -37,7 +37,7 @@ static bool is_bo_busy(struct ilo_context *ilo, struct intel_bo *bo, bool *need_flush) { - const bool referenced = ilo->cp->bo->references(ilo->cp->bo, bo); + const bool referenced = intel_bo_references(ilo->cp->bo, bo); if (need_flush) *need_flush = referenced; @@ -64,13 +64,13 @@ map_bo_for_transfer(struct ilo_context *ilo, struct intel_bo *bo, switch (xfer->method) { case ILO_TRANSFER_MAP_CPU: - err = bo->map(bo, (xfer->base.usage & PIPE_TRANSFER_WRITE)); + err = intel_bo_map(bo, (xfer->base.usage & PIPE_TRANSFER_WRITE)); break; case ILO_TRANSFER_MAP_GTT: - err = bo->map_gtt(bo); + err = intel_bo_map_gtt(bo); break; case ILO_TRANSFER_MAP_UNSYNC: - err = bo->map_unsynchronized(bo); + err = intel_bo_map_unsynchronized(bo); break; default: assert(!"unknown mapping method"); @@ -412,7 +412,7 @@ tex_staging_sys_zs_read(struct ilo_context *ilo, { const bool swizzle = ilo->dev->has_address_swizzling; const struct pipe_box *box = &xfer->base.box; - const uint8_t *src = tex->bo->get_virtual(tex->bo); + const uint8_t *src = intel_bo_get_virtual(tex->bo); tex_tile_offset_func tile_offset; unsigned tiles_per_row; int slice; @@ -423,7 +423,7 @@ tex_staging_sys_zs_read(struct ilo_context *ilo, if (tex->separate_s8) { struct ilo_texture *s8_tex = tex->separate_s8; - const uint8_t *s8_src = s8_tex->bo->get_virtual(s8_tex->bo); + const uint8_t *s8_src = intel_bo_get_virtual(s8_tex->bo); tex_tile_offset_func s8_tile_offset; unsigned s8_tiles_per_row; int dst_cpp, dst_s8_pos, src_cpp_used; @@ -523,7 +523,7 @@ tex_staging_sys_zs_write(struct ilo_context *ilo, { const bool swizzle = ilo->dev->has_address_swizzling; const struct pipe_box *box = &xfer->base.box; - uint8_t *dst = tex->bo->get_virtual(tex->bo); + uint8_t *dst = intel_bo_get_virtual(tex->bo); tex_tile_offset_func tile_offset; unsigned tiles_per_row; int slice; @@ -534,7 +534,7 @@ tex_staging_sys_zs_write(struct ilo_context *ilo, if (tex->separate_s8) { struct ilo_texture *s8_tex = tex->separate_s8; - uint8_t *s8_dst = s8_tex->bo->get_virtual(s8_tex->bo); + uint8_t *s8_dst = intel_bo_get_virtual(s8_tex->bo); tex_tile_offset_func s8_tile_offset; unsigned s8_tiles_per_row; int src_cpp, src_s8_pos, dst_cpp_used; @@ -637,7 +637,7 @@ tex_staging_sys_convert_write(struct ilo_context *ilo, void *dst; int slice; - dst = tex->bo->get_virtual(tex->bo); + dst = intel_bo_get_virtual(tex->bo); dst += tex_get_box_offset(tex, xfer->base.level, box); /* slice stride is not always available */ @@ -684,16 +684,16 @@ tex_staging_sys_map_bo(const struct ilo_context *ilo, int err; if (prefer_cpu && (tex->tiling == INTEL_TILING_NONE || !linear_view)) - err = tex->bo->map(tex->bo, !for_read_back); + err = intel_bo_map(tex->bo, !for_read_back); else - err = tex->bo->map_gtt(tex->bo); + err = intel_bo_map_gtt(tex->bo); if (!tex->separate_s8) return !err; - err = tex->separate_s8->bo->map(tex->separate_s8->bo, !for_read_back); + err = intel_bo_map(tex->separate_s8->bo, !for_read_back); if (err) - tex->bo->unmap(tex->bo); + intel_bo_unmap(tex->bo); return !err; } @@ -703,9 +703,9 @@ tex_staging_sys_unmap_bo(const struct ilo_context *ilo, const struct ilo_texture *tex) { if (tex->separate_s8) - tex->separate_s8->bo->unmap(tex->separate_s8->bo); + intel_bo_unmap(tex->separate_s8->bo); - tex->bo->unmap(tex->bo); + intel_bo_unmap(tex->bo); } static void @@ -807,7 +807,7 @@ tex_direct_unmap(struct ilo_context *ilo, struct ilo_texture *tex, struct ilo_transfer *xfer) { - tex->bo->unmap(tex->bo); + intel_bo_unmap(tex->bo); } static bool @@ -827,7 +827,7 @@ tex_direct_map(struct ilo_context *ilo, else xfer->base.layer_stride = 0; - xfer->ptr = tex->bo->get_virtual(tex->bo); + xfer->ptr = intel_bo_get_virtual(tex->bo); xfer->ptr += tex_get_box_offset(tex, xfer->base.level, &xfer->base.box); return true; @@ -902,7 +902,7 @@ buf_map(struct ilo_context *ilo, struct ilo_transfer *xfer) xfer->base.stride = 0; xfer->base.layer_stride = 0; - xfer->ptr = buf->bo->get_virtual(buf->bo); + xfer->ptr = intel_bo_get_virtual(buf->bo); xfer->ptr += xfer->base.box.x; return true; @@ -913,7 +913,7 @@ buf_unmap(struct ilo_context *ilo, struct ilo_transfer *xfer) { struct ilo_buffer *buf = ilo_buffer(xfer->base.resource); - buf->bo->unmap(buf->bo); + intel_bo_unmap(buf->bo); } static void @@ -944,7 +944,7 @@ buf_pwrite(struct ilo_context *ilo, struct ilo_buffer *buf, ilo_cp_flush(ilo->cp); } - buf->bo->pwrite(buf->bo, offset, size, data); + intel_bo_pwrite(buf->bo, offset, size, data); } static void |