From 6055e3f088433cb0e81d97130fe1a0dcbc07f61d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 19 Aug 2017 21:43:54 +0200 Subject: [PATCH 1/3] fb_accel_sti: reorder blit_mutex locking This seems to help spurious deadlocks in the STI framebuffer blit code. Not 100% sure why, butthis helps, but I have not seen lockups with this. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7c5bb95597070d3613e74a4efad97956d562b3d8 Author: Stefan Seyfried Date: 2017-08-19 (Sat, 19 Aug 2017) ------------------ This commit was generated by Migit --- src/driver/fb_accel_sti.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/driver/fb_accel_sti.cpp b/src/driver/fb_accel_sti.cpp index dfe0ac5c3..17e342faf 100644 --- a/src/driver/fb_accel_sti.cpp +++ b/src/driver/fb_accel_sti.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -333,10 +334,12 @@ void CFbAccelSTi::run() time_t last_blit = 0; blit_pending = false; blit_thread = true; - blit_mutex.lock(); set_threadname("stifb::autoblit"); while (blit_thread) { + blit_mutex.lock(); blit_cond.wait(&blit_mutex, blit_pending ? BLIT_INTERVAL_MIN : BLIT_INTERVAL_MAX); + blit_mutex.unlock(); + time_t now = time_monotonic_ms(); if (now - last_blit < BLIT_INTERVAL_MIN) { @@ -346,20 +349,22 @@ void CFbAccelSTi::run() else { blit_pending = false; - blit_mutex.unlock(); _blit(); - blit_mutex.lock(); last_blit = now; } } - blit_mutex.unlock(); printf(LOGTAG "::run end\n"); } void CFbAccelSTi::blit() { //printf(LOGTAG "::blit\n"); - blit_mutex.lock(); + int status = blit_mutex.trylock(); + if (status) { + printf(LOGTAG "::blit trylock failed: %d (%s)\n", status, + (status > 0) ? strerror(status) : strerror(errno)); + return; + } blit_cond.signal(); blit_mutex.unlock(); } From 52a42f2459be2126b62320e239b6f551582a09b4 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 11:30:57 +0200 Subject: [PATCH 2/3] CKeyChooserItemNoKey: fix type cast Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/78638536787f6f69c01979d47f1ac5d5cc20cdb5 Author: Stefan Seyfried Date: 2017-08-20 (Sun, 20 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/keychooser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/keychooser.h b/src/gui/widget/keychooser.h index 8c89140c7..b2cdbeb64 100644 --- a/src/gui/widget/keychooser.h +++ b/src/gui/widget/keychooser.h @@ -96,7 +96,7 @@ class CKeyChooserItemNoKey : public CMenuTarget int exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) { - *key=(int)CRCInput::RC_nokey; + *key=(unsigned int)CRCInput::RC_nokey; return menu_return::RETURN_REPAINT; } From b6b774046d613b6d9e78a9d18930069e089f6e67 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 20 Aug 2017 11:44:01 +0200 Subject: [PATCH 3/3] rcinput: fix getKeyName for RC_none case Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/eaec2224e1778da623ba334519db68769648a263 Author: Stefan Seyfried Date: 2017-08-20 (Sun, 20 Aug 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/rcinput.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index cbaab0987..0d19b46d1 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1682,9 +1682,14 @@ const char * CRCInput::getSpecialKeyName(const unsigned int key) std::string CRCInput::getKeyName(const unsigned int key) { - std::string res(getKeyNameC(key & ~RC_Repeat)); - if ((key & RC_Repeat) && res != "unknown") - res += " (long)"; + std::string res; + if (key > RC_MaxRC) + res = getKeyNameC(key); /* will only resolve RC_nokey or "unknown" */ + else { + res = (getKeyNameC(key & ~RC_Repeat)); + if ((key & RC_Repeat) && res != "unknown") + res += " (long)"; + } return res; }