Skip to content

Commit

Permalink
Merge pull request #2 from Tof37/master
Browse files Browse the repository at this point in the history
Merge Padding fix properly in master branch.
  • Loading branch information
skritchz committed Jan 11, 2013
2 parents da9ea0b + 4de0b43 commit 8c866c0
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 18 deletions.
8 changes: 4 additions & 4 deletions arch/arm/configs/scritch_es209ra_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-msm/board-es209ra.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;

Expand Down
6 changes: 2 additions & 4 deletions drivers/video/msm/mdp4_overlay_lcdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions drivers/video/msm/mdp_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions drivers/video/msm/mdp_dma_lcdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
7 changes: 3 additions & 4 deletions drivers/video/msm/mdp_dma_tv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
34 changes: 34 additions & 0 deletions drivers/video/msm/msm_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -2752,4 +2783,7 @@ int __init msm_fb_init(void)
return 0;
}

module_param(align_buffer, bool, 0644);


module_init(msm_fb_init);
1 change: 1 addition & 0 deletions drivers/video/msm/msm_fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions drivers/video/msm/msm_fb_panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 8c866c0

Please sign in to comment.