diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2008-11-18 15:13:01 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2009-01-12 14:56:29 -0500 |
commit | 02603930da19fa447648952873e967fb9663ec18 (patch) | |
tree | 88e5f7dceb0955843da655016f795ab71d95edf0 /drivers/video | |
parent | ae04d1401577bb63151480a053057de58b8e10bb (diff) |
fbdev: atafb - Fix line length handling
- Make sure par->next_line is always set (this was done for Falcon only),
as all the text console drawing operations need a valid par->next_line,
- Make sure fix->line_length is always set, as some userspace applications
need it because they don't have fallback code for the case where it's zero.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/atafb.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 77eb8b34fbfa..b7646ad71bb3 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c | |||
@@ -614,7 +614,7 @@ static int tt_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) | |||
614 | fix->xpanstep = 0; | 614 | fix->xpanstep = 0; |
615 | fix->ypanstep = 1; | 615 | fix->ypanstep = 1; |
616 | fix->ywrapstep = 0; | 616 | fix->ywrapstep = 0; |
617 | fix->line_length = 0; | 617 | fix->line_length = par->next_line; |
618 | fix->accel = FB_ACCEL_ATARIBLITT; | 618 | fix->accel = FB_ACCEL_ATARIBLITT; |
619 | return 0; | 619 | return 0; |
620 | } | 620 | } |
@@ -691,6 +691,7 @@ static int tt_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) | |||
691 | return -EINVAL; | 691 | return -EINVAL; |
692 | par->yres_virtual = yres_virtual; | 692 | par->yres_virtual = yres_virtual; |
693 | par->screen_base = screen_base + var->yoffset * linelen; | 693 | par->screen_base = screen_base + var->yoffset * linelen; |
694 | par->next_line = linelen; | ||
694 | return 0; | 695 | return 0; |
695 | } | 696 | } |
696 | 697 | ||
@@ -918,7 +919,7 @@ static int falcon_encode_fix(struct fb_fix_screeninfo *fix, | |||
918 | fix->visual = FB_VISUAL_TRUECOLOR; | 919 | fix->visual = FB_VISUAL_TRUECOLOR; |
919 | fix->xpanstep = 2; | 920 | fix->xpanstep = 2; |
920 | } | 921 | } |
921 | fix->line_length = 0; | 922 | fix->line_length = par->next_line; |
922 | fix->accel = FB_ACCEL_ATARIBLITT; | 923 | fix->accel = FB_ACCEL_ATARIBLITT; |
923 | return 0; | 924 | return 0; |
924 | } | 925 | } |
@@ -1852,7 +1853,7 @@ static int stste_encode_fix(struct fb_fix_screeninfo *fix, | |||
1852 | fix->ypanstep = 0; | 1853 | fix->ypanstep = 0; |
1853 | } | 1854 | } |
1854 | fix->ywrapstep = 0; | 1855 | fix->ywrapstep = 0; |
1855 | fix->line_length = 0; | 1856 | fix->line_length = par->next_line; |
1856 | fix->accel = FB_ACCEL_ATARIBLITT; | 1857 | fix->accel = FB_ACCEL_ATARIBLITT; |
1857 | return 0; | 1858 | return 0; |
1858 | } | 1859 | } |
@@ -1910,6 +1911,7 @@ static int stste_decode_var(struct fb_var_screeninfo *var, | |||
1910 | return -EINVAL; | 1911 | return -EINVAL; |
1911 | par->yres_virtual = yres_virtual; | 1912 | par->yres_virtual = yres_virtual; |
1912 | par->screen_base = screen_base + var->yoffset * linelen; | 1913 | par->screen_base = screen_base + var->yoffset * linelen; |
1914 | par->next_line = linelen; | ||
1913 | return 0; | 1915 | return 0; |
1914 | } | 1916 | } |
1915 | 1917 | ||
@@ -2169,7 +2171,7 @@ static int ext_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) | |||
2169 | fix->xpanstep = 0; | 2171 | fix->xpanstep = 0; |
2170 | fix->ypanstep = 0; | 2172 | fix->ypanstep = 0; |
2171 | fix->ywrapstep = 0; | 2173 | fix->ywrapstep = 0; |
2172 | fix->line_length = 0; | 2174 | fix->line_length = par->next_line; |
2173 | return 0; | 2175 | return 0; |
2174 | } | 2176 | } |
2175 | 2177 | ||
@@ -2184,6 +2186,8 @@ static int ext_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) | |||
2184 | var->xoffset > 0 || | 2186 | var->xoffset > 0 || |
2185 | var->yoffset > 0) | 2187 | var->yoffset > 0) |
2186 | return -EINVAL; | 2188 | return -EINVAL; |
2189 | |||
2190 | par->next_line = external_xres_virtual * external_depth / 8; | ||
2187 | return 0; | 2191 | return 0; |
2188 | } | 2192 | } |
2189 | 2193 | ||