mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-25 02:41:45 +00:00
dm: vdisplay: terminate acrn-dm process when SDL init failed
Virtual display is component which based on native window system. This feature depended phisical monitor connected and graphic driver in SOS running correctly. If these dependencies fail, it is a fatal error for virtual display. We have to terminate the device model to let user fix runtime environment issue for graphics. Tracked-On: #7672 Signed-off-by: Sun Peng <peng.p.sun@linux.intel.com>
This commit is contained in:
@@ -1128,7 +1128,7 @@ vdpy_deinit(int handle)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
gfx_ui_init()
|
||||
{
|
||||
SDL_SysWMinfo info;
|
||||
@@ -1141,6 +1141,7 @@ gfx_ui_init()
|
||||
|
||||
if (SDL_Init(SDL_INIT_VIDEO)) {
|
||||
pr_err("Failed to Init SDL2 system");
|
||||
return -1;
|
||||
}
|
||||
|
||||
SDL_GetDisplayBounds(0, &disp_rect);
|
||||
@@ -1150,6 +1151,7 @@ gfx_ui_init()
|
||||
pr_err("Too small resolutions. Please check the "
|
||||
" graphics system\n");
|
||||
SDL_Quit();
|
||||
return -1;
|
||||
}
|
||||
|
||||
SDL_SetHint(SDL_HINT_GRAB_KEYBOARD, "1");
|
||||
@@ -1170,6 +1172,8 @@ gfx_ui_init()
|
||||
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
|
||||
|
||||
vdpy.s.is_ui_realized = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user