#include "iris_screen.h"
#include "intel/compiler/brw_compiler.h"
#include "intel/common/gen_gem.h"
+#include "intel/common/gen_l3_config.h"
#include "iris_monitor.h"
static void
return -1;
}
+static const struct gen_l3_config *
+iris_get_default_l3_config(const struct gen_device_info *devinfo,
+ bool compute)
+{
+ bool wants_dc_cache = true;
+ bool has_slm = compute;
+ const struct gen_l3_weights w =
+ gen_get_default_l3_weights(devinfo, wants_dc_cache, has_slm);
+ return gen_get_l3_config(devinfo, w);
+}
+
static void
iris_shader_debug_log(void *data, const char *fmt, ...)
{
screen->compiler->supports_shader_constants = true;
screen->compiler->compact_params = false;
+ screen->l3_config_3d = iris_get_default_l3_config(&screen->devinfo, false);
+ screen->l3_config_cs = iris_get_default_l3_config(&screen->devinfo, true);
+
iris_disk_cache_init(screen);
slab_create_parent(&screen->transfer_pool,
struct iris_bo;
struct iris_monitor_config;
+struct gen_l3_config;
#define READ_ONCE(x) (*(volatile __typeof__(x) *)&(x))
#define WRITE_ONCE(x, v) *(volatile __typeof__(x) *)&(x) = (v)
struct brw_compiler *compiler;
struct iris_monitor_config *monitor_cfg;
+ const struct gen_l3_config *l3_config_3d;
+ const struct gen_l3_config *l3_config_cs;
+
/**
* A buffer containing nothing useful, for hardware workarounds that
* require scratch writes or reads from some unimportant memory.
_iris_emit_lri(batch, L3_ALLOCATION_REG_num, reg_val);
}
-static void
-iris_emit_default_l3_config(struct iris_batch *batch, bool compute)
-{
- const struct gen_device_info *devinfo = &batch->screen->devinfo;
- bool wants_dc_cache = true;
- bool has_slm = compute;
- const struct gen_l3_weights w =
- gen_get_default_l3_weights(devinfo, wants_dc_cache, has_slm);
- const struct gen_l3_config *cfg = gen_get_l3_config(devinfo, w);
- iris_emit_l3_config(batch, cfg);
-}
-
#if GEN_GEN == 9
static void
iris_enable_obj_preemption(struct iris_batch *batch, bool enable)
emit_pipeline_select(batch, _3D);
- iris_emit_default_l3_config(batch, false);
+ iris_emit_l3_config(batch, batch->screen->l3_config_3d);
init_state_base_address(batch);
emit_pipeline_select(batch, GPGPU);
#endif
- iris_emit_default_l3_config(batch, true);
+ iris_emit_l3_config(batch, batch->screen->l3_config_cs);
init_state_base_address(batch);