freedreno,tu,ir3: Pass fd_dev_info into ir3_compiler_create

We want to modify fd_dev_info with debug options, so we must
have a single source of fd_dev_info.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25939>
This commit is contained in:
Danylo Piliaiev 2023-10-27 14:08:33 +02:00 committed by Marge Bot
parent e6bfe42b6e
commit 17827ef24c
10 changed files with 17 additions and 11 deletions

View file

@ -345,7 +345,8 @@ a4xx_init(struct fd_device *dev, const struct fd_dev_id *dev_id)
};
struct ir3_compiler_options compiler_options = {};
a4xx_backend->compiler = ir3_compiler_create(dev, dev_id, &compiler_options);
a4xx_backend->compiler =
ir3_compiler_create(dev, dev_id, fd_dev_info(dev_id), &compiler_options);
a4xx_backend->dev = dev;
return &a4xx_backend->base;

View file

@ -610,7 +610,8 @@ a6xx_init(struct fd_device *dev, const struct fd_dev_id *dev_id)
};
struct ir3_compiler_options compiler_options = {};
a6xx_backend->compiler = ir3_compiler_create(dev, dev_id, &compiler_options);
a6xx_backend->compiler =
ir3_compiler_create(dev, dev_id, fd_dev_info(dev_id), &compiler_options);
a6xx_backend->dev = dev;
a6xx_backend->info = fd_dev_info(dev_id);

View file

@ -244,7 +244,7 @@ replay_context_init(struct replay_context *ctx, struct fd_dev_id *dev_id,
struct ir3_compiler_options options{};
ctx->compiler =
ir3_compiler_create(NULL, dev_id, &options);
ir3_compiler_create(NULL, dev_id, fd_dev_info(dev_id), &options);
ctx->compiled_shaders = _mesa_hash_table_u64_create(ctx->mem_ctx);
}

View file

@ -127,6 +127,7 @@ static const nir_shader_compiler_options ir3_base_options = {
struct ir3_compiler *
ir3_compiler_create(struct fd_device *dev, const struct fd_dev_id *dev_id,
const struct fd_dev_info *dev_info,
const struct ir3_compiler_options *options)
{
struct ir3_compiler *compiler = rzalloc(NULL, struct ir3_compiler);
@ -146,7 +147,6 @@ ir3_compiler_create(struct fd_device *dev, const struct fd_dev_id *dev_id,
compiler->options = *options;
/* TODO see if older GPU's were different here */
const struct fd_dev_info *dev_info = fd_dev_info(compiler->dev_id);
compiler->branchstack_size = 64;
compiler->wave_granularity = dev_info->wave_granularity;
compiler->max_waves = 16;

View file

@ -254,6 +254,7 @@ struct ir3_compiler {
void ir3_compiler_destroy(struct ir3_compiler *compiler);
struct ir3_compiler *ir3_compiler_create(struct fd_device *dev,
const struct fd_dev_id *dev_id,
const struct fd_dev_info *dev_info,
const struct ir3_compiler_options *options);
void ir3_disk_cache_init(struct ir3_compiler *compiler);

View file

@ -155,7 +155,7 @@ main(int argc, char **argv)
.gpu_id = 630,
};
c = ir3_compiler_create(NULL, &dev_id, &(struct ir3_compiler_options){});
c = ir3_compiler_create(NULL, &dev_id, fd_dev_info(&dev_id), &(struct ir3_compiler_options){});
for (int i = 0; i < ARRAY_SIZE(tests); i++) {
const struct test *test = &tests[i];

View file

@ -535,8 +535,10 @@ main(int argc, char **argv)
if (!compilers[dev_info->chip]) {
dev_ids[dev_info->chip].gpu_id = test->gpu_id;
dev_ids[dev_info->chip].chip_id = test->chip_id;
compilers[dev_info->chip] = ir3_compiler_create(
NULL, &dev_ids[dev_info->chip], &(struct ir3_compiler_options){});
compilers[dev_info->chip] =
ir3_compiler_create(NULL, &dev_ids[dev_info->chip],
fd_dev_info(&dev_ids[dev_info->chip]),
&(struct ir3_compiler_options){});
}
FILE *fasm =

View file

@ -2285,8 +2285,8 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice,
.storage_16bit = physical_device->info->a6xx.storage_16bit,
.shared_push_consts = !TU_DEBUG(PUSH_CONSTS_PER_STAGE),
};
device->compiler =
ir3_compiler_create(NULL, &physical_device->dev_id, &ir3_options);
device->compiler = ir3_compiler_create(
NULL, &physical_device->dev_id, physical_device->info, &ir3_options);
}
if (!device->compiler) {
result = vk_startup_errorf(physical_device->instance,

View file

@ -370,7 +370,7 @@ main(int argc, char **argv)
struct fd_dev_id dev_id = {
.gpu_id = gpu_id,
};
compiler = ir3_compiler_create(NULL, &dev_id,
compiler = ir3_compiler_create(NULL, &dev_id, fd_dev_info(&dev_id),
&(struct ir3_compiler_options) {});
if (from_tgsi) {

View file

@ -587,7 +587,8 @@ ir3_screen_init(struct pipe_screen *pscreen)
if (screen->gen >= 6) {
options.lower_base_vertex = true;
}
screen->compiler = ir3_compiler_create(screen->dev, screen->dev_id, &options);
screen->compiler =
ir3_compiler_create(screen->dev, screen->dev_id, screen->info, &options);
/* TODO do we want to limit things to # of fast cores, or just limit
* based on total # of both big and little cores. The little cores