From 632479b1ba8a8241c4334f577a650d10618e6d1b Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Mon, 31 Jul 2023 03:46:16 +0200 Subject: [PATCH] atirage: use new refresh task control. --- devices/video/atirage.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/devices/video/atirage.cpp b/devices/video/atirage.cpp index acef23a..71e0e7f 100644 --- a/devices/video/atirage.cpp +++ b/devices/video/atirage.cpp @@ -20,7 +20,6 @@ along with this program. If not, see . */ #include -#include #include #include #include @@ -567,17 +566,8 @@ void ATIRage::crtc_update() { LOG_F(INFO, "Pixel (dot) clock: %f MHz", this->pixel_clock * 1e-6); LOG_F(INFO, "Refresh rate: %f Hz", this->refresh_rate); - if (this->refresh_task_id) { - TimerManager::get_instance()->cancel_timer(this->refresh_task_id); - } - - uint64_t refresh_interval = static_cast(1.0f / this->refresh_rate * NS_PER_SEC + 0.5); - this->refresh_task_id = TimerManager::get_instance()->add_cyclic_timer( - refresh_interval, - [this]() { - this->update_screen(); - } - ); + this->stop_refresh_task(); + this->start_refresh_task(); this->crtc_on = true; }