WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-236607-20220214222201.patch (text/plain), 3.36 KB, created by
Alejandro G. Castro
on 2022-02-14 13:22:02 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alejandro G. Castro
Created:
2022-02-14 13:22:02 PST
Size:
3.36 KB
patch
obsolete
>Subversion Revision: 289737 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f8e76531ef93eb0c9f1b16c535099d1e0751658f..dfaf5be94f113d911426f2627d5688a73dd5d68a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2022-02-14 Alejandro G. Castro <alex@igalia.com> >+ >+ [GTK][WPE] Use drm render nodes in GbmDevice and make the fd global to the process >+ https://bugs.webkit.org/show_bug.cgi?id=236607 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We are creating a global static variable to handle the fd of the >+ device in the process, to make sure we search and open once for >+ the graphics device. Also we are using the DRM_NODE_RENDER because >+ we do not need the primary device for the operations we expect to >+ use. >+ >+ No new tests, already covered in the tests. >+ >+ * platform/graphics/gbm/GBMDevice.cpp: >+ (WebCore::GBMDevice::GBMDevice): Use a new global fd. >+ (WebCore::GBMDevice::getDeviceFd): We do not return the file descriptor. >+ * platform/graphics/gbm/GBMDevice.h: Ditto. >+ > 2022-02-14 Frédéric Wang <fwang@igalia.com> > > Nullptr crash in CompositeEditCommand::splitTreeToNode via InsertParagraphSeparatorCommand::doApply >diff --git a/Source/WebCore/platform/graphics/gbm/GBMDevice.cpp b/Source/WebCore/platform/graphics/gbm/GBMDevice.cpp >index d3f6c31e30c559b97e639fe48c73a9967c3ebc56..66aa03ed71f86d0ab9aa9ee953856f49b5dfcc8a 100644 >--- a/Source/WebCore/platform/graphics/gbm/GBMDevice.cpp >+++ b/Source/WebCore/platform/graphics/gbm/GBMDevice.cpp >@@ -53,11 +53,15 @@ const GBMDevice& GBMDevice::get() > return *threadSpecificDevice(); > } > >+static int globalFd { -1 }; >+ > GBMDevice::GBMDevice() > { >- int fd = getDeviceFd(); >- if (fd >= 0) >- m_device = gbm_create_device(fd); >+ if (globalFd == -1) >+ getDeviceFd(); >+ >+ if (globalFd >= 0) >+ m_device = gbm_create_device(globalFd); > } > > GBMDevice::~GBMDevice() >@@ -68,27 +72,26 @@ GBMDevice::~GBMDevice() > } > } > >-int GBMDevice::getDeviceFd() >+void GBMDevice::getDeviceFd() > { > drmDevicePtr devices[64]; > memset(devices, 0, sizeof(devices)); > > int numDevices = drmGetDevices2(0, devices, WTF_ARRAY_LENGTH(devices)); > if (numDevices <=0) >- return -1; >+ return; > >- int fd = -1; > for (int i = 0; i < numDevices; ++i) { > drmDevice* device = devices[i]; >- if (!(device->available_nodes & (1 << DRM_NODE_PRIMARY))) >+ if (!(device->available_nodes & (1 << DRM_NODE_RENDER))) > continue; > >- fd = open(device->nodes[DRM_NODE_PRIMARY], O_RDWR); >- if (fd < 0) >- continue; >+ globalFd = open(device->nodes[DRM_NODE_RENDER], O_RDWR); >+ if (globalFd >= 0) >+ break; > } > >- return fd; >+ drmFreeDevices(devices, numDevices); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/gbm/GBMDevice.h b/Source/WebCore/platform/graphics/gbm/GBMDevice.h >index 5ce52fea76825d3c7a04b3fb32383df5cc54eae6..5f5fb69a7797782f44b7c492f723fdb89d44fd11 100644 >--- a/Source/WebCore/platform/graphics/gbm/GBMDevice.h >+++ b/Source/WebCore/platform/graphics/gbm/GBMDevice.h >@@ -44,7 +44,7 @@ public: > struct gbm_device* device() const { return m_device; } > > private: >- int getDeviceFd(); >+ void getDeviceFd(); > > struct gbm_device* m_device { nullptr }; > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 236607
:
451937
|
452063