Chromium Code Reviews| 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 |