diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fsl-diu-fb.c | 32 | ||||
-rw-r--r-- | drivers/video/pxafb.c | 68 |
2 files changed, 68 insertions, 32 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index bd320a2bfb7c..fb51197d1c98 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -479,6 +479,10 @@ static void adjust_aoi_size_position(struct fb_var_screeninfo *var, | |||
479 | base_plane_width = machine_data->fsl_diu_info[0]->var.xres; | 479 | base_plane_width = machine_data->fsl_diu_info[0]->var.xres; |
480 | base_plane_height = machine_data->fsl_diu_info[0]->var.yres; | 480 | base_plane_height = machine_data->fsl_diu_info[0]->var.yres; |
481 | 481 | ||
482 | if (mfbi->x_aoi_d < 0) | ||
483 | mfbi->x_aoi_d = 0; | ||
484 | if (mfbi->y_aoi_d < 0) | ||
485 | mfbi->y_aoi_d = 0; | ||
482 | switch (index) { | 486 | switch (index) { |
483 | case 0: | 487 | case 0: |
484 | if (mfbi->x_aoi_d != 0) | 488 | if (mfbi->x_aoi_d != 0) |
@@ -778,6 +782,22 @@ static void unmap_video_memory(struct fb_info *info) | |||
778 | } | 782 | } |
779 | 783 | ||
780 | /* | 784 | /* |
785 | * Using the fb_var_screeninfo in fb_info we set the aoi of this | ||
786 | * particular framebuffer. It is a light version of fsl_diu_set_par. | ||
787 | */ | ||
788 | static int fsl_diu_set_aoi(struct fb_info *info) | ||
789 | { | ||
790 | struct fb_var_screeninfo *var = &info->var; | ||
791 | struct mfb_info *mfbi = info->par; | ||
792 | struct diu_ad *ad = mfbi->ad; | ||
793 | |||
794 | /* AOI should not be greater than display size */ | ||
795 | ad->offset_xyi = cpu_to_le32((var->yoffset << 16) | var->xoffset); | ||
796 | ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d); | ||
797 | return 0; | ||
798 | } | ||
799 | |||
800 | /* | ||
781 | * Using the fb_var_screeninfo in fb_info we set the resolution of this | 801 | * 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 | 802 | * 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 | 803 | * in fb_info. It does not alter var in fb_info since we are using that |
@@ -817,11 +837,11 @@ static int fsl_diu_set_par(struct fb_info *info) | |||
817 | diu_ops.get_pixel_format(var->bits_per_pixel, | 837 | diu_ops.get_pixel_format(var->bits_per_pixel, |
818 | machine_data->monitor_port); | 838 | machine_data->monitor_port); |
819 | ad->addr = cpu_to_le32(info->fix.smem_start); | 839 | ad->addr = cpu_to_le32(info->fix.smem_start); |
820 | ad->src_size_g_alpha = cpu_to_le32((var->yres << 12) | | 840 | ad->src_size_g_alpha = cpu_to_le32((var->yres_virtual << 12) | |
821 | var->xres) | mfbi->g_alpha; | 841 | var->xres_virtual) | mfbi->g_alpha; |
822 | /* fix me. AOI should not be greater than display size */ | 842 | /* AOI should not be greater than display size */ |
823 | ad->aoi_size = cpu_to_le32((var->yres << 16) | var->xres); | 843 | ad->aoi_size = cpu_to_le32((var->yres << 16) | var->xres); |
824 | ad->offset_xyi = 0; | 844 | 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); | 845 | ad->offset_xyd = cpu_to_le32((mfbi->y_aoi_d << 16) | mfbi->x_aoi_d); |
826 | 846 | ||
827 | /* Disable chroma keying function */ | 847 | /* Disable chroma keying function */ |
@@ -921,6 +941,8 @@ static int fsl_diu_pan_display(struct fb_var_screeninfo *var, | |||
921 | else | 941 | else |
922 | info->var.vmode &= ~FB_VMODE_YWRAP; | 942 | info->var.vmode &= ~FB_VMODE_YWRAP; |
923 | 943 | ||
944 | fsl_diu_set_aoi(info); | ||
945 | |||
924 | return 0; | 946 | return 0; |
925 | } | 947 | } |
926 | 948 | ||
@@ -989,7 +1011,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", | 1011 | 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); | 1012 | mfbi->index, aoi_d.x_aoi_d, aoi_d.y_aoi_d); |
991 | fsl_diu_check_var(&info->var, info); | 1013 | fsl_diu_check_var(&info->var, info); |
992 | fsl_diu_set_par(info); | 1014 | fsl_diu_set_aoi(info); |
993 | break; | 1015 | break; |
994 | case MFB_GET_AOID: | 1016 | case MFB_GET_AOID: |
995 | aoi_d.x_aoi_d = mfbi->x_aoi_d; | 1017 | aoi_d.x_aoi_d = mfbi->x_aoi_d; |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index e7aa7ae8fca8..97204497d9f7 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -1031,7 +1031,9 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi) | |||
1031 | pxa_gpio_mode(GPIO74_LCD_FCLK_MD); | 1031 | pxa_gpio_mode(GPIO74_LCD_FCLK_MD); |
1032 | pxa_gpio_mode(GPIO75_LCD_LCLK_MD); | 1032 | pxa_gpio_mode(GPIO75_LCD_LCLK_MD); |
1033 | pxa_gpio_mode(GPIO76_LCD_PCLK_MD); | 1033 | pxa_gpio_mode(GPIO76_LCD_PCLK_MD); |
1034 | pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD); | 1034 | |
1035 | if ((lccr0 & LCCR0_PAS) == 0) | ||
1036 | pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD); | ||
1035 | } | 1037 | } |
1036 | 1038 | ||
1037 | static void pxafb_enable_controller(struct pxafb_info *fbi) | 1039 | static void pxafb_enable_controller(struct pxafb_info *fbi) |
@@ -1400,6 +1402,8 @@ static void pxafb_decode_mach_info(struct pxafb_info *fbi, | |||
1400 | if (lcd_conn == LCD_MONO_STN_8BPP) | 1402 | if (lcd_conn == LCD_MONO_STN_8BPP) |
1401 | fbi->lccr0 |= LCCR0_DPD; | 1403 | fbi->lccr0 |= LCCR0_DPD; |
1402 | 1404 | ||
1405 | fbi->lccr0 |= (lcd_conn & LCD_ALTERNATE_MAPPING) ? LCCR0_LDDALT : 0; | ||
1406 | |||
1403 | fbi->lccr3 = LCCR3_Acb((inf->lcd_conn >> 10) & 0xff); | 1407 | fbi->lccr3 = LCCR3_Acb((inf->lcd_conn >> 10) & 0xff); |
1404 | fbi->lccr3 |= (lcd_conn & LCD_BIAS_ACTIVE_LOW) ? LCCR3_OEP : 0; | 1408 | fbi->lccr3 |= (lcd_conn & LCD_BIAS_ACTIVE_LOW) ? LCCR3_OEP : 0; |
1405 | fbi->lccr3 |= (lcd_conn & LCD_PCLK_EDGE_FALL) ? LCCR3_PCP : 0; | 1409 | fbi->lccr3 |= (lcd_conn & LCD_PCLK_EDGE_FALL) ? LCCR3_PCP : 0; |
@@ -1673,53 +1677,63 @@ MODULE_PARM_DESC(options, "LCD parameters (see Documentation/fb/pxafb.txt)"); | |||
1673 | #define pxafb_setup_options() (0) | 1677 | #define pxafb_setup_options() (0) |
1674 | #endif | 1678 | #endif |
1675 | 1679 | ||
1676 | static int __devinit pxafb_probe(struct platform_device *dev) | ||
1677 | { | ||
1678 | struct pxafb_info *fbi; | ||
1679 | struct pxafb_mach_info *inf; | ||
1680 | struct resource *r; | ||
1681 | int irq, ret; | ||
1682 | |||
1683 | dev_dbg(&dev->dev, "pxafb_probe\n"); | ||
1684 | |||
1685 | inf = dev->dev.platform_data; | ||
1686 | ret = -ENOMEM; | ||
1687 | fbi = NULL; | ||
1688 | if (!inf) | ||
1689 | goto failed; | ||
1690 | |||
1691 | ret = pxafb_parse_options(&dev->dev, g_options); | ||
1692 | if (ret < 0) | ||
1693 | goto failed; | ||
1694 | |||
1695 | #ifdef DEBUG_VAR | 1680 | #ifdef DEBUG_VAR |
1696 | /* Check for various illegal bit-combinations. Currently only | 1681 | /* Check for various illegal bit-combinations. Currently only |
1697 | * a warning is given. */ | 1682 | * a warning is given. */ |
1683 | static void __devinit pxafb_check_options(struct device *dev, | ||
1684 | struct pxafb_mach_info *inf) | ||
1685 | { | ||
1686 | if (inf->lcd_conn) | ||
1687 | return; | ||
1698 | 1688 | ||
1699 | if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) | 1689 | if (inf->lccr0 & LCCR0_INVALID_CONFIG_MASK) |
1700 | dev_warn(&dev->dev, "machine LCCR0 setting contains " | 1690 | dev_warn(dev, "machine LCCR0 setting contains " |
1701 | "illegal bits: %08x\n", | 1691 | "illegal bits: %08x\n", |
1702 | inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); | 1692 | inf->lccr0 & LCCR0_INVALID_CONFIG_MASK); |
1703 | if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) | 1693 | if (inf->lccr3 & LCCR3_INVALID_CONFIG_MASK) |
1704 | dev_warn(&dev->dev, "machine LCCR3 setting contains " | 1694 | dev_warn(dev, "machine LCCR3 setting contains " |
1705 | "illegal bits: %08x\n", | 1695 | "illegal bits: %08x\n", |
1706 | inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); | 1696 | inf->lccr3 & LCCR3_INVALID_CONFIG_MASK); |
1707 | if (inf->lccr0 & LCCR0_DPD && | 1697 | if (inf->lccr0 & LCCR0_DPD && |
1708 | ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || | 1698 | ((inf->lccr0 & LCCR0_PAS) != LCCR0_Pas || |
1709 | (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || | 1699 | (inf->lccr0 & LCCR0_SDS) != LCCR0_Sngl || |
1710 | (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) | 1700 | (inf->lccr0 & LCCR0_CMS) != LCCR0_Mono)) |
1711 | dev_warn(&dev->dev, "Double Pixel Data (DPD) mode is " | 1701 | dev_warn(dev, "Double Pixel Data (DPD) mode is " |
1712 | "only valid in passive mono" | 1702 | "only valid in passive mono" |
1713 | " single panel mode\n"); | 1703 | " single panel mode\n"); |
1714 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && | 1704 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Act && |
1715 | (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) | 1705 | (inf->lccr0 & LCCR0_SDS) == LCCR0_Dual) |
1716 | dev_warn(&dev->dev, "Dual panel only valid in passive mode\n"); | 1706 | dev_warn(dev, "Dual panel only valid in passive mode\n"); |
1717 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && | 1707 | if ((inf->lccr0 & LCCR0_PAS) == LCCR0_Pas && |
1718 | (inf->modes->upper_margin || inf->modes->lower_margin)) | 1708 | (inf->modes->upper_margin || inf->modes->lower_margin)) |
1719 | dev_warn(&dev->dev, "Upper and lower margins must be 0 in " | 1709 | dev_warn(dev, "Upper and lower margins must be 0 in " |
1720 | "passive mode\n"); | 1710 | "passive mode\n"); |
1711 | } | ||
1712 | #else | ||
1713 | #define pxafb_check_options(...) do {} while (0) | ||
1721 | #endif | 1714 | #endif |
1722 | 1715 | ||
1716 | static int __devinit pxafb_probe(struct platform_device *dev) | ||
1717 | { | ||
1718 | struct pxafb_info *fbi; | ||
1719 | struct pxafb_mach_info *inf; | ||
1720 | struct resource *r; | ||
1721 | int irq, ret; | ||
1722 | |||
1723 | dev_dbg(&dev->dev, "pxafb_probe\n"); | ||
1724 | |||
1725 | inf = dev->dev.platform_data; | ||
1726 | ret = -ENOMEM; | ||
1727 | fbi = NULL; | ||
1728 | if (!inf) | ||
1729 | goto failed; | ||
1730 | |||
1731 | ret = pxafb_parse_options(&dev->dev, g_options); | ||
1732 | if (ret < 0) | ||
1733 | goto failed; | ||
1734 | |||
1735 | pxafb_check_options(&dev->dev, inf); | ||
1736 | |||
1723 | dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n", | 1737 | dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n", |
1724 | inf->modes->xres, | 1738 | inf->modes->xres, |
1725 | inf->modes->yres, | 1739 | inf->modes->yres, |