Commit f99be221 authored by Maksim Sisov's avatar Maksim Sisov Committed by Commit Bot

[ozone/common] Make planar import work with 0x5505 and 0x5504.

This is first step to migrate minigbm to use
GBM_BO_IMPORT_FD_MODIFIER instead of GBM_BO_IMPORT_FD_PLANAR.

Ones ChromeOS will start using the newest chrome, we can
finally add GBM_BO_IMPORT_FD_MODIFIER 0x5504 to minigbm and
get rid of GBM_BO_IMPORT_FD_PLANAR.

See comment from Tomasz in https://crrev.com/c/1273455

Bug: 869206, 578890, 820047
Change-Id: Ibac5c0c874c523e845675ff944561d3e2a3ec530
Reviewed-on: https://chromium-review.googlesource.com/c/1278400
Commit-Queue: Maksim Sisov <msisov@igalia.com>
Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599893}
parent 372dd188
......@@ -15,6 +15,14 @@
namespace gbm_wrapper {
namespace {
// Temporary defines while we migrate to GBM_BO_IMPORT_FD_MODIFIER.
#define GBM_BO_IMPORT_FD_PLANAR_5504 0x5504
#define GBM_BO_IMPORT_FD_PLANAR_5505 0x5505
} // namespace
class Buffer final : public ui::GbmBuffer {
public:
Buffer(struct gbm_bo* bo,
......@@ -238,10 +246,17 @@ class Device final : public ui::GbmDevice {
// 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(device_, GBM_BO_IMPORT_FD_PLANAR, &fd_data, gbm_flags);
//
// See the comment regarding the GBM_BO_IMPORT_FD_PLANAR_550X above.
bo = gbm_bo_import(device_, GBM_BO_IMPORT_FD_PLANAR_5505, &fd_data,
gbm_flags);
if (!bo) {
LOG(ERROR) << "nullptr returned from gbm_bo_import";
return nullptr;
bo = gbm_bo_import(device_, GBM_BO_IMPORT_FD_PLANAR_5504, &fd_data,
gbm_flags);
if (!bo) {
LOG(ERROR) << "nullptr returned from gbm_bo_import";
return nullptr;
}
}
return std::make_unique<Buffer>(bo, format, gbm_flags, planes[0].modifier,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment