diff --git a/src/platforms/atomic-kms/server/kms/atomic_kms_output.cpp b/src/platforms/atomic-kms/server/kms/atomic_kms_output.cpp index 56606aa3ac..a2030552b4 100644 --- a/src/platforms/atomic-kms/server/kms/atomic_kms_output.cpp +++ b/src/platforms/atomic-kms/server/kms/atomic_kms_output.cpp @@ -15,7 +15,6 @@ */ #include "atomic_kms_output.h" -#include "kms-utils/drm_event_handler.h" #include "kms-utils/drm_mode_resources.h" #include "kms_framebuffer.h" #include "mir/graphics/display_configuration.h" @@ -187,10 +186,8 @@ class mga::AtomicKMSOutput::PropertyBlob */ mga::AtomicKMSOutput::AtomicKMSOutput( mir::Fd drm_master, - kms::DRMModeConnectorUPtr connector, - std::shared_ptr event_handler) + kms::DRMModeConnectorUPtr connector) : drm_fd_{drm_master}, - event_handler{std::move(event_handler)}, configuration{ Configuration { .connector = std::move(connector), diff --git a/src/platforms/atomic-kms/server/kms/atomic_kms_output.h b/src/platforms/atomic-kms/server/kms/atomic_kms_output.h index b2132031cf..74a9962d2a 100644 --- a/src/platforms/atomic-kms/server/kms/atomic_kms_output.h +++ b/src/platforms/atomic-kms/server/kms/atomic_kms_output.h @@ -29,10 +29,6 @@ namespace mir { namespace graphics { -namespace kms -{ -class DRMEventHandler; -} namespace atomic { @@ -43,8 +39,7 @@ class AtomicKMSOutput : public KMSOutput public: AtomicKMSOutput( mir::Fd drm_master, - kms::DRMModeConnectorUPtr connector, - std::shared_ptr event_handler); + kms::DRMModeConnectorUPtr connector); ~AtomicKMSOutput(); uint32_t id() const override; @@ -92,7 +87,6 @@ class AtomicKMSOutput : public KMSOutput void restore_saved_crtc(); mir::Fd const drm_fd_; - std::shared_ptr const event_handler; std::future pending_page_flip; diff --git a/src/platforms/atomic-kms/server/kms/display.cpp b/src/platforms/atomic-kms/server/kms/display.cpp index 9fccc20dac..d02762ed47 100644 --- a/src/platforms/atomic-kms/server/kms/display.cpp +++ b/src/platforms/atomic-kms/server/kms/display.cpp @@ -15,7 +15,6 @@ */ #include "display.h" -#include "kms-utils/threaded_drm_event_handler.h" #include "kms/egl_helper.h" #include "mir/graphics/platform.h" #include "platform.h" @@ -147,14 +146,12 @@ mga::Display::Display( std::shared_ptr const& initial_conf_policy, std::shared_ptr const& listener) : drm_fd{std::move(drm_fd)}, - event_handler{std::make_shared(this->drm_fd)}, gbm{std::move(gbm)}, listener(listener), monitor(mir::udev::Context()), output_container{ std::make_shared( - this->drm_fd, - event_handler)}, + this->drm_fd)}, current_display_configuration{output_container}, dirty_configuration{false}, bypass_option(bypass_option) @@ -366,7 +363,6 @@ void mga::Display::configure_locked( auto db = std::make_unique( drm_fd, gbm, - event_handler, bypass_option, listener, std::move(kms_output), diff --git a/src/platforms/atomic-kms/server/kms/display.h b/src/platforms/atomic-kms/server/kms/display.h index d99fb417dc..7626dd8a60 100644 --- a/src/platforms/atomic-kms/server/kms/display.h +++ b/src/platforms/atomic-kms/server/kms/display.h @@ -17,7 +17,6 @@ #ifndef MIR_GRAPHICS_GBM_ATOMIC_KMS_DISPLAY_H_ #define MIR_GRAPHICS_GBM_ATOMIC_KMS_DISPLAY_H_ -#include "kms-utils/drm_event_handler.h" #include "mir/graphics/display.h" #include "mir/udev/wrapper.h" #include "real_kms_output_container.h" @@ -40,11 +39,6 @@ class DisplayConfigurationPolicy; class EventHandlerRegister; class GLConfig; -namespace kms -{ -class DRMEventHandler; -} - namespace atomic { @@ -91,7 +85,6 @@ class Display : public graphics::Display mutable std::mutex configuration_mutex; mir::Fd const drm_fd; - std::shared_ptr const event_handler; std::shared_ptr const gbm; std::shared_ptr const listener; mir::udev::Monitor monitor; diff --git a/src/platforms/atomic-kms/server/kms/display_buffer.cpp b/src/platforms/atomic-kms/server/kms/display_buffer.cpp index 6cb7d4dd0d..4ed7b950bd 100644 --- a/src/platforms/atomic-kms/server/kms/display_buffer.cpp +++ b/src/platforms/atomic-kms/server/kms/display_buffer.cpp @@ -50,7 +50,6 @@ namespace mgk = mir::graphics::kms; mga::DisplaySink::DisplaySink( mir::Fd drm_fd, std::shared_ptr gbm, - std::shared_ptr event_handler, mga::BypassOption, std::shared_ptr const& listener, std::shared_ptr output, @@ -59,7 +58,6 @@ mga::DisplaySink::DisplaySink( : gbm{std::move(gbm)}, listener(listener), output{std::move(output)}, - event_handler{std::move(event_handler)}, area(area), transform{transformation}, needs_set_crtc{false} @@ -170,7 +168,7 @@ void mga::DisplaySink::post() * Try to schedule a page flip as first preference to avoid tearing. * We wait synchronously for this to complete. */ - if (!needs_set_crtc && !schedule_page_flip(*scheduled_fb)) + if (!needs_set_crtc && !output->schedule_page_flip(*scheduled_fb)) needs_set_crtc = true; /* @@ -208,20 +206,6 @@ std::chrono::milliseconds mga::DisplaySink::recommended_sleep() const return recommend_sleep; } -bool mga::DisplaySink::schedule_page_flip(FBHandle const& bufobj) -{ - /* - * Schedule the current front buffer object for display. Note that - * the page flip is asynchronous and synchronized with vertical refresh. - */ - if (output->schedule_page_flip(bufobj)) - { - page_flip_pending = true; - return true; - } - return false; -} - void mga::DisplaySink::schedule_set_crtc() { needs_set_crtc = true; diff --git a/src/platforms/atomic-kms/server/kms/display_sink.h b/src/platforms/atomic-kms/server/kms/display_sink.h index afc5407081..f1740c7c64 100644 --- a/src/platforms/atomic-kms/server/kms/display_sink.h +++ b/src/platforms/atomic-kms/server/kms/display_sink.h @@ -17,7 +17,6 @@ #ifndef MIR_GRAPHICS_GBM_ATOMIC_KMS_DISPLAY_SINK_H_ #define MIR_GRAPHICS_GBM_ATOMIC_KMS_DISPLAY_SINK_H_ -#include "kms-utils/drm_event_handler.h" #include "mir/graphics/display_sink.h" #include "mir/graphics/display.h" #include "display_helpers.h" @@ -57,7 +56,6 @@ class DisplaySink : public graphics::DisplaySink, DisplaySink( mir::Fd drm_fd, std::shared_ptr gbm, - std::shared_ptr event_handler, BypassOption bypass_options, std::shared_ptr const& listener, std::shared_ptr output, @@ -89,18 +87,12 @@ class DisplaySink : public graphics::DisplaySink, auto maybe_create_allocator(DisplayAllocator::Tag const& type_tag) -> DisplayAllocator* override; private: - bool schedule_page_flip(FBHandle const& bufobj); void set_crtc(FBHandle const&); std::shared_ptr const gbm; - bool holding_client_buffers{false}; - std::shared_ptr bypass_bufobj{nullptr}; std::shared_ptr const listener; std::shared_ptr const output; - bool page_flip_pending{false}; - - std::shared_ptr const event_handler; std::shared_ptr kms_allocator; std::unique_ptr gbm_allocator; diff --git a/src/platforms/atomic-kms/server/kms/real_kms_output_container.cpp b/src/platforms/atomic-kms/server/kms/real_kms_output_container.cpp index 7e355f13f5..abd4d6d2fe 100644 --- a/src/platforms/atomic-kms/server/kms/real_kms_output_container.cpp +++ b/src/platforms/atomic-kms/server/kms/real_kms_output_container.cpp @@ -17,16 +17,13 @@ #include #include "real_kms_output_container.h" #include "atomic_kms_output.h" -#include "kms-utils/drm_event_handler.h" #include "kms-utils/drm_mode_resources.h" namespace mga = mir::graphics::atomic; mga::RealKMSOutputContainer::RealKMSOutputContainer( - mir::Fd drm_fd, - std::shared_ptr event_handler) - : drm_fd{std::move(drm_fd)}, - event_handler{std::move(event_handler)} + mir::Fd drm_fd) + : drm_fd{std::move(drm_fd)} { } @@ -69,8 +66,7 @@ void mga::RealKMSOutputContainer::update_from_hardware_state() { new_outputs.push_back(std::make_shared( drm_fd, - std::move(connector), - event_handler)); + std::move(connector))); } } diff --git a/src/platforms/atomic-kms/server/kms/real_kms_output_container.h b/src/platforms/atomic-kms/server/kms/real_kms_output_container.h index b6a6d67e15..00041b3fff 100644 --- a/src/platforms/atomic-kms/server/kms/real_kms_output_container.h +++ b/src/platforms/atomic-kms/server/kms/real_kms_output_container.h @@ -25,10 +25,6 @@ namespace mir { namespace graphics { -namespace kms -{ -class DRMEventHandler; -} namespace atomic { @@ -36,14 +32,13 @@ namespace atomic class RealKMSOutputContainer : public KMSOutputContainer { public: - RealKMSOutputContainer(mir::Fd drm_fd, std::shared_ptr event_handler); + RealKMSOutputContainer(mir::Fd drm_fd); void for_each_output(std::function const&)> functor) const override; void update_from_hardware_state() override; private: mir::Fd const drm_fd; - std::shared_ptr const event_handler; std::vector> outputs; };