Message ID | 1416907825-23826-1-git-send-email-josh.wu@atmel.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Guennadi Liakhovetski |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from <linux-media-owner@vger.kernel.org>) id 1XtCUx-00052P-Vb; Tue, 25 Nov 2014 10:33:27 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-7) with esmtp id 1XtCUv-0005K3-2a; Tue, 25 Nov 2014 10:33:27 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751750AbaKYJdX (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Tue, 25 Nov 2014 04:33:23 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:34102 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbaKYJdW (ORCPT <rfc822;linux-media@vger.kernel.org>); Tue, 25 Nov 2014 04:33:22 -0500 Received: from apsmtp01.atmel.com (10.168.254.31) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.2.347.0; Tue, 25 Nov 2014 10:33:16 +0100 Received: from melon.corp.atmel.com (10.168.254.13) by apsmtp01.atmel.com (10.168.254.31) with Microsoft SMTP Server id 14.2.347.0; Tue, 25 Nov 2014 17:32:09 +0800 From: Josh Wu <josh.wu@atmel.com> To: <linux-media@vger.kernel.org> CC: <m.chehab@samsung.com>, <linux-arm-kernel@lists.infradead.org>, <g.liakhovetski@gmx.de>, <voice.shen@atmel.com>, <nicolas.ferre@atmel.com>, Josh Wu <josh.wu@atmel.com> Subject: [PATCH] media: atmel-isi: increase the burst length to improve the performance Date: Tue, 25 Nov 2014 17:30:25 +0800 Message-ID: <1416907825-23826-1-git-send-email-josh.wu@atmel.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.11.25.92119 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1600_1699 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __DATE_TZ_HK 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Josh Wu
Nov. 25, 2014, 9:30 a.m. UTC
The burst length could be BEATS_4/8/16. Before this patch, isi use default
value BEATS_4. To imporve the performance we could set it to BEATS_16.
Otherwise sometime it would cause the ISI overflow error.
Reported-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
drivers/media/platform/soc_camera/atmel-isi.c | 2 ++
include/media/atmel-isi.h | 4 ++++
2 files changed, 6 insertions(+)
Comments
Hi Josh, On Tue, 25 Nov 2014, Josh Wu wrote: > The burst length could be BEATS_4/8/16. Before this patch, isi use default > value BEATS_4. To imporve the performance we could set it to BEATS_16. > > Otherwise sometime it would cause the ISI overflow error. Without looking at datasheets - what does this bit do? Change the transfer length? What happens then if the data amount isn't a multiple of the transfer size? Thanks Guennadi > > Reported-by: Bo Shen <voice.shen@atmel.com> > Signed-off-by: Josh Wu <josh.wu@atmel.com> > --- > drivers/media/platform/soc_camera/atmel-isi.c | 2 ++ > include/media/atmel-isi.h | 4 ++++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c > index ee5650f..fda587b 100644 > --- a/drivers/media/platform/soc_camera/atmel-isi.c > +++ b/drivers/media/platform/soc_camera/atmel-isi.c > @@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) > if (isi->pdata.full_mode) > cfg1 |= ISI_CFG1_FULL_MODE; > > + cfg1 |= ISI_CFG1_THMASK_BEATS_16; > + > isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); > isi_writel(isi, ISI_CFG1, cfg1); > > diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h > index c2e5703..6008b09 100644 > --- a/include/media/atmel-isi.h > +++ b/include/media/atmel-isi.h > @@ -59,6 +59,10 @@ > #define ISI_CFG1_FRATE_DIV_MASK (7 << 8) > #define ISI_CFG1_DISCR (1 << 11) > #define ISI_CFG1_FULL_MODE (1 << 12) > +/* Definition for THMASK(ISI_V2) */ > +#define ISI_CFG1_THMASK_BEATS_4 (0 << 13) > +#define ISI_CFG1_THMASK_BEATS_8 (1 << 13) > +#define ISI_CFG1_THMASK_BEATS_16 (2 << 13) > > /* Bitfields in CFG2 */ > #define ISI_CFG2_GRAYSCALE (1 << 13) > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, Gunenadi On 11/26/2014 6:21 AM, Guennadi Liakhovetski wrote: > Hi Josh, > > On Tue, 25 Nov 2014, Josh Wu wrote: > >> The burst length could be BEATS_4/8/16. Before this patch, isi use default >> value BEATS_4. To imporve the performance we could set it to BEATS_16. >> >> Otherwise sometime it would cause the ISI overflow error. > Without looking at datasheets - what does this bit do? Change the transfer > length? Atmel ISI has two internal 32-bytes FIFOs, one for Preview, another for Codec. This field is the threshold to trigger the FIFO transfer to AHB by DMA. We can set the threshold to allow 4-bytes, 8-bytes or 16-bytes for a burst. BEATS_4, means only allow 4-bytes in a burst. BEATS_8, means only allow 4-bytes and 8-bytes in a burst. BEATS_16, means allow 4-bytes, 8-bytes and 16-bytes in a burst. So BEATS_16 will use the DMA more efficient if has lots of data to transfer. As we are allowed to use 16-bytes in a burst. That will trigger less burst than BEATS_4 to transfer same amount of data. We found this patch can fix ISI FIFO overflow error when system is in a situation that with a very high memory load. If we only allow 4-bytes in a burst, that need more burst to transfer data and less effective. > What happens then if the data amount isn't a multiple of the > transfer size? BEATS_16 means allowed 4-bytes, 8-bytes and 16-bytes in a burst. So it still can perform a 4-bytes transfer if the data is not multiple of 16. I think all the data transfer are aligned with 4 bytes. The DMA address should be aligned with 4 bytes as well. Best Regards, Josh Wu > > Thanks > Guennadi > >> Reported-by: Bo Shen <voice.shen@atmel.com> >> Signed-off-by: Josh Wu <josh.wu@atmel.com> >> --- >> drivers/media/platform/soc_camera/atmel-isi.c | 2 ++ >> include/media/atmel-isi.h | 4 ++++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c >> index ee5650f..fda587b 100644 >> --- a/drivers/media/platform/soc_camera/atmel-isi.c >> +++ b/drivers/media/platform/soc_camera/atmel-isi.c >> @@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) >> if (isi->pdata.full_mode) >> cfg1 |= ISI_CFG1_FULL_MODE; >> >> + cfg1 |= ISI_CFG1_THMASK_BEATS_16; >> + >> isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); >> isi_writel(isi, ISI_CFG1, cfg1); >> >> diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h >> index c2e5703..6008b09 100644 >> --- a/include/media/atmel-isi.h >> +++ b/include/media/atmel-isi.h >> @@ -59,6 +59,10 @@ >> #define ISI_CFG1_FRATE_DIV_MASK (7 << 8) >> #define ISI_CFG1_DISCR (1 << 11) >> #define ISI_CFG1_FULL_MODE (1 << 12) >> +/* Definition for THMASK(ISI_V2) */ >> +#define ISI_CFG1_THMASK_BEATS_4 (0 << 13) >> +#define ISI_CFG1_THMASK_BEATS_8 (1 << 13) >> +#define ISI_CFG1_THMASK_BEATS_16 (2 << 13) >> >> /* Bitfields in CFG2 */ >> #define ISI_CFG2_GRAYSCALE (1 << 13) >> -- >> 1.9.1 >> -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, Guennadi Ping? what about the status of this patch? Best Regards, Josh Wu On 11/25/2014 5:30 PM, Josh Wu wrote: > The burst length could be BEATS_4/8/16. Before this patch, isi use default > value BEATS_4. To imporve the performance we could set it to BEATS_16. > > Otherwise sometime it would cause the ISI overflow error. > > Reported-by: Bo Shen <voice.shen@atmel.com> > Signed-off-by: Josh Wu <josh.wu@atmel.com> > --- > drivers/media/platform/soc_camera/atmel-isi.c | 2 ++ > include/media/atmel-isi.h | 4 ++++ > 2 files changed, 6 insertions(+) > > diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c > index ee5650f..fda587b 100644 > --- a/drivers/media/platform/soc_camera/atmel-isi.c > +++ b/drivers/media/platform/soc_camera/atmel-isi.c > @@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) > if (isi->pdata.full_mode) > cfg1 |= ISI_CFG1_FULL_MODE; > > + cfg1 |= ISI_CFG1_THMASK_BEATS_16; > + > isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); > isi_writel(isi, ISI_CFG1, cfg1); > > diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h > index c2e5703..6008b09 100644 > --- a/include/media/atmel-isi.h > +++ b/include/media/atmel-isi.h > @@ -59,6 +59,10 @@ > #define ISI_CFG1_FRATE_DIV_MASK (7 << 8) > #define ISI_CFG1_DISCR (1 << 11) > #define ISI_CFG1_FULL_MODE (1 << 12) > +/* Definition for THMASK(ISI_V2) */ > +#define ISI_CFG1_THMASK_BEATS_4 (0 << 13) > +#define ISI_CFG1_THMASK_BEATS_8 (1 << 13) > +#define ISI_CFG1_THMASK_BEATS_16 (2 << 13) > > /* Bitfields in CFG2 */ > #define ISI_CFG2_GRAYSCALE (1 << 13) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Josh, On Mon, 2 Feb 2015, Josh Wu wrote: > Hi, Guennadi > > Ping? what about the status of this patch? Right, got lost, sorry... Added to the queue now. Thanks Guennadi > Best Regards, > Josh Wu > > On 11/25/2014 5:30 PM, Josh Wu wrote: > > The burst length could be BEATS_4/8/16. Before this patch, isi use default > > value BEATS_4. To imporve the performance we could set it to BEATS_16. > > > > Otherwise sometime it would cause the ISI overflow error. > > > > Reported-by: Bo Shen <voice.shen@atmel.com> > > Signed-off-by: Josh Wu <josh.wu@atmel.com> > > --- > > drivers/media/platform/soc_camera/atmel-isi.c | 2 ++ > > include/media/atmel-isi.h | 4 ++++ > > 2 files changed, 6 insertions(+) > > > > diff --git a/drivers/media/platform/soc_camera/atmel-isi.c > > b/drivers/media/platform/soc_camera/atmel-isi.c > > index ee5650f..fda587b 100644 > > --- a/drivers/media/platform/soc_camera/atmel-isi.c > > +++ b/drivers/media/platform/soc_camera/atmel-isi.c > > @@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct > > soc_camera_device *icd) > > if (isi->pdata.full_mode) > > cfg1 |= ISI_CFG1_FULL_MODE; > > + cfg1 |= ISI_CFG1_THMASK_BEATS_16; > > + > > isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); > > isi_writel(isi, ISI_CFG1, cfg1); > > diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h > > index c2e5703..6008b09 100644 > > --- a/include/media/atmel-isi.h > > +++ b/include/media/atmel-isi.h > > @@ -59,6 +59,10 @@ > > #define ISI_CFG1_FRATE_DIV_MASK (7 << 8) > > #define ISI_CFG1_DISCR (1 << 11) > > #define ISI_CFG1_FULL_MODE (1 << 12) > > +/* Definition for THMASK(ISI_V2) */ > > +#define ISI_CFG1_THMASK_BEATS_4 (0 << 13) > > +#define ISI_CFG1_THMASK_BEATS_8 (1 << 13) > > +#define ISI_CFG1_THMASK_BEATS_16 (2 << 13) > > /* Bitfields in CFG2 */ > > #define ISI_CFG2_GRAYSCALE (1 << 13) > -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi, Guennadi On 2/2/2015 6:22 PM, Guennadi Liakhovetski wrote: > Hi Josh, > > On Mon, 2 Feb 2015, Josh Wu wrote: > >> Hi, Guennadi >> >> Ping? what about the status of this patch? > Right, got lost, sorry... Added to the queue now. Thank you. Best Regards, Josh Wu > > Thanks > Guennadi > >> Best Regards, >> Josh Wu >> >> On 11/25/2014 5:30 PM, Josh Wu wrote: >>> The burst length could be BEATS_4/8/16. Before this patch, isi use default >>> value BEATS_4. To imporve the performance we could set it to BEATS_16. >>> >>> Otherwise sometime it would cause the ISI overflow error. >>> >>> Reported-by: Bo Shen <voice.shen@atmel.com> >>> Signed-off-by: Josh Wu <josh.wu@atmel.com> >>> --- >>> drivers/media/platform/soc_camera/atmel-isi.c | 2 ++ >>> include/media/atmel-isi.h | 4 ++++ >>> 2 files changed, 6 insertions(+) >>> >>> diff --git a/drivers/media/platform/soc_camera/atmel-isi.c >>> b/drivers/media/platform/soc_camera/atmel-isi.c >>> index ee5650f..fda587b 100644 >>> --- a/drivers/media/platform/soc_camera/atmel-isi.c >>> +++ b/drivers/media/platform/soc_camera/atmel-isi.c >>> @@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct >>> soc_camera_device *icd) >>> if (isi->pdata.full_mode) >>> cfg1 |= ISI_CFG1_FULL_MODE; >>> + cfg1 |= ISI_CFG1_THMASK_BEATS_16; >>> + >>> isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); >>> isi_writel(isi, ISI_CFG1, cfg1); >>> diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h >>> index c2e5703..6008b09 100644 >>> --- a/include/media/atmel-isi.h >>> +++ b/include/media/atmel-isi.h >>> @@ -59,6 +59,10 @@ >>> #define ISI_CFG1_FRATE_DIV_MASK (7 << 8) >>> #define ISI_CFG1_DISCR (1 << 11) >>> #define ISI_CFG1_FULL_MODE (1 << 12) >>> +/* Definition for THMASK(ISI_V2) */ >>> +#define ISI_CFG1_THMASK_BEATS_4 (0 << 13) >>> +#define ISI_CFG1_THMASK_BEATS_8 (1 << 13) >>> +#define ISI_CFG1_THMASK_BEATS_16 (2 << 13) >>> /* Bitfields in CFG2 */ >>> #define ISI_CFG2_GRAYSCALE (1 << 13) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/platform/soc_camera/atmel-isi.c b/drivers/media/platform/soc_camera/atmel-isi.c index ee5650f..fda587b 100644 --- a/drivers/media/platform/soc_camera/atmel-isi.c +++ b/drivers/media/platform/soc_camera/atmel-isi.c @@ -839,6 +839,8 @@ static int isi_camera_set_bus_param(struct soc_camera_device *icd) if (isi->pdata.full_mode) cfg1 |= ISI_CFG1_FULL_MODE; + cfg1 |= ISI_CFG1_THMASK_BEATS_16; + isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS); isi_writel(isi, ISI_CFG1, cfg1); diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h index c2e5703..6008b09 100644 --- a/include/media/atmel-isi.h +++ b/include/media/atmel-isi.h @@ -59,6 +59,10 @@ #define ISI_CFG1_FRATE_DIV_MASK (7 << 8) #define ISI_CFG1_DISCR (1 << 11) #define ISI_CFG1_FULL_MODE (1 << 12) +/* Definition for THMASK(ISI_V2) */ +#define ISI_CFG1_THMASK_BEATS_4 (0 << 13) +#define ISI_CFG1_THMASK_BEATS_8 (1 << 13) +#define ISI_CFG1_THMASK_BEATS_16 (2 << 13) /* Bitfields in CFG2 */ #define ISI_CFG2_GRAYSCALE (1 << 13)