Commit 8552cb30 authored by Mark Yacoub's avatar Mark Yacoub Committed by Commit Bot

ozone: Cleanup code involved in Modeset

1. Use const and pass by reference when appropriate.
2. Convert NULL to nullptr in the modified files.
3. Fix some file formatting to match clang.
4. Use default and explicit constructors where they should be
5. Remove unused SetCrtc overload.

BUG=987274
TEST=HardwareDisplayControllerTest, HardwareDisplayPlaneManager*Test

Change-Id: Ic0f019bfa862a5160805ecbfd22dc391e6f9f418
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2031864
Commit-Queue: Mark Yacoub <markyacoub@google.com>
Auto-Submit: Mark Yacoub <markyacoub@google.com>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737024}
parent ae56ec4b
...@@ -45,9 +45,9 @@ CrtcController::~CrtcController() { ...@@ -45,9 +45,9 @@ CrtcController::~CrtcController() {
} }
bool CrtcController::Modeset(const DrmOverlayPlane& plane, bool CrtcController::Modeset(const DrmOverlayPlane& plane,
drmModeModeInfo mode) { const drmModeModeInfo& mode) {
if (!drm_->SetCrtc(crtc_, plane.buffer->opaque_framebuffer_id(), if (!drm_->SetCrtc(crtc_, plane.buffer->opaque_framebuffer_id(),
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_
<< " connector=" << connector_ << " connector=" << connector_
<< " framebuffer_id=" << plane.buffer->opaque_framebuffer_id() << " framebuffer_id=" << plane.buffer->opaque_framebuffer_id()
......
...@@ -42,7 +42,7 @@ class CrtcController { ...@@ -42,7 +42,7 @@ class 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 DrmOverlayPlane& plane, drmModeModeInfo mode); bool Modeset(const DrmOverlayPlane& plane, const drmModeModeInfo& mode);
// Disables the controller. // Disables the controller.
bool Disable(); bool Disable();
......
...@@ -146,7 +146,7 @@ DrmPropertyBlobMetadata::~DrmPropertyBlobMetadata() { ...@@ -146,7 +146,7 @@ DrmPropertyBlobMetadata::~DrmPropertyBlobMetadata() {
class DrmDevice::PageFlipManager { class DrmDevice::PageFlipManager {
public: public:
PageFlipManager() : next_id_(0) {} PageFlipManager() : next_id_(0) {}
~PageFlipManager() {} ~PageFlipManager() = default;
void OnPageFlip(uint32_t frame, base::TimeTicks timestamp, uint64_t id) { void OnPageFlip(uint32_t frame, base::TimeTicks timestamp, uint64_t id) {
auto it = auto it =
...@@ -248,7 +248,7 @@ DrmDevice::DrmDevice(const base::FilePath& device_path, ...@@ -248,7 +248,7 @@ DrmDevice::DrmDevice(const base::FilePath& device_path,
is_primary_device_(is_primary_device), is_primary_device_(is_primary_device),
gbm_(std::move(gbm)) {} gbm_(std::move(gbm)) {}
DrmDevice::~DrmDevice() {} DrmDevice::~DrmDevice() = default;
bool DrmDevice::Initialize() { bool DrmDevice::Initialize() {
// Ignore devices that cannot perform modesetting. // Ignore devices that cannot perform modesetting.
...@@ -302,36 +302,22 @@ ScopedDrmCrtcPtr DrmDevice::GetCrtc(uint32_t crtc_id) { ...@@ -302,36 +302,22 @@ ScopedDrmCrtcPtr DrmDevice::GetCrtc(uint32_t crtc_id) {
bool DrmDevice::SetCrtc(uint32_t crtc_id, bool DrmDevice::SetCrtc(uint32_t crtc_id,
uint32_t framebuffer, uint32_t framebuffer,
std::vector<uint32_t> connectors, std::vector<uint32_t> connectors,
drmModeModeInfo* mode) { const drmModeModeInfo& mode) {
DCHECK(file_.IsValid()); DCHECK(file_.IsValid());
DCHECK(!connectors.empty()); DCHECK(!connectors.empty());
DCHECK(mode);
TRACE_EVENT2("drm", "DrmDevice::SetCrtc", "crtc", crtc_id, "size", TRACE_EVENT2("drm", "DrmDevice::SetCrtc", "crtc", crtc_id, "size",
gfx::Size(mode->hdisplay, mode->vdisplay).ToString()); gfx::Size(mode.hdisplay, mode.vdisplay).ToString());
return !drmModeSetCrtc(file_.GetPlatformFile(), crtc_id, framebuffer, 0, 0, return !drmModeSetCrtc(file_.GetPlatformFile(), crtc_id, framebuffer, 0, 0,
connectors.data(), connectors.size(), mode); connectors.data(), connectors.size(),
} const_cast<drmModeModeInfo*>(&mode));
bool DrmDevice::SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) {
DCHECK(file_.IsValid());
// If there's no buffer then the CRTC was disabled.
if (!crtc->buffer_id)
return DisableCrtc(crtc->crtc_id);
DCHECK(!connectors.empty());
TRACE_EVENT1("drm", "DrmDevice::RestoreCrtc", "crtc", crtc->crtc_id);
return !drmModeSetCrtc(file_.GetPlatformFile(), crtc->crtc_id,
crtc->buffer_id, crtc->x, crtc->y, connectors.data(),
connectors.size(), &crtc->mode);
} }
bool DrmDevice::DisableCrtc(uint32_t crtc_id) { bool DrmDevice::DisableCrtc(uint32_t crtc_id) {
DCHECK(file_.IsValid()); DCHECK(file_.IsValid());
TRACE_EVENT1("drm", "DrmDevice::DisableCrtc", "crtc", crtc_id); TRACE_EVENT1("drm", "DrmDevice::DisableCrtc", "crtc", crtc_id);
return !drmModeSetCrtc(file_.GetPlatformFile(), crtc_id, 0, 0, 0, NULL, 0, return !drmModeSetCrtc(file_.GetPlatformFile(), crtc_id, 0, 0, 0, nullptr, 0,
NULL); nullptr);
} }
ScopedDrmConnectorPtr DrmDevice::GetConnector(uint32_t connector_id) { ScopedDrmConnectorPtr DrmDevice::GetConnector(uint32_t connector_id) {
...@@ -432,7 +418,8 @@ bool DrmDevice::SetProperty(uint32_t connector_id, ...@@ -432,7 +418,8 @@ bool DrmDevice::SetProperty(uint32_t connector_id,
property_id, value); property_id, value);
} }
ScopedDrmPropertyBlob DrmDevice::CreatePropertyBlob(void* blob, size_t size) { ScopedDrmPropertyBlob DrmDevice::CreatePropertyBlob(const void* blob,
size_t size) {
uint32_t id = 0; uint32_t id = 0;
int ret = drmModeCreatePropertyBlob(file_.GetPlatformFile(), blob, size, &id); int ret = drmModeCreatePropertyBlob(file_.GetPlatformFile(), blob, size, &id);
DCHECK(!ret && id); DCHECK(!ret && id);
...@@ -526,7 +513,7 @@ bool DrmDevice::MapDumbBuffer(uint32_t handle, size_t size, void** pixels) { ...@@ -526,7 +513,7 @@ bool DrmDevice::MapDumbBuffer(uint32_t handle, size_t size, void** pixels) {
return false; return false;
} }
*pixels = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, *pixels = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED,
file_.GetPlatformFile(), map_request.offset); file_.GetPlatformFile(), map_request.offset);
if (*pixels == MAP_FAILED) { if (*pixels == MAP_FAILED) {
PLOG(ERROR) << "Cannot mmap dumb buffer"; PLOG(ERROR) << "Cannot mmap dumb buffer";
......
...@@ -106,12 +106,7 @@ class DrmDevice : public base::RefCountedThreadSafe<DrmDevice> { ...@@ -106,12 +106,7 @@ class DrmDevice : public base::RefCountedThreadSafe<DrmDevice> {
virtual bool SetCrtc(uint32_t crtc_id, virtual bool SetCrtc(uint32_t crtc_id,
uint32_t framebuffer, uint32_t framebuffer,
std::vector<uint32_t> connectors, std::vector<uint32_t> connectors,
drmModeModeInfo* mode); const drmModeModeInfo& mode);
// Used to set a specific configuration to the CRTC. Normally this function
// would be called with a CRTC saved state (from |GetCrtc|) to restore it to
// its original configuration.
virtual bool SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors);
virtual bool DisableCrtc(uint32_t crtc_id); virtual bool DisableCrtc(uint32_t crtc_id);
...@@ -168,7 +163,8 @@ class DrmDevice : public base::RefCountedThreadSafe<DrmDevice> { ...@@ -168,7 +163,8 @@ class DrmDevice : public base::RefCountedThreadSafe<DrmDevice> {
uint64_t value); uint64_t value);
// Creates a property blob with data |blob| of size |size|. // Creates a property blob with data |blob| of size |size|.
virtual ScopedDrmPropertyBlob CreatePropertyBlob(void* blob, size_t size); virtual ScopedDrmPropertyBlob CreatePropertyBlob(const void* blob,
size_t size);
virtual void DestroyPropertyBlob(uint32_t id); virtual void DestroyPropertyBlob(uint32_t id);
......
...@@ -47,7 +47,7 @@ constexpr uint32_t kInFormatsPropId = 301; ...@@ -47,7 +47,7 @@ constexpr uint32_t kInFormatsPropId = 301;
class DrmOverlayValidatorTest : public testing::Test { class DrmOverlayValidatorTest : public testing::Test {
public: public:
DrmOverlayValidatorTest() {} DrmOverlayValidatorTest() = default;
void SetUp() override; void SetUp() override;
void TearDown() override; void TearDown() override;
......
...@@ -52,7 +52,7 @@ void DrawCursor(DrmDumbBuffer* cursor, const SkBitmap& image) { ...@@ -52,7 +52,7 @@ void DrawCursor(DrmDumbBuffer* cursor, const SkBitmap& image) {
// Clear to transparent in case |image| is smaller than the canvas. // Clear to transparent in case |image| is smaller than the canvas.
SkCanvas* canvas = cursor->GetCanvas(); SkCanvas* canvas = cursor->GetCanvas();
canvas->clear(SK_ColorTRANSPARENT); canvas->clear(SK_ColorTRANSPARENT);
canvas->drawBitmapRect(image, damage, NULL); canvas->drawBitmapRect(image, damage, nullptr);
} }
} // namespace } // namespace
...@@ -65,11 +65,10 @@ HardwareDisplayController::HardwareDisplayController( ...@@ -65,11 +65,10 @@ HardwareDisplayController::HardwareDisplayController(
AllocateCursorBuffers(); AllocateCursorBuffers();
} }
HardwareDisplayController::~HardwareDisplayController() { HardwareDisplayController::~HardwareDisplayController() = default;
}
bool HardwareDisplayController::Modeset(const DrmOverlayPlane& primary, bool HardwareDisplayController::Modeset(const DrmOverlayPlane& primary,
drmModeModeInfo mode) { const drmModeModeInfo& mode) {
TRACE_EVENT0("drm", "HDC::Modeset"); TRACE_EVENT0("drm", "HDC::Modeset");
DCHECK(primary.buffer.get()); DCHECK(primary.buffer.get());
bool status = true; bool status = true;
......
...@@ -95,7 +95,7 @@ class HardwareDisplayController { ...@@ -95,7 +95,7 @@ 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 DrmOverlayPlane& primary, drmModeModeInfo mode); bool Modeset(const DrmOverlayPlane& primary, const 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 DrmOverlayPlane& primary); bool Enable(const DrmOverlayPlane& primary);
......
...@@ -28,8 +28,7 @@ HardwareDisplayPlaneList::HardwareDisplayPlaneList() { ...@@ -28,8 +28,7 @@ HardwareDisplayPlaneList::HardwareDisplayPlaneList() {
atomic_property_set.reset(drmModeAtomicAlloc()); atomic_property_set.reset(drmModeAtomicAlloc());
} }
HardwareDisplayPlaneList::~HardwareDisplayPlaneList() { HardwareDisplayPlaneList::~HardwareDisplayPlaneList() = default;
}
HardwareDisplayPlaneList::PageFlipInfo::PageFlipInfo(uint32_t crtc_id, HardwareDisplayPlaneList::PageFlipInfo::PageFlipInfo(uint32_t crtc_id,
uint32_t framebuffer) uint32_t framebuffer)
...@@ -38,8 +37,7 @@ HardwareDisplayPlaneList::PageFlipInfo::PageFlipInfo(uint32_t crtc_id, ...@@ -38,8 +37,7 @@ HardwareDisplayPlaneList::PageFlipInfo::PageFlipInfo(uint32_t crtc_id,
HardwareDisplayPlaneList::PageFlipInfo::PageFlipInfo( HardwareDisplayPlaneList::PageFlipInfo::PageFlipInfo(
const PageFlipInfo& other) = default; const PageFlipInfo& other) = default;
HardwareDisplayPlaneList::PageFlipInfo::~PageFlipInfo() { HardwareDisplayPlaneList::PageFlipInfo::~PageFlipInfo() = default;
}
HardwareDisplayPlaneManager::CrtcState::CrtcState() = default; HardwareDisplayPlaneManager::CrtcState::CrtcState() = default;
...@@ -50,8 +48,7 @@ HardwareDisplayPlaneManager::CrtcState::CrtcState(CrtcState&&) = default; ...@@ -50,8 +48,7 @@ HardwareDisplayPlaneManager::CrtcState::CrtcState(CrtcState&&) = default;
HardwareDisplayPlaneManager::HardwareDisplayPlaneManager(DrmDevice* drm) HardwareDisplayPlaneManager::HardwareDisplayPlaneManager(DrmDevice* drm)
: drm_(drm) {} : drm_(drm) {}
HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() { HardwareDisplayPlaneManager::~HardwareDisplayPlaneManager() = default;
}
bool HardwareDisplayPlaneManager::Initialize() { bool HardwareDisplayPlaneManager::Initialize() {
// Try to get all of the planes if possible, so we don't have to try to // Try to get all of the planes if possible, so we don't have to try to
...@@ -97,9 +94,10 @@ HardwareDisplayPlane* HardwareDisplayPlaneManager::FindNextUnusedPlane( ...@@ -97,9 +94,10 @@ HardwareDisplayPlane* HardwareDisplayPlaneManager::FindNextUnusedPlane(
} }
int HardwareDisplayPlaneManager::LookupCrtcIndex(uint32_t crtc_id) const { int HardwareDisplayPlaneManager::LookupCrtcIndex(uint32_t crtc_id) const {
for (size_t i = 0; i < crtc_state_.size(); ++i) for (size_t i = 0; i < crtc_state_.size(); ++i) {
if (crtc_state_[i].properties.id == crtc_id) if (crtc_state_[i].properties.id == crtc_id)
return i; return i;
}
return -1; return -1;
} }
...@@ -182,8 +180,9 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes( ...@@ -182,8 +180,9 @@ bool HardwareDisplayPlaneManager::AssignOverlayPlanes(
// This returns a number in 16.16 fixed point, required by the DRM overlay // This returns a number in 16.16 fixed point, required by the DRM overlay
// APIs. // APIs.
auto to_fixed_point = auto to_fixed_point = [](double v) -> uint32_t {
[](double v) -> uint32_t { return v * kFixedPointScaleValue; }; return v * kFixedPointScaleValue;
};
fixed_point_rect = gfx::Rect(to_fixed_point(crop_rect.x()), fixed_point_rect = gfx::Rect(to_fixed_point(crop_rect.x()),
to_fixed_point(crop_rect.y()), to_fixed_point(crop_rect.y()),
to_fixed_point(crop_rect.width()), to_fixed_point(crop_rect.width()),
......
...@@ -56,7 +56,7 @@ struct HardwareDisplayPlaneList { ...@@ -56,7 +56,7 @@ struct HardwareDisplayPlaneList {
class HardwareDisplayPlaneManager { class HardwareDisplayPlaneManager {
public: public:
HardwareDisplayPlaneManager(DrmDevice* drm); explicit HardwareDisplayPlaneManager(DrmDevice* drm);
virtual ~HardwareDisplayPlaneManager(); virtual ~HardwareDisplayPlaneManager();
// This parses information from the drm driver, adding any new planes // This parses information from the drm driver, adding any new planes
......
...@@ -57,8 +57,8 @@ HardwareDisplayPlaneManagerAtomic::HardwareDisplayPlaneManagerAtomic( ...@@ -57,8 +57,8 @@ HardwareDisplayPlaneManagerAtomic::HardwareDisplayPlaneManagerAtomic(
DrmDevice* drm) DrmDevice* drm)
: HardwareDisplayPlaneManager(drm) {} : HardwareDisplayPlaneManager(drm) {}
HardwareDisplayPlaneManagerAtomic::~HardwareDisplayPlaneManagerAtomic() { HardwareDisplayPlaneManagerAtomic::~HardwareDisplayPlaneManagerAtomic() =
} default;
bool HardwareDisplayPlaneManagerAtomic::Commit( bool HardwareDisplayPlaneManagerAtomic::Commit(
HardwareDisplayPlaneList* plane_list, HardwareDisplayPlaneList* plane_list,
......
...@@ -15,7 +15,7 @@ namespace ui { ...@@ -15,7 +15,7 @@ namespace ui {
class HardwareDisplayPlaneManagerAtomic : public HardwareDisplayPlaneManager { class HardwareDisplayPlaneManagerAtomic : public HardwareDisplayPlaneManager {
public: public:
HardwareDisplayPlaneManagerAtomic(DrmDevice* drm); explicit HardwareDisplayPlaneManagerAtomic(DrmDevice* drm);
~HardwareDisplayPlaneManagerAtomic() override; ~HardwareDisplayPlaneManagerAtomic() override;
// HardwareDisplayPlaneManager: // HardwareDisplayPlaneManager:
......
...@@ -42,8 +42,8 @@ HardwareDisplayPlaneManagerLegacy::HardwareDisplayPlaneManagerLegacy( ...@@ -42,8 +42,8 @@ HardwareDisplayPlaneManagerLegacy::HardwareDisplayPlaneManagerLegacy(
DrmDevice* drm) DrmDevice* drm)
: HardwareDisplayPlaneManager(drm) {} : HardwareDisplayPlaneManager(drm) {}
HardwareDisplayPlaneManagerLegacy::~HardwareDisplayPlaneManagerLegacy() { HardwareDisplayPlaneManagerLegacy::~HardwareDisplayPlaneManagerLegacy() =
} default;
bool HardwareDisplayPlaneManagerLegacy::Commit( bool HardwareDisplayPlaneManagerLegacy::Commit(
HardwareDisplayPlaneList* plane_list, HardwareDisplayPlaneList* plane_list,
......
...@@ -15,7 +15,7 @@ namespace ui { ...@@ -15,7 +15,7 @@ namespace ui {
class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager { class HardwareDisplayPlaneManagerLegacy : public HardwareDisplayPlaneManager {
public: public:
HardwareDisplayPlaneManagerLegacy(DrmDevice* device); explicit HardwareDisplayPlaneManagerLegacy(DrmDevice* device);
~HardwareDisplayPlaneManagerLegacy() override; ~HardwareDisplayPlaneManagerLegacy() override;
// HardwareDisplayPlaneManager: // HardwareDisplayPlaneManager:
......
...@@ -82,7 +82,6 @@ MockDrmDevice::MockDrmDevice(std::unique_ptr<GbmDevice> gbm_device) ...@@ -82,7 +82,6 @@ MockDrmDevice::MockDrmDevice(std::unique_ptr<GbmDevice> gbm_device)
std::move(gbm_device)), std::move(gbm_device)),
get_crtc_call_count_(0), get_crtc_call_count_(0),
set_crtc_call_count_(0), set_crtc_call_count_(0),
restore_crtc_call_count_(0),
add_framebuffer_call_count_(0), add_framebuffer_call_count_(0),
remove_framebuffer_call_count_(0), remove_framebuffer_call_count_(0),
page_flip_call_count_(0), page_flip_call_count_(0),
...@@ -150,7 +149,7 @@ bool MockDrmDevice::InitializeStateWithResult( ...@@ -150,7 +149,7 @@ bool MockDrmDevice::InitializeStateWithResult(
return plane_manager_->Initialize(); return plane_manager_->Initialize();
} }
MockDrmDevice::~MockDrmDevice() {} MockDrmDevice::~MockDrmDevice() = default;
ScopedDrmResourcesPtr MockDrmDevice::GetResources() { ScopedDrmResourcesPtr MockDrmDevice::GetResources() {
ScopedDrmResourcesPtr resources(DrmAllocator<drmModeRes>()); ScopedDrmResourcesPtr resources(DrmAllocator<drmModeRes>());
...@@ -198,19 +197,13 @@ ScopedDrmCrtcPtr MockDrmDevice::GetCrtc(uint32_t crtc_id) { ...@@ -198,19 +197,13 @@ ScopedDrmCrtcPtr MockDrmDevice::GetCrtc(uint32_t crtc_id) {
bool MockDrmDevice::SetCrtc(uint32_t crtc_id, bool MockDrmDevice::SetCrtc(uint32_t crtc_id,
uint32_t framebuffer, uint32_t framebuffer,
std::vector<uint32_t> connectors, std::vector<uint32_t> connectors,
drmModeModeInfo* mode) { const drmModeModeInfo& mode) {
crtc_fb_[crtc_id] = framebuffer; crtc_fb_[crtc_id] = framebuffer;
current_framebuffer_ = framebuffer; current_framebuffer_ = framebuffer;
set_crtc_call_count_++; set_crtc_call_count_++;
return set_crtc_expectation_; return set_crtc_expectation_;
} }
bool MockDrmDevice::SetCrtc(drmModeCrtc* crtc,
std::vector<uint32_t> connectors) {
restore_crtc_call_count_++;
return true;
}
bool MockDrmDevice::DisableCrtc(uint32_t crtc_id) { bool MockDrmDevice::DisableCrtc(uint32_t crtc_id) {
current_framebuffer_ = 0; current_framebuffer_ = 0;
return true; return true;
...@@ -304,7 +297,7 @@ bool MockDrmDevice::SetProperty(uint32_t connector_id, ...@@ -304,7 +297,7 @@ bool MockDrmDevice::SetProperty(uint32_t connector_id,
return true; return true;
} }
ScopedDrmPropertyBlob MockDrmDevice::CreatePropertyBlob(void* blob, ScopedDrmPropertyBlob MockDrmDevice::CreatePropertyBlob(const void* blob,
size_t size) { size_t size) {
uint32_t id = ++property_id_generator_; uint32_t id = ++property_id_generator_;
allocated_property_blobs_.insert(id); allocated_property_blobs_.insert(id);
......
...@@ -44,7 +44,7 @@ class MockDrmDevice : public DrmDevice { ...@@ -44,7 +44,7 @@ class MockDrmDevice : public DrmDevice {
std::vector<DrmDevice::Property> properties; std::vector<DrmDevice::Property> properties;
}; };
MockDrmDevice(std::unique_ptr<GbmDevice> gbm_device); explicit MockDrmDevice(std::unique_ptr<GbmDevice> gbm_device);
static ScopedDrmPropertyBlobPtr AllocateInFormatsBlob( static ScopedDrmPropertyBlobPtr AllocateInFormatsBlob(
uint32_t id, uint32_t id,
...@@ -53,7 +53,6 @@ class MockDrmDevice : public DrmDevice { ...@@ -53,7 +53,6 @@ class MockDrmDevice : public DrmDevice {
int get_get_crtc_call_count() const { return get_crtc_call_count_; } int get_get_crtc_call_count() const { return get_crtc_call_count_; }
int get_set_crtc_call_count() const { return set_crtc_call_count_; } int get_set_crtc_call_count() const { return set_crtc_call_count_; }
int get_restore_crtc_call_count() const { return restore_crtc_call_count_; }
int get_add_framebuffer_call_count() const { int get_add_framebuffer_call_count() const {
return add_framebuffer_call_count_; return add_framebuffer_call_count_;
} }
...@@ -114,8 +113,7 @@ class MockDrmDevice : public DrmDevice { ...@@ -114,8 +113,7 @@ class MockDrmDevice : public DrmDevice {
bool SetCrtc(uint32_t crtc_id, bool SetCrtc(uint32_t crtc_id,
uint32_t framebuffer, uint32_t framebuffer,
std::vector<uint32_t> connectors, std::vector<uint32_t> connectors,
drmModeModeInfo* mode) override; const drmModeModeInfo& mode) override;
bool SetCrtc(drmModeCrtc* crtc, std::vector<uint32_t> connectors) override;
bool DisableCrtc(uint32_t crtc_id) override; bool DisableCrtc(uint32_t crtc_id) override;
ScopedDrmConnectorPtr GetConnector(uint32_t connector_id) override; ScopedDrmConnectorPtr GetConnector(uint32_t connector_id) override;
bool AddFramebuffer2(uint32_t width, bool AddFramebuffer2(uint32_t width,
...@@ -139,7 +137,8 @@ class MockDrmDevice : public DrmDevice { ...@@ -139,7 +137,8 @@ class MockDrmDevice : public DrmDevice {
bool SetProperty(uint32_t connector_id, bool SetProperty(uint32_t connector_id,
uint32_t property_id, uint32_t property_id,
uint64_t value) override; uint64_t value) override;
ScopedDrmPropertyBlob CreatePropertyBlob(void* blob, size_t size) override; ScopedDrmPropertyBlob CreatePropertyBlob(const void* blob,
size_t size) override;
void DestroyPropertyBlob(uint32_t id) override; void DestroyPropertyBlob(uint32_t id) override;
bool GetCapability(uint64_t capability, uint64_t* value) override; bool GetCapability(uint64_t capability, uint64_t* value) override;
ScopedDrmPropertyBlobPtr GetPropertyBlob(uint32_t property_id) override; ScopedDrmPropertyBlobPtr GetPropertyBlob(uint32_t property_id) override;
...@@ -183,7 +182,6 @@ class MockDrmDevice : public DrmDevice { ...@@ -183,7 +182,6 @@ class MockDrmDevice : public DrmDevice {
int get_crtc_call_count_; int get_crtc_call_count_;
int set_crtc_call_count_; int set_crtc_call_count_;
int restore_crtc_call_count_;
int add_framebuffer_call_count_; int add_framebuffer_call_count_;
int remove_framebuffer_call_count_; int remove_framebuffer_call_count_;
int page_flip_call_count_; int page_flip_call_count_;
......
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