egl/device: drop unnecessary intermediate variable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29459>
This commit is contained in:
Eric Engestrom
2024-05-29 11:11:51 +02:00
committed by Marge Bot
parent 0c58e8b893
commit 86ee97801b

View File

@@ -340,22 +340,20 @@ device_probe_device_sw(_EGLDisplay *disp)
EGLBoolean
dri2_initialize_device(_EGLDisplay *disp)
{
_EGLDevice *dev;
const char *err;
struct dri2_egl_display *dri2_dpy = dri2_display_create();
if (!dri2_dpy)
return EGL_FALSE;
/* Extension requires a PlatformDisplay - the EGLDevice. */
dev = disp->PlatformDisplay;
disp->Device = disp->PlatformDisplay;
disp->Device = dev;
disp->DriverData = (void *)dri2_dpy;
err = "DRI2: failed to load driver";
if (_eglDeviceSupports(dev, _EGL_DEVICE_DRM)) {
if (_eglDeviceSupports(disp->Device, _EGL_DEVICE_DRM)) {
if (!device_probe_device(disp))
goto cleanup;
} else if (_eglDeviceSupports(dev, _EGL_DEVICE_SOFTWARE)) {
} else if (_eglDeviceSupports(disp->Device, _EGL_DEVICE_SOFTWARE)) {
if (!device_probe_device_sw(disp))
goto cleanup;
} else {