| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/ozone/platform/drm/common/drm_util.h" | 5 #include "ui/ozone/platform/drm/common/drm_util.h" |
| 6 | 6 |
| 7 #include <drm_fourcc.h> | 7 #include <drm_fourcc.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 case DRM_FORMAT_NV12: | 414 case DRM_FORMAT_NV12: |
| 415 return gfx::BufferFormat::YUV_420_BIPLANAR; | 415 return gfx::BufferFormat::YUV_420_BIPLANAR; |
| 416 case DRM_FORMAT_YV12: | 416 case DRM_FORMAT_YV12: |
| 417 return gfx::BufferFormat::YVU_420; | 417 return gfx::BufferFormat::YVU_420; |
| 418 default: | 418 default: |
| 419 NOTREACHED(); | 419 NOTREACHED(); |
| 420 return gfx::BufferFormat::BGRA_8888; | 420 return gfx::BufferFormat::BGRA_8888; |
| 421 } | 421 } |
| 422 } | 422 } |
| 423 | 423 |
| 424 int GetFourCCFormatForFramebuffer(gfx::BufferFormat format) { | 424 int GetFourCCFormatForOpaqueFramebuffer(gfx::BufferFormat format) { |
| 425 // Currently, drm supports 24 bitcolordepth for hardware overlay. | 425 // DRM atomic interface doesn't currently support specifying an alpha |
| 426 // blending. We can simulate disabling alpha bleding creating an fb |
| 427 // with a format without the alpha channel. |
| 426 switch (format) { | 428 switch (format) { |
| 427 case gfx::BufferFormat::RGBA_8888: | 429 case gfx::BufferFormat::RGBA_8888: |
| 428 case gfx::BufferFormat::RGBX_8888: | 430 case gfx::BufferFormat::RGBX_8888: |
| 429 return DRM_FORMAT_XBGR8888; | 431 return DRM_FORMAT_XBGR8888; |
| 430 case gfx::BufferFormat::BGRA_8888: | 432 case gfx::BufferFormat::BGRA_8888: |
| 431 case gfx::BufferFormat::BGRX_8888: | 433 case gfx::BufferFormat::BGRX_8888: |
| 432 return DRM_FORMAT_XRGB8888; | 434 return DRM_FORMAT_XRGB8888; |
| 433 case gfx::BufferFormat::BGR_565: | 435 case gfx::BufferFormat::BGR_565: |
| 434 return DRM_FORMAT_RGB565; | 436 return DRM_FORMAT_RGB565; |
| 435 case gfx::BufferFormat::UYVY_422: | 437 case gfx::BufferFormat::UYVY_422: |
| 436 return DRM_FORMAT_UYVY; | 438 return DRM_FORMAT_UYVY; |
| 437 default: | 439 default: |
| 438 NOTREACHED(); | 440 NOTREACHED(); |
| 439 return 0; | 441 return 0; |
| 440 } | 442 } |
| 441 } | 443 } |
| 442 } // namespace ui | 444 } // namespace ui |
| OLD | NEW |