diff --git a/arch/arm/configs/scritch_es209ra_defconfig b/arch/arm/configs/scritch_es209ra_defconfig index aef3be1c..43a5ea7b 100644 --- a/arch/arm/configs/scritch_es209ra_defconfig +++ b/arch/arm/configs/scritch_es209ra_defconfig @@ -33,7 +33,7 @@ CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_LOCALVERSION="$(KERNEL_LOCAL_VERSION)-Scritch" +CONFIG_LOCALVERSION="$(KERNEL_LOCAL_VERSION)-CMX10" # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SWAP=y CONFIG_SYSVIPC=y @@ -370,8 +370,8 @@ CONFIG_CPU_FREQ_STAT_DETAILS=y # CONFIG_CPU_FREQ_DEFAULT_GOV_MINMAX is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_SCARY is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS2 is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=y +CONFIG_CPU_FREQ_DEFAULT_GOV_SMARTASS2=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVEX is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_SAVAGEDZEN is not set # CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set @@ -384,7 +384,7 @@ CONFIG_CPU_FREQ_GOV_INTERACTIVE=y # CONFIG_CPU_FREQ_GOV_MINMAX is not set CONFIG_CPU_FREQ_GOV_SMARTASS=y CONFIG_CPU_FREQ_GOV_SCARY=y -# CONFIG_CPU_FREQ_GOV_SMARTASS2 is not set +CONFIG_CPU_FREQ_GOV_SMARTASS2=y # CONFIG_CPU_FREQ_GOV_SAVAGEDZEN is not set CONFIG_CPU_FREQ_MIN_TICKS=10 CONFIG_CPU_FREQ_SAMPLING_LATENCY_MULTIPLIER=1000 diff --git a/arch/arm/mach-msm/board-es209ra.c b/arch/arm/mach-msm/board-es209ra.c index fe7e83ed..fa5286c8 100644 --- a/arch/arm/mach-msm/board-es209ra.c +++ b/arch/arm/mach-msm/board-es209ra.c @@ -146,8 +146,10 @@ #ifdef CONFIG_FB_MSM_TRIPLE_BUFFER #define MSM_FB_SIZE 0x00278780 +#define MSM_FB_NUM 3 #else #define MSM_FB_SIZE 0x001B0500 +#define MSM_FB_NUM 2 #endif //#define MSM_FB_SIZE 0x00300000 // 0x00500000 @@ -780,7 +782,7 @@ static void __init msm_mddi_tmd_fwvga_display_device_init(void) panel_data->panel_info.clk_rate = 200000000; panel_data->panel_info.clk_min = 192000000; panel_data->panel_info.clk_max = 200000000; - panel_data->panel_info.fb_num = 2; + panel_data->panel_info.fb_num = MSM_FB_NUM; panel_data->panel_info.mddi.vdopkt = MDDI_DEFAULT_PRIM_PIX_ATTR; diff --git a/drivers/video/msm/mdp4_overlay_lcdc.c b/drivers/video/msm/mdp4_overlay_lcdc.c index ffa53121..4b096efc 100644 --- a/drivers/video/msm/mdp4_overlay_lcdc.c +++ b/drivers/video/msm/mdp4_overlay_lcdc.c @@ -144,8 +144,7 @@ int mdp_lcdc_on(struct platform_device *pdev) bpp = fbi->var.bits_per_pixel / 8; buf = (uint8 *) fbi->fix.smem_start; - buf += fbi->var.xoffset * bpp + - fbi->var.yoffset * fbi->fix.line_length; + buf += calc_fb_offset(mfd, fbi, bpp); if (lcdc_pipe == NULL) { ptype = mdp4_overlay_format2type(mfd->fb_imgType); @@ -316,8 +315,7 @@ void mdp4_lcdc_overlay(struct msm_fb_data_type *mfd) /* no need to power on cmd block since it's lcdc mode */ bpp = fbi->var.bits_per_pixel / 8; buf = (uint8 *) fbi->fix.smem_start; - buf += fbi->var.xoffset * bpp + - fbi->var.yoffset * fbi->fix.line_length; + buf += calc_fb_offset(mfd, fbi, bpp); mutex_lock(&mfd->dma->ov_mutex); diff --git a/drivers/video/msm/mdp_dma.c b/drivers/video/msm/mdp_dma.c index ac622d8f..0270d7e1 100644 --- a/drivers/video/msm/mdp_dma.c +++ b/drivers/video/msm/mdp_dma.c @@ -561,14 +561,14 @@ void mdp_set_dma_pan_info(struct fb_info *info, struct mdp_dirty_region *dirty, boolean sync) { struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par; + struct fb_info *fbi = mfd->fbi; MDPIBUF *iBuf; int bpp = info->var.bits_per_pixel / 8; down(&mfd->sem); iBuf = &mfd->ibuf; iBuf->buf = (uint8 *) info->fix.smem_start; - iBuf->buf += info->var.xoffset * bpp + - info->var.yoffset * info->fix.line_length; + iBuf->buf += calc_fb_offset(mfd, fbi, bpp); iBuf->ibuf_width = info->var.xres_virtual; iBuf->bpp = bpp; diff --git a/drivers/video/msm/mdp_dma_lcdc.c b/drivers/video/msm/mdp_dma_lcdc.c index 2ff8f13b..5d6896cd 100644 --- a/drivers/video/msm/mdp_dma_lcdc.c +++ b/drivers/video/msm/mdp_dma_lcdc.c @@ -154,7 +154,7 @@ int mdp_lcdc_on(struct platform_device *pdev) bpp = fbi->var.bits_per_pixel / 8; buf = (uint8 *) fbi->fix.smem_start; - buf += fbi->var.xoffset * bpp + fbi->var.yoffset * fbi->fix.line_length; + buf += calc_fb_offset(mfd, fbi, bpp); dma2_cfg_reg = DMA_PACK_ALIGN_LSB | DMA_DITHER_EN | DMA_OUT_SEL_LCDC; @@ -374,8 +374,7 @@ void mdp_lcdc_update(struct msm_fb_data_type *mfd) /* no need to power on cmd block since it's lcdc mode */ bpp = fbi->var.bits_per_pixel / 8; buf = (uint8 *) fbi->fix.smem_start; - buf += fbi->var.xoffset * bpp + - fbi->var.yoffset * fbi->fix.line_length; + buf += calc_fb_offset(mfd, fbi, bpp); dma_base = DMA_P_BASE; diff --git a/drivers/video/msm/mdp_dma_tv.c b/drivers/video/msm/mdp_dma_tv.c index 938fea98..d1b680a8 100644 --- a/drivers/video/msm/mdp_dma_tv.c +++ b/drivers/video/msm/mdp_dma_tv.c @@ -102,8 +102,7 @@ int mdp_dma3_on(struct platform_device *pdev) bpp = fbi->var.bits_per_pixel / 8; buf = (uint8 *) fbi->fix.smem_start; - buf += fbi->var.xoffset * bpp + - fbi->var.yoffset * fbi->fix.line_length; + buf += calc_fb_offset(mfd, fbi, bpp); /* starting address[31..8] of Video frame buffer is CS0 */ MDP_OUTP(MDP_BASE + 0xC0008, (uint32) buf >> 3); @@ -163,8 +162,8 @@ void mdp_dma3_update(struct msm_fb_data_type *mfd) /* no need to power on cmd block since dma3 is running */ bpp = fbi->var.bits_per_pixel / 8; buf = (uint8 *) fbi->fix.smem_start; - buf += fbi->var.xoffset * bpp + - fbi->var.yoffset * fbi->fix.line_length; + buf += calc_fb_offset(mfd, fbi, bpp); + MDP_OUTP(MDP_BASE + 0xC0008, (uint32) buf >> 3); spin_lock_irqsave(&mdp_spin_lock, flag); diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c index fee56c79..974924a6 100644 --- a/drivers/video/msm/msm_fb.c +++ b/drivers/video/msm/msm_fb.c @@ -57,6 +57,7 @@ extern int load_565rle_image(char *filename); static unsigned char *fbram; static unsigned char *fbram_phys; static int fbram_size; +static bool align_buffer = false; static struct platform_device *pdev_list[MSM_FB_MAX_DEV_LIST]; static int pdev_list_cnt; @@ -628,6 +629,36 @@ static int msm_fb_blank_sub(int blank_mode, struct fb_info *info, return ret; } +int calc_fb_offset(struct msm_fb_data_type *mfd, struct fb_info *fbi, int bpp) +{ + struct msm_panel_info *panel_info = &mfd->panel_info; + int remainder, yres, offset; + + if (!align_buffer) + { + return fbi->var.xoffset * bpp + fbi->var.yoffset * fbi->fix.line_length; + } + + yres = panel_info->yres; + remainder = (fbi->fix.line_length*yres) & (PAGE_SIZE - 1); + + if (!remainder) + remainder = PAGE_SIZE; + + if (fbi->var.yoffset < yres) { + offset = (fbi->var.xoffset * bpp); + /* iBuf->buf += fbi->var.xoffset * bpp + 0 * + yres * fbi->fix.line_length; */ + } else if (fbi->var.yoffset >= yres && fbi->var.yoffset < 2 * yres) { + offset = (fbi->var.xoffset * bpp + yres * + fbi->fix.line_length + PAGE_SIZE - remainder); + } else { + offset = (fbi->var.xoffset * bpp + 2 * yres * + fbi->fix.line_length + 2 * (PAGE_SIZE - remainder)); + } + return offset; +} + static void msm_fb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) { @@ -2752,4 +2783,7 @@ int __init msm_fb_init(void) return 0; } +module_param(align_buffer, bool, 0644); + + module_init(msm_fb_init); diff --git a/drivers/video/msm/msm_fb.h b/drivers/video/msm/msm_fb.h index 6c54da03..8db49418 100644 --- a/drivers/video/msm/msm_fb.h +++ b/drivers/video/msm/msm_fb.h @@ -168,6 +168,7 @@ void msm_fb_set_backlight(struct msm_fb_data_type *mfd, __u32 bkl_lvl, void msm_fb_add_device(struct platform_device *pdev); int msm_fb_detect_client(const char *name); +int calc_fb_offset(struct msm_fb_data_type *mfd, struct fb_info *fbi, int bpp); #ifdef CONFIG_FB_BACKLIGHT void msm_fb_config_backlight(struct msm_fb_data_type *mfd); diff --git a/drivers/video/msm/msm_fb_panel.h b/drivers/video/msm/msm_fb_panel.h index 7448dba0..5e13ef2b 100644 --- a/drivers/video/msm/msm_fb_panel.h +++ b/drivers/video/msm/msm_fb_panel.h @@ -110,6 +110,10 @@ struct msm_panel_info { __u32 clk_max; __u32 frame_count; + /* physical size in mm */ + __u32 width; + __u32 height; + union { struct mddi_panel_info mddi; };