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

Unified Diff: ui/ozone/platform/drm/gpu/hardware_display_plane.cc

Issue 1314553002: Move Format checks to HardwareDisplayPlane (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/hardware_display_plane.cc
diff --git a/ui/ozone/platform/drm/gpu/hardware_display_plane.cc b/ui/ozone/platform/drm/gpu/hardware_display_plane.cc
index 779f3d660417ab2bc845a890e1d361ccd9fe4d32..f4bde4827ee52ea40af3f42728ee0e1c3406bb6f 100644
--- a/ui/ozone/platform/drm/gpu/hardware_display_plane.cc
+++ b/ui/ozone/platform/drm/gpu/hardware_display_plane.cc
@@ -5,6 +5,8 @@
#include "ui/ozone/platform/drm/gpu/hardware_display_plane.h"
#include <drm.h>
+#include <gbm.h>
dnicoara 2015/08/25 19:27:16 The bots are not going to like this include since
kalyank 2015/08/26 08:42:42 Done.
kalyank 2015/08/26 08:42:42 GBM_BO_FORMAT_* are enum values. We have GBM_FORMA
+#include <drm/drm_fourcc.h>
#include <xf86drm.h>
#include "base/logging.h"
@@ -31,7 +33,28 @@ bool HardwareDisplayPlane::Initialize(DrmDevice* drm,
}
bool HardwareDisplayPlane::IsSupportedFormat(uint32_t format) const {
- return true;
+ uint32_t format_type = 0;
kalyank 2015/08/24 17:22:00 Depends on https://codereview.chromium.org/1294113
+ switch (format) {
+ case GBM_BO_FORMAT_ARGB8888: {
+ // We create a FB of 24 bit color depth.
+ format_type = DRM_FORMAT_XRGB8888;
+ break;
+ }
+ case GBM_BO_FORMAT_XRGB8888: {
+ format_type = DRM_FORMAT_XRGB8888;
+ break;
+ }
+ default:
+ NOTREACHED();
+ return false;
dnicoara 2015/08/25 19:27:16 drm_buffer.cc needs to also be updated to return t
kalyank 2015/08/26 08:42:42 Done.
+ }
+
+ for (auto& element : supported_formats_) {
+ if (element == format_type)
+ return true;
+ }
+
+ return false;
}
} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/gpu/hardware_display_plane.h ('k') | ui/ozone/platform/drm/gpu/hardware_display_plane_atomic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698