Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(869)

Unified Diff: ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc

Issue 1262043002: Implement DRM Native Pixmap using prime buffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-master
Patch Set: remove drm header Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/BUILD.gn ('k') | ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
diff --git a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc b/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
index 3bf453c44b047e88f5f5a5c539ee170417d52e15..284b50b7978ddb611a055bd2b5b61095f268cca5 100644
--- a/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
+++ b/ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc
@@ -8,12 +8,9 @@
#include "base/macros.h"
#include "ui/gfx/native_pixmap_handle_ozone.h"
+#include "ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h"
#include "ui/ozone/public/client_native_pixmap_factory.h"
-#if defined(USE_VGEM_MAP)
-#include "ui/ozone/platform/drm/common/client_native_pixmap_vgem.h"
-#endif
-
namespace ui {
namespace {
@@ -39,14 +36,6 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
~ClientNativePixmapFactoryGbm() override {}
// ClientNativePixmapFactory:
- void Initialize(base::ScopedFD device_fd) override {
-#if defined(USE_VGEM_MAP)
- // It's called in IO thread. We rely on clients for thread-safety.
- // Switching to an IPC message filter ensures thread-safety.
- DCHECK_LT(vgem_fd_.get(), 0);
- vgem_fd_ = std::move(device_fd);
-#endif
- }
bool IsConfigurationSupported(gfx::BufferFormat format,
gfx::BufferUsage usage) const override {
switch (usage) {
@@ -58,11 +47,7 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
format == gfx::BufferFormat::BGRX_8888;
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT: {
-#if defined(USE_VGEM_MAP)
- return vgem_fd_.is_valid() && format == gfx::BufferFormat::BGRA_8888;
-#else
- return false;
-#endif
+ return format == gfx::BufferFormat::BGRA_8888;
}
}
NOTREACHED();
@@ -77,15 +62,8 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
switch (usage) {
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
-#if defined(USE_VGEM_MAP)
- // A valid |vgem_fd_| is required to acquire a VGEM bo. |vgem_fd_| is
- // set before a widget is created.
- DCHECK_GE(vgem_fd_.get(), 0);
- return ClientNativePixmapVgem::ImportFromDmabuf(
- vgem_fd_.get(), scoped_fd.get(), size, handle.stride);
-#endif
- NOTREACHED();
- return nullptr;
+ return ClientNativePixmapDmaBuf::ImportFromDmabuf(
+ scoped_fd.get(), size, handle.stride);
case gfx::BufferUsage::GPU_READ:
case gfx::BufferUsage::SCANOUT:
return make_scoped_ptr<ClientNativePixmapGbm>(
@@ -95,11 +73,6 @@ class ClientNativePixmapFactoryGbm : public ClientNativePixmapFactory {
return nullptr;
}
- private:
-#if defined(USE_VGEM_MAP)
- base::ScopedFD vgem_fd_;
-#endif
-
DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapFactoryGbm);
};
« no previous file with comments | « ui/ozone/platform/drm/BUILD.gn ('k') | ui/ozone/platform/drm/common/client_native_pixmap_dmabuf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698