Commit 7fc09df4 authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

ozone: drm: Remove DrmVSyncProvider

This is not used with surfaceless; vsync timing information comes via the
PresentationCallback.

Bug: none
Test: compile

Change-Id: I73895bc913dfc2cc03381debcac83108828301d2

Reviewed-on: https://chromium-review.googlesource.com/c/1262615Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596873}
parent dc0fc59e
......@@ -54,8 +54,6 @@ source_set("gbm") {
"gpu/drm_thread_message_proxy.h",
"gpu/drm_thread_proxy.cc",
"gpu/drm_thread_proxy.h",
"gpu/drm_vsync_provider.cc",
"gpu/drm_vsync_provider.h",
"gpu/drm_window.cc",
"gpu/drm_window.h",
"gpu/drm_window_proxy.cc",
......
......@@ -244,17 +244,6 @@ void DrmThread::OnPlanesReadyForPageFlip(
}
}
void DrmThread::GetVSyncParameters(
gfx::AcceleratedWidget widget,
const gfx::VSyncProvider::UpdateVSyncCallback& callback) {
DrmWindow* window = screen_manager_->GetWindow(widget);
// No need to call the callback if there isn't a window since the vsync
// provider doesn't require the callback to be called if there isn't a vsync
// data source.
if (window)
window->GetVSyncParameters(callback);
}
void DrmThread::IsDeviceAtomic(gfx::AcceleratedWidget widget, bool* is_atomic) {
scoped_refptr<ui::DrmDevice> drm_device =
device_manager_->GetDrmDevice(widget);
......
......@@ -90,9 +90,6 @@ class DrmThread : public base::Thread,
std::vector<DrmOverlayPlane> planes,
SwapCompletionOnceCallback submission_callback,
PresentationOnceCallback presentation_callback);
void GetVSyncParameters(
gfx::AcceleratedWidget widget,
const gfx::VSyncProvider::UpdateVSyncCallback& callback);
void IsDeviceAtomic(gfx::AcceleratedWidget widget, bool* is_atomic);
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h"
#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
namespace ui {
DrmVSyncProvider::DrmVSyncProvider(DrmWindowProxy* window) : window_(window) {}
DrmVSyncProvider::~DrmVSyncProvider() {
}
void DrmVSyncProvider::GetVSyncParameters(const UpdateVSyncCallback& callback) {
window_->GetVSyncParameters(callback);
}
bool DrmVSyncProvider::GetVSyncParametersIfAvailable(
base::TimeTicks* timebase,
base::TimeDelta* interval) {
return false;
}
bool DrmVSyncProvider::SupportGetVSyncParametersIfAvailable() const {
return false;
}
bool DrmVSyncProvider::IsHWClock() const {
return true;
}
} // namespace ui
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_OZONE_PLATFORM_IMPL_DRM_VSYNC_PROVIDER_H_
#define UI_OZONE_PLATFORM_IMPL_DRM_VSYNC_PROVIDER_H_
#include "base/macros.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/vsync_provider.h"
namespace ui {
class DrmWindowProxy;
class DrmVSyncProvider : public gfx::VSyncProvider {
public:
DrmVSyncProvider(DrmWindowProxy* window);
~DrmVSyncProvider() override;
void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
bool GetVSyncParametersIfAvailable(base::TimeTicks* timebase,
base::TimeDelta* interval) override;
bool SupportGetVSyncParametersIfAvailable() const override;
bool IsHWClock() const override;
private:
DrmWindowProxy* const window_;
DISALLOW_COPY_AND_ASSIGN(DrmVSyncProvider);
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_IMPL_DRM_VSYNC_PROVIDER_H_
......@@ -137,21 +137,6 @@ const DrmOverlayPlane* DrmWindow::GetLastModesetBuffer() {
return DrmOverlayPlane::GetPrimaryPlane(last_submitted_planes_);
}
void DrmWindow::GetVSyncParameters(
const gfx::VSyncProvider::UpdateVSyncCallback& callback) const {
if (!controller_)
return;
// If we're in mirror mode the 2 CRTCs should have similar modes with the same
// refresh rates.
CrtcController* crtc = controller_->crtc_controllers()[0].get();
const base::TimeTicks last_flip = controller_->GetTimeOfLastFlip();
if (last_flip == base::TimeTicks() || crtc->mode().vrefresh == 0)
return; // The value is invalid, so we can't update the parameters.
callback.Run(last_flip,
base::TimeDelta::FromSeconds(1) / crtc->mode().vrefresh);
}
void DrmWindow::UpdateCursorImage() {
if (!controller_)
return;
......
......@@ -88,9 +88,6 @@ class DrmWindow {
// Returns the last buffer associated with this window.
const DrmOverlayPlane* GetLastModesetBuffer();
void GetVSyncParameters(
const gfx::VSyncProvider::UpdateVSyncCallback& callback) const;
private:
// Draw next frame in an animated cursor.
void OnCursorAnimationTimeout();
......
......@@ -34,14 +34,6 @@ void DrmWindowProxy::SchedulePageFlip(
CreateSafeOnceCallback(std::move(presentation_callback))));
}
void DrmWindowProxy::GetVSyncParameters(
const gfx::VSyncProvider::UpdateVSyncCallback& callback) {
drm_thread_->task_runner()->PostTask(
FROM_HERE, base::BindOnce(&DrmThread::GetVSyncParameters,
base::Unretained(drm_thread_), widget_,
CreateSafeCallback(callback)));
}
bool DrmWindowProxy::SupportsGpuFences() const {
bool is_atomic = false;
PostSyncTask(
......
......@@ -28,9 +28,6 @@ class DrmWindowProxy {
SwapCompletionOnceCallback submission_callback,
PresentationOnceCallback presentation_callback);
void GetVSyncParameters(
const gfx::VSyncProvider::UpdateVSyncCallback& callback);
bool SupportsGpuFences() const;
private:
......
......@@ -15,7 +15,6 @@
#include "ui/ozone/common/egl_util.h"
#include "ui/ozone/platform/drm/gpu/drm_device.h"
#include "ui/ozone/platform/drm/gpu/drm_framebuffer.h"
#include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h"
#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
#include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
......@@ -54,9 +53,6 @@ void GbmSurfaceless::QueueOverlayPlane(DrmOverlayPlane plane) {
bool GbmSurfaceless::Initialize(gl::GLSurfaceFormat format) {
if (!SurfacelessEGL::Initialize(format))
return false;
vsync_provider_ = std::make_unique<DrmVSyncProvider>(window_.get());
if (!vsync_provider_)
return false;
return true;
}
......@@ -84,10 +80,6 @@ bool GbmSurfaceless::IsOffscreen() {
return false;
}
gfx::VSyncProvider* GbmSurfaceless::GetVSyncProvider() {
return vsync_provider_.get();
}
bool GbmSurfaceless::SupportsPresentationCallback() {
return true;
}
......
......@@ -45,7 +45,6 @@ class GbmSurfaceless : public gl::SurfacelessEGL {
bool enable_blend,
std::unique_ptr<gfx::GpuFence> gpu_fence) override;
bool IsOffscreen() override;
gfx::VSyncProvider* GetVSyncProvider() override;
bool SupportsPresentationCallback() override;
bool SupportsAsyncSwap() override;
bool SupportsPostSubBuffer() override;
......
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