egl: add fd_display_gpu to struct dri2_egl_display

fd opened on display gpu is saved in fd_display_gpu. It is later used
to create dri screen on display gpu.

Signed-off-by: Yogesh Mohanmarimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13422>
This commit is contained in:
Yogesh Mohanmarimuthu 2021-10-17 22:24:10 +05:30 committed by Marge Bot
parent 0813c1a6fa
commit 4e6e30215d
7 changed files with 9 additions and 0 deletions

View file

@ -244,6 +244,7 @@ struct dri2_egl_display
const __DRIconfigOptionsExtension *configOptions;
const __DRImutableRenderBufferDriverExtension *mutable_render_buffer;
int fd;
int fd_display_gpu;
/* dri2_initialize/dri2_terminate increment/decrement this count, so does
* dri2_make_current (tracks if there are active contexts/surfaces). */

View file

@ -1676,6 +1676,7 @@ dri2_initialize_android(_EGLDisplay *disp)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
ret = hw_get_module(GRALLOC_HARDWARE_MODULE_ID,
(const hw_module_t **)&dri2_dpy->gralloc);
if (ret) {

View file

@ -352,6 +352,7 @@ dri2_initialize_device(_EGLDisplay *disp)
dev = disp->PlatformDisplay;
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
disp->Device = dev;
disp->DriverData = (void *) dri2_dpy;
err = "DRI2: failed to load driver";

View file

@ -692,6 +692,7 @@ dri2_initialize_drm(_EGLDisplay *disp)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
disp->DriverData = (void *) dri2_dpy;
gbm = disp->PlatformDisplay;

View file

@ -334,6 +334,7 @@ dri2_initialize_surfaceless(_EGLDisplay *disp)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
disp->DriverData = (void *) dri2_dpy;
/* When ForceSoftware is false, we try the HW driver. When ForceSoftware

View file

@ -2093,6 +2093,7 @@ dri2_initialize_wayland_drm(_EGLDisplay *disp)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
disp->DriverData = (void *) dri2_dpy;
if (dri2_wl_formats_init(&dri2_dpy->formats) < 0)

View file

@ -1452,6 +1452,7 @@ dri2_initialize_x11_swrast(_EGLDisplay *disp)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
if (!dri2_get_xcb_connection(disp, dri2_dpy))
goto cleanup;
@ -1541,6 +1542,7 @@ dri2_initialize_x11_dri3(_EGLDisplay *disp)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
if (!dri2_get_xcb_connection(disp, dri2_dpy))
goto cleanup;
@ -1650,6 +1652,7 @@ dri2_initialize_x11_dri2(_EGLDisplay *disp)
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
dri2_dpy->fd = -1;
dri2_dpy->fd_display_gpu = -1;
if (!dri2_get_xcb_connection(disp, dri2_dpy))
goto cleanup;