Xfbdev: Handle unset fix.line_length
Older frame buffer devices may not fill in fix.line_length, in which case it must be calculated by the application. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
5c509c360d
commit
1049b32166
|
@ -206,6 +206,10 @@ fbdevScreenInitialize(KdScreenInfo * screen, FbdevScrPriv * scrpriv)
|
||||||
depth = priv->var.bits_per_pixel;
|
depth = priv->var.bits_per_pixel;
|
||||||
gray = priv->var.grayscale;
|
gray = priv->var.grayscale;
|
||||||
|
|
||||||
|
/* Calculate fix.line_length if it's zero */
|
||||||
|
if (!priv->fix.line_length)
|
||||||
|
priv->fix.line_length = (priv->var.xres_virtual * depth + 7) / 8;
|
||||||
|
|
||||||
switch (priv->fix.visual) {
|
switch (priv->fix.visual) {
|
||||||
case FB_VISUAL_PSEUDOCOLOR:
|
case FB_VISUAL_PSEUDOCOLOR:
|
||||||
if (gray) {
|
if (gray) {
|
||||||
|
|
Loading…
Reference in New Issue