| Index: ui/ozone/platform/drm/common/drm_util.cc
|
| diff --git a/ui/ozone/platform/drm/common/drm_util.cc b/ui/ozone/platform/drm/common/drm_util.cc
|
| index 57f3488fbc807d9b2058052f75843200806a7b16..78dbbc3c74699fe5f7d0dd4a9025f19f72be860e 100644
|
| --- a/ui/ozone/platform/drm/common/drm_util.cc
|
| +++ b/ui/ozone/platform/drm/common/drm_util.cc
|
| @@ -273,6 +273,10 @@ DisplaySnapshot_Params CreateDisplaySnapshotParams(
|
|
|
| int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
|
| switch (format) {
|
| + case gfx::BufferFormat::RGBA_8888:
|
| + return DRM_FORMAT_ABGR8888;
|
| + case gfx::BufferFormat::RGBX_8888:
|
| + return DRM_FORMAT_XBGR8888;
|
| case gfx::BufferFormat::BGRA_8888:
|
| return DRM_FORMAT_ARGB8888;
|
| case gfx::BufferFormat::BGRX_8888:
|
| @@ -287,6 +291,10 @@ int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) {
|
|
|
| gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) {
|
| switch (format) {
|
| + case DRM_FORMAT_ABGR8888:
|
| + return gfx::BufferFormat::RGBA_8888;
|
| + case DRM_FORMAT_XBGR8888:
|
| + return gfx::BufferFormat::RGBX_8888;
|
| case DRM_FORMAT_ARGB8888:
|
| return gfx::BufferFormat::BGRA_8888;
|
| case DRM_FORMAT_XRGB8888:
|
| @@ -298,4 +306,21 @@ gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) {
|
| return gfx::BufferFormat::BGRA_8888;
|
| }
|
| }
|
| +
|
| +int GetFourCCFormatForFramebuffer(gfx::BufferFormat format) {
|
| + // Currently, drm supports 24 bitcolordepth for hardware overlay.
|
| + switch (format) {
|
| + case gfx::BufferFormat::RGBA_8888:
|
| + case gfx::BufferFormat::RGBX_8888:
|
| + return DRM_FORMAT_XBGR8888;
|
| + case gfx::BufferFormat::BGRA_8888:
|
| + case gfx::BufferFormat::BGRX_8888:
|
| + return DRM_FORMAT_XRGB8888;
|
| + case gfx::BufferFormat::UYVY_422:
|
| + return DRM_FORMAT_UYVY;
|
| + default:
|
| + NOTREACHED();
|
| + return 0;
|
| + }
|
| +}
|
| } // namespace ui
|
|
|