dri: add loader_dri_create_image helper
authorLucas Stach <l.stach@pengutronix.de>
Tue, 15 Dec 2020 13:39:32 +0000 (14:39 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 19 May 2021 16:54:19 +0000 (16:54 +0000)
commitcb9ae4273d680ab34fc2ca933c4f960e7f086275
treea8c54d27be87a2b069ed40ccc6f61500ee6f560a
parent7327b2b7b438ce097e956554743bb0c5c8f21954
dri: add loader_dri_create_image helper

The DRI image extension already has two different ways to allocate an
image (with and without a modifier) and will soon grow a third one.
Add a helper, which handles calling the appropriate implementation to
get rid of code duplication in the winsys.

This convert the two obvious call sites (GBM dri and EGL wayland)
that profit from the code dedup.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>
src/egl/drivers/dri2/platform_wayland.c
src/gbm/backends/dri/gbm_dri.c
src/loader/Makefile.sources
src/loader/loader_dri_helper.c [new file with mode: 0644]
src/loader/loader_dri_helper.h [new file with mode: 0644]
src/loader/meson.build