From 39226705b7ee79504b5b09669e5420cd7c374713 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 12 Jun 2013 16:38:38 +0800 Subject: ilo: update winsys interface The motivation is to kill tiling and pitch in struct intel_bo. That requires us to make tiling and pitch not queryable, and be passed around as function parameters. --- src/gallium/drivers/ilo/ilo_resource.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/ilo/ilo_resource.c b/src/gallium/drivers/ilo/ilo_resource.c index 1b291002489..8824b97ebc6 100644 --- a/src/gallium/drivers/ilo/ilo_resource.c +++ b/src/gallium/drivers/ilo/ilo_resource.c @@ -868,6 +868,8 @@ tex_create_bo(struct ilo_texture *tex, struct ilo_screen *is = ilo_screen(tex->base.screen); const char *name; struct intel_bo *bo; + enum intel_tiling_mode tiling; + unsigned long pitch; switch (tex->base.target) { case PIPE_TEXTURE_1D: @@ -900,13 +902,16 @@ tex_create_bo(struct ilo_texture *tex, } if (handle) { - bo = intel_winsys_import_handle(is->winsys, name, - tex->bo_width, tex->bo_height, tex->bo_cpp, handle); + bo = intel_winsys_import_handle(is->winsys, name, handle, + tex->bo_width, tex->bo_height, tex->bo_cpp, + &tiling, &pitch); } else { - bo = intel_winsys_alloc(is->winsys, name, + bo = intel_winsys_alloc_texture(is->winsys, name, tex->bo_width, tex->bo_height, tex->bo_cpp, - tex->tiling, tex->bo_flags); + tex->tiling, tex->bo_flags, &pitch); + + tiling = tex->tiling; } if (!bo) @@ -916,8 +921,8 @@ tex_create_bo(struct ilo_texture *tex, intel_bo_unreference(tex->bo); tex->bo = bo; - tex->tiling = intel_bo_get_tiling(bo); - tex->bo_stride = intel_bo_get_pitch(bo); + tex->tiling = tiling; + tex->bo_stride = pitch; return true; } @@ -1034,9 +1039,11 @@ tex_create(struct pipe_screen *screen, static bool tex_get_handle(struct ilo_texture *tex, struct winsys_handle *handle) { + struct ilo_screen *is = ilo_screen(tex->base.screen); int err; - err = intel_bo_export_handle(tex->bo, handle); + err = intel_winsys_export_handle(is->winsys, tex->bo, + tex->tiling, tex->bo_stride, handle); return !err; } -- cgit v1.2.3