From 61879d2c53a0473a24b4a9a69fcedd1af8f74fdf Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Tue, 7 Jun 2022 11:19:41 +0200 Subject: Enabled VA-API by default (+ added VA-API fixes from upstream), Fixed WebGL performance on NVIDIA drivers (mzbz#1735929) --- D147635.diff | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 D147635.diff (limited to 'D147635.diff') diff --git a/D147635.diff b/D147635.diff new file mode 100644 index 0000000..1d4bb58 --- /dev/null +++ b/D147635.diff @@ -0,0 +1,125 @@ +diff --git a/gfx/gl/GLLibraryEGL.h b/gfx/gl/GLLibraryEGL.h +--- a/gfx/gl/GLLibraryEGL.h ++++ b/gfx/gl/GLLibraryEGL.h +@@ -106,10 +106,13 @@ + KHR_swap_buffers_with_damage, + EXT_buffer_age, + KHR_partial_update, + NV_robustness_video_memory_purge, + MESA_platform_surfaceless, ++ EXT_image_dma_buf_import, ++ EXT_image_dma_buf_import_modifiers, ++ MESA_image_dma_buf_export, + Max + }; + + // - + +@@ -461,10 +464,23 @@ + // EGL_KHR_partial_update + EGLBoolean fSetDamageRegion(EGLDisplay dpy, EGLSurface surface, + const EGLint* rects, EGLint n_rects) { + WRAP(fSetDamageRegion(dpy, surface, rects, n_rects)); + } ++ // EGL_MESA_image_dma_buf_export ++ EGLBoolean fExportDMABUFImageQuery(EGLDisplay dpy, EGLImage image, ++ int* fourcc, int* num_planes, ++ uint64_t* modifiers) { ++ WRAP( ++ fExportDMABUFImageQueryMESA(dpy, image, fourcc, num_planes, modifiers)); ++ } ++ EGLBoolean fExportDMABUFImage(EGLDisplay dpy, EGLImage image, int* fds, ++ EGLint* strides, EGLint* offsets) { ++ WRAP(fExportDMABUFImageMESA(dpy, image, fds, strides, offsets)); ++ } ++ ++#undef WRAP + + #undef WRAP + #undef PROFILE_CALL + #undef BEFORE_CALL + #undef AFTER_CALL +@@ -593,10 +609,22 @@ + EGLBoolean(GLAPIENTRY* fSetDamageRegion)(EGLDisplay dpy, EGLSurface surface, + const EGLint* rects, + EGLint n_rects); + EGLClientBuffer(GLAPIENTRY* fGetNativeClientBufferANDROID)( + const struct AHardwareBuffer* buffer); ++ ++ // EGL_MESA_image_dma_buf_export ++ EGLBoolean(GLAPIENTRY* fExportDMABUFImageQueryMESA)(EGLDisplay dpy, ++ EGLImage image, ++ int* fourcc, ++ int* num_planes, ++ uint64_t* modifiers); ++ EGLBoolean(GLAPIENTRY* fExportDMABUFImageMESA)(EGLDisplay dpy, ++ EGLImage image, int* fds, ++ EGLint* strides, ++ EGLint* offsets); ++ + } mSymbols = {}; + }; + + class EglDisplay final { + public: +@@ -852,10 +880,23 @@ + EGLBoolean fSetDamageRegion(EGLSurface surface, const EGLint* rects, + EGLint n_rects) { + MOZ_ASSERT(IsExtensionSupported(EGLExtension::KHR_partial_update)); + return mLib->fSetDamageRegion(mDisplay, surface, rects, n_rects); + } ++ ++ EGLBoolean fExportDMABUFImageQuery(EGLImage image, int* fourcc, ++ int* num_planes, ++ uint64_t* modifiers) const { ++ MOZ_ASSERT(IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export)); ++ return mLib->fExportDMABUFImageQuery(mDisplay, image, fourcc, num_planes, ++ modifiers); ++ } ++ EGLBoolean fExportDMABUFImage(EGLImage image, int* fds, EGLint* strides, ++ EGLint* offsets) const { ++ MOZ_ASSERT(IsExtensionSupported(EGLExtension::MESA_image_dma_buf_export)); ++ return mLib->fExportDMABUFImage(mDisplay, image, fds, strides, offsets); ++ } + }; + + } /* namespace gl */ + } /* namespace mozilla */ + +diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp +--- a/gfx/gl/GLLibraryEGL.cpp ++++ b/gfx/gl/GLLibraryEGL.cpp +@@ -82,11 +82,14 @@ + "EGL_EXT_swap_buffers_with_damage", + "EGL_KHR_swap_buffers_with_damage", + "EGL_EXT_buffer_age", + "EGL_KHR_partial_update", + "EGL_NV_robustness_video_memory_purge", +- "EGL_MESA_platform_surfaceless"}; ++ "EGL_MESA_platform_surfaceless", ++ "EGL_EXT_image_dma_buf_import", ++ "EGL_EXT_image_dma_buf_import_modifiers", ++ "EGL_MESA_image_dma_buf_export"}; + + PRLibrary* LoadApitraceLibrary() { + const char* path = nullptr; + + #ifdef ANDROID +@@ -647,10 +650,16 @@ + { + const SymLoadStruct symbols[] = {SYMBOL(GetPlatformDisplay), + END_OF_SYMBOLS}; + (void)fnLoadSymbols(symbols); + } ++ { ++ const SymLoadStruct symbols[] = {SYMBOL(ExportDMABUFImageQueryMESA), ++ SYMBOL(ExportDMABUFImageMESA), ++ END_OF_SYMBOLS}; ++ (void)fnLoadSymbols(symbols); ++ } + + return true; + } + + // - + -- cgit