Skip to content

Conversation

@carlosgcampos
Copy link
Contributor

@carlosgcampos carlosgcampos commented Apr 15, 2024

f78822d

[WPE] WPE Platform: change the API to get the preferred DMA-BUF formats
https://bugs.webkit.org/show_bug.cgi?id=272667

Reviewed by Alejandro G. Castro.

The initial API we added was very simple, just providing a single list
of formats, usages and modifiers, but it turned out it was not so simple
to iterate the formats, since we always want to iterate by tranche.
Also, we want to handle the main and target devices in the future, so we
need a new API that simplifies the iteration by tranche and includes the
devices.

* Source/WebKit/Shared/glib/DMABufRendererBufferFormat.h:
(WebKit::DMABufRendererBufferFormat::operator== const): Deleted.
* Source/WebKit/Shared/glib/DMABufRendererBufferFormat.serialization.in:
* Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::preferredBufferFormats const):
* Source/WebKit/WPEPlatform/CMakeLists.txt:
* Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormat.cpp: Removed.
* Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormat.h: Removed.
* Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormats.cpp: Added.
(DMABufFormat::DMABufFormat):
(DMABufFormatsGroup::DMABufFormatsGroup):
(wpe_buffer_dma_buf_formats_class_init):
(wpe_buffer_dma_buf_formats_get_device):
(wpe_buffer_dma_buf_formats_get_n_groups):
(wpe_buffer_dma_buf_formats_get_group_usage):
(wpe_buffer_dma_buf_formats_get_group_device):
(wpe_buffer_dma_buf_formats_get_group_n_formats):
(wpe_buffer_dma_buf_formats_get_format_fourcc):
(wpe_buffer_dma_buf_formats_get_format_modifiers):
(_WPEBufferDMABufFormatsBuilder::_WPEBufferDMABufFormatsBuilder):
(wpe_buffer_dma_buf_formats_builder_new):
(wpe_buffer_dma_buf_formats_builder_ref):
(wpe_buffer_dma_buf_formats_builder_unref):
(wpe_buffer_dma_buf_formats_builder_append_group):
(wpe_buffer_dma_buf_formats_builder_append_format):
(wpe_buffer_dma_buf_formats_builder_end):
* Source/WebKit/WPEPlatform/wpe/WPEDisplay.cpp:
(wpeDisplayDispose):
(wpeDisplayPreferredDMABufFormats):
(wpe_display_get_preferred_dma_buf_formats):
* Source/WebKit/WPEPlatform/wpe/WPEDisplay.h:
* Source/WebKit/WPEPlatform/wpe/WPEView.cpp:
(wpe_view_class_init):
(wpe_view_get_preferred_dma_buf_formats):
(wpeViewDispose): Deleted.
* Source/WebKit/WPEPlatform/wpe/WPEView.h:
* Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp:
(wpeDisplayDRMGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/headless/WPEDisplayHeadless.cpp:
(wpeDisplayHeadlessGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/wayland/WPEDisplayWayland.cpp:
(wpeDisplayWaylandGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/wayland/WPEViewWayland.cpp:
(DMABufFeedback::DMABufFeedback):
(DMABufFeedback::drmDeviceForUsage):
(DMABufFeedback::drmDevice const):
(DMABufFeedback::Tranche::Tranche):
(DMABufFeedback::Tranche::drmDevice const):
(wpeViewWaylandGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/wpe-platform.h:
* Source/WebKit/WebProcess/WebPage/dmabuf/AcceleratedSurfaceDMABuf.cpp:
(WebKit::AcceleratedSurfaceDMABuf::RenderTargetEGLImage::create):
(WebKit::AcceleratedSurfaceDMABuf::SwapChain::setupBufferFormat):
* Source/WebKit/WebProcess/WebPage/dmabuf/AcceleratedSurfaceDMABuf.h:

Canonical link: https://commits.webkit.org/277538@main

08fb2b3

Misc iOS, tvOS & watchOS macOS Linux Windows
❌ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ❌ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 🧪 api-mac ✅ 🧪 api-wpe
🧪 ios-wk2-wpt ✅ 🛠 wpe-skia
🧪 api-ios 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 tv 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 tv-sim ✅ 🧪 api-gtk
✅ 🛠 watch
✅ 🛠 🧪 unsafe-merge ✅ 🛠 watch-sim

@carlosgcampos carlosgcampos requested review from a team, cdumez and zdobersek as code owners April 15, 2024 12:32
@carlosgcampos carlosgcampos self-assigned this Apr 15, 2024
@carlosgcampos carlosgcampos added the WPE WebKit WebKit WPE component label Apr 15, 2024
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 15, 2024
@carlosgcampos carlosgcampos removed the merging-blocked Applied to prevent a change from being merged label Apr 15, 2024
@carlosgcampos carlosgcampos force-pushed the wpe-platform-dmabuf-feedback-api branch from fdcb30e to dce70cd Compare April 15, 2024 13:23
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 15, 2024
Copy link
Contributor

@alexgcastro alexgcastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great addition.

@carlosgcampos carlosgcampos removed the merging-blocked Applied to prevent a change from being merged label Apr 16, 2024
@carlosgcampos carlosgcampos force-pushed the wpe-platform-dmabuf-feedback-api branch from dce70cd to 08fb2b3 Compare April 16, 2024 09:30
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Apr 16, 2024
@carlosgcampos carlosgcampos added unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed merging-blocked Applied to prevent a change from being merged labels Apr 16, 2024
https://bugs.webkit.org/show_bug.cgi?id=272667

Reviewed by Alejandro G. Castro.

The initial API we added was very simple, just providing a single list
of formats, usages and modifiers, but it turned out it was not so simple
to iterate the formats, since we always want to iterate by tranche.
Also, we want to handle the main and target devices in the future, so we
need a new API that simplifies the iteration by tranche and includes the
devices.

* Source/WebKit/Shared/glib/DMABufRendererBufferFormat.h:
(WebKit::DMABufRendererBufferFormat::operator== const): Deleted.
* Source/WebKit/Shared/glib/DMABufRendererBufferFormat.serialization.in:
* Source/WebKit/UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::preferredBufferFormats const):
* Source/WebKit/WPEPlatform/CMakeLists.txt:
* Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormat.cpp: Removed.
* Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormat.h: Removed.
* Source/WebKit/WPEPlatform/wpe/WPEBufferDMABufFormats.cpp: Added.
(DMABufFormat::DMABufFormat):
(DMABufFormatsGroup::DMABufFormatsGroup):
(wpe_buffer_dma_buf_formats_class_init):
(wpe_buffer_dma_buf_formats_get_device):
(wpe_buffer_dma_buf_formats_get_n_groups):
(wpe_buffer_dma_buf_formats_get_group_usage):
(wpe_buffer_dma_buf_formats_get_group_device):
(wpe_buffer_dma_buf_formats_get_group_n_formats):
(wpe_buffer_dma_buf_formats_get_format_fourcc):
(wpe_buffer_dma_buf_formats_get_format_modifiers):
(_WPEBufferDMABufFormatsBuilder::_WPEBufferDMABufFormatsBuilder):
(wpe_buffer_dma_buf_formats_builder_new):
(wpe_buffer_dma_buf_formats_builder_ref):
(wpe_buffer_dma_buf_formats_builder_unref):
(wpe_buffer_dma_buf_formats_builder_append_group):
(wpe_buffer_dma_buf_formats_builder_append_format):
(wpe_buffer_dma_buf_formats_builder_end):
* Source/WebKit/WPEPlatform/wpe/WPEDisplay.cpp:
(wpeDisplayDispose):
(wpeDisplayPreferredDMABufFormats):
(wpe_display_get_preferred_dma_buf_formats):
* Source/WebKit/WPEPlatform/wpe/WPEDisplay.h:
* Source/WebKit/WPEPlatform/wpe/WPEView.cpp:
(wpe_view_class_init):
(wpe_view_get_preferred_dma_buf_formats):
(wpeViewDispose): Deleted.
* Source/WebKit/WPEPlatform/wpe/WPEView.h:
* Source/WebKit/WPEPlatform/wpe/drm/WPEDisplayDRM.cpp:
(wpeDisplayDRMGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/headless/WPEDisplayHeadless.cpp:
(wpeDisplayHeadlessGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/wayland/WPEDisplayWayland.cpp:
(wpeDisplayWaylandGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/wayland/WPEViewWayland.cpp:
(DMABufFeedback::DMABufFeedback):
(DMABufFeedback::drmDeviceForUsage):
(DMABufFeedback::drmDevice const):
(DMABufFeedback::Tranche::Tranche):
(DMABufFeedback::Tranche::drmDevice const):
(wpeViewWaylandGetPreferredDMABufFormats):
* Source/WebKit/WPEPlatform/wpe/wpe-platform.h:
* Source/WebKit/WebProcess/WebPage/dmabuf/AcceleratedSurfaceDMABuf.cpp:
(WebKit::AcceleratedSurfaceDMABuf::RenderTargetEGLImage::create):
(WebKit::AcceleratedSurfaceDMABuf::SwapChain::setupBufferFormat):
* Source/WebKit/WebProcess/WebPage/dmabuf/AcceleratedSurfaceDMABuf.h:

Canonical link: https://commits.webkit.org/277538@main
@webkit-commit-queue webkit-commit-queue force-pushed the wpe-platform-dmabuf-feedback-api branch from 08fb2b3 to f78822d Compare April 16, 2024 11:50
@webkit-commit-queue
Copy link
Collaborator

Committed 277538@main (f78822d): https://commits.webkit.org/277538@main

Reviewed commits have been landed. Closing PR #27255 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit f78822d into WebKit:main Apr 16, 2024
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Apr 16, 2024
@carlosgcampos carlosgcampos deleted the wpe-platform-dmabuf-feedback-api branch April 16, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WPE WebKit WebKit WPE component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants