xserver/glamor/glamor_egl_priv.h
stefan11111 fbde8700f8 glamor/glamor_egl: Add support for passing gbm devices to glamor
Instead of having glamor_egl create the gbm device, let the ddx create
it and pass it to glamor.

This allows for saving some resources and for fixing a
bug on amd (if it still happens)

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-10-19 13:09:25 +02:00

69 lines
1.5 KiB
C

/* SPDX-License-Identifier: MIT OR X11
*
* Copyright © 2026 stefan11111 <stefan11111@shitposting.expert>
*/
/**
* Private definitions to be used by glamor and the xf86 server
*/
#ifndef GLAMOR_EGL_PRIV_H
#define GLAMOR_EGL_PRIV_H
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
#include <epoxy/gl.h>
#include <epoxy/egl.h>
#include "scrnintstr.h"
#include "glamor_egl_ext.h"
#ifdef DRI3
#include "dri3.h"
#endif
#ifdef GLAMOR_HAS_GBM
#include <gbm.h>
#endif
typedef struct glamor_egl_screen_private {
EGLDisplay display;
EGLContext context;
char *device_path;
char *glvnd_vendor; /* glvnd vendor library name or driver name */
int exact_glvnd_vendor; /* If the glvnd vendor should be assumed valid with no checks */
void* server_private;
#ifdef DRI3
dri3_screen_info_rec dri3_info;
#endif
#ifdef GLAMOR_HAS_GBM
struct gbm_device *gbm;
int fast_gbm_import;
int can_texture_gbm_bo;
int gbm_borrowed; /* If glamor borrowed the gbm device, and should not destroy it */
#endif
int has_image_dma_buf_export;
int has_EXT_EGL_image_storage;
int has_OES_EGL_image;
int fd;
int dmabuf_capable;
} glamor_egl_priv_t;
/**
* Deinitialize an egl context created by glamor egl
* and free associated resources.
*/
void glamor_egl_cleanup(glamor_egl_priv_t *glamor_egl);
/**
* Deinitialize an egl context created by glamor egl
* and free associated resources.
*/
void glamor_egl_cleanup_screen(ScreenPtr screen);
#endif /* GLAMOR_EGL_PRIV_H */