diff options
author | Eric Miao <ycmiao@ycmiao-hp520.(none)> | 2008-12-17 01:56:54 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2008-12-29 04:59:16 -0500 |
commit | 7e4b19c95c8632b543bd510ec6c710bebb53b840 (patch) | |
tree | 5c6eeaeb949a8beded5193379fb552fb15cf8fe1 /drivers/video | |
parent | 77e196752bdd76a0c58ab082658d28c6a90fa40e (diff) |
[ARM] pxafb: allow pxafb_set_par() to start from arbitrary yoffset
Note the var->yres_virtual is only re-calculated from the fix.smem_len
when text mode acceleration is enabled (which is default), this is due
to the issue as Russell suggested below:
Previous experience of doing this with the X server and acornfb is that
it causes all sorts of problems - it seems to force the X server into
assuming that the framebuffer should be panned no matter what settings
you ask it for.
The recommended workaround (implemented in acornfb) is to only do these
kinds of adjustments if text mode acceleration is enabled. IIRC, the X
server should be disabling text mode acceleration when it maps the
framebuffer. I seem to remember that there are X servers which forget
to do that though.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Eric Miao <ycmiao@ycmiao-hp520.(none)>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/pxafb.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 25bf4b8b6b53..ab816cadb470 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -306,8 +306,6 @@ static void pxafb_setmode(struct fb_var_screeninfo *var, | |||
306 | var->lower_margin = mode->lower_margin; | 306 | var->lower_margin = mode->lower_margin; |
307 | var->sync = mode->sync; | 307 | var->sync = mode->sync; |
308 | var->grayscale = mode->cmap_greyscale; | 308 | var->grayscale = mode->cmap_greyscale; |
309 | var->xres_virtual = var->xres; | ||
310 | var->yres_virtual = var->yres; | ||
311 | } | 309 | } |
312 | 310 | ||
313 | /* | 311 | /* |
@@ -345,10 +343,14 @@ static int pxafb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
345 | return -EINVAL; | 343 | return -EINVAL; |
346 | } | 344 | } |
347 | 345 | ||
348 | var->xres_virtual = | 346 | /* we don't support xpan, force xres_virtual to be equal to xres */ |
349 | max(var->xres_virtual, var->xres); | 347 | var->xres_virtual = var->xres; |
350 | var->yres_virtual = | 348 | |
351 | max(var->yres_virtual, var->yres); | 349 | if (var->accel_flags & FB_ACCELF_TEXT) |
350 | var->yres_virtual = fbi->fb.fix.smem_len / | ||
351 | (var->xres_virtual * var->bits_per_pixel / 8); | ||
352 | else | ||
353 | var->yres_virtual = max(var->yres_virtual, var->yres); | ||
352 | 354 | ||
353 | /* | 355 | /* |
354 | * Setup the RGB parameters for this display. | 356 | * Setup the RGB parameters for this display. |
@@ -878,7 +880,7 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var, | |||
878 | struct pxafb_info *fbi) | 880 | struct pxafb_info *fbi) |
879 | { | 881 | { |
880 | u_long flags; | 882 | u_long flags; |
881 | size_t nbytes; | 883 | size_t nbytes, offset; |
882 | 884 | ||
883 | #if DEBUG_VAR | 885 | #if DEBUG_VAR |
884 | if (!(fbi->lccr0 & LCCR0_LCDT)) { | 886 | if (!(fbi->lccr0 & LCCR0_LCDT)) { |
@@ -939,17 +941,18 @@ static int pxafb_activate_var(struct fb_var_screeninfo *var, | |||
939 | 941 | ||
940 | fbi->reg_lccr3 |= pxafb_bpp_to_lccr3(var); | 942 | fbi->reg_lccr3 |= pxafb_bpp_to_lccr3(var); |
941 | 943 | ||
942 | nbytes = var->yres * fbi->fb.fix.line_length; | 944 | nbytes = fbi->fb.fix.line_length * var->yres; |
945 | offset = fbi->fb.fix.line_length * var->yoffset; | ||
943 | 946 | ||
944 | if ((fbi->lccr0 & LCCR0_SDS) == LCCR0_Dual) { | 947 | if ((fbi->lccr0 & LCCR0_SDS) == LCCR0_Dual) { |
945 | nbytes = nbytes / 2; | 948 | nbytes = nbytes / 2; |
946 | setup_frame_dma(fbi, DMA_LOWER, PAL_NONE, nbytes, nbytes); | 949 | setup_frame_dma(fbi, DMA_LOWER, PAL_NONE, offset + nbytes, nbytes); |
947 | } | 950 | } |
948 | 951 | ||
949 | if ((var->bits_per_pixel >= 16) || (fbi->lccr0 & LCCR0_LCDT)) | 952 | if ((var->bits_per_pixel >= 16) || (fbi->lccr0 & LCCR0_LCDT)) |
950 | setup_frame_dma(fbi, DMA_BASE, PAL_NONE, 0, nbytes); | 953 | setup_frame_dma(fbi, DMA_BASE, PAL_NONE, offset, nbytes); |
951 | else | 954 | else |
952 | setup_frame_dma(fbi, DMA_BASE, PAL_BASE, 0, nbytes); | 955 | setup_frame_dma(fbi, DMA_BASE, PAL_BASE, offset, nbytes); |
953 | 956 | ||
954 | fbi->reg_lccr4 = lcd_readl(fbi, LCCR4) & ~LCCR4_PAL_FOR_MASK; | 957 | fbi->reg_lccr4 = lcd_readl(fbi, LCCR4) & ~LCCR4_PAL_FOR_MASK; |
955 | fbi->reg_lccr4 |= (fbi->lccr4 & LCCR4_PAL_FOR_MASK); | 958 | fbi->reg_lccr4 |= (fbi->lccr4 & LCCR4_PAL_FOR_MASK); |
@@ -1362,7 +1365,7 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev) | |||
1362 | fbi->fb.fix.type = FB_TYPE_PACKED_PIXELS; | 1365 | fbi->fb.fix.type = FB_TYPE_PACKED_PIXELS; |
1363 | fbi->fb.fix.type_aux = 0; | 1366 | fbi->fb.fix.type_aux = 0; |
1364 | fbi->fb.fix.xpanstep = 0; | 1367 | fbi->fb.fix.xpanstep = 0; |
1365 | fbi->fb.fix.ypanstep = 0; | 1368 | fbi->fb.fix.ypanstep = 1; |
1366 | fbi->fb.fix.ywrapstep = 0; | 1369 | fbi->fb.fix.ywrapstep = 0; |
1367 | fbi->fb.fix.accel = FB_ACCEL_NONE; | 1370 | fbi->fb.fix.accel = FB_ACCEL_NONE; |
1368 | 1371 | ||
@@ -1370,7 +1373,7 @@ static struct pxafb_info * __devinit pxafb_init_fbinfo(struct device *dev) | |||
1370 | fbi->fb.var.activate = FB_ACTIVATE_NOW; | 1373 | fbi->fb.var.activate = FB_ACTIVATE_NOW; |
1371 | fbi->fb.var.height = -1; | 1374 | fbi->fb.var.height = -1; |
1372 | fbi->fb.var.width = -1; | 1375 | fbi->fb.var.width = -1; |
1373 | fbi->fb.var.accel_flags = 0; | 1376 | fbi->fb.var.accel_flags = FB_ACCELF_TEXT; |
1374 | fbi->fb.var.vmode = FB_VMODE_NONINTERLACED; | 1377 | fbi->fb.var.vmode = FB_VMODE_NONINTERLACED; |
1375 | 1378 | ||
1376 | fbi->fb.fbops = &pxafb_ops; | 1379 | fbi->fb.fbops = &pxafb_ops; |