Chromium Code Reviews| Index: ui/ozone/platform/drm/gpu/gbm_buffer.cc |
| diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/ui/ozone/platform/drm/gpu/gbm_buffer.cc |
| index 32c8209d9c3a76cac9cde80f182cb1f960eece0b..de946fc69da623089d12275baa9bfd4a4f703a10 100644 |
| --- a/ui/ozone/platform/drm/gpu/gbm_buffer.cc |
| +++ b/ui/ozone/platform/drm/gpu/gbm_buffer.cc |
| @@ -169,25 +169,20 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferFromFds( |
| bool use_scanout = gbm_device_is_format_supported( |
| gbm->device(), fourcc_format, GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); |
| + use_scanout &= (planes.size() == 1); |
|
Daniele Castagna
2016/11/05 01:01:38
nit: Why are you using a bitwise operator with a b
gurchetansingh
2016/11/05 01:11:53
fixed
|
| + |
| gbm_bo* bo = nullptr; |
| if (use_scanout) { |
| - struct gbm_import_fd_planar_data fd_data {}; |
| - for (size_t i = 0; i < fds.size(); ++i) |
| - fd_data.fds[i] = fds[i].get(); |
| - |
| + struct gbm_import_fd_data fd_data; |
| + fd_data.fd = fds[0].get(); |
| fd_data.width = size.width(); |
| fd_data.height = size.height(); |
| + fd_data.stride = planes[0].stride; |
| fd_data.format = fourcc_format; |
| - for (size_t i = 0; i < planes.size(); ++i) { |
| - fd_data.strides[i] = planes[i].stride; |
| - fd_data.offsets[i] = planes[i].offset; |
| - fd_data.format_modifiers[i] = planes[i].modifier; |
| - } |
| - |
| - // The fds passed to gbm_bo_import are not ref-counted and need to be |
| + // The fd passed to gbm_bo_import is not ref-counted and need to be |
| // kept open for the lifetime of the buffer. |
| - bo = gbm_bo_import(gbm->device(), GBM_BO_IMPORT_FD_PLANAR, &fd_data, |
| + bo = gbm_bo_import(gbm->device(), GBM_BO_IMPORT_FD, &fd_data, |
| GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); |
| if (!bo) { |
| LOG(ERROR) << "nullptr returned from gbm_bo_import"; |