From 729e4a7768e5cc852c84237bcf18064456fe35db Mon Sep 17 00:00:00 2001 From: Markinus Date: Sun, 29 Aug 2010 11:01:03 +0200 Subject: [PATCH] htcleo: add different mdp modifications We have to check whether the hacks are still needed or not --- drivers/video/msm/mdp.c | 5 +++++ drivers/video/msm/mdp_lcdc.c | 31 +++++++++++++++++++++++++++---- drivers/video/msm/mdp_ppp.c | 9 +++++++++ drivers/video/msm/msm_fb.c | 6 ++++++ 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c index 4bec4eb9..2f8a7555 100644 --- a/drivers/video/msm/mdp.c +++ b/drivers/video/msm/mdp.c @@ -139,6 +139,11 @@ static irqreturn_t mdp_isr(int irq, void *data) status = mdp_readl(mdp, MDP_INTR_STATUS); mdp_writel(mdp, status, MDP_INTR_CLEAR); + +#if defined(CONFIG_MACH_HTCLEO) + status &= ~0x10000; // Cotulla +#endif + // pr_info("%s: status=%08x (irq_mask=%08x)\n", __func__, status, // mdp_irq_mask); status &= mdp_irq_mask; diff --git a/drivers/video/msm/mdp_lcdc.c b/drivers/video/msm/mdp_lcdc.c index d27df4da..d1d87ffb 100644 --- a/drivers/video/msm/mdp_lcdc.c +++ b/drivers/video/msm/mdp_lcdc.c @@ -230,10 +230,33 @@ static void lcdc_request_vsync(struct msm_panel_data *fb_panel, /* the vsync callback will start the dma */ vsync_cb->func(vsync_cb); - lcdc->got_vsync = 0; - mdp_out_if_req_irq(mdp_dev, MSM_LCDC_INTERFACE, MDP_LCDC_FRAME_START, - &lcdc->frame_start_cb); - lcdc_wait_vsync(fb_panel); +// CotullaFIX start +// FUCK, who make calls from console with disabled interrupts, FUCK THEM! + if (irqs_disabled()) + { + struct mdp_lcdc_info *lcdc = panel_to_lcdc(fb_panel); + uint32_t status; + uint32_t i; + // do it via polling + for (i = 0; i < 20; i++) + { + status = mdp_readl(lcdc->mdp, MDP_INTR_STATUS); + if (status & MDP_LCDC_FRAME_START) + break; + mdelay(1); + } + // clear intr at the end + mdp_writel(lcdc->mdp, MDP_LCDC_FRAME_START, MDP_INTR_CLEAR); +// vsync_cb->func(vsync_cb); + } + else + { + lcdc->got_vsync = 0; + mdp_out_if_req_irq(mdp_dev, MSM_LCDC_INTERFACE, MDP_LCDC_FRAME_START, + &lcdc->frame_start_cb); + lcdc_wait_vsync(fb_panel); + } +// CotullaFIX end } static void lcdc_clear_vsync(struct msm_panel_data *fb_panel) diff --git a/drivers/video/msm/mdp_ppp.c b/drivers/video/msm/mdp_ppp.c index e24e896e..334e2ebb 100644 --- a/drivers/video/msm/mdp_ppp.c +++ b/drivers/video/msm/mdp_ppp.c @@ -268,6 +268,7 @@ static void blit_blend(struct mdp_blit_req *req, struct ppp_regs *regs) req->alpha &= 0xff; /* ALPHA BLEND */ if (HAS_ALPHA(req->src.format)) { +#if !defined(CONFIG_MACH_HTCLEO) regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON; if (req->flags & MDP_BLEND_FG_PREMULT) { #ifdef CONFIG_MSM_MDP31 @@ -284,6 +285,10 @@ static void blit_blend(struct mdp_blit_req *req, struct ppp_regs *regs) } else { regs->op |= PPP_OP_BLEND_SRCPIXEL_ALPHA; } +#else + regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON; + regs->op |= PPP_OP_BLEND_SRCPIXEL_ALPHA; +#endif } else if (req->alpha < MDP_ALPHA_NOP) { /* just blend by alpha */ regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON | @@ -496,6 +501,10 @@ static int send_blit(const struct mdp_info *mdp, struct mdp_blit_req *req, mdp_writel_dbg(mdp, regs->bg_img_sz, MDP_PPP_BG_IMAGE_SIZE); mdp_writel_dbg(mdp, regs->bg_alpha_sel, MDP_PPP_BLEND_BG_ALPHA_SEL); + +#if defined(CONFIG_MACH_HTCLEO) + mdp_writel_dbg(mdp, 0, MDP_TFETCH_TEST_MODE); +#endif #endif } if( src_file != -1 && dst_file != -1 ) diff --git a/drivers/video/msm/msm_fb.c b/drivers/video/msm/msm_fb.c index 24b89aa1..4410bc77 100644 --- a/drivers/video/msm/msm_fb.c +++ b/drivers/video/msm/msm_fb.c @@ -629,22 +629,28 @@ int msmfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) static void msmfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect) { cfb_fillrect(p, rect); +#if !defined(CONFIG_MACH_HTCLEO) msmfb_update(p, rect->dx, rect->dy, rect->dx + rect->width, rect->dy + rect->height); +#endif } static void msmfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) { cfb_copyarea(p, area); +#if !defined(CONFIG_MACH_HTCLEO) msmfb_update(p, area->dx, area->dy, area->dx + area->width, area->dy + area->height); +#endif } static void msmfb_imageblit(struct fb_info *p, const struct fb_image *image) { cfb_imageblit(p, image); +#if !defined(CONFIG_MACH_HTCLEO) msmfb_update(p, image->dx, image->dy, image->dx + image->width, image->dy + image->height); +#endif }