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

Unified Diff: ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h

Issue 1134993003: ozone: Implement zero/one-copy texture for Ozone GBM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve reveman's concerns Created 5 years, 4 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
Index: ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h
diff --git a/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h b/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h
new file mode 100644
index 0000000000000000000000000000000000000000..54b137af31f0c23e997ae5ef440b3400395ad9ca
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/client_native_pixmap_vgem.h
@@ -0,0 +1,54 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_
+
+#include "base/file_descriptor_posix.h"
+#include "ui/gfx/buffer_types.h"
+#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/native_pixmap_handle_ozone.h"
+#include "ui/ozone/public/client_native_pixmap.h"
+
+namespace ui {
+
+class ClientNativePixmapVgem : public ClientNativePixmap {
+ public:
+ static scoped_ptr<ClientNativePixmap> Create(
+ const gfx::NativePixmapHandle& handle,
+ const base::FileDescriptor& vgem_handle,
+ const gfx::Size& size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage);
+
+ ~ClientNativePixmapVgem() override;
+
+ // Overridden from ClientNativePixmap.
+ bool Map(void** data) override;
+ void Unmap() override;
+ void GetStride(int* stride) const override;
+
+ private:
+ ClientNativePixmapVgem(const gfx::NativePixmapHandle& handle,
+ const base::FileDescriptor& vgem_handle,
+ const gfx::Size& size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ uint32_t vgem_bo_handle);
+
+ base::ScopedFD dma_buf_;
reveman 2015/08/07 14:35:16 what is this used for?
dshwang 2015/08/07 15:36:46 Client should keep dmabuf fd and close it after vg
reveman 2015/08/07 17:59:44 drmPrimeFDToHandle doesn't dup the fd? That's a bi
dshwang 2015/08/11 17:44:56 you are right. Don't need to keep dmabuf fd. remov
+ base::FileDescriptor vgem_fd_;
+ gfx::Size size_;
+ gfx::BufferFormat format_;
reveman 2015/08/07 14:35:16 where is this used?
dshwang 2015/08/07 15:36:46 Removed.
+ gfx::BufferUsage usage_;
reveman 2015/08/07 14:35:16 what do we need this for?
dshwang 2015/08/07 15:36:46 Removed.
+ uint32_t vgem_bo_handle_;
+ int stride_;
+ void* mmap_ptr_;
reveman 2015/08/07 14:35:16 s/mmap_ptr_/data_/ ?
dshwang 2015/08/07 15:36:46 Done.
+
+ DISALLOW_COPY_AND_ASSIGN(ClientNativePixmapVgem);
+};
+
+} // namespace ui
+
+#endif // UI_OZONE_PLATFORM_DRM_GPU_CLIENT_NATIVE_PIXMAP_VGEM_H_

Powered by Google App Engine
This is Rietveld 408576698