diff options
author | Chia-I Wu <[email protected]> | 2013-06-12 16:38:38 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2013-06-12 17:46:52 +0800 |
commit | 39226705b7ee79504b5b09669e5420cd7c374713 (patch) | |
tree | 3a8b919ec8fbce6ded320ed4f61f135817578723 /src/gallium/drivers/ilo/ilo_resource.c | |
parent | cdfb2163c4cf6b54b6d8ba61f5460a29f58e3184 (diff) |
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.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_resource.c')
-rw-r--r-- | src/gallium/drivers/ilo/ilo_resource.c | 21 |
1 files changed, 14 insertions, 7 deletions
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; } |