commit | 1ece8e3c72c256af0b921ce0eed296b00364d79d | [log] [tgz] |
---|---|---|
author | Min Wang <wangmin@phytium.com.cn> | Fri May 24 15:45:53 2024 +0800 |
committer | Min Wang <wangmin@phytium.com.cn> | Wed Jun 05 15:38:48 2024 +0800 |
tree | caea6be0a67f6b4409f23f7fb3ab2356a0e9938d | |
parent | 033b18e03fec76a026df1b71fbc2e00f2ee6fece [diff] |
ikvm_manager.cpp: fix a deadlock issue There is a deadlock in the case that the screen resolution is altered. The probability of deadlock will increase as the frame rate increases. The deadlock is likely to be reproduced when the frame rate is set to above 30fps. The scenario of deadlock is described as below. mainThread serverThread | setServerDone | setVideoDone <----------switch to mainThread <----set serverDone to true | waitServer | serverDone is set to FALSE | screen resolution has been changed | videoDone is set to FALSE | waitServer(A, wait serverThread to set serverDone to TRUE, \ | block mainthread) | ----------switch to serverThread-------------------> waitVideo | | (B, wait mainthread to set videoDone to TRUE, block serverThread) A)The main thread is blocked for waiting serverThread to set serverDone, at the meantime, B)The serverThread is blocked for waiting main thread to set videoDone. So a deadlock is generated. The patch delays to set videoDone to false after the mainThread is blocked for waiting serverDone, then the value of the videoDone maintains true. So the serverThread is unblocked as the videoDone is true. After serverThread finishes executing setServerDone, mainThread is unblocked and continues executing. Change-Id: If30d2cd5c493a909397fde43d1cf538cc28f3df2 Signed-off-by: Min Wang <wangmin@phytium.com.cn>
The obmc-ikvm application is a VNC server that provides access to the host graphics output. The application interfaces with the video device on the BMC that captures the host graphics, and then serves that video data on the RFB (remote framebuffer, also known as VNC) protocol. The application also interfaces with the BMC USB gadget device to pass HID events from the BMC to the host, allowing the user to interact with the host system.
Once the host is running and an appropriate HID gadget device is instantiated on the BMC, the application can be started with the following command: obmc-ikvm -v <video device path> -i <HID gadget device path>
For example:
obmc-ikvm -v /dev/video0 -i /dev/hidg0