Changeset 274354 in webkit
- Timestamp:
- Mar 12, 2021, 7:02:28 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/x11/PlatformDisplayX11.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/x11/PlatformDisplayX11.h (modified) (2 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r274353 r274354 1 2021-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 1 12 2021-03-12 Antoine Quint <graouts@webkit.org> 2 13 -
trunk/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
r274273 r274354 43 43 #endif 44 44 45 #if USE(GLX) 46 #include <GL/glx.h> 47 #endif 48 45 49 #if USE(LCMS) 46 50 #include <lcms2.h> … … 129 133 damageErrorBase = m_damageErrorBase; 130 134 return m_supportsXDamage.value(); 135 } 136 137 bool PlatformDisplayX11::supportsGLX(Optional<int>& glxErrorBase) const 138 { 139 #if USE(GLX) 140 if (!m_supportsGLX) { 141 m_supportsGLX = false; 142 if (m_display) { 143 int eventBase, errorBase; 144 m_supportsGLX = glXQueryExtension(m_display, &errorBase, &eventBase); 145 if (m_supportsGLX.value()) 146 m_glxErrorBase = errorBase; 147 } 148 } 149 150 glxErrorBase = m_glxErrorBase; 151 return m_supportsGLX.value(); 152 #else 153 return false; 154 #endif 131 155 } 132 156 -
trunk/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h
r274273 r274354 50 50 bool supportsXComposite() const; 51 51 bool supportsXDamage(Optional<int>& damageEventBase, Optional<int>& damageErrorBase) const; 52 bool supportsGLX(Optional<int>& glxErrorBase) const; 52 53 53 54 private: … … 69 70 mutable Optional<int> m_damageEventBase; 70 71 mutable Optional<int> m_damageErrorBase; 72 #if USE(GLX) 73 mutable Optional<bool> m_supportsGLX; 74 mutable Optional<int> m_glxErrorBase; 75 #endif 71 76 mutable void* m_visual { nullptr }; 72 77 }; -
trunk/Source/WebKit/ChangeLog
r274330 r274354 1 2021-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 1 16 2021-03-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 17 -
trunk/Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
r267398 r274354 47 47 #include <wtf/NeverDestroyed.h> 48 48 49 #if USE(GLX) 50 #include <X11/Xproto.h> 51 #include <GL/glxproto.h> 52 #endif 53 49 54 namespace WebKit { 50 55 51 56 static Optional<int> s_damageEventBase; 52 57 static Optional<int> s_damageErrorBase; 58 #if USE(GLX) 59 static Optional<int> s_glxErrorBase; 60 #endif 53 61 54 62 class XDamageNotifier { … … 136 144 { 137 145 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 138 150 return display.supportsXComposite() && display.supportsXDamage(s_damageEventBase, s_damageErrorBase); 139 151 } … … 156 168 } 157 169 170 #if USE(GLX) 171 static 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 158 178 AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11() 159 179 { … … 162 182 163 183 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)); 165 190 if (m_damage) { 166 191 XDamageNotifier::singleton().remove(m_damage.get()); … … 179 204 180 205 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)); 182 212 if (m_damage) { 183 213 XDamageNotifier::singleton().remove(m_damage.get()); … … 199 229 size.scale(deviceScaleFactor); 200 230 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)); 202 237 ASSERT(downcast<WebCore::PlatformDisplayX11>(WebCore::PlatformDisplay::sharedDisplay()).native() == gdk_x11_display_get_xdisplay(gdk_display_get_default())); 203 238 #if USE(GTK4)
Note:
See TracChangeset
for help on using the changeset viewer.