mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 12:30:09 +01:00
egl: move _EGLDisplay DriverData association into dri2_display_create
this was duplicated all over Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33891>
This commit is contained in:
parent
5bcb09d9e7
commit
c4c07136e6
8 changed files with 12 additions and 22 deletions
|
|
@ -1007,7 +1007,7 @@ dri2_display_destroy(_EGLDisplay *disp)
|
|||
}
|
||||
|
||||
struct dri2_egl_display *
|
||||
dri2_display_create(void)
|
||||
dri2_display_create(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = calloc(1, sizeof *dri2_dpy);
|
||||
if (!dri2_dpy) {
|
||||
|
|
@ -1018,6 +1018,7 @@ dri2_display_create(void)
|
|||
dri2_dpy->fd_render_gpu = -1;
|
||||
dri2_dpy->fd_display_gpu = -1;
|
||||
dri2_dpy->multibuffers_available = true;
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
|
||||
return dri2_dpy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -612,7 +612,7 @@ void
|
|||
dri2_display_destroy(_EGLDisplay *disp);
|
||||
|
||||
struct dri2_egl_display *
|
||||
dri2_display_create(void);
|
||||
dri2_display_create(_EGLDisplay *disp);
|
||||
|
||||
EGLBoolean
|
||||
dri2_init_surface(_EGLSurface *surf, _EGLDisplay *disp, EGLint type,
|
||||
|
|
|
|||
|
|
@ -1184,7 +1184,7 @@ dri2_initialize_android(_EGLDisplay *disp)
|
|||
struct dri2_egl_display *dri2_dpy;
|
||||
const char *err;
|
||||
|
||||
dri2_dpy = dri2_display_create();
|
||||
dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
|
||||
|
||||
|
|
@ -1196,7 +1196,6 @@ dri2_initialize_android(_EGLDisplay *disp)
|
|||
|
||||
bool force_pure_swrast = debug_get_bool_option("MESA_ANDROID_NO_KMS_SWRAST", false);
|
||||
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
if (!force_pure_swrast)
|
||||
device_opened = droid_open_device(disp, disp->Options.ForceSoftware);
|
||||
|
||||
|
|
|
|||
|
|
@ -336,14 +336,13 @@ EGLBoolean
|
|||
dri2_initialize_device(_EGLDisplay *disp)
|
||||
{
|
||||
const char *err;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return EGL_FALSE;
|
||||
|
||||
/* Extension requires a PlatformDisplay - the EGLDevice. */
|
||||
disp->Device = disp->PlatformDisplay;
|
||||
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
err = "DRI2: failed to load driver";
|
||||
if (_eglDeviceSupports(disp->Device, _EGL_DEVICE_DRM)) {
|
||||
if (!device_probe_device(disp))
|
||||
|
|
|
|||
|
|
@ -560,12 +560,10 @@ dri2_initialize_drm(_EGLDisplay *disp)
|
|||
{
|
||||
struct gbm_device *gbm;
|
||||
const char *err;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return EGL_FALSE;
|
||||
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
|
||||
gbm = disp->PlatformDisplay;
|
||||
if (gbm == NULL) {
|
||||
if (disp->Device) {
|
||||
|
|
|
|||
|
|
@ -361,12 +361,10 @@ dri2_initialize_surfaceless(_EGLDisplay *disp)
|
|||
{
|
||||
const char *err;
|
||||
bool driver_loaded = false;
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return EGL_FALSE;
|
||||
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
|
||||
/* When ForceSoftware is false, we try the HW driver. When ForceSoftware
|
||||
* is true, we try kms_swrast and swrast in order.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2242,12 +2242,10 @@ dri2_initialize_wayland_drm_extensions(struct dri2_egl_display *dri2_dpy)
|
|||
static EGLBoolean
|
||||
dri2_initialize_wayland_drm(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return EGL_FALSE;
|
||||
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
|
||||
if (dri2_wl_formats_init(&dri2_dpy->formats) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
|
@ -2993,12 +2991,10 @@ static const __DRIextension *kopper_swrast_loader_extensions[] = {
|
|||
static EGLBoolean
|
||||
dri2_initialize_wayland_swrast(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return EGL_FALSE;
|
||||
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
|
||||
if (dri2_wl_formats_init(&dri2_dpy->formats) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
|
|
|||
|
|
@ -1654,7 +1654,6 @@ dri2_get_xcb_connection(_EGLDisplay *disp, struct dri2_egl_display *dri2_dpy)
|
|||
int screen;
|
||||
const char *msg;
|
||||
|
||||
disp->DriverData = (void *)dri2_dpy;
|
||||
if (disp->PlatformDisplay == NULL) {
|
||||
dri2_dpy->conn = xcb_connect(NULL, &screen);
|
||||
dri2_dpy->own_device = true;
|
||||
|
|
@ -1765,7 +1764,7 @@ dri2_x11_check_multibuffers(_EGLDisplay *disp)
|
|||
static EGLBoolean
|
||||
dri2_initialize_x11_swrast(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return EGL_FALSE;
|
||||
|
||||
|
|
@ -1858,7 +1857,7 @@ static const __DRIextension *dri3_image_loader_extensions[] = {
|
|||
static enum dri2_egl_driver_fail
|
||||
dri2_initialize_x11_dri3(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
enum dri2_egl_driver_fail status = DRI2_EGL_DRIVER_FAILED;
|
||||
if (!dri2_dpy)
|
||||
return DRI2_EGL_DRIVER_FAILED;
|
||||
|
|
@ -1958,7 +1957,7 @@ static const __DRIextension *dri2_loader_extensions[] = {
|
|||
static EGLBoolean
|
||||
dri2_initialize_x11_dri2(_EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_display_create(disp);
|
||||
if (!dri2_dpy)
|
||||
return EGL_FALSE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue