From patchwork Wed Sep 16 19:27:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rajashekhara, Sudhakar" X-Patchwork-Id: 47905 Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8GA9DLJ014447 for ; Wed, 16 Sep 2009 10:09:14 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id n8GA7fiw024775; Wed, 16 Sep 2009 05:07:41 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id n8GA7ek3019564; Wed, 16 Sep 2009 05:07:40 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 1C50A80627; Wed, 16 Sep 2009 05:07:40 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id F293780626 for ; Wed, 16 Sep 2009 05:07:36 -0500 (CDT) Received: from tidmzi-ftp.india.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with SMTP id n8GA7Ygs004187; Wed, 16 Sep 2009 05:07:35 -0500 (CDT) Received: from symphonyindia.ti.com (symphony-ftp [192.168.247.11]) by tidmzi-ftp.india.ext.ti.com (Postfix) with SMTP id CB4413886B; Wed, 16 Sep 2009 15:34:34 +0530 (IST) Received: from localhost.localdomain ([192.168.247.76]) by symphonyindia.ti.com (8.13.1/8.12.10) with ESMTP id n8GA0ll2022317; Wed, 16 Sep 2009 15:30:47 +0530 From: Sudhakar Rajashekhara To: linux-fbdev-devel@lists.sourceforge.net Date: Wed, 16 Sep 2009 15:27:05 -0400 Message-Id: <1253129225-15827-1-git-send-email-sudhakar.raj@ti.com> X-Mailer: git-send-email 1.5.6 Cc: davinci-linux-open-source@linux.davincidsp.com, akpm@linux-foundation.org, krzysztof.h1@poczta.fm Subject: [PATCH] davinci: fb: Disable end-of-frame interrupt X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com Currently end-of-frame interrupt is being used while disabling LCD controller to wait or the frame being diaplyed to complete. But when the LCD is disabled by clearing the LCD Raster Control enable bit in the LCD Raster Control Register, the LCD allows the current frame to complete before it is disabled. Hence disable end-of-frame interrupt and remove waitqueue related code which was used to handle this interrupt. Because of above modifications, modify the lcd_disable_raster() and lcd_reset() functions to return void instead of int. Signed-off-by: Sudhakar Rajashekhara --- This patch applies to mmotm tree available at http://git.zen-sources.org/?p=mmotm.git;a=summary. drivers/video/da8xx-fb.c | 36 ++++++++---------------------------- 1 files changed, 8 insertions(+), 28 deletions(-) diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 04de744..42e1005 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c @@ -107,7 +107,6 @@ static inline void lcdc_write(unsigned int val, unsigned int addr) } struct da8xx_fb_par { - wait_queue_head_t da8xx_wq; resource_size_t p_palette_base; unsigned char *v_palette_base; struct clk *lcdc_clk; @@ -193,21 +192,13 @@ static struct da8xx_panel known_lcd_panels[] = { }; /* Disable the Raster Engine of the LCD Controller */ -static int lcd_disable_raster(struct da8xx_fb_par *par) +static void lcd_disable_raster(struct da8xx_fb_par *par) { - int ret = 0; u32 reg; reg = lcdc_read(LCD_RASTER_CTRL_REG); - if (reg & LCD_RASTER_ENABLE) { + if (reg & LCD_RASTER_ENABLE) lcdc_write(reg & ~LCD_RASTER_ENABLE, LCD_RASTER_CTRL_REG); - ret = wait_event_interruptible_timeout(par->da8xx_wq, - !lcdc_read(LCD_STAT_REG) & - LCD_END_OF_FRAME0, WSI_TIMEOUT); - if (ret == 0) - ret = -ETIMEDOUT; - } - return ret; } static void lcd_blit(int load_mode, struct da8xx_fb_par *par) @@ -255,7 +246,7 @@ static int lcd_cfg_dma(int burst_size) default: return -EINVAL; } - lcdc_write(reg | LCD_END_OF_FRAME_INT_ENA, LCD_DMA_CTRL_REG); + lcdc_write(reg, LCD_DMA_CTRL_REG); return 0; } @@ -450,19 +441,15 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } -static int lcd_reset(struct da8xx_fb_par *par) +static void lcd_reset(struct da8xx_fb_par *par) { - int ret = 0; - /* Disable the Raster if previously Enabled */ if (lcdc_read(LCD_RASTER_CTRL_REG) & LCD_RASTER_ENABLE) - ret = lcd_disable_raster(par); + lcd_disable_raster(par); /* DMA has to be disabled */ lcdc_write(0, LCD_DMA_CTRL_REG); lcdc_write(0, LCD_RASTER_CTRL_REG); - - return ret; } static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, @@ -471,9 +458,7 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, u32 bpp; int ret = 0; - ret = lcd_reset(par); - if (ret != 0) - return ret; + lcd_reset(par); /* Configure the LCD clock divisor. */ lcdc_write(LCD_CLK_DIVISOR(panel->pxl_clk) | @@ -529,7 +514,6 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg, static irqreturn_t lcdc_irq_handler(int irq, void *arg) { u32 stat = lcdc_read(LCD_STAT_REG); - struct da8xx_fb_par *par = arg; u32 reg; if ((stat & LCD_SYNC_LOST) && (stat & LCD_FIFO_UNDERFLOW)) { @@ -540,7 +524,6 @@ static irqreturn_t lcdc_irq_handler(int irq, void *arg) } else lcdc_write(stat, LCD_STAT_REG); - wake_up_interruptible(&par->da8xx_wq); return IRQ_HANDLED; } @@ -595,13 +578,12 @@ static int fb_check_var(struct fb_var_screeninfo *var, static int __devexit fb_remove(struct platform_device *dev) { struct fb_info *info = dev_get_drvdata(&dev->dev); - int ret = 0; if (info) { struct da8xx_fb_par *par = info->par; if (lcdc_read(LCD_RASTER_CTRL_REG) & LCD_RASTER_ENABLE) - ret = lcd_disable_raster(par); + lcd_disable_raster(par); lcdc_write(0, LCD_RASTER_CTRL_REG); /* disable DMA */ @@ -620,7 +602,7 @@ static int __devexit fb_remove(struct platform_device *dev) release_mem_region(lcdc_regs->start, resource_size(lcdc_regs)); } - return ret; + return 0; } static int fb_ioctl(struct fb_info *info, unsigned int cmd, @@ -774,8 +756,6 @@ static int __init fb_probe(struct platform_device *device) par->lcdc_clk = fb_clk; - init_waitqueue_head(&par->da8xx_wq); - par->irq = platform_get_irq(device, 0); if (par->irq < 0) { ret = -ENOENT;