From 5806b3b6df6d2b3fba8876e36a0da98ad4d9fe0e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 22 Feb 2017 21:23:11 +0100 Subject: [PATCH] fb_accel: move hd2 specific parts from fader to fb_accel Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9287d66472e9c834e23e87ef87aa9b6334a2dc22 Author: Stefan Seyfried Date: 2017-02-22 (Wed, 22 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/fade.cpp | 16 ---------------- src/driver/fb_accel_cs_hd2.cpp | 5 ++++- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/driver/fade.cpp b/src/driver/fade.cpp index 3af188521..daefa3696 100644 --- a/src/driver/fade.cpp +++ b/src/driver/fade.cpp @@ -55,11 +55,7 @@ void COSDFader::StartFadeIn() fadeIn = true; fadeOut = false; fadeValue = 100; -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_UNIFORM_ALPHA); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha -#endif frameBuffer->setBlendLevel(fadeValue); #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_CS_HD2)) @@ -79,11 +75,7 @@ bool COSDFader::StartFadeOut() if ((!fadeOut) && g_settings.widget_fade) { fadeOut = true; fadeTimer = g_RCInput->addTimer( FADE_TIME, false ); -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_UNIFORM_ALPHA); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha -#endif ret = true; } return ret; @@ -93,11 +85,7 @@ void COSDFader::StopFade() { if ( fadeIn || fadeOut ) { g_RCInput->killTimer(fadeTimer); -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha -#endif #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_CS_HD2)) usleep(60000); #endif @@ -124,11 +112,7 @@ bool COSDFader::FadeDone() fadeValue = max_alpha; g_RCInput->killTimer (fadeTimer); fadeIn = false; -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha -#endif #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_CS_HD2)) usleep(60000); #endif diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index b801a37ff..ce20ce051 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -241,7 +241,10 @@ fb_pixel_t * CFbAccelCSHD2::getBackBufferPointer() const void CFbAccelCSHD2::setBlendMode(uint8_t mode) { - if (ioctl(fd, FBIO_SETBLENDMODE, mode)) + uint8_t arg = CNXTFB_BLEND_MODE_PER_PIXEL; + if (mode == 2) + arg = CNXTFB_BLEND_MODE_UNIFORM_ALPHA; + if (ioctl(fd, FBIO_SETBLENDMODE, arg)) printf("FBIO_SETBLENDMODE failed.\n"); }