Skip to content

Commit

Permalink
Cherry-pick 267070@main (75237ef). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=260431

    [GTK][WPE] Pass GBM_BO_USE_RENDERING to gbm_bo_create
    https://bugs.webkit.org/show_bug.cgi?id=260431

    Reviewed by Michael Catanzaro.

    I suspect nvidia GBM implementation defaults to GBM_BO_USE_SCANOUT when
    no flags are passed and then tries to create KMS dumb buffers. In any
    case, using GBM_BO_USE_RENDERING is correct since those buffers are
    created in the web process for rendering (as a color buffer storage).

    * Source/WebCore/platform/graphics/gbm/GBMBufferSwapchain.cpp:
    (WebCore::GBMBufferSwapchain::getBuffer):
    * Source/WebKit/WebProcess/WebPage/gtk/AcceleratedSurfaceDMABuf.cpp:
    (WebKit::AcceleratedSurfaceDMABuf::RenderTargetEGLImage::create):

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

Canonical link: https://commits.webkit.org/266719.25@webkitglib/2.42
  • Loading branch information
carlosgcampos authored and mcatanzaro committed Aug 28, 2023
1 parent 13de864 commit 20cfdaf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ RefPtr<GBMBufferSwapchain::Buffer> GBMBufferSwapchain::getBuffer(const BufferDes
buffer->m_planes[i].height = description.format.planeHeight(i, description.height);
}

uint32_t boFlags = 0;
uint32_t boFlags = GBM_BO_USE_RENDERING;
if (description.flags & BufferDescription::LinearStorage)
boFlags |= GBM_BO_USE_LINEAR;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ std::unique_ptr<AcceleratedSurfaceDMABuf::RenderTarget> AcceleratedSurfaceDMABuf
WTFLogAlways("Failed to create GBM buffer of size %dx%d: no GBM device found", size.width(), size.height());
return { };
}
auto* bo = gbm_bo_create(device, size.width(), size.height(), uint32_t(WebCore::DMABufFormat::FourCC::ARGB8888), 0);
auto* bo = gbm_bo_create(device, size.width(), size.height(), uint32_t(WebCore::DMABufFormat::FourCC::ARGB8888), GBM_BO_USE_RENDERING);
if (!bo) {
WTFLogAlways("Failed to create GBM buffer of size %dx%d: %s", size.width(), size.height(), safeStrerror(errno).data());
return { };
Expand Down

0 comments on commit 20cfdaf

Please sign in to comment.