fb_generic: add swidth variable, "stride in fb_pixel_t units"

this should allow to use fb_pixel_t pointer arithmetics more often
instead of byte pointers


Origin commit data
------------------
Branch: ni/coolstream
Commit: 7c7d5f08dd
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-15 (Wed, 15 Feb 2017)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2017-02-15 20:30:52 +01:00
committed by Michael Liebmann
parent e6c0521928
commit adb8a608d5
8 changed files with 12 additions and 9 deletions

View File

@@ -346,6 +346,7 @@ int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int)
return -1;
}
stride = _fix.line_length;
swidth = stride / sizeof(fb_pixel_t);
if (ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK) < 0)
printf("screen unblanking failed\n");
xRes = screeninfo.xres;
@@ -355,7 +356,7 @@ int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int)
int needmem = stride * yRes * 2;
if (available >= needmem)
{
backbuffer = lfb + stride / sizeof(fb_pixel_t) * yRes;
backbuffer = lfb + swidth * yRes;
return 0;
}
fprintf(stderr, LOGTAG "not enough FB memory (have %d, need %d)\n", available, needmem);