From d98f9e816c3ce96ba2f5fe4ced40d84d3fa8dd59 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 28 Mar 2017 12:36:26 +0200 Subject: [PATCH] framebuffer: fix unscaled paintings; this fixes our starbar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f6f1a71b397f66c216f9202f56aa4dff4032310b Author: vanhofen Date: 2017-03-28 (Tue, 28 Mar 2017) Origin message was: ------------------ - framebuffer: fix unscaled paintings; this fixes our starbar --- src/driver/fb_accel_cs_hd1.cpp | 6 ++++++ src/driver/fb_accel_cs_hd2.cpp | 6 ++++++ src/driver/fb_generic.cpp | 7 ++----- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/driver/fb_accel_cs_hd1.cpp b/src/driver/fb_accel_cs_hd1.cpp index 46cc19c12..342c69a2c 100644 --- a/src/driver/fb_accel_cs_hd1.cpp +++ b/src/driver/fb_accel_cs_hd1.cpp @@ -306,6 +306,12 @@ void CFbAccelCSHD1::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_ uint32_t xc = (width > xRes) ? (uint32_t)xRes : width; uint32_t yc = (height > yRes) ? (uint32_t)yRes : height; + //NI + if (unscaled_w != 0 && (int)unscaled_w < xc) + xc = unscaled_w; + if (unscaled_h != 0 && (int)unscaled_h < yc) + yc = unscaled_h; + void* uKva = cs_phys_addr((void*)boxBuf); if(uKva != NULL) { OpenThreads::ScopedLock m_lock(mutex); diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index 07ff23c09..3237668dc 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -169,6 +169,12 @@ void CFbAccelCSHD2::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint3 xc = (width > xRes) ? xRes : width; yc = (height > yRes) ? yRes : height; + //NI + if (unscaled_w != 0 && (int)unscaled_w < xc) + xc = unscaled_w; + if (unscaled_h != 0 && (int)unscaled_h < yc) + yc = unscaled_h; + if(!(width%4)) { fb_image image; image.dx = xoff; diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 8dea24c47..ff7ee60f9 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -1673,14 +1673,11 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 xc = (width > xRes) ? xRes : width; yc = (height > yRes) ? yRes : height; -//FIXME -#if 0 //NI - if(unscaled_w != 0 && (int)unscaled_w < xc) + if (unscaled_w != 0 && (int)unscaled_w < xc) xc = unscaled_w; - if(unscaled_h != 0 && (int)unscaled_h < yc) + if (unscaled_h != 0 && (int)unscaled_h < yc) yc = unscaled_h; -#endif fb_pixel_t* data = (fb_pixel_t *) fbbuff;