aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fsl-diu-fb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fsl-diu-fb.c')
-rw-r--r--drivers/video/fsl-diu-fb.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index bd320a2bfb7c..d9d24938da9e 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -778,6 +778,22 @@ static void unmap_video_memory(struct fb_info *info)
778} 778}
779 779
780/* 780/*
781 * Using the fb_var_screeninfo in fb_info we set the aoi of this
782 * particular framebuffer. It is a light version of fsl_diu_set_par.
783 */
784static int fsl_diu_set_aoi(struct fb_info *info)
785{
786 struct fb_var_screeninfo *var = &info->var;
787 struct mfb_info *mfbi = info->par;
788 struct diu_ad *ad = mfbi->ad;
789
790 /* AOI should not be greater than display size */
791 ad->offset_xyi = cpu_to_le32((var->yoffset << 16) | var->xoffset);
792 ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d);
793 return 0;
794}
795
796/*
781 * Using the fb_var_screeninfo in fb_info we set the resolution of this 797 * Using the fb_var_screeninfo in fb_info we set the resolution of this
782 * particular framebuffer. This function alters the fb_fix_screeninfo stored 798 * particular framebuffer. This function alters the fb_fix_screeninfo stored
783 * in fb_info. It does not alter var in fb_info since we are using that 799 * in fb_info. It does not alter var in fb_info since we are using that
@@ -817,11 +833,11 @@ static int fsl_diu_set_par(struct fb_info *info)
817 diu_ops.get_pixel_format(var->bits_per_pixel, 833 diu_ops.get_pixel_format(var->bits_per_pixel,
818 machine_data->monitor_port); 834 machine_data->monitor_port);
819 ad->addr = cpu_to_le32(info->fix.smem_start); 835 ad->addr = cpu_to_le32(info->fix.smem_start);
820 ad->src_size_g_alpha = cpu_to_le32((var->yres << 12) | 836 ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) |
821 var->xres) | mfbi->g_alpha; 837 var->xres_virtual) | mfbi->g_alpha;
822 /* fix me. AOI should not be greater than display size */ 838 /* AOI should not be greater than display size */
823 ad->aoi_size = cpu_to_le32((var->yres << 16) | var->xres); 839 ad->aoi_size = cpu_to_le32((var->yres << 16) | var->xres);
824 ad->offset_xyi = 0; 840 ad->offset_xyi = cpu_to_le32((var->yoffset << 16) | var->xoffset);
825 ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d); 841 ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d);
826 842
827 /* Disable chroma keying function */ 843 /* Disable chroma keying function */
@@ -921,6 +937,8 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var,
921 else 937 else
922 info->var.vmode &= ~FB_VMODE_YWRAP; 938 info->var.vmode &= ~FB_VMODE_YWRAP;
923 939
940 fsl_diu_set_aoi(info);
941
924 return 0; 942 return 0;
925} 943}
926 944
@@ -989,7 +1007,7 @@ static int fsl_diu_ioctl(struct fb_info *info, unsigned int cmd,
989 pr_debug("set AOI display offset of index %d to (%d,%d)\n", 1007 pr_debug("set AOI display offset of index %d to (%d,%d)\n",
990 mfbi->index, aoi_d.x_aoi_d, aoi_d.y_aoi_d); 1008 mfbi->index, aoi_d.x_aoi_d, aoi_d.y_aoi_d);
991 fsl_diu_check_var(&info->var, info); 1009 fsl_diu_check_var(&info->var, info);
992 fsl_diu_set_par(info); 1010 fsl_diu_set_aoi(info);
993 break; 1011 break;
994 case MFB_GET_AOID: 1012 case MFB_GET_AOID:
995 aoi_d.x_aoi_d = mfbi->x_aoi_d; 1013 aoi_d.x_aoi_d = mfbi->x_aoi_d;