]> git.webhop.me Git - input.git/commitdiff
init backbuffer depending on FSCREENINFO line_length
authorGetAway <get-away@t-online.de>
Wed, 4 Oct 2017 10:36:34 +0000 (12:36 +0200)
committerJacek Jendrzej <satbaby@kawaii.com>
Wed, 4 Oct 2017 12:54:37 +0000 (14:54 +0200)
this prevents horizontal cut of OSD with new fb driver
bump version 2.11

fb_display.c
gfx.c
input.c
input.h
text.c

index ce645a4ed3ee36e0cbc248c64be960f06072ba18..6db3adce0c123e97352766ec6cf51cacab045b2f 100644 (file)
@@ -76,7 +76,7 @@ void blit2FB(void *fbbuff,
                {
                        uint32_t * data = (uint32_t *) fbbuff;
 
-                       uint32_t * d = (uint32_t *)lbb + xo + stride * ssy/*yoffs*/;
+                       uint32_t * d = (uint32_t *)lbb + xo + swidth * ssy/*yoffs*/;
                        uint32_t * d2;
 
                        for (count = 0; count < yc; count++ ) {
@@ -99,7 +99,7 @@ void blit2FB(void *fbbuff,
                                        d2++;
                                        pixpos++;
                                }
-                               d += stride;
+                               d += swidth;
                        }
                }
                break;
diff --git a/gfx.c b/gfx.c
index bb69a546a5ab03e89caffc999838e0a755bff6fa..981cbbbc4540aca3e9e27819770e1d0fb3d7d456 100644 (file)
--- a/gfx.c
+++ b/gfx.c
@@ -13,7 +13,7 @@ void RenderBox(int _sx, int _sy, int _ex, int _ey, int rad, int col)
 {
        int F,R=rad,ssx=startx+_sx,ssy=starty+_sy,dxx=_ex-_sx,dyy=_ey-_sy,rx,ry,wx,wy,count;
 
-       uint32_t *pos = lbb + ssx + stride * ssy;
+       uint32_t *pos = lbb + ssx + swidth * ssy;
        uint32_t *pos0, *pos1, *pos2, *pos3, *i;
        uint32_t pix = bgra[col];
 
@@ -64,10 +64,10 @@ void RenderBox(int _sx, int _sy, int _ex, int _ey, int rad, int col)
                rx=R-ssx;
                ry=R-ssy;
 
-               pos0=pos+(dyy-ry)*stride;
-               pos1=pos+ry*stride;
-               pos2=pos+rx*stride;
-               pos3=pos+(dyy-rx)*stride;
+               pos0=pos+(dyy-ry)*swidth;
+               pos1=pos+ry*swidth;
+               pos2=pos+rx*swidth;
+               pos3=pos+(dyy-rx)*swidth;
 
                while (ssx <= ssy)
                {
@@ -86,8 +86,8 @@ void RenderBox(int _sx, int _sy, int _ex, int _ey, int rad, int col)
                                *i = pix;
 
                        ssx++;
-                       pos2-=stride;
-                       pos3+=stride;
+                       pos2-=swidth;
+                       pos3+=swidth;
                        if (F<0)
                        {
                                F+=(ssx<<1)-1;
@@ -96,18 +96,18 @@ void RenderBox(int _sx, int _sy, int _ex, int _ey, int rad, int col)
                        { 
                                F+=((ssx-ssy)<<1);
                                ssy--;
-                               pos0-=stride;
-                               pos1+=stride;
+                               pos0-=swidth;
+                               pos1+=swidth;
                        }
                }
-               pos+=R*stride;
+               pos+=R*swidth;
        }
 
        for (count=R; count<(dyy-R); count++)
        {
                for(i=pos; i<pos+dxx;i++)
                        *i = pix;
-               pos+=stride;
+               pos+=swidth;
        }
 }
 
diff --git a/input.c b/input.c
index c5456c03d65eed215baf84d8accd85d9e1f7c103..a4cd0d881a0a879d9660a1912feaa7b639eda57c 100644 (file)
--- a/input.c
+++ b/input.c
@@ -12,7 +12,7 @@
 
 #define NCF_FILE       "/var/tuxbox/config/neutrino.conf"
 #define BUFSIZE        1024
-#define I_VERSION      2.10
+#define I_VERSION      2.11
 
 
 char FONT[128]="/share/fonts/neutrino.ttf";
@@ -63,7 +63,7 @@ char nstr[512]={0};
 char *trstr=NULL;
 const char sc[8]={'a','o','u','A','O','U','z','d'}, tc[8]={0xE4,0xF6,0xFC,0xC4,0xD6,0xDC,0xDF,0xB0};
 int radius;
-int stride;
+int swidth;
 
 
 static void quit_signal(int sig)
@@ -528,8 +528,12 @@ char rstr[512]={0}, *title=NULL, *format=NULL, *defstr=NULL, *aptr=NULL, *rptr=N
 
                desc.flags = FT_LOAD_RENDER | FT_LOAD_FORCE_AUTOHINT;
 
-       //init backbuffer
-
+               //init backbuffer
+               int stride = fix_screeninfo.line_length;
+               swidth = stride/sizeof(uint32_t);
+               if (stride == 7680 && var_screeninfo.xres == 1280) {
+                       var_screeninfo.yres = 1080;
+               }
                if(!(lbb = malloc(var_screeninfo.xres*var_screeninfo.yres*sizeof(uint32_t))))
                {
                        perror(__plugin__ " <allocating of Backbuffer>\n");
@@ -538,8 +542,6 @@ char rstr[512]={0}, *title=NULL, *format=NULL, *defstr=NULL, *aptr=NULL, *rptr=N
                        munmap(lfb, fix_screeninfo.smem_len);
                        return -1;
                }
-               stride = fix_screeninfo.line_length/sizeof(uint32_t);
-
                if(!(obb = malloc(var_screeninfo.xres*var_screeninfo.yres*sizeof(uint32_t))))
                {
                        perror(__plugin__ " <allocating of Backbuffer>\n");
diff --git a/input.h b/input.h
index 6b8c182ae134aefb5ee1e1fb0c8067fe0dd0bf0b..188c367ca906f60e8fa6346f7de7992060aa6612 100644 (file)
--- a/input.h
+++ b/input.h
@@ -135,7 +135,7 @@ enum {
 
 extern uint32_t *lfb, *lbb, *obb;
 extern uint32_t bgra[];
-extern int stride;
+extern int swidth;
 
 extern int FSIZE_BIG;
 extern int FSIZE_MED;
diff --git a/text.c b/text.c
index d41ec26600bac97417fbf77d086b32b660b1219f..f8b0362bd53a44a41f9deb63ad249a04e8167abb 100644 (file)
--- a/text.c
+++ b/text.c
@@ -153,10 +153,10 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
        {
                if (_sx + sbit->xadvance > _ex + 5)
                        return -1; /* limit to maxwidth */
-               uint32_t bgcolor = *(lbb + (sy + _sy - _d - 1) * stride + (sx + _sx + sbit->left));
+               uint32_t bgcolor = *(lbb + (sy + _sy - _d - 1) * swidth + (sx + _sx + sbit->left));
                uint32_t fgcolor = bgra[color];
                uint32_t *colors = lookup_colors(fgcolor, bgcolor);
-               uint32_t *p = lbb + (sx + _sx + sbit->left + kerning.x) + stride * (sy + _sy - sbit->top - _d);
+               uint32_t *p = lbb + (sx + _sx + sbit->left + kerning.x) + swidth * (sy + _sy - sbit->top - _d);
                uint32_t *r = p + (_ex - _sx);  /* end of usable box */
                for(row = 0; row < sbit->height; row++)
                {
@@ -170,8 +170,8 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color)
                                if (q > r)      /* we are past _ex */
                                        break;
                        }
-                       p += stride;
-                       r += stride;
+                       p += swidth;
+                       r += swidth;
                }
        }