| Index: ui/ozone/platform/drm/gbm_surface_factory.cc
|
| diff --git a/ui/ozone/platform/drm/gbm_surface_factory.cc b/ui/ozone/platform/drm/gbm_surface_factory.cc
|
| index afe8d2cb6644f929ee2bda09965fbf291c5e95f6..189593c747457b343faf6e15f9a722e2976bc44d 100644
|
| --- a/ui/ozone/platform/drm/gbm_surface_factory.cc
|
| +++ b/ui/ozone/platform/drm/gbm_surface_factory.cc
|
| @@ -150,15 +150,14 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
|
| gfx::AcceleratedWidget widget,
|
| gfx::Size size,
|
| BufferFormat format,
|
| - BufferUsage usage) {
|
| - if (usage == MAP)
|
| - return nullptr;
|
| -
|
| + BufferUsage usage,
|
| + gfx::GpuMemoryBufferHandle* handle) {
|
| + DCHECK(handle || usage == SCANOUT);
|
| scoped_refptr<GbmDevice> gbm = GetGbmDevice(widget);
|
| DCHECK(gbm);
|
|
|
| scoped_refptr<GbmBuffer> buffer =
|
| - GbmBuffer::CreateBuffer(gbm, format, size, true);
|
| + GbmBuffer::CreateBuffer(gbm, format, size, usage == SCANOUT);
|
| if (!buffer.get())
|
| return nullptr;
|
|
|
| @@ -166,6 +165,11 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
|
| if (!pixmap->Initialize())
|
| return nullptr;
|
|
|
| + if (usage == MAP) {
|
| + DCHECK(handle);
|
| + pixmap->ExportDmaBuf(drm_device_manager_->GetVgemDevice(), handle);
|
| + }
|
| +
|
| return pixmap;
|
| }
|
|
|
| @@ -202,7 +206,6 @@ bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() {
|
| bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) {
|
| switch (usage) {
|
| case MAP:
|
| - return false;
|
| case SCANOUT:
|
| return true;
|
| }
|
|
|