atimach64gx: use new refresh task control.

This commit is contained in:
Maxim Poliakovski 2023-07-31 03:52:17 +02:00
parent 632479b1ba
commit 0ca1ebf724
1 changed files with 2 additions and 12 deletions

View File

@ -25,7 +25,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <core/bitops.h>
#include <core/timermanager.h>
#include <devices/deviceregistry.h>
#include <devices/video/atimach64defs.h>
#include <devices/video/atimach64gx.h>
@ -307,17 +306,8 @@ void AtiMach64Gx::enable_crtc_internal()
ABORT_F("%s: unsupported pixel depth %d", this->name.c_str(), this->pixel_depth);
}
if (this->refresh_task_id) {
TimerManager::get_instance()->cancel_timer(this->refresh_task_id);
}
uint64_t refresh_interval = static_cast<uint64_t>(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;