| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 case DRM_FORMAT_XBGR8888: | 368 case DRM_FORMAT_XBGR8888: |
| 369 return gfx::BufferFormat::RGBX_8888; | 369 return gfx::BufferFormat::RGBX_8888; |
| 370 case DRM_FORMAT_ARGB8888: | 370 case DRM_FORMAT_ARGB8888: |
| 371 return gfx::BufferFormat::BGRA_8888; | 371 return gfx::BufferFormat::BGRA_8888; |
| 372 case DRM_FORMAT_XRGB8888: | 372 case DRM_FORMAT_XRGB8888: |
| 373 return gfx::BufferFormat::BGRX_8888; | 373 return gfx::BufferFormat::BGRX_8888; |
| 374 case DRM_FORMAT_RGB565: | 374 case DRM_FORMAT_RGB565: |
| 375 return gfx::BufferFormat::BGR_565; | 375 return gfx::BufferFormat::BGR_565; |
| 376 case DRM_FORMAT_UYVY: | 376 case DRM_FORMAT_UYVY: |
| 377 return gfx::BufferFormat::UYVY_422; | 377 return gfx::BufferFormat::UYVY_422; |
| 378 case DRM_FORMAT_NV12: |
| 379 return gfx::BufferFormat::YUV_420_BIPLANAR; |
| 378 case DRM_FORMAT_YV12: | 380 case DRM_FORMAT_YV12: |
| 379 return gfx::BufferFormat::YVU_420; | 381 return gfx::BufferFormat::YVU_420; |
| 380 default: | 382 default: |
| 381 NOTREACHED(); | 383 NOTREACHED(); |
| 382 return gfx::BufferFormat::BGRA_8888; | 384 return gfx::BufferFormat::BGRA_8888; |
| 383 } | 385 } |
| 384 } | 386 } |
| 385 | 387 |
| 386 int GetFourCCFormatForFramebuffer(gfx::BufferFormat format) { | 388 int GetFourCCFormatForFramebuffer(gfx::BufferFormat format) { |
| 387 // Currently, drm supports 24 bitcolordepth for hardware overlay. | 389 // Currently, drm supports 24 bitcolordepth for hardware overlay. |
| 388 switch (format) { | 390 switch (format) { |
| 389 case gfx::BufferFormat::RGBA_8888: | 391 case gfx::BufferFormat::RGBA_8888: |
| 390 case gfx::BufferFormat::RGBX_8888: | 392 case gfx::BufferFormat::RGBX_8888: |
| 391 return DRM_FORMAT_XBGR8888; | 393 return DRM_FORMAT_XBGR8888; |
| 392 case gfx::BufferFormat::BGRA_8888: | 394 case gfx::BufferFormat::BGRA_8888: |
| 393 case gfx::BufferFormat::BGRX_8888: | 395 case gfx::BufferFormat::BGRX_8888: |
| 394 return DRM_FORMAT_XRGB8888; | 396 return DRM_FORMAT_XRGB8888; |
| 395 case gfx::BufferFormat::BGR_565: | 397 case gfx::BufferFormat::BGR_565: |
| 396 return DRM_FORMAT_RGB565; | 398 return DRM_FORMAT_RGB565; |
| 397 case gfx::BufferFormat::UYVY_422: | 399 case gfx::BufferFormat::UYVY_422: |
| 398 return DRM_FORMAT_UYVY; | 400 return DRM_FORMAT_UYVY; |
| 399 default: | 401 default: |
| 400 NOTREACHED(); | 402 NOTREACHED(); |
| 401 return 0; | 403 return 0; |
| 402 } | 404 } |
| 403 } | 405 } |
| 404 } // namespace ui | 406 } // namespace ui |
| OLD | NEW |