mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-07 13:48:28 +02:00
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
------------------
Commit: 7c7d5f08dd
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-15 (Wed, 15 Feb 2017)
This commit is contained in:
committed by
Michael Liebmann
parent
8cad1eb1a8
commit
0f4ed6c34a
@@ -156,6 +156,7 @@ void CFbAccelTD::init(const char *)
|
||||
lbb = lfb; /* the memory area to draw to... */
|
||||
available = fix.smem_len;
|
||||
stride = fix.line_length;
|
||||
swidth = stride / sizeof(fb_pixel_t);
|
||||
xRes = screeninfo.xres;
|
||||
yRes = screeninfo.yres;
|
||||
bpp = screeninfo.bits_per_pixel;
|
||||
@@ -169,7 +170,7 @@ int CFbAccelTD::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);
|
||||
|
Reference in New Issue
Block a user