diff options
author | York Sun <yorksun@freescale.com> | 2008-08-15 03:40:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-15 11:35:43 -0400 |
commit | ae5591e3f4754478b397a4e09ebd7cf4774ef88e (patch) | |
tree | c9d7a34ce41c2dd9b58e8bf5bc467ada58cf001c /drivers | |
parent | 8c5a1cf0ad3ac5fcdf51314a63b16a440870f6a2 (diff) |
freescale DIU: add virtual resolution and panning support
Application can now have the virtual resoltuion and use FBIOPAN_DISPLAY
ioctl to pan.
Signed-off-by: York Sun <yorksun@freescale.com>
Cc: Kumar Gala <galak@gate.crashing.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fsl-diu-fb.c | 28 |
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 | */ | ||
784 | static 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; |