From: Tapani Pälli Date: Wed, 28 Aug 2019 11:46:16 +0000 (+0300) Subject: iris: use driconf for 'bo_reuse' parameter X-Git-Tag: upstream/19.3.0~2382 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6dc4ddc5f81f7a3041eb61370dbb7edf90a92a6a;p=platform%2Fupstream%2Fmesa.git iris: use driconf for 'bo_reuse' parameter Signed-off-by: Tapani Pälli Reviewed-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke --- diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index e34c8f3..2dc7e3e 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -1570,7 +1570,7 @@ iris_gtt_size(int fd) * \param fd File descriptor of the opened DRM device. */ struct iris_bufmgr * -iris_bufmgr_init(struct gen_device_info *devinfo, int fd) +iris_bufmgr_init(struct gen_device_info *devinfo, int fd, bool bo_reuse) { uint64_t gtt_size = iris_gtt_size(fd); if (gtt_size <= IRIS_MEMZONE_OTHER_START) @@ -1599,6 +1599,7 @@ iris_bufmgr_init(struct gen_device_info *devinfo, int fd) list_inithead(&bufmgr->zombie_list); bufmgr->has_llc = devinfo->has_llc; + bufmgr->bo_reuse = bo_reuse; STATIC_ASSERT(IRIS_MEMZONE_SHADER_START == 0ull); const uint64_t _4GB = 1ull << 32; @@ -1622,9 +1623,6 @@ iris_bufmgr_init(struct gen_device_info *devinfo, int fd) IRIS_MEMZONE_OTHER_START, (gtt_size - _4GB) - IRIS_MEMZONE_OTHER_START); - // XXX: driconf - bufmgr->bo_reuse = env_var_as_boolean("bo_reuse", true); - init_cache_buckets(bufmgr); bufmgr->name_table = diff --git a/src/gallium/drivers/iris/iris_bufmgr.h b/src/gallium/drivers/iris/iris_bufmgr.h index 779f055..d5ae9b4 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.h +++ b/src/gallium/drivers/iris/iris_bufmgr.h @@ -323,7 +323,8 @@ int iris_bo_busy(struct iris_bo *bo); int iris_bo_madvise(struct iris_bo *bo, int madv); /* drm_bacon_bufmgr_gem.c */ -struct iris_bufmgr *iris_bufmgr_init(struct gen_device_info *devinfo, int fd); +struct iris_bufmgr *iris_bufmgr_init(struct gen_device_info *devinfo, int fd, + bool bo_reuse); struct iris_bo *iris_bo_gem_create_from_name(struct iris_bufmgr *bufmgr, const char *name, unsigned handle); diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index 1fd6eb5..e3dc00f 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -53,6 +53,11 @@ enum iris_param_domain { BRW_PARAM_DOMAIN_IMAGE, }; +enum { + DRI_CONF_BO_REUSE_DISABLED, + DRI_CONF_BO_REUSE_ALL +}; + #define BRW_PARAM(domain, val) (BRW_PARAM_DOMAIN_##domain << 24 | (val)) #define BRW_PARAM_DOMAIN(param) ((uint32_t)(param) >> 24) #define BRW_PARAM_VALUE(param) ((uint32_t)(param) & 0x00ffffff) diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index fa528a0..5fbc214 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -630,7 +630,17 @@ iris_screen_create(int fd, const struct pipe_screen_config *config) if (getenv("INTEL_NO_HW") != NULL) screen->no_hw = true; - screen->bufmgr = iris_bufmgr_init(&screen->devinfo, fd); + bool bo_reuse = false; + int bo_reuse_mode = driQueryOptioni(config->options, "bo_reuse"); + switch (bo_reuse_mode) { + case DRI_CONF_BO_REUSE_DISABLED: + break; + case DRI_CONF_BO_REUSE_ALL: + bo_reuse = true; + break; + } + + screen->bufmgr = iris_bufmgr_init(&screen->devinfo, fd, bo_reuse); if (!screen->bufmgr) return NULL;