Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321020
b: refs/heads/master
c: 6cd77e0
h: refs/heads/master
v: v3
  • Loading branch information
Liu Ying authored and Florian Tobias Schandinat committed Jun 27, 2012
1 parent f3a6530 commit 6fb03c7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f90fa539dff47e65fe859de2a9089e53231e0da
refs/heads/master: 6cd77e00c00c5da3b6f8546dcb6dfac9611ca10b
33 changes: 26 additions & 7 deletions trunk/drivers/video/mx3fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ struct mx3fb_info {
dma_cookie_t cookie;
struct scatterlist sg[2];

u32 sync; /* preserve var->sync flags */
struct fb_var_screeninfo cur_var; /* current var info */
};

static void mx3fb_dma_done(void *);
Expand Down Expand Up @@ -700,7 +700,7 @@ static void mx3fb_dma_done(void *arg)

static int __set_par(struct fb_info *fbi, bool lock)
{
u32 mem_len;
u32 mem_len, cur_xoffset, cur_yoffset;
struct ipu_di_signal_cfg sig_cfg;
enum ipu_panel mode = IPU_PANEL_TFT;
struct mx3fb_info *mx3_fbi = fbi->par;
Expand Down Expand Up @@ -780,8 +780,25 @@ static int __set_par(struct fb_info *fbi, bool lock)
video->out_height = fbi->var.yres;
video->out_stride = fbi->var.xres_virtual;

if (mx3_fbi->blank == FB_BLANK_UNBLANK)
if (mx3_fbi->blank == FB_BLANK_UNBLANK) {
sdc_enable_channel(mx3_fbi);
/*
* sg[0] points to fb smem_start address
* and is actually active in controller.
*/
mx3_fbi->cur_var.xoffset = 0;
mx3_fbi->cur_var.yoffset = 0;
}

/*
* Preserve xoffset and yoffest in case they are
* inactive in controller as fb is blanked.
*/
cur_xoffset = mx3_fbi->cur_var.xoffset;
cur_yoffset = mx3_fbi->cur_var.yoffset;
mx3_fbi->cur_var = fbi->var;
mx3_fbi->cur_var.xoffset = cur_xoffset;
mx3_fbi->cur_var.yoffset = cur_yoffset;

return 0;
}
Expand Down Expand Up @@ -901,8 +918,8 @@ static int mx3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *fbi)
var->grayscale = 0;

/* Preserve sync flags */
var->sync |= mx3_fbi->sync;
mx3_fbi->sync |= var->sync;
var->sync |= mx3_fbi->cur_var.sync;
mx3_fbi->cur_var.sync |= var->sync;

return 0;
}
Expand Down Expand Up @@ -1043,8 +1060,8 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
return -EINVAL;
}

if (fbi->var.xoffset == var->xoffset &&
fbi->var.yoffset == var->yoffset)
if (mx3_fbi->cur_var.xoffset == var->xoffset &&
mx3_fbi->cur_var.yoffset == var->yoffset)
return 0; /* No change, do nothing */

y_bottom = var->yoffset;
Expand Down Expand Up @@ -1127,6 +1144,8 @@ static int mx3fb_pan_display(struct fb_var_screeninfo *var,
else
fbi->var.vmode &= ~FB_VMODE_YWRAP;

mx3_fbi->cur_var = fbi->var;

mutex_unlock(&mx3_fbi->mutex);

dev_dbg(fbi->device, "Update complete\n");
Expand Down

0 comments on commit 6fb03c7

Please sign in to comment.