Keep the modifier logic together.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3704>
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);
}
.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)
{
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
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;