From 5eb5847d487d76a763b739219366f62b19bc5a73 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Mon, 3 Aug 2020 22:19:42 +0200 Subject: [PATCH] egl: replace replace _EGLDriver with _EGLDisplay->Driver in eglapi.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Eric Engestrom Reviewed-by: Marek Olšák Part-of: --- src/egl/main/eglapi.c | 94 +++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 48 deletions(-) diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index 011c191f2b8..bdf7bc4b1cb 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -802,7 +802,7 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, if (!share && share_list != EGL_NO_CONTEXT) RETURN_EGL_ERROR(disp, EGL_BAD_CONTEXT, EGL_NO_CONTEXT); - context = drv->CreateContext(disp, conf, share, attrib_list); + context = disp->Driver->CreateContext(disp, conf, share, attrib_list); ret = (context) ? _eglLinkContext(context) : EGL_NO_CONTEXT; RETURN_EGL_EVAL(disp, ret); @@ -821,7 +821,7 @@ eglDestroyContext(EGLDisplay dpy, EGLContext ctx) _EGL_CHECK_CONTEXT(disp, context, EGL_FALSE, drv); _eglUnlinkContext(context); - ret = drv->DestroyContext(disp, context); + ret = disp->Driver->DestroyContext(disp, context); RETURN_EGL_EVAL(disp, ret); } @@ -835,14 +835,12 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, _EGLContext *context = _eglLookupContext(ctx, disp); _EGLSurface *draw_surf = _eglLookupSurface(draw, disp); _EGLSurface *read_surf = _eglLookupSurface(read, disp); - const _EGLDriver *drv; EGLBoolean ret; _EGL_FUNC_START(disp, EGL_OBJECT_CONTEXT_KHR, context, EGL_FALSE); if (!disp) RETURN_EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE); - drv = disp->Driver; /* display is allowed to be uninitialized under certain condition */ if (!disp->Initialized) { @@ -850,7 +848,7 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, ctx != EGL_NO_CONTEXT) RETURN_EGL_ERROR(disp, EGL_BAD_DISPLAY, EGL_FALSE); } - if (!drv) + if (!disp->Driver) RETURN_EGL_SUCCESS(disp, EGL_TRUE); if (!context && ctx != EGL_NO_CONTEXT) @@ -879,7 +877,7 @@ eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, if (read_surf && read_surf->Lost) RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_FALSE); - ret = drv->MakeCurrent(disp, draw_surf, read_surf, context); + ret = disp->Driver->MakeCurrent(disp, draw_surf, read_surf, context); RETURN_EGL_EVAL(disp, ret); } @@ -968,7 +966,7 @@ _eglCreateWindowSurfaceCommon(_EGLDisplay *disp, EGLConfig config, if (_eglNativeSurfaceAlreadyUsed(disp, native_window)) RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE); - surf = drv->CreateWindowSurface(disp, conf, native_window, attrib_list); + surf = disp->Driver->CreateWindowSurface(disp, conf, native_window, attrib_list); ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE; RETURN_EGL_EVAL(disp, ret); @@ -1094,7 +1092,7 @@ _eglCreatePixmapSurfaceCommon(_EGLDisplay *disp, EGLConfig config, if (_eglNativeSurfaceAlreadyUsed(disp, native_pixmap)) RETURN_EGL_ERROR(disp, EGL_BAD_ALLOC, EGL_NO_SURFACE); - surf = drv->CreatePixmapSurface(disp, conf, native_pixmap, attrib_list); + surf = disp->Driver->CreatePixmapSurface(disp, conf, native_pixmap, attrib_list); ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE; RETURN_EGL_EVAL(disp, ret); @@ -1166,7 +1164,7 @@ eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, if ((conf->SurfaceType & EGL_PBUFFER_BIT) == 0) RETURN_EGL_ERROR(disp, EGL_BAD_MATCH, EGL_NO_SURFACE); - surf = drv->CreatePbufferSurface(disp, conf, attrib_list); + surf = disp->Driver->CreatePbufferSurface(disp, conf, attrib_list); ret = (surf) ? _eglLinkSurface(surf) : EGL_NO_SURFACE; RETURN_EGL_EVAL(disp, ret); @@ -1184,7 +1182,7 @@ eglDestroySurface(EGLDisplay dpy, EGLSurface surface) _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE); _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); _eglUnlinkSurface(surf); - ret = drv->DestroySurface(disp, surf); + ret = disp->Driver->DestroySurface(disp, surf); RETURN_EGL_EVAL(disp, ret); } @@ -1201,8 +1199,8 @@ eglQuerySurface(EGLDisplay dpy, EGLSurface surface, _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE); _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); - if (drv->QuerySurface) - ret = drv->QuerySurface(disp, surf, attribute, value); + if (disp->Driver->QuerySurface) + ret = disp->Driver->QuerySurface(disp, surf, attribute, value); else ret = _eglQuerySurface(disp, surf, attribute, value); @@ -1237,7 +1235,7 @@ eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE); _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); - ret = drv->BindTexImage(disp, surf, buffer); + ret = disp->Driver->BindTexImage(disp, surf, buffer); RETURN_EGL_EVAL(disp, ret); } @@ -1253,7 +1251,7 @@ eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) _EGL_FUNC_START(disp, EGL_OBJECT_SURFACE_KHR, surf, EGL_FALSE); _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); - ret = drv->ReleaseTexImage(disp, surf, buffer); + ret = disp->Driver->ReleaseTexImage(disp, surf, buffer); RETURN_EGL_EVAL(disp, ret); } @@ -1286,8 +1284,8 @@ eglSwapInterval(EGLDisplay dpy, EGLint interval) surf->Config->MaxSwapInterval); if (surf->SwapInterval != interval) { - if (drv->SwapInterval) - ret = drv->SwapInterval(disp, surf, interval); + if (disp->Driver->SwapInterval) + ret = disp->Driver->SwapInterval(disp, surf, interval); else ret = _eglSwapInterval(disp, surf, interval); } @@ -1333,7 +1331,7 @@ eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) if (surf->Lost) RETURN_EGL_ERROR(disp, EGL_BAD_NATIVE_WINDOW, EGL_FALSE); - ret = drv->SwapBuffers(disp, surf); + ret = disp->Driver->SwapBuffers(disp, surf); /* EGL_KHR_partial_update * Frame boundary successfully reached, @@ -1369,7 +1367,7 @@ _eglSwapBuffersWithDamageCommon(_EGLDisplay *disp, _EGLSurface *surf, if ((n_rects > 0 && rects == NULL) || n_rects < 0) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->SwapBuffersWithDamageEXT(disp, surf, rects, n_rects); + ret = disp->Driver->SwapBuffersWithDamageEXT(disp, surf, rects, n_rects); /* EGL_KHR_partial_update * Frame boundary successfully reached, @@ -1456,7 +1454,7 @@ eglSetDamageRegionKHR(EGLDisplay dpy, EGLSurface surface, RETURN_EGL_ERROR(disp, EGL_BAD_ACCESS, EGL_FALSE); _eglSetDamageRegionKHRClampRects(surf, rects, n_rects); - ret = drv->SetDamageRegion(disp, surf, rects, n_rects); + ret = disp->Driver->SetDamageRegion(disp, surf, rects, n_rects); if (ret) surf->SetDamageRegionCalled = EGL_TRUE; @@ -1478,7 +1476,7 @@ eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) native_pixmap_ptr = (void*) target; _EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv); - ret = drv->CopyBuffers(disp, surf, native_pixmap_ptr); + ret = disp->Driver->CopyBuffers(disp, surf, native_pixmap_ptr); RETURN_EGL_EVAL(disp, ret); } @@ -1734,7 +1732,7 @@ _eglCreateImageCommon(_EGLDisplay *disp, EGLContext ctx, EGLenum target, if (ctx != EGL_NO_CONTEXT && target == EGL_LINUX_DMA_BUF_EXT) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR); - img = drv->CreateImageKHR(disp, context, target, buffer, attr_list); + img = disp->Driver->CreateImageKHR(disp, context, target, buffer, attr_list); ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR; RETURN_EGL_EVAL(disp, ret); @@ -1783,7 +1781,7 @@ _eglDestroyImageCommon(_EGLDisplay *disp, _EGLImage *img) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); _eglUnlinkImage(img); - ret = drv->DestroyImageKHR(disp, img); + ret = disp->Driver->DestroyImageKHR(disp, img); RETURN_EGL_EVAL(disp, ret); } @@ -1867,7 +1865,7 @@ _eglCreateSync(_EGLDisplay *disp, EGLenum type, const EGLAttrib *attrib_list, RETURN_EGL_ERROR(disp, invalid_type_error, EGL_NO_SYNC_KHR); } - sync = drv->CreateSyncKHR(disp, type, attrib_list); + sync = disp->Driver->CreateSyncKHR(disp, type, attrib_list); ret = (sync) ? _eglLinkSync(sync) : EGL_NO_SYNC_KHR; RETURN_EGL_EVAL(disp, ret); @@ -1935,7 +1933,7 @@ _eglDestroySync(_EGLDisplay *disp, _EGLSync *s) disp->Extensions.ANDROID_native_fence_sync); _eglUnlinkSync(s); - ret = drv->DestroySyncKHR(disp, s); + ret = disp->Driver->DestroySyncKHR(disp, s); RETURN_EGL_EVAL(disp, ret); } @@ -1982,7 +1980,7 @@ _eglClientWaitSyncCommon(_EGLDisplay *disp, EGLDisplay dpy, if (s->Type == EGL_SYNC_REUSABLE_KHR) _eglUnlockDisplay(dpy); - ret = drv->ClientWaitSyncKHR(disp, s, flags, timeout); + ret = disp->Driver->ClientWaitSyncKHR(disp, s, flags, timeout); /* * 'disp' is already unlocked for reusable sync type, @@ -2035,7 +2033,7 @@ _eglWaitSyncCommon(_EGLDisplay *disp, _EGLSync *s, EGLint flags) if (flags != 0) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->WaitSyncKHR(disp, s); + ret = disp->Driver->WaitSyncKHR(disp, s); RETURN_EGL_EVAL(disp, ret); } @@ -2076,7 +2074,7 @@ eglSignalSyncKHR(EGLDisplay dpy, EGLSync sync, EGLenum mode) _EGL_CHECK_SYNC(disp, s, EGL_FALSE, drv); assert(disp->Extensions.KHR_reusable_sync); - ret = drv->SignalSyncKHR(disp, s, mode); + ret = disp->Driver->SignalSyncKHR(disp, s, mode); RETURN_EGL_EVAL(disp, ret); } @@ -2158,7 +2156,7 @@ eglDupNativeFenceFDANDROID(EGLDisplay dpy, EGLSync sync) _EGL_CHECK_SYNC(disp, s, EGL_NO_NATIVE_FENCE_FD_ANDROID, drv); assert(disp->Extensions.ANDROID_native_fence_sync); - ret = drv->DupNativeFenceFDANDROID(disp, s); + ret = disp->Driver->DupNativeFenceFDANDROID(disp, s); RETURN_EGL_EVAL(disp, ret); } @@ -2185,7 +2183,7 @@ eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, surf != ctx->DrawSurface) RETURN_EGL_ERROR(disp, EGL_BAD_SURFACE, EGL_FALSE); - ret = drv->SwapBuffersRegionNOK(disp, surf, numRects, rects); + ret = disp->Driver->SwapBuffersRegionNOK(disp, surf, numRects, rects); RETURN_EGL_EVAL(disp, ret); } @@ -2205,7 +2203,7 @@ eglCreateDRMImageMESA(EGLDisplay dpy, const EGLint *attr_list) if (!disp->Extensions.MESA_drm_image) RETURN_EGL_EVAL(disp, EGL_NO_IMAGE_KHR); - img = drv->CreateDRMImageMESA(disp, attr_list); + img = disp->Driver->CreateDRMImageMESA(disp, attr_list); ret = (img) ? _eglLinkImage(img) : EGL_NO_IMAGE_KHR; RETURN_EGL_EVAL(disp, ret); @@ -2228,7 +2226,7 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImage image, if (!img) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->ExportDRMImageMESA(disp, img, name, handle, stride); + ret = disp->Driver->ExportDRMImageMESA(disp, img, name, handle, stride); RETURN_EGL_EVAL(disp, ret); } @@ -2251,7 +2249,7 @@ eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display) if (!display) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->BindWaylandDisplayWL(disp, display); + ret = disp->Driver->BindWaylandDisplayWL(disp, display); RETURN_EGL_EVAL(disp, ret); } @@ -2271,7 +2269,7 @@ eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display) if (!display) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->UnbindWaylandDisplayWL(disp, display); + ret = disp->Driver->UnbindWaylandDisplayWL(disp, display); RETURN_EGL_EVAL(disp, ret); } @@ -2292,7 +2290,7 @@ eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, if (!buffer) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->QueryWaylandBufferWL(disp, buffer, attribute, value); + ret = disp->Driver->QueryWaylandBufferWL(disp, buffer, attribute, value); RETURN_EGL_EVAL(disp, ret); } @@ -2317,7 +2315,7 @@ eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImage image) if (!img) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, NULL); - ret = drv->CreateWaylandBufferFromImageWL(disp, img); + ret = disp->Driver->CreateWaylandBufferFromImageWL(disp, img); RETURN_EGL_EVAL(disp, ret); } @@ -2338,7 +2336,7 @@ eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface, if (!disp->Extensions.NV_post_sub_buffer) RETURN_EGL_EVAL(disp, EGL_FALSE); - ret = drv->PostSubBufferNV(disp, surf, x, y, width, height); + ret = disp->Driver->PostSubBufferNV(disp, surf, x, y, width, height); RETURN_EGL_EVAL(disp, ret); } @@ -2362,7 +2360,7 @@ eglGetSyncValuesCHROMIUM(EGLDisplay dpy, EGLSurface surface, if (!ust || !msc || !sbc) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->GetSyncValuesCHROMIUM(disp, surf, ust, msc, sbc); + ret = disp->Driver->GetSyncValuesCHROMIUM(disp, surf, ust, msc, sbc); RETURN_EGL_EVAL(disp, ret); } @@ -2385,7 +2383,7 @@ eglExportDMABUFImageQueryMESA(EGLDisplay dpy, EGLImage image, if (!img) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->ExportDMABUFImageQueryMESA(disp, img, fourcc, nplanes, modifiers); + ret = disp->Driver->ExportDMABUFImageQueryMESA(disp, img, fourcc, nplanes, modifiers); RETURN_EGL_EVAL(disp, ret); } @@ -2407,7 +2405,7 @@ eglExportDMABUFImageMESA(EGLDisplay dpy, EGLImage image, if (!img) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_FALSE); - ret = drv->ExportDMABUFImageMESA(disp, img, fds, strides, offsets); + ret = disp->Driver->ExportDMABUFImageMESA(disp, img, fds, strides, offsets); RETURN_EGL_EVAL(disp, ret); } @@ -2571,7 +2569,7 @@ eglQueryDmaBufFormatsEXT(EGLDisplay dpy, EGLint max_formats, _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); - ret = drv->QueryDmaBufFormatsEXT(disp, max_formats, formats, num_formats); + ret = disp->Driver->QueryDmaBufFormatsEXT(disp, max_formats, formats, num_formats); RETURN_EGL_EVAL(disp, ret); } @@ -2589,7 +2587,7 @@ eglQueryDmaBufModifiersEXT(EGLDisplay dpy, EGLint format, EGLint max_modifiers, _EGL_CHECK_DISPLAY(disp, EGL_FALSE, drv); - ret = drv->QueryDmaBufModifiersEXT(disp, format, max_modifiers, modifiers, + ret = disp->Driver->QueryDmaBufModifiersEXT(disp, format, max_modifiers, modifiers, external_only, num_modifiers); RETURN_EGL_EVAL(disp, ret); @@ -2633,7 +2631,7 @@ eglSetBlobCacheFuncsANDROID(EGLDisplay *dpy, EGLSetBlobFuncANDROID set, disp->BlobCacheSet = set; disp->BlobCacheGet = get; - drv->SetBlobCacheFuncsANDROID(disp, set, get); + disp->Driver->SetBlobCacheFuncsANDROID(disp, set, get); _eglUnlockDisplay(disp); } @@ -2713,7 +2711,7 @@ eglGetDisplayDriverConfig(EGLDisplay dpy) assert(disp->Extensions.MESA_query_driver); - ret = drv->QueryDriverConfig(disp); + ret = disp->Driver->QueryDriverConfig(disp); RETURN_EGL_EVAL(disp, ret); } @@ -2729,7 +2727,7 @@ eglGetDisplayDriverName(EGLDisplay dpy) assert(disp->Extensions.MESA_query_driver); - ret = drv->QueryDriverName(disp); + ret = disp->Driver->QueryDriverName(disp); RETURN_EGL_EVAL(disp, ret); } @@ -2803,8 +2801,8 @@ MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context, if (ret != MESA_GLINTEROP_SUCCESS) return ret; - if (drv->GLInteropQueryDeviceInfo) - ret = drv->GLInteropQueryDeviceInfo(disp, ctx, out); + if (disp->Driver->GLInteropQueryDeviceInfo) + ret = disp->Driver->GLInteropQueryDeviceInfo(disp, ctx, out); else ret = MESA_GLINTEROP_UNSUPPORTED; @@ -2826,8 +2824,8 @@ MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context, if (ret != MESA_GLINTEROP_SUCCESS) return ret; - if (drv->GLInteropExportObject) - ret = drv->GLInteropExportObject(disp, ctx, in, out); + if (disp->Driver->GLInteropExportObject) + ret = disp->Driver->GLInteropExportObject(disp, ctx, in, out); else ret = MESA_GLINTEROP_UNSUPPORTED; -- 2.30.2