diff options
author | Jing Xiang <jxiang@marvell.com> | 2013-09-13 02:59:48 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-09-20 05:52:33 -0400 |
commit | cc50bc5bb29a9b4f71913d0b36ab45c6055eafc0 (patch) | |
tree | 4e0a1c1ff1bde36a12067cec11c101ecc2abb698 /drivers/video/mmp | |
parent | 1f2e42c6c3cdf1b62772f27e1de6033691839cfb (diff) |
video: mmp: calculate pitch value when fb set win
Add new func mmpfb_set_win to make code clean, it will do resolution
and fmt setting of win in mmpfb_set_win.
Signed-off-by: Jing Xiang <jxiang@marvell.com>
Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Signed-off-by: Zhou Zhu <zzhu3@marvell.com>
Reviewed-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/mmp')
-rw-r--r-- | drivers/video/mmp/fb/mmpfb.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/video/mmp/fb/mmpfb.c b/drivers/video/mmp/fb/mmpfb.c index 4ab95b8daed3..19fd913f462d 100644 --- a/drivers/video/mmp/fb/mmpfb.c +++ b/drivers/video/mmp/fb/mmpfb.c | |||
@@ -392,12 +392,23 @@ static int var_update(struct fb_info *info) | |||
392 | return 0; | 392 | return 0; |
393 | } | 393 | } |
394 | 394 | ||
395 | static void mmpfb_set_win(struct fb_info *info) | ||
396 | { | ||
397 | struct mmpfb_info *fbi = info->par; | ||
398 | struct mmp_win win; | ||
399 | |||
400 | memset(&win, 0, sizeof(win)); | ||
401 | win.xsrc = win.xdst = fbi->mode.xres; | ||
402 | win.ysrc = win.ydst = fbi->mode.yres; | ||
403 | win.pix_fmt = fbi->pix_fmt; | ||
404 | mmp_overlay_set_win(fbi->overlay, &win); | ||
405 | } | ||
406 | |||
395 | static int mmpfb_set_par(struct fb_info *info) | 407 | static int mmpfb_set_par(struct fb_info *info) |
396 | { | 408 | { |
397 | struct mmpfb_info *fbi = info->par; | 409 | struct mmpfb_info *fbi = info->par; |
398 | struct fb_var_screeninfo *var = &info->var; | 410 | struct fb_var_screeninfo *var = &info->var; |
399 | struct mmp_addr addr; | 411 | struct mmp_addr addr; |
400 | struct mmp_win win; | ||
401 | struct mmp_mode mode; | 412 | struct mmp_mode mode; |
402 | int ret; | 413 | int ret; |
403 | 414 | ||
@@ -409,11 +420,8 @@ static int mmpfb_set_par(struct fb_info *info) | |||
409 | fbmode_to_mmpmode(&mode, &fbi->mode, fbi->output_fmt); | 420 | fbmode_to_mmpmode(&mode, &fbi->mode, fbi->output_fmt); |
410 | mmp_path_set_mode(fbi->path, &mode); | 421 | mmp_path_set_mode(fbi->path, &mode); |
411 | 422 | ||
412 | memset(&win, 0, sizeof(win)); | 423 | /* set window related info */ |
413 | win.xsrc = win.xdst = fbi->mode.xres; | 424 | mmpfb_set_win(info); |
414 | win.ysrc = win.ydst = fbi->mode.yres; | ||
415 | win.pix_fmt = fbi->pix_fmt; | ||
416 | mmp_overlay_set_win(fbi->overlay, &win); | ||
417 | 425 | ||
418 | /* set address always */ | 426 | /* set address always */ |
419 | memset(&addr, 0, sizeof(addr)); | 427 | memset(&addr, 0, sizeof(addr)); |
@@ -427,16 +435,12 @@ static int mmpfb_set_par(struct fb_info *info) | |||
427 | static void mmpfb_power(struct mmpfb_info *fbi, int power) | 435 | static void mmpfb_power(struct mmpfb_info *fbi, int power) |
428 | { | 436 | { |
429 | struct mmp_addr addr; | 437 | struct mmp_addr addr; |
430 | struct mmp_win win; | ||
431 | struct fb_var_screeninfo *var = &fbi->fb_info->var; | 438 | struct fb_var_screeninfo *var = &fbi->fb_info->var; |
432 | 439 | ||
433 | /* for power on, always set address/window again */ | 440 | /* for power on, always set address/window again */ |
434 | if (power) { | 441 | if (power) { |
435 | memset(&win, 0, sizeof(win)); | 442 | /* set window related info */ |
436 | win.xsrc = win.xdst = fbi->mode.xres; | 443 | mmpfb_set_win(fbi->fb_info); |
437 | win.ysrc = win.ydst = fbi->mode.yres; | ||
438 | win.pix_fmt = fbi->pix_fmt; | ||
439 | mmp_overlay_set_win(fbi->overlay, &win); | ||
440 | 444 | ||
441 | /* set address always */ | 445 | /* set address always */ |
442 | memset(&addr, 0, sizeof(addr)); | 446 | memset(&addr, 0, sizeof(addr)); |