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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 if (!params.has_native_mode && !params.modes.empty()) { | 266 if (!params.has_native_mode && !params.modes.empty()) { |
267 params.has_native_mode = true; | 267 params.has_native_mode = true; |
268 params.native_mode = params.modes.front(); | 268 params.native_mode = params.modes.front(); |
269 } | 269 } |
270 | 270 |
271 return params; | 271 return params; |
272 } | 272 } |
273 | 273 |
274 int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) { | 274 int GetFourCCFormatFromBufferFormat(gfx::BufferFormat format) { |
275 switch (format) { | 275 switch (format) { |
| 276 case gfx::BufferFormat::RGBA_8888: |
| 277 return DRM_FORMAT_ABGR8888; |
276 case gfx::BufferFormat::BGRA_8888: | 278 case gfx::BufferFormat::BGRA_8888: |
277 return DRM_FORMAT_ARGB8888; | 279 return DRM_FORMAT_ARGB8888; |
278 case gfx::BufferFormat::BGRX_8888: | 280 case gfx::BufferFormat::BGRX_8888: |
279 return DRM_FORMAT_XRGB8888; | 281 return DRM_FORMAT_XRGB8888; |
280 case gfx::BufferFormat::UYVY_422: | 282 case gfx::BufferFormat::UYVY_422: |
281 return DRM_FORMAT_UYVY; | 283 return DRM_FORMAT_UYVY; |
282 default: | 284 default: |
283 NOTREACHED(); | 285 NOTREACHED(); |
284 return 0; | 286 return 0; |
285 } | 287 } |
286 } | 288 } |
287 | 289 |
288 gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) { | 290 gfx::BufferFormat GetBufferFormatFromFourCCFormat(int format) { |
289 switch (format) { | 291 switch (format) { |
| 292 case DRM_FORMAT_ABGR8888: |
| 293 return gfx::BufferFormat::RGBA_8888; |
290 case DRM_FORMAT_ARGB8888: | 294 case DRM_FORMAT_ARGB8888: |
291 return gfx::BufferFormat::BGRA_8888; | 295 return gfx::BufferFormat::BGRA_8888; |
292 case DRM_FORMAT_XRGB8888: | 296 case DRM_FORMAT_XRGB8888: |
293 return gfx::BufferFormat::BGRX_8888; | 297 return gfx::BufferFormat::BGRX_8888; |
294 case DRM_FORMAT_UYVY: | 298 case DRM_FORMAT_UYVY: |
295 return gfx::BufferFormat::UYVY_422; | 299 return gfx::BufferFormat::UYVY_422; |
296 default: | 300 default: |
297 NOTREACHED(); | 301 NOTREACHED(); |
298 return gfx::BufferFormat::BGRA_8888; | 302 return gfx::BufferFormat::BGRA_8888; |
299 } | 303 } |
300 } | 304 } |
301 } // namespace ui | 305 } // namespace ui |
OLD | NEW |