⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 275041 in webkit


Ignore:
Timestamp:
Mar 25, 2021, 10:06:19 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r274354 - [GTK] GTK4 crashes with XVFB: GLXBadWindow
https://bugs.webkit.org/show_bug.cgi?id=223108

Reviewed by Žan Doberšek.

Source/WebCore:

  • platform/graphics/x11/PlatformDisplayX11.cpp:

(WebCore::PlatformDisplayX11::supportsGLX const): Check if GLX extension is supported and return the base error code.

  • platform/graphics/x11/PlatformDisplayX11.h:

Source/WebKit:

Handle GLXBadWindow errors in AcceleratedBackingStoreX11.

  • UIProcess/gtk/AcceleratedBackingStoreX11.cpp:

(WebKit::AcceleratedBackingStoreX11::checkRequirements):
(WebKit::glxErrorCode):
(WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
(WebKit::AcceleratedBackingStoreX11::update):

Location:
releases/WebKitGTK/webkit-2.32/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog

    r275029 r275041  
     12021-03-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] GTK4 crashes with XVFB: GLXBadWindow
     4        https://bugs.webkit.org/show_bug.cgi?id=223108
     5
     6        Reviewed by Žan Doberšek.
     7
     8        * platform/graphics/x11/PlatformDisplayX11.cpp:
     9        (WebCore::PlatformDisplayX11::supportsGLX const): Check if GLX extension is supported and return the base error code.
     10        * platform/graphics/x11/PlatformDisplayX11.h:
     11
    1122021-03-24  Zan Dobersek  <zdobersek@igalia.com>
    213
  • releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp

    r271220 r275041  
    4040#include <EGL/egl.h>
    4141#include <EGL/eglext.h>
     42#endif
     43
     44#if USE(GLX)
     45#include <GL/glx.h>
    4246#endif
    4347
     
    126130}
    127131
     132bool PlatformDisplayX11::supportsGLX(Optional<int>& glxErrorBase) const
     133{
     134#if USE(GLX)
     135    if (!m_supportsGLX) {
     136        m_supportsGLX = false;
     137        if (m_display) {
     138            int eventBase, errorBase;
     139            m_supportsGLX = glXQueryExtension(m_display, &errorBase, &eventBase);
     140            if (m_supportsGLX.value())
     141                m_glxErrorBase = errorBase;
     142        }
     143    }
     144
     145    glxErrorBase = m_glxErrorBase;
     146    return m_supportsGLX.value();
     147#else
     148    return false;
     149#endif
     150}
     151
    128152void* PlatformDisplayX11::visual() const
    129153{
  • releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h

    r267024 r275041  
    5050    bool supportsXComposite() const;
    5151    bool supportsXDamage(Optional<int>& damageEventBase, Optional<int>& damageErrorBase) const;
     52    bool supportsGLX(Optional<int>& glxErrorBase) const;
    5253
    5354private:
     
    6566    mutable Optional<int> m_damageEventBase;
    6667    mutable Optional<int> m_damageErrorBase;
     68#if USE(GLX)
     69    mutable Optional<bool> m_supportsGLX;
     70    mutable Optional<int> m_glxErrorBase;
     71#endif
    6772    mutable void* m_visual { nullptr };
    6873};
  • releases/WebKitGTK/webkit-2.32/Source/WebKit/ChangeLog

    r275026 r275041  
     12021-03-12  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] GTK4 crashes with XVFB: GLXBadWindow
     4        https://bugs.webkit.org/show_bug.cgi?id=223108
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Handle GLXBadWindow errors in AcceleratedBackingStoreX11.
     9
     10        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
     11        (WebKit::AcceleratedBackingStoreX11::checkRequirements):
     12        (WebKit::glxErrorCode):
     13        (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
     14        (WebKit::AcceleratedBackingStoreX11::update):
     15
    1162021-03-24  Pablo Saavedra  <psaavedra@igalia.com>
    217
  • releases/WebKitGTK/webkit-2.32/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp

    r267398 r275041  
    4747#include <wtf/NeverDestroyed.h>
    4848
     49#if USE(GLX)
     50#include <X11/Xproto.h>
     51#include <GL/glxproto.h>
     52#endif
     53
    4954namespace WebKit {
    5055
    5156static Optional<int> s_damageEventBase;
    5257static Optional<int> s_damageErrorBase;
     58#if USE(GLX)
     59static Optional<int> s_glxErrorBase;
     60#endif
    5361
    5462class XDamageNotifier {
     
    136144{
    137145    auto& display = downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay());
     146#if USE(GLX)
     147    // GLX is optional, he we just want the error base.
     148    display.supportsGLX(s_glxErrorBase);
     149#endif
    138150    return display.supportsXComposite() && display.supportsXDamage(s_damageEventBase, s_damageErrorBase);
    139151}
     
    156168}
    157169
     170#if USE(GLX)
     171static inline unsigned char glxErrorCode(unsigned char errorCode)
     172{
     173    ASSERT(s_glxErrorBase);
     174    return static_cast<unsigned>(s_glxErrorBase.value()) + errorCode;
     175}
     176#endif
     177
    158178AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11()
    159179{
     
    162182
    163183    Display* display = downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()).native();
    164     WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, { BadDrawable, xDamageErrorCode(BadDamage) });
     184    Vector<unsigned char> errorList = { BadDrawable, xDamageErrorCode(BadDamage) };
     185#if USE(GLX)
     186    if (s_glxErrorBase)
     187        errorList.append(glxErrorCode(GLXBadWindow));
     188#endif
     189    WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, WTFMove(errorList));
    165190    if (m_damage) {
    166191        XDamageNotifier::singleton().remove(m_damage.get());
     
    179204
    180205    if (m_surface) {
    181         WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, { BadDrawable, xDamageErrorCode(BadDamage) });
     206        Vector<unsigned char> errorList = { BadDrawable, xDamageErrorCode(BadDamage) };
     207#if USE(GLX)
     208        if (s_glxErrorBase)
     209            errorList.append(glxErrorCode(GLXBadWindow));
     210#endif
     211        WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, WTFMove(errorList));
    182212        if (m_damage) {
    183213            XDamageNotifier::singleton().remove(m_damage.get());
     
    199229    size.scale(deviceScaleFactor);
    200230
    201     WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, { BadDrawable, xDamageErrorCode(BadDamage) });
     231    Vector<unsigned char> errorList = { BadDrawable, xDamageErrorCode(BadDamage) };
     232#if USE(GLX)
     233    if (s_glxErrorBase)
     234        errorList.append(glxErrorCode(GLXBadWindow));
     235#endif
     236    WebCore::XErrorTrapper trapper(display, WebCore::XErrorTrapper::Policy::Crash, WTFMove(errorList));
    202237    ASSERT(downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()).native() == gdk_x11_display_get_xdisplay(gdk_display_get_default()));
    203238#if USE(GTK4)
Note: See TracChangeset for help on using the changeset viewer.