Allow the vnc server to run when using crosvm as vmm
The vnc server sends input through unix sockets to crosvm's virtio
input devices and receives screen updates through a vsock socket.
Performance is not the best, but it's usable.
Bug: 128852363
Bug: 127361363
Test: run locally
Change-Id: I2b2be2c3f338e7624e390879293ce61186dded38
diff --git a/host/frontend/vnc_server/vnc_utils.h b/host/frontend/vnc_server/vnc_utils.h
index 3eac9f3..194e828 100644
--- a/host/frontend/vnc_server/vnc_utils.h
+++ b/host/frontend/vnc_server/vnc_utils.h
@@ -21,6 +21,7 @@
#include <utility>
#include <vector>
+#include "common/libs/utils/size_utils.h"
#include "common/libs/tcp_socket/tcp_socket.h"
#include "common/vsoc/lib/screen_region_view.h"
#include "host/libs/config/cuttlefish_config.h"
@@ -68,16 +69,12 @@
// The width of the screen regardless of orientation. Does not change.
inline int ActualScreenWidth() {
- return vsoc::screen::ScreenRegionView::GetInstance(
- vsoc::GetDomain().c_str())
- ->x_res();
+ return AlignToPowerOf2(vsoc::CuttlefishConfig::Get()->x_res(), 4);
}
// The height of the screen regardless of orientation. Does not change.
inline int ActualScreenHeight() {
- return vsoc::screen::ScreenRegionView::GetInstance(
- vsoc::GetDomain().c_str())
- ->y_res();
+ return vsoc::CuttlefishConfig::Get()->y_res();
}
inline int ScreenSizeInBytes() {