Commit b069c93a authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

ozone: drm: Rename ui::OverlayPlane to ui::DrmOverlayPlane

The OverlayPlane struct uses the ScanoutBuffer class, which was
originally a DRM platform implementation detail. This struct was moved
into common code with the intent to share it with other linux platforms.

However, exposing ScanoutBuffer is probably not what we want to do - it
contains several methods that are specific to DRM. Instead, a public
ui::OverlayPlane should be using the gfx::NativePixmap interface, which
is already public.

Move ui::OverlayPlane back into DRM, and rename it to DrmOverlayPlane. A
followup CL will add a new version of ui::OverlayPlane that uses
gfx::NativePixmap instead.

Bug: 851997
Test: compile

Change-Id: I1f4dbc11419aaacabb2a63eb692eb6a3892a3be3
Reviewed-on: https://chromium-review.googlesource.com/1097208
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: default avatarRobert Kroeger <rjkroege@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569702}
parent f148ff5d
...@@ -44,7 +44,8 @@ CrtcController::~CrtcController() { ...@@ -44,7 +44,8 @@ CrtcController::~CrtcController() {
} }
} }
bool CrtcController::Modeset(const OverlayPlane& plane, drmModeModeInfo mode) { bool CrtcController::Modeset(const DrmOverlayPlane& plane,
drmModeModeInfo mode) {
if (!drm_->SetCrtc(crtc_, plane.buffer->GetOpaqueFramebufferId(), if (!drm_->SetCrtc(crtc_, plane.buffer->GetOpaqueFramebufferId(),
std::vector<uint32_t>(1, connector_), &mode)) { std::vector<uint32_t>(1, connector_), &mode)) {
PLOG(ERROR) << "Failed to modeset: crtc=" << crtc_ PLOG(ERROR) << "Failed to modeset: crtc=" << crtc_
...@@ -63,7 +64,7 @@ bool CrtcController::Modeset(const OverlayPlane& plane, drmModeModeInfo mode) { ...@@ -63,7 +64,7 @@ bool CrtcController::Modeset(const OverlayPlane& plane, drmModeModeInfo mode) {
// planes have been updated. However if a page flip is still pending, set the // planes have been updated. However if a page flip is still pending, set the
// pending planes to the same values so that the callback keeps the correct // pending planes to the same values so that the callback keeps the correct
// state. // state.
current_planes_ = std::vector<OverlayPlane>(1, plane); current_planes_ = std::vector<DrmOverlayPlane>(1, plane);
if (page_flip_request_.get()) if (page_flip_request_.get())
pending_planes_ = current_planes_; pending_planes_ = current_planes_;
...@@ -82,13 +83,13 @@ bool CrtcController::Disable() { ...@@ -82,13 +83,13 @@ bool CrtcController::Disable() {
bool CrtcController::SchedulePageFlip( bool CrtcController::SchedulePageFlip(
HardwareDisplayPlaneList* plane_list, HardwareDisplayPlaneList* plane_list,
const OverlayPlaneList& overlays, const DrmOverlayPlaneList& overlays,
bool test_only, bool test_only,
scoped_refptr<PageFlipRequest> page_flip_request) { scoped_refptr<PageFlipRequest> page_flip_request) {
DCHECK(!page_flip_request_.get() || test_only); DCHECK(!page_flip_request_.get() || test_only);
DCHECK(!is_disabled_); DCHECK(!is_disabled_);
const OverlayPlane* primary = OverlayPlane::GetPrimaryPlane(overlays); const DrmOverlayPlane* primary = DrmOverlayPlane::GetPrimaryPlane(overlays);
if (primary && !drm_->plane_manager()->ValidatePrimarySize(*primary, mode_)) { if (primary && !drm_->plane_manager()->ValidatePrimarySize(*primary, mode_)) {
VLOG(2) << "Trying to pageflip a buffer with the wrong size. Expected " VLOG(2) << "Trying to pageflip a buffer with the wrong size. Expected "
<< mode_.hdisplay << "x" << mode_.vdisplay << " got " << mode_.hdisplay << "x" << mode_.vdisplay << " got "
......
...@@ -48,14 +48,14 @@ class CrtcController : public base::SupportsWeakPtr<CrtcController> { ...@@ -48,14 +48,14 @@ class CrtcController : public base::SupportsWeakPtr<CrtcController> {
// Perform the initial modesetting operation using |plane| as the buffer for // Perform the initial modesetting operation using |plane| as the buffer for
// the primary plane. The CRTC configuration is specified by |mode|. // the primary plane. The CRTC configuration is specified by |mode|.
bool Modeset(const OverlayPlane& plane, drmModeModeInfo mode); bool Modeset(const DrmOverlayPlane& plane, drmModeModeInfo mode);
// Disables the controller. // Disables the controller.
bool Disable(); bool Disable();
// Schedule a page flip event and present the overlays in |planes|. // Schedule a page flip event and present the overlays in |planes|.
bool SchedulePageFlip(HardwareDisplayPlaneList* plane_list, bool SchedulePageFlip(HardwareDisplayPlaneList* plane_list,
const OverlayPlaneList& planes, const DrmOverlayPlaneList& planes,
bool test_only, bool test_only,
scoped_refptr<PageFlipRequest> page_flip_request); scoped_refptr<PageFlipRequest> page_flip_request);
...@@ -90,8 +90,8 @@ class CrtcController : public base::SupportsWeakPtr<CrtcController> { ...@@ -90,8 +90,8 @@ class CrtcController : public base::SupportsWeakPtr<CrtcController> {
// Buffers need to be declared first so that they are destroyed last. Needed // Buffers need to be declared first so that they are destroyed last. Needed
// since the controllers may reference the buffers. // since the controllers may reference the buffers.
OverlayPlaneList current_planes_; DrmOverlayPlaneList current_planes_;
OverlayPlaneList pending_planes_; DrmOverlayPlaneList pending_planes_;
scoped_refptr<ScanoutBuffer> cursor_buffer_; scoped_refptr<ScanoutBuffer> cursor_buffer_;
scoped_refptr<PageFlipRequest> page_flip_request_; scoped_refptr<PageFlipRequest> page_flip_request_;
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
namespace ui { namespace ui {
OverlayPlane::OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, DrmOverlayPlane::DrmOverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer,
gfx::GpuFence* gpu_fence) gfx::GpuFence* gpu_fence)
: buffer(buffer), : buffer(buffer),
plane_transform(gfx::OVERLAY_TRANSFORM_NONE), plane_transform(gfx::OVERLAY_TRANSFORM_NONE),
display_bounds(gfx::Point(), buffer->GetSize()), display_bounds(gfx::Point(), buffer->GetSize()),
...@@ -19,13 +19,13 @@ OverlayPlane::OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, ...@@ -19,13 +19,13 @@ OverlayPlane::OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer,
enable_blend(false), enable_blend(false),
gpu_fence(gpu_fence) {} gpu_fence(gpu_fence) {}
OverlayPlane::OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, DrmOverlayPlane::DrmOverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer,
int z_order, int z_order,
gfx::OverlayTransform plane_transform, gfx::OverlayTransform plane_transform,
const gfx::Rect& display_bounds, const gfx::Rect& display_bounds,
const gfx::RectF& crop_rect, const gfx::RectF& crop_rect,
bool enable_blend, bool enable_blend,
gfx::GpuFence* gpu_fence) gfx::GpuFence* gpu_fence)
: buffer(buffer), : buffer(buffer),
z_order(z_order), z_order(z_order),
plane_transform(plane_transform), plane_transform(plane_transform),
...@@ -34,19 +34,19 @@ OverlayPlane::OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, ...@@ -34,19 +34,19 @@ OverlayPlane::OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer,
enable_blend(enable_blend), enable_blend(enable_blend),
gpu_fence(gpu_fence) {} gpu_fence(gpu_fence) {}
OverlayPlane::OverlayPlane(const OverlayPlane& other) = default; DrmOverlayPlane::DrmOverlayPlane(const DrmOverlayPlane& other) = default;
OverlayPlane::~OverlayPlane() {} DrmOverlayPlane::~DrmOverlayPlane() {}
bool OverlayPlane::operator<(const OverlayPlane& plane) const { bool DrmOverlayPlane::operator<(const DrmOverlayPlane& plane) const {
return std::tie(z_order, display_bounds, crop_rect, plane_transform) < return std::tie(z_order, display_bounds, crop_rect, plane_transform) <
std::tie(plane.z_order, plane.display_bounds, plane.crop_rect, std::tie(plane.z_order, plane.display_bounds, plane.crop_rect,
plane.plane_transform); plane.plane_transform);
} }
// static // static
const OverlayPlane* OverlayPlane::GetPrimaryPlane( const DrmOverlayPlane* DrmOverlayPlane::GetPrimaryPlane(
const OverlayPlaneList& overlays) { const DrmOverlayPlaneList& overlays) {
for (size_t i = 0; i < overlays.size(); ++i) { for (size_t i = 0; i < overlays.size(); ++i) {
if (overlays[i].z_order == 0) if (overlays[i].z_order == 0)
return &overlays[i]; return &overlays[i];
......
...@@ -21,29 +21,30 @@ namespace ui { ...@@ -21,29 +21,30 @@ namespace ui {
class ScanoutBuffer; class ScanoutBuffer;
struct OverlayPlane; struct DrmOverlayPlane;
typedef std::vector<OverlayPlane> OverlayPlaneList; typedef std::vector<DrmOverlayPlane> DrmOverlayPlaneList;
struct OverlayPlane { struct DrmOverlayPlane {
// Simpler constructor for the primary plane. // Simpler constructor for the primary plane.
explicit OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, explicit DrmOverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer,
gfx::GpuFence* gpu_fence); gfx::GpuFence* gpu_fence);
OverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer, DrmOverlayPlane(const scoped_refptr<ScanoutBuffer>& buffer,
int z_order, int z_order,
gfx::OverlayTransform plane_transform, gfx::OverlayTransform plane_transform,
const gfx::Rect& display_bounds, const gfx::Rect& display_bounds,
const gfx::RectF& crop_rect, const gfx::RectF& crop_rect,
bool enable_blend, bool enable_blend,
gfx::GpuFence* gpu_fence); gfx::GpuFence* gpu_fence);
OverlayPlane(const OverlayPlane& other); DrmOverlayPlane(const DrmOverlayPlane& other);
bool operator<(const OverlayPlane& plane) const; bool operator<(const DrmOverlayPlane& plane) const;
~OverlayPlane(); ~DrmOverlayPlane();
// Returns the primary plane in |overlays|. // Returns the primary plane in |overlays|.
static const OverlayPlane* GetPrimaryPlane(const OverlayPlaneList& overlays); static const DrmOverlayPlane* GetPrimaryPlane(
const DrmOverlayPlaneList& overlays);
scoped_refptr<ScanoutBuffer> buffer; scoped_refptr<ScanoutBuffer> buffer;
int z_order = 0; int z_order = 0;
......
...@@ -55,7 +55,7 @@ DrmOverlayValidator::~DrmOverlayValidator() {} ...@@ -55,7 +55,7 @@ DrmOverlayValidator::~DrmOverlayValidator() {}
std::vector<OverlayCheckReturn_Params> DrmOverlayValidator::TestPageFlip( std::vector<OverlayCheckReturn_Params> DrmOverlayValidator::TestPageFlip(
const std::vector<OverlayCheck_Params>& params, const std::vector<OverlayCheck_Params>& params,
const OverlayPlaneList& last_used_planes) { const DrmOverlayPlaneList& last_used_planes) {
std::vector<OverlayCheckReturn_Params> returns(params.size()); std::vector<OverlayCheckReturn_Params> returns(params.size());
HardwareDisplayController* controller = window_->GetController(); HardwareDisplayController* controller = window_->GetController();
if (!controller) { if (!controller) {
...@@ -66,7 +66,7 @@ std::vector<OverlayCheckReturn_Params> DrmOverlayValidator::TestPageFlip( ...@@ -66,7 +66,7 @@ std::vector<OverlayCheckReturn_Params> DrmOverlayValidator::TestPageFlip(
return returns; return returns;
} }
OverlayPlaneList test_list; DrmOverlayPlaneList test_list;
std::vector<scoped_refptr<ScanoutBuffer>> reusable_buffers; std::vector<scoped_refptr<ScanoutBuffer>> reusable_buffers;
scoped_refptr<DrmDevice> drm = controller->GetAllocationDrmDevice(); scoped_refptr<DrmDevice> drm = controller->GetAllocationDrmDevice();
...@@ -84,9 +84,9 @@ std::vector<OverlayCheckReturn_Params> DrmOverlayValidator::TestPageFlip( ...@@ -84,9 +84,9 @@ std::vector<OverlayCheckReturn_Params> DrmOverlayValidator::TestPageFlip(
GetFourCCFormatFromBufferFormat(params[i].format), GetFourCCFormatFromBufferFormat(params[i].format),
buffer_generator_, &reusable_buffers); buffer_generator_, &reusable_buffers);
OverlayPlane plane(buffer, params[i].plane_z_order, params[i].transform, DrmOverlayPlane plane(buffer, params[i].plane_z_order, params[i].transform,
params[i].display_rect, params[i].crop_rect, params[i].display_rect, params[i].crop_rect,
/* enable_blend */ true, /* gpu_fence */ nullptr); /* enable_blend */ true, /* gpu_fence */ nullptr);
test_list.push_back(plane); test_list.push_back(plane);
if (buffer && controller->TestPageFlip(test_list)) { if (buffer && controller->TestPageFlip(test_list)) {
......
...@@ -26,7 +26,7 @@ class DrmOverlayValidator { ...@@ -26,7 +26,7 @@ class DrmOverlayValidator {
// without failing the page flip. It expects |params| to be sorted by z_order. // without failing the page flip. It expects |params| to be sorted by z_order.
std::vector<OverlayCheckReturn_Params> TestPageFlip( std::vector<OverlayCheckReturn_Params> TestPageFlip(
const std::vector<OverlayCheck_Params>& params, const std::vector<OverlayCheck_Params>& params,
const OverlayPlaneList& last_used_planes); const DrmOverlayPlaneList& last_used_planes);
private: private:
DrmWindow* window_; // Not owned. DrmWindow* window_; // Not owned.
......
...@@ -80,7 +80,7 @@ class DrmOverlayValidatorTest : public testing::Test { ...@@ -80,7 +80,7 @@ class DrmOverlayValidatorTest : public testing::Test {
ui::DrmWindow* window_; ui::DrmWindow* window_;
std::unique_ptr<ui::DrmOverlayValidator> overlay_validator_; std::unique_ptr<ui::DrmOverlayValidator> overlay_validator_;
std::vector<ui::OverlayCheck_Params> overlay_params_; std::vector<ui::OverlayCheck_Params> overlay_params_;
ui::OverlayPlaneList plane_list_; ui::DrmOverlayPlaneList plane_list_;
int on_swap_buffers_count_; int on_swap_buffers_count_;
gfx::SwapResult last_swap_buffers_result_; gfx::SwapResult last_swap_buffers_result_;
...@@ -191,9 +191,9 @@ void DrmOverlayValidatorTest::AddPlane(const ui::OverlayCheck_Params& params) { ...@@ -191,9 +191,9 @@ void DrmOverlayValidatorTest::AddPlane(const ui::OverlayCheck_Params& params) {
scoped_refptr<ui::ScanoutBuffer> scanout_buffer = buffer_generator_->Create( scoped_refptr<ui::ScanoutBuffer> scanout_buffer = buffer_generator_->Create(
drm, ui::GetFourCCFormatFromBufferFormat(params.format), {}, drm, ui::GetFourCCFormatFromBufferFormat(params.format), {},
params.buffer_size); params.buffer_size);
ui::OverlayPlane plane(std::move(scanout_buffer), params.plane_z_order, ui::DrmOverlayPlane plane(std::move(scanout_buffer), params.plane_z_order,
params.transform, params.display_rect, params.transform, params.display_rect,
params.crop_rect, true, nullptr); params.crop_rect, true, nullptr);
plane_list_.push_back(plane); plane_list_.push_back(plane);
} }
...@@ -210,7 +210,8 @@ TEST_F(DrmOverlayValidatorTest, WindowWithNoController) { ...@@ -210,7 +210,8 @@ TEST_F(DrmOverlayValidatorTest, WindowWithNoController) {
ui::HardwareDisplayController* controller = window_->GetController(); ui::HardwareDisplayController* controller = window_->GetController();
window_->SetController(nullptr); window_->SetController(nullptr);
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); overlay_validator_->TestPageFlip(overlay_params_,
ui::DrmOverlayPlaneList());
EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_NOT); EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_NOT);
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT);
window_->SetController(controller); window_->SetController(controller);
...@@ -218,7 +219,8 @@ TEST_F(DrmOverlayValidatorTest, WindowWithNoController) { ...@@ -218,7 +219,8 @@ TEST_F(DrmOverlayValidatorTest, WindowWithNoController) {
TEST_F(DrmOverlayValidatorTest, DontPromoteMoreLayersThanAvailablePlanes) { TEST_F(DrmOverlayValidatorTest, DontPromoteMoreLayersThanAvailablePlanes) {
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); overlay_validator_->TestPageFlip(overlay_params_,
ui::DrmOverlayPlaneList());
EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_ABLE);
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT);
} }
...@@ -230,7 +232,8 @@ TEST_F(DrmOverlayValidatorTest, DontCollapseOverlayToPrimaryInFullScreen) { ...@@ -230,7 +232,8 @@ TEST_F(DrmOverlayValidatorTest, DontCollapseOverlayToPrimaryInFullScreen) {
plane_list_.back().display_bounds = primary_rect_; plane_list_.back().display_bounds = primary_rect_;
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); overlay_validator_->TestPageFlip(overlay_params_,
ui::DrmOverlayPlaneList());
// Second candidate should be marked as Invalid as we have only one plane // Second candidate should be marked as Invalid as we have only one plane
// per CRTC. // per CRTC.
EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_ABLE);
...@@ -254,7 +257,8 @@ TEST_F(DrmOverlayValidatorTest, OverlayFormat_XRGB) { ...@@ -254,7 +257,8 @@ TEST_F(DrmOverlayValidatorTest, OverlayFormat_XRGB) {
InitializeDrmState(std::vector<CrtcState>(1, state)); InitializeDrmState(std::vector<CrtcState>(1, state));
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); overlay_validator_->TestPageFlip(overlay_params_,
ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
for (const auto& param : returns) for (const auto& param : returns)
EXPECT_EQ(param.status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(param.status, ui::OVERLAY_STATUS_ABLE);
...@@ -282,7 +286,8 @@ TEST_F(DrmOverlayValidatorTest, OverlayFormat_YUV) { ...@@ -282,7 +286,8 @@ TEST_F(DrmOverlayValidatorTest, OverlayFormat_YUV) {
InitializeDrmState(std::vector<CrtcState>(1, state)); InitializeDrmState(std::vector<CrtcState>(1, state));
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); overlay_validator_->TestPageFlip(overlay_params_,
ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
for (const auto& param : returns) for (const auto& param : returns)
EXPECT_EQ(param.status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(param.status, ui::OVERLAY_STATUS_ABLE);
...@@ -309,7 +314,7 @@ TEST_F(DrmOverlayValidatorTest, RejectYUVBuffersIfNotSupported) { ...@@ -309,7 +314,7 @@ TEST_F(DrmOverlayValidatorTest, RejectYUVBuffersIfNotSupported) {
std::vector<ui::OverlayCheck_Params> validated_params = overlay_params_; std::vector<ui::OverlayCheck_Params> validated_params = overlay_params_;
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(validated_params, overlay_validator_->TestPageFlip(validated_params,
ui::OverlayPlaneList()); ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT);
} }
...@@ -338,9 +343,10 @@ TEST_F(DrmOverlayValidatorTest, ...@@ -338,9 +343,10 @@ TEST_F(DrmOverlayValidatorTest,
controller->AddCrtc( controller->AddCrtc(
std::unique_ptr<ui::CrtcController>(new ui::CrtcController( std::unique_ptr<ui::CrtcController>(new ui::CrtcController(
drm_.get(), kCrtcIdBase + 1, kConnectorIdBase + 1))); drm_.get(), kCrtcIdBase + 1, kConnectorIdBase + 1)));
ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>( ui::DrmOverlayPlane plane1(
new ui::MockScanoutBuffer(primary_rect_.size())), scoped_refptr<ui::ScanoutBuffer>(
nullptr); new ui::MockScanoutBuffer(primary_rect_.size())),
nullptr);
EXPECT_TRUE(controller->Modeset(plane1, kDefaultMode)); EXPECT_TRUE(controller->Modeset(plane1, kDefaultMode));
gfx::RectF crop_rect = gfx::RectF(0, 0, 0.5, 0.5); gfx::RectF crop_rect = gfx::RectF(0, 0, 0.5, 0.5);
...@@ -354,7 +360,7 @@ TEST_F(DrmOverlayValidatorTest, ...@@ -354,7 +360,7 @@ TEST_F(DrmOverlayValidatorTest,
validated_params.back().format = gfx::BufferFormat::UYVY_422; validated_params.back().format = gfx::BufferFormat::UYVY_422;
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(validated_params, overlay_validator_->TestPageFlip(validated_params,
ui::OverlayPlaneList()); ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE);
...@@ -366,7 +372,7 @@ TEST_F(DrmOverlayValidatorTest, ...@@ -366,7 +372,7 @@ TEST_F(DrmOverlayValidatorTest,
InitializeDrmState(crtc_states); InitializeDrmState(crtc_states);
returns = overlay_validator_->TestPageFlip(validated_params, returns = overlay_validator_->TestPageFlip(validated_params,
ui::OverlayPlaneList()); ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT);
...@@ -377,7 +383,7 @@ TEST_F(DrmOverlayValidatorTest, ...@@ -377,7 +383,7 @@ TEST_F(DrmOverlayValidatorTest,
InitializeDrmState(crtc_states); InitializeDrmState(crtc_states);
returns = overlay_validator_->TestPageFlip(validated_params, returns = overlay_validator_->TestPageFlip(validated_params,
ui::OverlayPlaneList()); ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_NOT);
controller->RemoveCrtc(drm_, kCrtcIdBase + 1); controller->RemoveCrtc(drm_, kCrtcIdBase + 1);
...@@ -406,9 +412,10 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) { ...@@ -406,9 +412,10 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) {
controller->AddCrtc( controller->AddCrtc(
std::unique_ptr<ui::CrtcController>(new ui::CrtcController( std::unique_ptr<ui::CrtcController>(new ui::CrtcController(
drm_.get(), kCrtcIdBase + 1, kConnectorIdBase + 1))); drm_.get(), kCrtcIdBase + 1, kConnectorIdBase + 1)));
ui::OverlayPlane plane1(scoped_refptr<ui::ScanoutBuffer>( ui::DrmOverlayPlane plane1(
new ui::MockScanoutBuffer(primary_rect_.size())), scoped_refptr<ui::ScanoutBuffer>(
nullptr); new ui::MockScanoutBuffer(primary_rect_.size())),
nullptr);
EXPECT_TRUE(controller->Modeset(plane1, kDefaultMode)); EXPECT_TRUE(controller->Modeset(plane1, kDefaultMode));
overlay_params_.back().buffer_size = overlay_rect_.size(); overlay_params_.back().buffer_size = overlay_rect_.size();
...@@ -416,7 +423,8 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) { ...@@ -416,7 +423,8 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) {
plane_list_.back().display_bounds = overlay_rect_; plane_list_.back().display_bounds = overlay_rect_;
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); overlay_validator_->TestPageFlip(overlay_params_,
ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE);
...@@ -424,8 +432,8 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) { ...@@ -424,8 +432,8 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) {
crtc_states[1].planes[1].formats = {DRM_FORMAT_XRGB8888}; crtc_states[1].planes[1].formats = {DRM_FORMAT_XRGB8888};
InitializeDrmState(crtc_states); InitializeDrmState(crtc_states);
returns = returns = overlay_validator_->TestPageFlip(overlay_params_,
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); ui::DrmOverlayPlaneList());
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE);
// Check case where we dont have support for packed formats in primary // Check case where we dont have support for packed formats in primary
...@@ -434,8 +442,8 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) { ...@@ -434,8 +442,8 @@ TEST_F(DrmOverlayValidatorTest, OptimalFormatXRGB_MirroredControllers) {
crtc_states[1].planes[1].formats = {DRM_FORMAT_XRGB8888, DRM_FORMAT_UYVY}; crtc_states[1].planes[1].formats = {DRM_FORMAT_XRGB8888, DRM_FORMAT_UYVY};
InitializeDrmState(crtc_states); InitializeDrmState(crtc_states);
returns = returns = overlay_validator_->TestPageFlip(overlay_params_,
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE); EXPECT_EQ(returns.back().status, ui::OVERLAY_STATUS_ABLE);
...@@ -448,7 +456,8 @@ TEST_F(DrmOverlayValidatorTest, RejectBufferAllocationFail) { ...@@ -448,7 +456,8 @@ TEST_F(DrmOverlayValidatorTest, RejectBufferAllocationFail) {
buffer_generator_->set_allocation_failure(true); buffer_generator_->set_allocation_failure(true);
std::vector<ui::OverlayCheckReturn_Params> returns = std::vector<ui::OverlayCheckReturn_Params> returns =
overlay_validator_->TestPageFlip(overlay_params_, ui::OverlayPlaneList()); overlay_validator_->TestPageFlip(overlay_params_,
ui::DrmOverlayPlaneList());
EXPECT_EQ(2u, returns.size()); EXPECT_EQ(2u, returns.size());
EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_NOT); EXPECT_EQ(returns.front().status, ui::OVERLAY_STATUS_NOT);
} }
...@@ -202,7 +202,7 @@ void DrmThread::GetScanoutFormats( ...@@ -202,7 +202,7 @@ void DrmThread::GetScanoutFormats(
} }
void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget,
const std::vector<OverlayPlane>& planes, const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback) { SwapCompletionOnceCallback callback) {
scoped_refptr<ui::DrmDevice> drm_device = scoped_refptr<ui::DrmDevice> drm_device =
device_manager_->GetDrmDevice(widget); device_manager_->GetDrmDevice(widget);
...@@ -215,7 +215,7 @@ void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget, ...@@ -215,7 +215,7 @@ void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget,
void DrmThread::OnPlanesReadyForPageFlip( void DrmThread::OnPlanesReadyForPageFlip(
gfx::AcceleratedWidget widget, gfx::AcceleratedWidget widget,
const std::vector<OverlayPlane>& planes, const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback) { SwapCompletionOnceCallback callback) {
DrmWindow* window = screen_manager_->GetWindow(widget); DrmWindow* window = screen_manager_->GetWindow(widget);
if (window) { if (window) {
......
...@@ -46,7 +46,7 @@ class GbmBuffer; ...@@ -46,7 +46,7 @@ class GbmBuffer;
class ScanoutBufferGenerator; class ScanoutBufferGenerator;
class ScreenManager; class ScreenManager;
struct OverlayPlane; struct DrmOverlayPlane;
// Holds all the DRM related state and performs all DRM related operations. // Holds all the DRM related state and performs all DRM related operations.
// //
...@@ -84,7 +84,7 @@ class DrmThread : public base::Thread, ...@@ -84,7 +84,7 @@ class DrmThread : public base::Thread,
// DrmWindowProxy (on GPU thread) is the client for these methods. // DrmWindowProxy (on GPU thread) is the client for these methods.
void SchedulePageFlip(gfx::AcceleratedWidget widget, void SchedulePageFlip(gfx::AcceleratedWidget widget,
const std::vector<OverlayPlane>& planes, const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback); SwapCompletionOnceCallback callback);
void GetVSyncParameters( void GetVSyncParameters(
gfx::AcceleratedWidget widget, gfx::AcceleratedWidget widget,
...@@ -143,7 +143,7 @@ class DrmThread : public base::Thread, ...@@ -143,7 +143,7 @@ class DrmThread : public base::Thread,
private: private:
void OnPlanesReadyForPageFlip(gfx::AcceleratedWidget widget, void OnPlanesReadyForPageFlip(gfx::AcceleratedWidget widget,
const std::vector<OverlayPlane>& planes, const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback); SwapCompletionOnceCallback callback);
std::unique_ptr<DrmDeviceManager> device_manager_; std::unique_ptr<DrmDeviceManager> device_manager_;
......
...@@ -114,7 +114,7 @@ void DrmWindow::MoveCursor(const gfx::Point& location) { ...@@ -114,7 +114,7 @@ void DrmWindow::MoveCursor(const gfx::Point& location) {
controller_->MoveCursor(location); controller_->MoveCursor(location);
} }
bool DrmWindow::SchedulePageFlip(const std::vector<OverlayPlane>& planes, bool DrmWindow::SchedulePageFlip(const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback) { SwapCompletionOnceCallback callback) {
if (controller_) { if (controller_) {
const DrmDevice* drm = controller_->GetAllocationDrmDevice().get(); const DrmDevice* drm = controller_->GetAllocationDrmDevice().get();
...@@ -154,8 +154,8 @@ std::vector<OverlayCheckReturn_Params> DrmWindow::TestPageFlip( ...@@ -154,8 +154,8 @@ std::vector<OverlayCheckReturn_Params> DrmWindow::TestPageFlip(
last_submitted_planes_); last_submitted_planes_);
} }
const OverlayPlane* DrmWindow::GetLastModesetBuffer() { const DrmOverlayPlane* DrmWindow::GetLastModesetBuffer() {
return OverlayPlane::GetPrimaryPlane(last_submitted_planes_); return DrmOverlayPlane::GetPrimaryPlane(last_submitted_planes_);
} }
void DrmWindow::GetVSyncParameters( void DrmWindow::GetVSyncParameters(
......
...@@ -85,13 +85,13 @@ class DrmWindow { ...@@ -85,13 +85,13 @@ class DrmWindow {
// Move the HW cursor to the specified location. // Move the HW cursor to the specified location.
void MoveCursor(const gfx::Point& location); void MoveCursor(const gfx::Point& location);
bool SchedulePageFlip(const std::vector<OverlayPlane>& planes, bool SchedulePageFlip(const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback); SwapCompletionOnceCallback callback);
std::vector<OverlayCheckReturn_Params> TestPageFlip( std::vector<OverlayCheckReturn_Params> TestPageFlip(
const std::vector<OverlayCheck_Params>& overlay_params); const std::vector<OverlayCheck_Params>& overlay_params);
// Returns the last buffer associated with this window. // Returns the last buffer associated with this window.
const OverlayPlane* GetLastModesetBuffer(); const DrmOverlayPlane* GetLastModesetBuffer();
void GetVSyncParameters( void GetVSyncParameters(
const gfx::VSyncProvider::UpdateVSyncCallback& callback) const; const gfx::VSyncProvider::UpdateVSyncCallback& callback) const;
...@@ -130,7 +130,7 @@ class DrmWindow { ...@@ -130,7 +130,7 @@ class DrmWindow {
int cursor_frame_ = 0; int cursor_frame_ = 0;
int cursor_frame_delay_ms_ = 0; int cursor_frame_delay_ms_ = 0;
OverlayPlaneList last_submitted_planes_; DrmOverlayPlaneList last_submitted_planes_;
bool force_buffer_reallocation_ = false; bool force_buffer_reallocation_ = false;
......
...@@ -18,8 +18,9 @@ DrmWindowProxy::DrmWindowProxy(gfx::AcceleratedWidget widget, ...@@ -18,8 +18,9 @@ DrmWindowProxy::DrmWindowProxy(gfx::AcceleratedWidget widget,
DrmWindowProxy::~DrmWindowProxy() {} DrmWindowProxy::~DrmWindowProxy() {}
void DrmWindowProxy::SchedulePageFlip(const std::vector<OverlayPlane>& planes, void DrmWindowProxy::SchedulePageFlip(
SwapCompletionOnceCallback callback) { const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback) {
auto safe_callback = CreateSafeOnceCallback(std::move(callback)); auto safe_callback = CreateSafeOnceCallback(std::move(callback));
drm_thread_->task_runner()->PostTask( drm_thread_->task_runner()->PostTask(
FROM_HERE, base::BindOnce(&DrmThread::SchedulePageFlip, FROM_HERE, base::BindOnce(&DrmThread::SchedulePageFlip,
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
namespace ui { namespace ui {
class DrmThread; class DrmThread;
struct OverlayPlane; struct DrmOverlayPlane;
class DrmWindowProxy { class DrmWindowProxy {
public: public:
...@@ -24,7 +24,7 @@ class DrmWindowProxy { ...@@ -24,7 +24,7 @@ class DrmWindowProxy {
gfx::AcceleratedWidget widget() const { return widget_; } gfx::AcceleratedWidget widget() const { return widget_; }
void SchedulePageFlip(const std::vector<OverlayPlane>& planes, void SchedulePageFlip(const std::vector<DrmOverlayPlane>& planes,
SwapCompletionOnceCallback callback); SwapCompletionOnceCallback callback);
void GetVSyncParameters( void GetVSyncParameters(
......
...@@ -175,7 +175,7 @@ TEST_F(DrmWindowTest, CheckCallbackOnFailedSwap) { ...@@ -175,7 +175,7 @@ TEST_F(DrmWindowTest, CheckCallbackOnFailedSwap) {
const gfx::Size window_size(6, 4); const gfx::Size window_size(6, 4);
ui::MockDumbBufferGenerator buffer_generator; ui::MockDumbBufferGenerator buffer_generator;
ui::DrmWindow* window = screen_manager_->GetWindow(kDefaultWidgetHandle); ui::DrmWindow* window = screen_manager_->GetWindow(kDefaultWidgetHandle);
ui::OverlayPlane plane( ui::DrmOverlayPlane plane(
buffer_generator.Create(drm_, DRM_FORMAT_XRGB8888, {}, window_size), buffer_generator.Create(drm_, DRM_FORMAT_XRGB8888, {}, window_size),
nullptr); nullptr);
...@@ -183,7 +183,7 @@ TEST_F(DrmWindowTest, CheckCallbackOnFailedSwap) { ...@@ -183,7 +183,7 @@ TEST_F(DrmWindowTest, CheckCallbackOnFailedSwap) {
// Window was re-sized, so the expectation is to re-create the buffers first. // Window was re-sized, so the expectation is to re-create the buffers first.
window->SchedulePageFlip( window->SchedulePageFlip(
std::vector<ui::OverlayPlane>(1, ui::OverlayPlane(plane)), std::vector<ui::DrmOverlayPlane>(1, ui::DrmOverlayPlane(plane)),
base::BindOnce(&DrmWindowTest::OnSwapBuffers, base::Unretained(this))); base::BindOnce(&DrmWindowTest::OnSwapBuffers, base::Unretained(this)));
EXPECT_EQ(1, on_swap_buffers_count_); EXPECT_EQ(1, on_swap_buffers_count_);
EXPECT_EQ(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS, EXPECT_EQ(gfx::SwapResult::SWAP_NAK_RECREATE_BUFFERS,
...@@ -192,7 +192,7 @@ TEST_F(DrmWindowTest, CheckCallbackOnFailedSwap) { ...@@ -192,7 +192,7 @@ TEST_F(DrmWindowTest, CheckCallbackOnFailedSwap) {
last_presentation_feedback_.flags); last_presentation_feedback_.flags);
window->SchedulePageFlip( window->SchedulePageFlip(
std::vector<ui::OverlayPlane>(1, ui::OverlayPlane(plane)), std::vector<ui::DrmOverlayPlane>(1, ui::DrmOverlayPlane(plane)),
base::BindOnce(&DrmWindowTest::OnSwapBuffers, base::Unretained(this))); base::BindOnce(&DrmWindowTest::OnSwapBuffers, base::Unretained(this)));
EXPECT_EQ(2, on_swap_buffers_count_); EXPECT_EQ(2, on_swap_buffers_count_);
EXPECT_EQ(gfx::SwapResult::SWAP_FAILED, last_swap_buffers_result_); EXPECT_EQ(gfx::SwapResult::SWAP_FAILED, last_swap_buffers_result_);
......
...@@ -377,8 +377,8 @@ bool GbmPixmap::ScheduleOverlayPlane(gfx::AcceleratedWidget widget, ...@@ -377,8 +377,8 @@ bool GbmPixmap::ScheduleOverlayPlane(gfx::AcceleratedWidget widget,
// here since this method might be called every pageflip. // here since this method might be called every pageflip.
if (buffer_->GetFramebufferId()) { if (buffer_->GetFramebufferId()) {
surface_manager_->GetSurface(widget)->QueueOverlayPlane( surface_manager_->GetSurface(widget)->QueueOverlayPlane(
OverlayPlane(buffer_, plane_z_order, plane_transform, display_bounds, DrmOverlayPlane(buffer_, plane_z_order, plane_transform, display_bounds,
crop_rect, enable_blend, gpu_fence)); crop_rect, enable_blend, gpu_fence));
} }
return true; return true;
......
...@@ -44,7 +44,7 @@ GbmSurfaceless::GbmSurfaceless(GbmSurfaceFactory* surface_factory, ...@@ -44,7 +44,7 @@ GbmSurfaceless::GbmSurfaceless(GbmSurfaceFactory* surface_factory,
unsubmitted_frames_.push_back(std::make_unique<PendingFrame>()); unsubmitted_frames_.push_back(std::make_unique<PendingFrame>());
} }
void GbmSurfaceless::QueueOverlayPlane(const OverlayPlane& plane) { void GbmSurfaceless::QueueOverlayPlane(const DrmOverlayPlane& plane) {
is_on_external_drm_device_ = plane.buffer->RequiresGlFinish(); is_on_external_drm_device_ = plane.buffer->RequiresGlFinish();
planes_.push_back(plane); planes_.push_back(plane);
} }
......
...@@ -32,7 +32,7 @@ class GbmSurfaceless : public gl::SurfacelessEGL { ...@@ -32,7 +32,7 @@ class GbmSurfaceless : public gl::SurfacelessEGL {
std::unique_ptr<DrmWindowProxy> window, std::unique_ptr<DrmWindowProxy> window,
gfx::AcceleratedWidget widget); gfx::AcceleratedWidget widget);
void QueueOverlayPlane(const OverlayPlane& plane); void QueueOverlayPlane(const DrmOverlayPlane& plane);
// gl::GLSurface: // gl::GLSurface:
bool Initialize(gl::GLSurfaceFormat format) override; bool Initialize(gl::GLSurfaceFormat format) override;
...@@ -99,7 +99,7 @@ class GbmSurfaceless : public gl::SurfacelessEGL { ...@@ -99,7 +99,7 @@ class GbmSurfaceless : public gl::SurfacelessEGL {
GbmSurfaceFactory* surface_factory_; GbmSurfaceFactory* surface_factory_;
std::unique_ptr<DrmWindowProxy> window_; std::unique_ptr<DrmWindowProxy> window_;
std::vector<OverlayPlane> planes_; std::vector<DrmOverlayPlane> planes_;
// The native surface. Deleting this is allowed to free the EGLNativeWindow. // The native surface. Deleting this is allowed to free the EGLNativeWindow.
gfx::AcceleratedWidget widget_; gfx::AcceleratedWidget widget_;
......
...@@ -45,7 +45,7 @@ HardwareDisplayController::~HardwareDisplayController() { ...@@ -45,7 +45,7 @@ HardwareDisplayController::~HardwareDisplayController() {
UnsetCursor(); UnsetCursor();
} }
bool HardwareDisplayController::Modeset(const OverlayPlane& primary, bool HardwareDisplayController::Modeset(const DrmOverlayPlane& primary,
drmModeModeInfo mode) { drmModeModeInfo mode) {
TRACE_EVENT0("drm", "HDC::Modeset"); TRACE_EVENT0("drm", "HDC::Modeset");
DCHECK(primary.buffer.get()); DCHECK(primary.buffer.get());
...@@ -58,7 +58,7 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary, ...@@ -58,7 +58,7 @@ bool HardwareDisplayController::Modeset(const OverlayPlane& primary,
return status; return status;
} }
bool HardwareDisplayController::Enable(const OverlayPlane& primary) { bool HardwareDisplayController::Enable(const DrmOverlayPlane& primary) {
TRACE_EVENT0("drm", "HDC::Enable"); TRACE_EVENT0("drm", "HDC::Enable");
DCHECK(primary.buffer.get()); DCHECK(primary.buffer.get());
bool status = true; bool status = true;
...@@ -86,20 +86,20 @@ void HardwareDisplayController::Disable() { ...@@ -86,20 +86,20 @@ void HardwareDisplayController::Disable() {
} }
bool HardwareDisplayController::SchedulePageFlip( bool HardwareDisplayController::SchedulePageFlip(
const OverlayPlaneList& plane_list, const DrmOverlayPlaneList& plane_list,
SwapCompletionOnceCallback callback) { SwapCompletionOnceCallback callback) {
return ActualSchedulePageFlip(plane_list, false /* test_only */, return ActualSchedulePageFlip(plane_list, false /* test_only */,
std::move(callback)); std::move(callback));
} }
bool HardwareDisplayController::TestPageFlip( bool HardwareDisplayController::TestPageFlip(
const OverlayPlaneList& plane_list) { const DrmOverlayPlaneList& plane_list) {
return ActualSchedulePageFlip(plane_list, true /* test_only */, return ActualSchedulePageFlip(plane_list, true /* test_only */,
base::BindOnce(&EmptyFlipCallback)); base::BindOnce(&EmptyFlipCallback));
} }
bool HardwareDisplayController::ActualSchedulePageFlip( bool HardwareDisplayController::ActualSchedulePageFlip(
const OverlayPlaneList& plane_list, const DrmOverlayPlaneList& plane_list,
bool test_only, bool test_only,
SwapCompletionOnceCallback callback) { SwapCompletionOnceCallback callback) {
TRACE_EVENT0("drm", "HDC::SchedulePageFlip"); TRACE_EVENT0("drm", "HDC::SchedulePageFlip");
...@@ -113,9 +113,9 @@ bool HardwareDisplayController::ActualSchedulePageFlip( ...@@ -113,9 +113,9 @@ bool HardwareDisplayController::ActualSchedulePageFlip(
return true; return true;
} }
OverlayPlaneList pending_planes = plane_list; DrmOverlayPlaneList pending_planes = plane_list;
std::sort(pending_planes.begin(), pending_planes.end(), std::sort(pending_planes.begin(), pending_planes.end(),
[](const OverlayPlane& l, const OverlayPlane& r) { [](const DrmOverlayPlane& l, const DrmOverlayPlane& r) {
return l.z_order < r.z_order; return l.z_order < r.z_order;
}); });
scoped_refptr<PageFlipRequest> page_flip_request = scoped_refptr<PageFlipRequest> page_flip_request =
......
...@@ -94,10 +94,10 @@ class HardwareDisplayController { ...@@ -94,10 +94,10 @@ class HardwareDisplayController {
// Performs the initial CRTC configuration. If successful, it will display the // Performs the initial CRTC configuration. If successful, it will display the
// framebuffer for |primary| with |mode|. // framebuffer for |primary| with |mode|.
bool Modeset(const OverlayPlane& primary, drmModeModeInfo mode); bool Modeset(const DrmOverlayPlane& primary, drmModeModeInfo mode);
// Performs a CRTC configuration re-using the modes from the CRTCs. // Performs a CRTC configuration re-using the modes from the CRTCs.
bool Enable(const OverlayPlane& primary); bool Enable(const DrmOverlayPlane& primary);
// Disables the CRTC. // Disables the CRTC.
void Disable(); void Disable();
...@@ -116,12 +116,12 @@ class HardwareDisplayController { ...@@ -116,12 +116,12 @@ class HardwareDisplayController {
// //
// Note that this function does not block. Also, this function should not be // Note that this function does not block. Also, this function should not be
// called again before the page flip occurrs. // called again before the page flip occurrs.
bool SchedulePageFlip(const OverlayPlaneList& plane_list, bool SchedulePageFlip(const DrmOverlayPlaneList& plane_list,
SwapCompletionOnceCallback callback); SwapCompletionOnceCallback callback);
// Returns true if the page flip with the |plane_list| would succeed. This // Returns true if the page flip with the |plane_list| would succeed. This
// doesn't change any state. // doesn't change any state.
bool TestPageFlip(const OverlayPlaneList& plane_list); bool TestPageFlip(const DrmOverlayPlaneList& plane_list);
// Return the supported modifiers for |fourcc_format| for this // Return the supported modifiers for |fourcc_format| for this
// controller. // controller.
...@@ -164,7 +164,7 @@ class HardwareDisplayController { ...@@ -164,7 +164,7 @@ class HardwareDisplayController {
scoped_refptr<DrmDevice> GetAllocationDrmDevice() const; scoped_refptr<DrmDevice> GetAllocationDrmDevice() const;
private: private:
bool ActualSchedulePageFlip(const OverlayPlaneList& plane_list, bool ActualSchedulePageFlip(const DrmOverlayPlaneList& plane_list,
bool test_only, bool test_only,
SwapCompletionOnceCallback callback); SwapCompletionOnceCallback callback);
......
...@@ -127,7 +127,7 @@ std::unique_ptr<HardwareDisplayPlane> HardwareDisplayPlaneManager::CreatePlane( ...@@ -127,7 +127,7 @@ std::unique_ptr<HardwareDisplayPlane> HardwareDisplayPlaneManager::CreatePlane(
HardwareDisplayPlane* HardwareDisplayPlaneManager::FindNextUnusedPlane( HardwareDisplayPlane* HardwareDisplayPlaneManager::FindNextUnusedPlane(
size_t* index, size_t* index,
uint32_t crtc_index, uint32_t crtc_index,
const OverlayPlane& overlay) const { const DrmOverlayPlane& overlay) const {
for (size_t i = *index; i < planes_.size(); ++i) { for (size_t i = *index; i < planes_.size(); ++i) {
auto* plane = planes_[i].get(); auto* plane = planes_[i].get();
if (!plane->in_use() && IsCompatible(plane, overlay, crtc_index)) { if (!plane->in_use() && IsCompatible(plane, overlay, crtc_index)) {
...@@ -146,7 +146,7 @@ int HardwareDisplayPlaneManager::LookupCrtcIndex(uint32_t crtc_id) const { ...@@ -146,7 +146,7 @@ int HardwareDisplayPlaneManager::LookupCrtcIndex(uint32_t crtc_id) const {
} }
bool HardwareDisplayPlaneManager::IsCompatible(HardwareDisplayPlane* plane, bool HardwareDisplayPlaneManager::IsCompatible(HardwareDisplayPlane* plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_index) const { uint32_t crtc_index) const {
if (plane->type() == HardwareDisplayPlane::kCursor || if (plane->type() == HardwareDisplayPlane::kCursor ||
!plane->CanUseForCrtc(crtc_index)) !plane->CanUseForCrtc(crtc_index))
...@@ -198,7 +198,7 @@ void HardwareDisplayPlaneManager::BeginFrame( ...@@ -198,7 +198,7 @@ void HardwareDisplayPlaneManager::BeginFrame(
bool HardwareDisplayPlaneManager::AssignOverlayPlanes( bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
HardwareDisplayPlaneList* plane_list, HardwareDisplayPlaneList* plane_list,
const OverlayPlaneList& overlay_list, const DrmOverlayPlaneList& overlay_list,
uint32_t crtc_id, uint32_t crtc_id,
CrtcController* crtc) { CrtcController* crtc) {
int crtc_index = LookupCrtcIndex(crtc_id); int crtc_index = LookupCrtcIndex(crtc_id);
......
...@@ -92,7 +92,7 @@ class HardwareDisplayPlaneManager { ...@@ -92,7 +92,7 @@ class HardwareDisplayPlaneManager {
// recording the plane IDs in the |plane_list|. Only planes compatible with // recording the plane IDs in the |plane_list|. Only planes compatible with
// |crtc_id| will be used. |overlay_list| must be sorted bottom-to-top. // |crtc_id| will be used. |overlay_list| must be sorted bottom-to-top.
virtual bool AssignOverlayPlanes(HardwareDisplayPlaneList* plane_list, virtual bool AssignOverlayPlanes(HardwareDisplayPlaneList* plane_list,
const OverlayPlaneList& overlay_list, const DrmOverlayPlaneList& overlay_list,
uint32_t crtc_id, uint32_t crtc_id,
CrtcController* crtc); CrtcController* crtc);
...@@ -113,7 +113,7 @@ class HardwareDisplayPlaneManager { ...@@ -113,7 +113,7 @@ class HardwareDisplayPlaneManager {
// Check that the primary plane is valid for this // Check that the primary plane is valid for this
// PlaneManager. Specifically, legacy can't support primary planes // PlaneManager. Specifically, legacy can't support primary planes
// that don't have the same size as the current mode of the crtc. // that don't have the same size as the current mode of the crtc.
virtual bool ValidatePrimarySize(const OverlayPlane& primary, virtual bool ValidatePrimarySize(const DrmOverlayPlane& primary,
const drmModeModeInfo& mode) = 0; const drmModeModeInfo& mode) = 0;
const std::vector<std::unique_ptr<HardwareDisplayPlane>>& planes() { const std::vector<std::unique_ptr<HardwareDisplayPlane>>& planes() {
...@@ -123,7 +123,7 @@ class HardwareDisplayPlaneManager { ...@@ -123,7 +123,7 @@ class HardwareDisplayPlaneManager {
// Request a callback to be called when the planes are ready to be displayed. // Request a callback to be called when the planes are ready to be displayed.
// The callback will be invoked in the caller's execution context (same // The callback will be invoked in the caller's execution context (same
// sequence or thread). // sequence or thread).
virtual void RequestPlanesReadyCallback(const OverlayPlaneList& planes, virtual void RequestPlanesReadyCallback(const DrmOverlayPlaneList& planes,
base::OnceClosure callback) = 0; base::OnceClosure callback) = 0;
// Returns all formats which can be scanned out by this PlaneManager. // Returns all formats which can be scanned out by this PlaneManager.
...@@ -148,7 +148,7 @@ class HardwareDisplayPlaneManager { ...@@ -148,7 +148,7 @@ class HardwareDisplayPlaneManager {
virtual bool SetPlaneData(HardwareDisplayPlaneList* plane_list, virtual bool SetPlaneData(HardwareDisplayPlaneList* plane_list,
HardwareDisplayPlane* hw_plane, HardwareDisplayPlane* hw_plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_id, uint32_t crtc_id,
const gfx::Rect& src_rect, const gfx::Rect& src_rect,
CrtcController* crtc) = 0; CrtcController* crtc) = 0;
...@@ -157,9 +157,10 @@ class HardwareDisplayPlaneManager { ...@@ -157,9 +157,10 @@ class HardwareDisplayPlaneManager {
// Finds the plane located at or after |*index| that is not in use and can // Finds the plane located at or after |*index| that is not in use and can
// be used with |crtc_index|. // be used with |crtc_index|.
HardwareDisplayPlane* FindNextUnusedPlane(size_t* index, HardwareDisplayPlane* FindNextUnusedPlane(
uint32_t crtc_index, size_t* index,
const OverlayPlane& overlay) const; uint32_t crtc_index,
const DrmOverlayPlane& overlay) const;
// Convert |crtc_id| into an index, returning -1 if the ID couldn't be found. // Convert |crtc_id| into an index, returning -1 if the ID couldn't be found.
int LookupCrtcIndex(uint32_t crtc_id) const; int LookupCrtcIndex(uint32_t crtc_id) const;
...@@ -167,7 +168,7 @@ class HardwareDisplayPlaneManager { ...@@ -167,7 +168,7 @@ class HardwareDisplayPlaneManager {
// Returns true if |plane| can support |overlay| and compatible with // Returns true if |plane| can support |overlay| and compatible with
// |crtc_index|. // |crtc_index|.
virtual bool IsCompatible(HardwareDisplayPlane* plane, virtual bool IsCompatible(HardwareDisplayPlane* plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_index) const; uint32_t crtc_index) const;
void ResetCurrentPlaneList(HardwareDisplayPlaneList* plane_list) const; void ResetCurrentPlaneList(HardwareDisplayPlaneList* plane_list) const;
......
...@@ -153,7 +153,7 @@ bool HardwareDisplayPlaneManagerAtomic::SetColorCorrectionOnAllCrtcPlanes( ...@@ -153,7 +153,7 @@ bool HardwareDisplayPlaneManagerAtomic::SetColorCorrectionOnAllCrtcPlanes(
} }
bool HardwareDisplayPlaneManagerAtomic::ValidatePrimarySize( bool HardwareDisplayPlaneManagerAtomic::ValidatePrimarySize(
const OverlayPlane& primary, const DrmOverlayPlane& primary,
const drmModeModeInfo& mode) { const drmModeModeInfo& mode) {
// Atomic KMS allows for primary planes that don't match the size of // Atomic KMS allows for primary planes that don't match the size of
// the current mode. // the current mode.
...@@ -161,7 +161,7 @@ bool HardwareDisplayPlaneManagerAtomic::ValidatePrimarySize( ...@@ -161,7 +161,7 @@ bool HardwareDisplayPlaneManagerAtomic::ValidatePrimarySize(
} }
void HardwareDisplayPlaneManagerAtomic::RequestPlanesReadyCallback( void HardwareDisplayPlaneManagerAtomic::RequestPlanesReadyCallback(
const OverlayPlaneList& planes, const DrmOverlayPlaneList& planes,
base::OnceClosure callback) { base::OnceClosure callback) {
base::SequencedTaskRunnerHandle::Get()->PostTask(FROM_HERE, base::SequencedTaskRunnerHandle::Get()->PostTask(FROM_HERE,
std::move(callback)); std::move(callback));
...@@ -170,7 +170,7 @@ void HardwareDisplayPlaneManagerAtomic::RequestPlanesReadyCallback( ...@@ -170,7 +170,7 @@ void HardwareDisplayPlaneManagerAtomic::RequestPlanesReadyCallback(
bool HardwareDisplayPlaneManagerAtomic::SetPlaneData( bool HardwareDisplayPlaneManagerAtomic::SetPlaneData(
HardwareDisplayPlaneList* plane_list, HardwareDisplayPlaneList* plane_list,
HardwareDisplayPlane* hw_plane, HardwareDisplayPlane* hw_plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_id, uint32_t crtc_id,
const gfx::Rect& src_rect, const gfx::Rect& src_rect,
CrtcController* crtc) { CrtcController* crtc) {
......
...@@ -26,14 +26,14 @@ class HardwareDisplayPlaneManagerAtomic : public HardwareDisplayPlaneManager { ...@@ -26,14 +26,14 @@ class HardwareDisplayPlaneManagerAtomic : public HardwareDisplayPlaneManager {
uint32_t crtc_id, uint32_t crtc_id,
ScopedDrmColorCtmPtr ctm_blob_data) override; ScopedDrmColorCtmPtr ctm_blob_data) override;
bool ValidatePrimarySize(const OverlayPlane& primary, bool ValidatePrimarySize(const DrmOverlayPlane& primary,
const drmModeModeInfo& mode) override; const drmModeModeInfo& mode) override;
void RequestPlanesReadyCallback(const OverlayPlaneList& planes, void RequestPlanesReadyCallback(const DrmOverlayPlaneList& planes,
base::OnceClosure callback) override; base::OnceClosure callback) override;
bool SetPlaneData(HardwareDisplayPlaneList* plane_list, bool SetPlaneData(HardwareDisplayPlaneList* plane_list,
HardwareDisplayPlane* hw_plane, HardwareDisplayPlane* hw_plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_id, uint32_t crtc_id,
const gfx::Rect& src_rect, const gfx::Rect& src_rect,
CrtcController* crtc) override; CrtcController* crtc) override;
......
...@@ -24,7 +24,7 @@ namespace { ...@@ -24,7 +24,7 @@ namespace {
// We currently wait for the fences serially, but it's possible // We currently wait for the fences serially, but it's possible
// that merging the fences and waiting on the merged fence fd // that merging the fences and waiting on the merged fence fd
// is more efficient. We should revisit once we have more info. // is more efficient. We should revisit once we have more info.
void WaitForPlaneFences(const ui::OverlayPlaneList& planes) { void WaitForPlaneFences(const ui::DrmOverlayPlaneList& planes) {
for (const auto& plane : planes) { for (const auto& plane : planes) {
if (plane.gpu_fence) if (plane.gpu_fence)
plane.gpu_fence->Wait(); plane.gpu_fence->Wait();
...@@ -140,7 +140,7 @@ bool HardwareDisplayPlaneManagerLegacy::SetColorCorrectionOnAllCrtcPlanes( ...@@ -140,7 +140,7 @@ bool HardwareDisplayPlaneManagerLegacy::SetColorCorrectionOnAllCrtcPlanes(
} }
bool HardwareDisplayPlaneManagerLegacy::ValidatePrimarySize( bool HardwareDisplayPlaneManagerLegacy::ValidatePrimarySize(
const OverlayPlane& primary, const DrmOverlayPlane& primary,
const drmModeModeInfo& mode) { const drmModeModeInfo& mode) {
DCHECK(primary.buffer.get()); DCHECK(primary.buffer.get());
...@@ -148,7 +148,7 @@ bool HardwareDisplayPlaneManagerLegacy::ValidatePrimarySize( ...@@ -148,7 +148,7 @@ bool HardwareDisplayPlaneManagerLegacy::ValidatePrimarySize(
} }
void HardwareDisplayPlaneManagerLegacy::RequestPlanesReadyCallback( void HardwareDisplayPlaneManagerLegacy::RequestPlanesReadyCallback(
const OverlayPlaneList& planes, const DrmOverlayPlaneList& planes,
base::OnceClosure callback) { base::OnceClosure callback) {
base::PostTaskWithTraitsAndReply( base::PostTaskWithTraitsAndReply(
FROM_HERE, FROM_HERE,
...@@ -159,7 +159,7 @@ void HardwareDisplayPlaneManagerLegacy::RequestPlanesReadyCallback( ...@@ -159,7 +159,7 @@ void HardwareDisplayPlaneManagerLegacy::RequestPlanesReadyCallback(
bool HardwareDisplayPlaneManagerLegacy::SetPlaneData( bool HardwareDisplayPlaneManagerLegacy::SetPlaneData(
HardwareDisplayPlaneList* plane_list, HardwareDisplayPlaneList* plane_list,
HardwareDisplayPlane* hw_plane, HardwareDisplayPlane* hw_plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_id, uint32_t crtc_id,
const gfx::Rect& src_rect, const gfx::Rect& src_rect,
CrtcController* crtc) { CrtcController* crtc) {
...@@ -183,7 +183,7 @@ bool HardwareDisplayPlaneManagerLegacy::SetPlaneData( ...@@ -183,7 +183,7 @@ bool HardwareDisplayPlaneManagerLegacy::SetPlaneData(
bool HardwareDisplayPlaneManagerLegacy::IsCompatible( bool HardwareDisplayPlaneManagerLegacy::IsCompatible(
HardwareDisplayPlane* plane, HardwareDisplayPlane* plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_index) const { uint32_t crtc_index) const {
if (plane->type() == HardwareDisplayPlane::kCursor || if (plane->type() == HardwareDisplayPlane::kCursor ||
!plane->CanUseForCrtc(crtc_index)) !plane->CanUseForCrtc(crtc_index))
......
...@@ -26,21 +26,21 @@ class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager { ...@@ -26,21 +26,21 @@ class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager {
uint32_t crtc_id, uint32_t crtc_id,
ScopedDrmColorCtmPtr ctm_blob_data) override; ScopedDrmColorCtmPtr ctm_blob_data) override;
bool ValidatePrimarySize(const OverlayPlane& primary, bool ValidatePrimarySize(const DrmOverlayPlane& primary,
const drmModeModeInfo& mode) override; const drmModeModeInfo& mode) override;
void RequestPlanesReadyCallback(const OverlayPlaneList& planes, void RequestPlanesReadyCallback(const DrmOverlayPlaneList& planes,
base::OnceClosure callback) override; base::OnceClosure callback) override;
protected: protected:
bool SetPlaneData(HardwareDisplayPlaneList* plane_list, bool SetPlaneData(HardwareDisplayPlaneList* plane_list,
HardwareDisplayPlane* hw_plane, HardwareDisplayPlane* hw_plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_id, uint32_t crtc_id,
const gfx::Rect& src_rect, const gfx::Rect& src_rect,
CrtcController* crtc) override; CrtcController* crtc) override;
bool IsCompatible(HardwareDisplayPlane* plane, bool IsCompatible(HardwareDisplayPlane* plane,
const OverlayPlane& overlay, const DrmOverlayPlane& overlay,
uint32_t crtc_index) const override; uint32_t crtc_index) const override;
bool CommitColorMatrix(const CrtcProperties& crtc_props) override; bool CommitColorMatrix(const CrtcProperties& crtc_props) override;
bool CommitGammaCorrection(const CrtcProperties& crtc_props) override; bool CommitGammaCorrection(const CrtcProperties& crtc_props) override;
......
...@@ -345,7 +345,7 @@ void ScreenManager::UpdateControllerToWindowMapping() { ...@@ -345,7 +345,7 @@ void ScreenManager::UpdateControllerToWindowMapping() {
} }
} }
OverlayPlane ScreenManager::GetModesetBuffer( DrmOverlayPlane ScreenManager::GetModesetBuffer(
HardwareDisplayController* controller, HardwareDisplayController* controller,
const gfx::Rect& bounds) { const gfx::Rect& bounds) {
DrmWindow* window = FindWindowAt(bounds); DrmWindow* window = FindWindowAt(bounds);
...@@ -355,7 +355,7 @@ OverlayPlane ScreenManager::GetModesetBuffer( ...@@ -355,7 +355,7 @@ OverlayPlane ScreenManager::GetModesetBuffer(
const auto& modifiers = const auto& modifiers =
controller->GetFormatModifiersForModesetting(fourcc_format); controller->GetFormatModifiersForModesetting(fourcc_format);
if (window) { if (window) {
const OverlayPlane* primary = window->GetLastModesetBuffer(); const DrmOverlayPlane* primary = window->GetLastModesetBuffer();
const DrmDevice* drm = controller->GetAllocationDrmDevice().get(); const DrmDevice* drm = controller->GetAllocationDrmDevice().get();
if (primary && primary->buffer->GetSize() == bounds.size() && if (primary && primary->buffer->GetSize() == bounds.size() &&
primary->buffer->GetGbmDeviceLinux() == drm->AsGbmDeviceLinux()) { primary->buffer->GetGbmDeviceLinux() == drm->AsGbmDeviceLinux()) {
...@@ -377,19 +377,19 @@ OverlayPlane ScreenManager::GetModesetBuffer( ...@@ -377,19 +377,19 @@ OverlayPlane ScreenManager::GetModesetBuffer(
buffer_generator_->Create(drm, fourcc_format, modifiers, bounds.size()); buffer_generator_->Create(drm, fourcc_format, modifiers, bounds.size());
if (!buffer) { if (!buffer) {
LOG(ERROR) << "Failed to create scanout buffer"; LOG(ERROR) << "Failed to create scanout buffer";
return OverlayPlane(nullptr, 0, gfx::OVERLAY_TRANSFORM_INVALID, gfx::Rect(), return DrmOverlayPlane(nullptr, 0, gfx::OVERLAY_TRANSFORM_INVALID,
gfx::RectF(), /* enable_blend */ true, gfx::Rect(), gfx::RectF(), /* enable_blend */ true,
/* gpu_fence */ nullptr); /* gpu_fence */ nullptr);
} }
FillModesetBuffer(drm, controller, buffer.get()); FillModesetBuffer(drm, controller, buffer.get());
return OverlayPlane(buffer, nullptr); return DrmOverlayPlane(buffer, nullptr);
} }
bool ScreenManager::EnableController(HardwareDisplayController* controller) { bool ScreenManager::EnableController(HardwareDisplayController* controller) {
DCHECK(!controller->crtc_controllers().empty()); DCHECK(!controller->crtc_controllers().empty());
gfx::Rect rect(controller->origin(), controller->GetModeSize()); gfx::Rect rect(controller->origin(), controller->GetModeSize());
OverlayPlane plane = GetModesetBuffer(controller, rect); DrmOverlayPlane plane = GetModesetBuffer(controller, rect);
if (!plane.buffer || !controller->Enable(plane)) { if (!plane.buffer || !controller->Enable(plane)) {
LOG(ERROR) << "Failed to enable controller"; LOG(ERROR) << "Failed to enable controller";
return false; return false;
...@@ -405,7 +405,7 @@ bool ScreenManager::ModesetController(HardwareDisplayController* controller, ...@@ -405,7 +405,7 @@ bool ScreenManager::ModesetController(HardwareDisplayController* controller,
gfx::Rect rect(origin, gfx::Size(mode.hdisplay, mode.vdisplay)); gfx::Rect rect(origin, gfx::Size(mode.hdisplay, mode.vdisplay));
controller->set_origin(origin); controller->set_origin(origin);
OverlayPlane plane = GetModesetBuffer(controller, rect); DrmOverlayPlane plane = GetModesetBuffer(controller, rect);
if (!plane.buffer || !controller->Modeset(plane, mode)) { if (!plane.buffer || !controller->Modeset(plane, mode)) {
LOG(ERROR) << "Failed to modeset controller"; LOG(ERROR) << "Failed to modeset controller";
return false; return false;
......
...@@ -112,8 +112,8 @@ class ScreenManager { ...@@ -112,8 +112,8 @@ class ScreenManager {
uint32_t connector, uint32_t connector,
const drmModeModeInfo& mode); const drmModeModeInfo& mode);
OverlayPlane GetModesetBuffer(HardwareDisplayController* controller, DrmOverlayPlane GetModesetBuffer(HardwareDisplayController* controller,
const gfx::Rect& bounds); const gfx::Rect& bounds);
bool EnableController(HardwareDisplayController* controller); bool EnableController(HardwareDisplayController* controller);
......
...@@ -502,7 +502,7 @@ TEST_F(ScreenManagerTest, EnableControllerWhenWindowHasBuffer) { ...@@ -502,7 +502,7 @@ TEST_F(ScreenManagerTest, EnableControllerWhenWindowHasBuffer) {
scoped_refptr<ui::ScanoutBuffer> buffer = buffer_generator_->Create( scoped_refptr<ui::ScanoutBuffer> buffer = buffer_generator_->Create(
drm_, DRM_FORMAT_XRGB8888, {}, GetPrimaryBounds().size()); drm_, DRM_FORMAT_XRGB8888, {}, GetPrimaryBounds().size());
window->SchedulePageFlip( window->SchedulePageFlip(
std::vector<ui::OverlayPlane>(1, ui::OverlayPlane(buffer, nullptr)), std::vector<ui::DrmOverlayPlane>(1, ui::DrmOverlayPlane(buffer, nullptr)),
base::DoNothing()); base::DoNothing());
screen_manager_->AddWindow(1, std::move(window)); screen_manager_->AddWindow(1, std::move(window));
...@@ -528,7 +528,7 @@ TEST_F(ScreenManagerTest, RejectBufferWithIncompatibleModifiers) { ...@@ -528,7 +528,7 @@ TEST_F(ScreenManagerTest, RejectBufferWithIncompatibleModifiers) {
GetPrimaryBounds().size()); GetPrimaryBounds().size());
window->SchedulePageFlip( window->SchedulePageFlip(
std::vector<ui::OverlayPlane>(1, ui::OverlayPlane(buffer, nullptr)), std::vector<ui::DrmOverlayPlane>(1, ui::DrmOverlayPlane(buffer, nullptr)),
base::DoNothing()); base::DoNothing());
screen_manager_->AddWindow(1, std::move(window)); screen_manager_->AddWindow(1, std::move(window));
......
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