Module: Mesa Branch: main Commit: a5b445782e9a8e1cd774629b7268ab8fb93e597e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5b445782e9a8e1cd774629b7268ab8fb93e597e
Author: Dmitry Baryshkov <[email protected]> Date: Tue Jul 18 19:58:16 2023 +0300 gallium: move kmsro definition to the bottom of the file The kmsro (in theory) can be using any other driver. In order to simplify handling of driver public headers, move kmsro definition to the bottom of the drm_helper.h Signed-off-by: Dmitry Baryshkov <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24218> --- src/gallium/auxiliary/target-helpers/drm_helper.h | 44 ++++++++++++----------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/gallium/auxiliary/target-helpers/drm_helper.h b/src/gallium/auxiliary/target-helpers/drm_helper.h index 323832ecc5a..ef32fb1f530 100644 --- a/src/gallium/auxiliary/target-helpers/drm_helper.h +++ b/src/gallium/auxiliary/target-helpers/drm_helper.h @@ -156,27 +156,6 @@ const driOptionDescription v3d_driconf[] = { }; #endif -#ifdef GALLIUM_KMSRO -#include "kmsro/drm/kmsro_drm_public.h" - -static struct pipe_screen * -pipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config) -{ - struct pipe_screen *screen; - - screen = kmsro_drm_screen_create(fd, config); - return screen ? debug_screen_wrap(screen) : NULL; -} -#if defined(GALLIUM_VC4) || defined(GALLIUM_V3D) -DRM_DRIVER_DESCRIPTOR(kmsro, v3d_driconf, ARRAY_SIZE(v3d_driconf)) -#else -DRM_DRIVER_DESCRIPTOR(kmsro, NULL, 0) -#endif - -#else -DRM_DRIVER_DESCRIPTOR_STUB(kmsro) -#endif - #ifdef GALLIUM_R300 #include "winsys/radeon_winsys.h" #include "r300/r300_public.h" @@ -450,4 +429,27 @@ DRM_DRIVER_DESCRIPTOR(zink, zink_driconf, ARRAY_SIZE(zink_driconf)) DRM_DRIVER_DESCRIPTOR_STUB(zink) #endif +#ifdef GALLIUM_KMSRO +#include "kmsro/drm/kmsro_drm_public.h" + +static struct pipe_screen * +pipe_kmsro_create_screen(int fd, const struct pipe_screen_config *config) +{ + struct pipe_screen *screen; + + screen = kmsro_drm_screen_create(fd, config); + return screen ? debug_screen_wrap(screen) : NULL; +} +#if defined(GALLIUM_VC4) || defined(GALLIUM_V3D) +DRM_DRIVER_DESCRIPTOR(kmsro, v3d_driconf, ARRAY_SIZE(v3d_driconf)) +#else +DRM_DRIVER_DESCRIPTOR(kmsro, NULL, 0) +#endif + +#else +DRM_DRIVER_DESCRIPTOR_STUB(kmsro) +#endif + +/* kmsro should be the last entry in the file. */ + #endif /* DRM_HELPER_H */
