From: Kristian H. Kristensen Date: Wed, 5 Feb 2020 01:41:27 +0000 (-0800) Subject: freedreno: Set up supported modifiers in fd*_resource_screen_init() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=af6fb4f0a9ffe3250612acd3eb382f5eb5227e48;p=mesa.git freedreno: Set up supported modifiers in fd*_resource_screen_init() Keep the modifier logic together. Part-of: --- diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c index 32d06ed13a4..bf1f9680c7c 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_screen.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_screen.c @@ -138,14 +138,6 @@ fd6_screen_init(struct pipe_screen *pscreen) screen->tile_mode = fd6_tile_mode; - static const uint64_t supported_modifiers[] = { - DRM_FORMAT_MOD_LINEAR, - DRM_FORMAT_MOD_QCOM_COMPRESSED, - }; - - screen->supported_modifiers = supported_modifiers; - screen->num_supported_modifiers = ARRAY_SIZE(supported_modifiers); - fd6_resource_screen_init(pscreen); fd6_emit_init_screen(pscreen); } diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 59b1d9793fa..54bf359a0cc 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -1206,6 +1206,10 @@ static const struct u_transfer_vtbl transfer_vtbl = { .get_stencil = fd_resource_get_stencil, }; +static const uint64_t supported_modifiers[] = { + DRM_FORMAT_MOD_LINEAR, +}; + void fd_resource_screen_init(struct pipe_screen *pscreen) { @@ -1226,6 +1230,10 @@ fd_resource_screen_init(struct pipe_screen *pscreen) if (!screen->setup_slices) screen->setup_slices = fd_setup_slices; + if (!screen->supported_modifiers) { + screen->supported_modifiers = supported_modifiers; + screen->num_supported_modifiers = ARRAY_SIZE(supported_modifiers); + } } static void diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c index 3c0ed69a9cb..f79d858e11e 100644 --- a/src/gallium/drivers/freedreno/freedreno_screen.c +++ b/src/gallium/drivers/freedreno/freedreno_screen.c @@ -985,15 +985,6 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro) pscreen->query_dmabuf_modifiers = fd_screen_query_dmabuf_modifiers; - if (!screen->supported_modifiers) { - static const uint64_t supported_modifiers[] = { - DRM_FORMAT_MOD_LINEAR, - }; - - screen->supported_modifiers = supported_modifiers; - screen->num_supported_modifiers = ARRAY_SIZE(supported_modifiers); - } - slab_create_parent(&screen->transfer_pool, sizeof(struct fd_transfer), 16); return pscreen;