From 456380bb272d3a301c887eee513a3937cc1f48e1 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Tue, 22 Oct 2019 14:01:54 -0700 Subject: Update to internal 10-22-19 Signed-off-by: Jason M. Bills --- .../libvncserver/libvncserver_%.bbappend | 2 +- ...d-flow-control-to-prevent-buffer-over-run.patch | 121 --------------- ...ard-and-mouse-input-events-dropping-issue.patch | 162 +++++++++++++++++++++ .../obmc-ikvm/obmc-ikvm_%.bbappend | 6 +- 4 files changed, 167 insertions(+), 124 deletions(-) delete mode 100644 meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch create mode 100644 meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0003-Fix-keyboard-and-mouse-input-events-dropping-issue.patch (limited to 'meta-openbmc-mods/meta-common/recipes-graphics') diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend b/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend index 0d9012235..000b24b39 100644 --- a/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-graphics/libvncserver/libvncserver_%.bbappend @@ -2,4 +2,4 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" # Use the latest to support obmc-ikvm properly #SRC_URI = "git://github.com/LibVNC/libvncserver" -SRCREV = "091b9eb739a95c8c969e2e6865c255b0d170f95f" +SRCREV = "864c2fd337029c92959303f4348099b31eec0aed" diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch deleted file mode 100644 index 70f2da4a0..000000000 --- a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0001-Add-flow-control-to-prevent-buffer-over-run.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 88337ce8246a453cd3c6e60e96aead43549a5e1d Mon Sep 17 00:00:00 2001 -From: Jae Hyun Yoo -Date: Thu, 9 May 2019 16:26:53 -0700 -Subject: [PATCH] Add flow control to prevent buffer over run - -This service uses direct frame update with bypassing image -compression and invalidating logic in libvncserver to achieve -better performance by using of H/W compressed JPEG frames as those -come from the video engine driver. - -This behavior helps quick frame update using very small amount of -CPU resources but it causes a side effect which crashes bmcweb -by OOM killer due to a buffer over run issue. Usually, this issue -happens often in a slow speed connection because this service -keeps sending all frames without any handshaking with clients so -a session buffer in the bmcweb gets bigger and bigger since the -low speed connection can't send all stream data on time. - -To fix this issue, this commit adds flow control logic to make -frame updating handshakes with client so that it'll send frames -only when it recieved client frame update messages. All other -frames when the client doesn't request will be dropped out to -prevent the buffer over run issue. - -Tested: -bmcweb didn't keep increasing its KVM session buffer. -KVM worked well with showing good refresh speed. - -resolves https://github.com/openbmc/bmcweb/issues/80 - -Change-Id: I6b09a711137d15a38fce59adada9bf3d00afde86 -Signed-off-by: Jae Hyun Yoo ---- - ikvm_server.cpp | 20 ++++++++++++++++++++ - ikvm_server.hpp | 11 +++++++++++ - 2 files changed, 31 insertions(+) - -diff --git a/ikvm_server.cpp b/ikvm_server.cpp -index 35310da292be..dfafe3a82e64 100644 ---- a/ikvm_server.cpp -+++ b/ikvm_server.cpp -@@ -119,6 +119,12 @@ void Server::sendFrame() - continue; - } - -+ if (!cd->needUpdate) -+ { -+ continue; -+ } -+ cd->needUpdate = false; -+ - if (cl->enableLastRectEncoding) - { - fu->nRects = 0xFFFF; -@@ -149,6 +155,19 @@ void Server::sendFrame() - rfbReleaseClientIterator(it); - } - -+void Server::clientFramebufferUpdateRequest( -+ rfbClientPtr cl, rfbFramebufferUpdateRequestMsg *furMsg) -+{ -+ ClientData *cd = (ClientData *)cl->clientData; -+ -+ if (!cd) -+ return; -+ -+ // Ignore the furMsg info. This service uses full frame update always. -+ -+ cd->needUpdate = true; -+} -+ - void Server::clientGone(rfbClientPtr cl) - { - Server* server = (Server*)cl->screen->screenData; -@@ -170,6 +189,7 @@ enum rfbNewClientAction Server::newClient(rfbClientPtr cl) - cl->clientData = - new ClientData(server->video.getFrameRate(), &server->input); - cl->clientGoneHook = clientGone; -+ cl->clientFramebufferUpdateRequestHook = clientFramebufferUpdateRequest; - if (!server->numClients++) - { - server->pendingResize = false; -diff --git a/ikvm_server.hpp b/ikvm_server.hpp -index b8062017b8ca..ebe4ad2b287e 100644 ---- a/ikvm_server.hpp -+++ b/ikvm_server.hpp -@@ -32,6 +32,7 @@ class Server - */ - ClientData(int s, Input* i) : skipFrame(s), input(i) - { -+ needUpdate = false; - } - ~ClientData() = default; - ClientData(const ClientData&) = default; -@@ -41,6 +42,7 @@ class Server - - int skipFrame; - Input* input; -+ bool needUpdate; - }; - - /* -@@ -85,6 +87,15 @@ class Server - - private: - /* -+ * @brief Handler for a client frame update message -+ * -+ * @param[in] cl - Handle to the client object -+ * @param[in] furMsg - Pointer of the FUR message -+ */ -+ static void -+ clientFramebufferUpdateRequest(rfbClientPtr cl, -+ rfbFramebufferUpdateRequestMsg *furMsg); -+ /* - * @brief Handler for a client disconnecting - * - * @param[in] cl - Handle to the client object --- -2.7.4 - diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0003-Fix-keyboard-and-mouse-input-events-dropping-issue.patch b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0003-Fix-keyboard-and-mouse-input-events-dropping-issue.patch new file mode 100644 index 000000000..43600ac8a --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm/0003-Fix-keyboard-and-mouse-input-events-dropping-issue.patch @@ -0,0 +1,162 @@ +From 0c0b7b5da551c99161bda98820a529ba29cbaac1 Mon Sep 17 00:00:00 2001 +From: Jae Hyun Yoo +Date: Wed, 21 Aug 2019 16:52:30 -0700 +Subject: [PATCH] Fix keyboard and mouse input events dropping issue + +Restarting of HID input devices causes input events dropping issue +which is critical for BMC KVM uses. For an example, user can't enter +to BIOS by doing keep pressing 'F2' or 'Del' key because of this issue. + +To fix the issue, this commit removes the input device restarting +logic and refines error log journaling logic using errno checking. + +Tested: + 1. Open BMCweb -> Server control -> KVM. + 2. Make a host reset and keep pressing 'F2' key. + 3. Was able to enter to BIOS using the key press. + +Change-Id: Iec1bfad1d9e5825858844cab658bbfa3e6bc24f6 +Signed-off-by: Jae Hyun Yoo +--- + ikvm_input.cpp | 58 +++++++--------------------------------------------------- + ikvm_input.hpp | 4 ---- + ikvm_video.cpp | 3 +-- + 3 files changed, 8 insertions(+), 57 deletions(-) + +diff --git a/ikvm_input.cpp b/ikvm_input.cpp +index d95e6313f62c..df12f2715585 100644 +--- a/ikvm_input.cpp ++++ b/ikvm_input.cpp +@@ -23,9 +23,9 @@ using namespace phosphor::logging; + using namespace sdbusplus::xyz::openbmc_project::Common::File::Error; + + Input::Input(const std::string& kbdPath, const std::string& ptrPath) : +- pointerError(false), sendKeyboard(false), sendPointer(false), +- keyboardFd(-1), pointerFd(-1), keyboardReport{0}, pointerReport{0}, +- keyboardPath(kbdPath), pointerPath(ptrPath) ++ sendKeyboard(false), sendPointer(false), keyboardFd(-1), pointerFd(-1), ++ keyboardReport{0}, pointerReport{0}, keyboardPath(kbdPath), ++ pointerPath(ptrPath) + { + if (!keyboardPath.empty()) + { +@@ -156,36 +156,6 @@ void Input::pointerEvent(int buttonMask, int x, int y, rfbClientPtr cl) + rfbDefaultPtrAddEvent(buttonMask, x, y, cl); + } + +-void Input::restart() +-{ +- if (!keyboardPath.empty() && keyboardFd < 0) +- { +- keyboardFd = open(keyboardPath.c_str(), O_RDWR | O_CLOEXEC); +- if (keyboardFd < 0) +- { +- log("Failed to open input device", +- entry("PATH=%s", keyboardPath.c_str()), +- entry("ERROR=%s", strerror(errno))); +- } +- +- sendKeyboard = false; +- } +- +- if (!pointerPath.empty() && pointerFd < 0) +- { +- pointerFd = open(pointerPath.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK); +- if (pointerFd < 0) +- { +- log("Failed to open input device", +- entry("PATH=%s", pointerPath.c_str()), +- entry("ERROR=%s", strerror(errno))); +- } +- +- pointerError = false; +- sendPointer = false; +- } +-} +- + void Input::sendWakeupPacket() + { + uint8_t wakeupReport[KEY_REPORT_LENGTH] = {0}; +@@ -459,13 +429,10 @@ bool Input::writeKeyboard(const uint8_t *report) + { + if (write(keyboardFd, report, KEY_REPORT_LENGTH) != KEY_REPORT_LENGTH) + { +- log("Failed to write keyboard report", +- entry("ERROR=%s", strerror(errno))); +- +- if (errno == ESHUTDOWN) ++ if (errno != ESHUTDOWN && errno != EAGAIN) + { +- close(keyboardFd); +- keyboardFd = -1; ++ log("Failed to write keyboard report", ++ entry("ERROR=%s", strerror(errno))); + } + + return false; +@@ -478,23 +445,12 @@ void Input::writePointer(const uint8_t *report) + { + if (write(pointerFd, report, PTR_REPORT_LENGTH) != PTR_REPORT_LENGTH) + { +- if (!pointerError) ++ if (errno != ESHUTDOWN && errno != EAGAIN) + { + log("Failed to write pointer report", + entry("ERROR=%s", strerror(errno))); +- pointerError = true; +- } +- +- if (errno == ESHUTDOWN) +- { +- close(pointerFd); +- pointerFd = -1; + } + } +- else +- { +- pointerError = false; +- } + } + + } // namespace ikvm +diff --git a/ikvm_input.hpp b/ikvm_input.hpp +index 953333263e2d..2adc7c106755 100644 +--- a/ikvm_input.hpp ++++ b/ikvm_input.hpp +@@ -48,8 +48,6 @@ class Input + */ + static void pointerEvent(int buttonMask, int x, int y, rfbClientPtr cl); + +- /* @brief Re-opens USB device in case the endpoint shutdown */ +- void restart(); + /* @brief Sends a wakeup data packet to the USB input device */ + void sendWakeupPacket(); + /* @brief Sends an HID report to the USB input device */ +@@ -90,8 +88,6 @@ class Input + bool writeKeyboard(const uint8_t *report); + void writePointer(const uint8_t *report); + +- /* @brief Indicates whether or not a pointer report error has occurred */ +- bool pointerError; + /* @brief Indicates whether or not to send a keyboard report */ + bool sendKeyboard; + /* @brief Indicates whether or not to send a pointer report */ +diff --git a/ikvm_video.cpp b/ikvm_video.cpp +index 6a5aa6c10927..7bd4b4eb6c98 100644 +--- a/ikvm_video.cpp ++++ b/ikvm_video.cpp +@@ -163,10 +163,9 @@ bool Video::needsResize() + restart(); + return false; + } +- else if (timingsError) ++ else + { + timingsError = false; +- input.restart(); + } + + if (timings.bt.width != width || timings.bt.height != height) +-- +2.7.4 + diff --git a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_%.bbappend b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_%.bbappend index cc18a9b43..2118baa8a 100644 --- a/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-graphics/obmc-ikvm/obmc-ikvm_%.bbappend @@ -1,6 +1,8 @@ FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" #SRC_URI = "git://github.com/openbmc/obmc-ikvm" -SRCREV = "95a3b35bf30f730d2bc512bd42aea45746c625e6" +SRCREV = "7cf1f1d43ef9b4c312bfb2c7c61514ca93a53ee6" -SRC_URI += "file://0001-Add-flow-control-to-prevent-buffer-over-run.patch" +SRC_URI += " \ + file://0003-Fix-keyboard-and-mouse-input-events-dropping-issue.patch \ + " -- cgit v1.2.3