From patchwork Thu Feb 11 10:24:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Edworthy X-Patchwork-Id: 78676 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1BAOhNT017804 for ; Thu, 11 Feb 2010 10:24:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431Ab0BKKYn (ORCPT ); Thu, 11 Feb 2010 05:24:43 -0500 Received: from mail.renesas.com ([202.234.163.13]:64492 "EHLO mail02.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751237Ab0BKKYm convert rfc822-to-8bit (ORCPT ); Thu, 11 Feb 2010 05:24:42 -0500 X-AuditID: ac140385-00000005000002de-c4-4b73dae8695b Received: from guardian03.idc.renesas.com ([172.20.8.202]) by mail02.idc.renesas.com (sendmail) with ESMTP id o1BAOeLS020858; Thu, 11 Feb 2010 19:24:40 +0900 (JST) Received: (from root@localhost) by guardian03.idc.renesas.com with id o1BAOf9H025039; Thu, 11 Feb 2010 19:24:41 +0900 (JST) Received: from mta04.idc.renesas.com (localhost [127.0.0.1]) by mta04.idc.renesas.com with ESMTP id o1BAOeTk018751; Thu, 11 Feb 2010 19:24:40 +0900 (JST) Received: from rte-ben-exch.RTE.ADWIN.RENESAS.COM ([172.28.0.16]) by rte-idc-bh1.RTE.ADWIN.RENESAS.COM with Microsoft SMTPSVC(6.0.3790.211); Thu, 11 Feb 2010 10:24:35 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH 02/02] sh: Fix panning Date: Thu, 11 Feb 2010 10:24:25 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 02/02] sh: Fix panning thread-index: AcqqmFH25A46qZOcSg+MKTO96oG0nwAabOyAAACMjtAAAAdKoA== From: "Phil Edworthy" To: Cc: , "Guennadi Liakhovetski" X-OriginalArrivalTime: 11 Feb 2010 10:24:35.0628 (UTC) FILETIME=[6894C6C0:01CAAB04] X-Brightmail-Tracker: AAAAAA== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 11 Feb 2010 10:24:44 +0000 (UTC) --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c @@ -128,7 +128,6 @@ struct sh_mobile_lcdc_chan { struct scatterlist *sglist; unsigned long frame_end; unsigned long pan_offset; - unsigned long new_pan_offset; wait_queue_head_t frame_end_wait; struct completion vsync_completion; }; @@ -373,21 +372,6 @@ static irqreturn_t sh_mobile_lcdc_irq(in } /* VSYNC End */ - if ((ldintr & LDINTR_VES) && - (ch->pan_offset != ch->new_pan_offset)) { - unsigned long ldrcntr = lcdc_read(priv, _LDRCNTR); - /* Set the source address for the next refresh */ - lcdc_write_chan_mirror(ch, LDSA1R, ch->dma_handle + - ch->new_pan_offset); - if (lcdc_chan_is_sublcd(ch)) - lcdc_write(ch->lcdc, _LDRCNTR, - ldrcntr ^ LDRCNTR_SRS); - else - lcdc_write(ch->lcdc, _LDRCNTR, - ldrcntr ^ LDRCNTR_MRS); - ch->pan_offset = ch->new_pan_offset; - } - if (ldintr & LDINTR_VES) complete(&ch->vsync_completion); } @@ -778,21 +762,28 @@ static int sh_mobile_fb_pan_display(stru struct fb_info *info) { struct sh_mobile_lcdc_chan *ch = info->par; + struct sh_mobile_lcdc_priv *priv = ch->lcdc; + unsigned long ldrcntr; + unsigned long new_pan_offset; + + new_pan_offset = (var->yoffset * info->fix.line_length) + + (var->xoffset * (info->var.bits_per_pixel / 8)); - if (info->var.xoffset == var->xoffset && - info->var.yoffset == var->yoffset) + if (new_pan_offset == ch->pan_offset) return 0; /* No change, do nothing */ - ch->new_pan_offset = (var->yoffset * info->fix.line_length) + - (var->xoffset * (info->var.bits_per_pixel / 8)); + ldrcntr = lcdc_read(priv, _LDRCNTR); - if (ch->new_pan_offset != ch->pan_offset) { - unsigned long ldintr; - ldintr = lcdc_read(ch->lcdc, _LDINTR); - ldintr |= LDINTR_VEE; - lcdc_write(ch->lcdc, _LDINTR, ldintr); - sh_mobile_lcdc_deferred_io_touch(info); - } + /* Set the source address for the next refresh */ + lcdc_write_chan_mirror(ch, LDSA1R, ch->dma_handle + new_pan_offset); + if (lcdc_chan_is_sublcd(ch)) + lcdc_write(ch->lcdc, _LDRCNTR, ldrcntr ^ LDRCNTR_SRS); + else + lcdc_write(ch->lcdc, _LDRCNTR, ldrcntr ^ LDRCNTR_MRS); + + ch->pan_offset = new_pan_offset; + + sh_mobile_lcdc_deferred_io_touch(info); return 0; } @@ -1015,7 +1006,6 @@ static int __init sh_mobile_lcdc_probe(s init_waitqueue_head(&priv->ch[i].frame_end_wait); init_completion(&priv->ch[i].vsync_completion); priv->ch[j].pan_offset = 0; - priv->ch[j].new_pan_offset = 0; switch (pdata->ch[i].chan) { case LCDC_CHAN_MAINLCD: