| Summary: | [GTK][WPE] Use drm render nodes in GbmDevice and make the fd global to the process | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Alejandro G. Castro <alex> | ||||||
| Component: | ANGLE | Assignee: | Alejandro G. Castro <alex> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | clord, dino, kbr, kkinnunen, webkit-bug-importer, zan, zdobersek | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 237649 | ||||||||
| Attachments: |
|
||||||||
|
Description
Alejandro G. Castro
2022-02-14 13:14:42 PST
Created attachment 451937 [details]
Patch
Comment on attachment 451937 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451937&action=review > Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:61 > + if (globalFd == -1) > + getDeviceFd(); This is now open to cross-thread race conditions. > Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:75 > -int GBMDevice::getDeviceFd() > +void GBMDevice::getDeviceFd() This should be moved out into a standalone static function that internally uses std::call_once() to protect against separate threads racing to open the render node. Comment on attachment 451937 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=451937&action=review > Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:81 > if (numDevices <=0) Poor spacing. > Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:89 > + globalFd = open(device->nodes[DRM_NODE_RENDER], O_RDWR); O_CLOEXEC should also be used. (In reply to Zan Dobersek from comment #2) > Comment on attachment 451937 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=451937&action=review > > > Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:61 > > + if (globalFd == -1) > > + getDeviceFd(); > > This is now open to cross-thread race conditions. > Good point, we need to protect the first access. > > Source/WebCore/platform/graphics/gbm/GBMDevice.cpp:75 > > -int GBMDevice::getDeviceFd() > > +void GBMDevice::getDeviceFd() > > This should be moved out into a standalone static function that internally > uses std::call_once() to protect against separate threads racing to open the > render node. Thanks for the comments! I'll update the patch. Created attachment 452063 [details]
Patch
Comment on attachment 452063 [details]
Patch
Great, thanks.
Committed r289885 (247323@main): <https://commits.webkit.org/247323@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 452063 [details]. |