From eabdacd4350897206738b7ff94232a35eeaa606a Mon Sep 17 00:00:00 2001
From: "adrian.spycher" <adrian.spycher@etu.hesge.ch>
Date: Tue, 5 Nov 2024 18:05:43 +0100
Subject: [PATCH] feat: complete emulated guess' function to init gfx

---
 guest/gfx/gfx_phys.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/guest/gfx/gfx_phys.c b/guest/gfx/gfx_phys.c
index 84602d0..3662131 100644
--- a/guest/gfx/gfx_phys.c
+++ b/guest/gfx/gfx_phys.c
@@ -1,7 +1,6 @@
 #include "gfx.h"
 
-#include "guest/utils.h"
-#include "guest/pmio.h"
+#include <stdint.h>
 #include "shared/hypercall_params.h"
 
 // --- DEFINE ---
@@ -12,5 +11,9 @@
 
 void gfx_phys_init(uint32_t width, uint32_t height) {
 
-    // TODO:
+    while (*(uint32_t *)REG_GFX_INIT_ST == 42);
+
+    *(uint32_t *)REG_GFX_INIT_CMD = 5;
+    *(uint32_t *)REG_GFX_INIT_DATA = width;
+    *(uint32_t *)REG_GFX_INIT_DATA = height;
 }
-- 
GitLab