19 #ifndef MIR_GRAPHICS_GBM_GBM_DISPLAY_HELPERS_H_
20 #define MIR_GRAPHICS_GBM_GBM_DISPLAY_HELPERS_H_
27 #pragma GCC diagnostic push
28 #pragma GCC diagnostic warning "-Wall"
30 #pragma GCC diagnostic pop
33 #include <xf86drmMode.h>
43 typedef std::unique_ptr<gbm_surface,std::function<void(gbm_surface*)>>
GBMSurfaceUPtr;
73 void setup(UdevHelper
const& udev);
85 int is_appropriate_device(
UdevHelper const& udev, udev_device* dev);
87 int count_connections(
int fd);
101 void setup(
const DRMHelper& drm);
102 void setup(
int drm_fd);
112 : egl_display{EGL_NO_DISPLAY}, egl_config{0},
113 egl_context{EGL_NO_CONTEXT}, egl_surface{EGL_NO_SURFACE},
114 should_terminate_egl{
false} {}
121 void setup(GBMHelper const& gbm);
122 void setup(GBMHelper const& gbm, EGLContext shared_context);
123 void setup(GBMHelper const& gbm, gbm_surface* surface_gbm,
124 EGLContext shared_context);
136 EGLDisplay egl_display;
137 EGLConfig egl_config;
138 EGLContext egl_context;
139 EGLSurface egl_surface;
140 bool should_terminate_egl;