From 19351af53dfffb8543d21a58be9c9f9a52b3ba62 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 8 Mar 2015 04:33:49 +0800 Subject: [PATCH] ilo: move intel_winsys to ilo_dev_info We want to use ilo_dev_info instead of ilo_screen in core. --- src/gallium/drivers/ilo/core/ilo_dev.h | 4 ++++ src/gallium/drivers/ilo/ilo_context.c | 2 +- src/gallium/drivers/ilo/ilo_resource.c | 12 ++++++------ src/gallium/drivers/ilo/ilo_screen.c | 8 ++++---- src/gallium/drivers/ilo/ilo_screen.h | 2 -- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/ilo/core/ilo_dev.h b/src/gallium/drivers/ilo/core/ilo_dev.h index ba55cd8b63d..f5a09c404ec 100644 --- a/src/gallium/drivers/ilo/core/ilo_dev.h +++ b/src/gallium/drivers/ilo/core/ilo_dev.h @@ -35,7 +35,11 @@ #define ILO_DEV_ASSERT(dev, min_gen, max_gen) \ ilo_dev_assert(dev, ILO_GEN(min_gen), ILO_GEN(max_gen)) +struct intel_winsys; + struct ilo_dev_info { + struct intel_winsys *winsys; + /* these mirror intel_winsys_info */ int devid; size_t aperture_total; diff --git a/src/gallium/drivers/ilo/ilo_context.c b/src/gallium/drivers/ilo/ilo_context.c index 8afe712ca4c..5993591aca2 100644 --- a/src/gallium/drivers/ilo/ilo_context.c +++ b/src/gallium/drivers/ilo/ilo_context.c @@ -143,7 +143,7 @@ ilo_context_create(struct pipe_screen *screen, void *priv) if (!ilo) return NULL; - ilo->winsys = is->winsys; + ilo->winsys = is->dev.winsys; ilo->dev = &is->dev; /* diff --git a/src/gallium/drivers/ilo/ilo_resource.c b/src/gallium/drivers/ilo/ilo_resource.c index 18062d75622..344993680aa 100644 --- a/src/gallium/drivers/ilo/ilo_resource.c +++ b/src/gallium/drivers/ilo/ilo_resource.c @@ -163,7 +163,7 @@ tex_import_handle(struct ilo_texture *tex, enum intel_tiling_mode tiling; unsigned long pitch; - tex->bo = intel_winsys_import_handle(is->winsys, name, handle, + tex->bo = intel_winsys_import_handle(is->dev.winsys, name, handle, tex->layout.bo_height, &tiling, &pitch); if (!tex->bo) return false; @@ -187,7 +187,7 @@ tex_create_bo(struct ilo_texture *tex) const bool cpu_init = resource_get_cpu_init(&tex->base); struct intel_bo *bo; - bo = intel_winsys_alloc_bo(is->winsys, name, + bo = intel_winsys_alloc_bo(is->dev.winsys, name, tex->layout.bo_stride * tex->layout.bo_height, cpu_init); /* set the tiling for transfer and export */ @@ -241,7 +241,7 @@ tex_create_hiz(struct ilo_texture *tex) struct ilo_screen *is = ilo_screen(tex->base.screen); unsigned lv; - tex->aux_bo = intel_winsys_alloc_bo(is->winsys, "hiz texture", + tex->aux_bo = intel_winsys_alloc_bo(is->dev.winsys, "hiz texture", tex->layout.aux_stride * tex->layout.aux_height, false); if (!tex->aux_bo) return false; @@ -270,7 +270,7 @@ tex_create_mcs(struct ilo_texture *tex) assert(tex->layout.aux_enables == (1 << (tex->base.last_level + 1)) - 1); - tex->aux_bo = intel_winsys_alloc_bo(is->winsys, "mcs texture", + tex->aux_bo = intel_winsys_alloc_bo(is->dev.winsys, "mcs texture", tex->layout.aux_stride * tex->layout.aux_height, false); if (!tex->aux_bo) return false; @@ -397,7 +397,7 @@ tex_get_handle(struct ilo_texture *tex, struct winsys_handle *handle) else tiling = surface_to_winsys_tiling(tex->layout.tiling); - err = intel_winsys_export_handle(is->winsys, tex->bo, tiling, + err = intel_winsys_export_handle(is->dev.winsys, tex->bo, tiling, tex->layout.bo_stride, tex->layout.bo_height, handle); return !err; @@ -410,7 +410,7 @@ buf_create_bo(struct ilo_buffer *buf) const char *name = resource_get_bo_name(&buf->base); const bool cpu_init = resource_get_cpu_init(&buf->base); - buf->bo = intel_winsys_alloc_bo(is->winsys, name, buf->bo_size, cpu_init); + buf->bo = intel_winsys_alloc_bo(is->dev.winsys, name, buf->bo_size, cpu_init); return (buf->bo != NULL); } diff --git a/src/gallium/drivers/ilo/ilo_screen.c b/src/gallium/drivers/ilo/ilo_screen.c index 3be13486392..e13e056e9ed 100644 --- a/src/gallium/drivers/ilo/ilo_screen.c +++ b/src/gallium/drivers/ilo/ilo_screen.c @@ -559,7 +559,7 @@ ilo_get_timestamp(struct pipe_screen *screen) uint32_t dw[2]; } timestamp; - intel_winsys_read_reg(is->winsys, GEN6_REG_TIMESTAMP, ×tamp.val); + intel_winsys_read_reg(is->dev.winsys, GEN6_REG_TIMESTAMP, ×tamp.val); /* * From the Ivy Bridge PRM, volume 1 part 3, page 107: @@ -664,7 +664,7 @@ ilo_screen_destroy(struct pipe_screen *screen) struct ilo_screen *is = ilo_screen(screen); /* as it seems, winsys is owned by the screen */ - intel_winsys_destroy(is->winsys); + intel_winsys_destroy(is->dev.winsys); FREE(is); } @@ -820,9 +820,9 @@ ilo_screen_create(struct intel_winsys *ws) if (!is) return NULL; - is->winsys = ws; + is->dev.winsys = ws; - info = intel_winsys_get_info(is->winsys); + info = intel_winsys_get_info(is->dev.winsys); if (!init_dev(&is->dev, info)) { FREE(is); return NULL; diff --git a/src/gallium/drivers/ilo/ilo_screen.h b/src/gallium/drivers/ilo/ilo_screen.h index ea8579e916a..713db0b1e13 100644 --- a/src/gallium/drivers/ilo/ilo_screen.h +++ b/src/gallium/drivers/ilo/ilo_screen.h @@ -32,7 +32,6 @@ #include "ilo_common.h" -struct intel_winsys; struct intel_bo; struct ilo_fence; @@ -40,7 +39,6 @@ struct ilo_fence; struct ilo_screen { struct pipe_screen base; - struct intel_winsys *winsys; struct ilo_dev_info dev; }; -- 2.30.2