linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] omap_vout: Fix "DMA transaction error" issue when rotation is enabled
@ 2012-03-09 12:11 Vaibhav Hiremath
  2012-03-14 15:30 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Vaibhav Hiremath @ 2012-03-09 12:11 UTC (permalink / raw)
  To: linux-media
  Cc: mchehab, archit, laurent.pinchart, linux-omap, Vaibhav Hiremath

When rotation is enabled and driver is configured in USERPTR
buffer exchange mechanism, in specific use-case driver reports
an error,
   "DMA transaction error with device 0".

In driver _buffer_prepare funtion, we were using
"vout->buf_phy_addr[vb->i]" for buffer physical address to
configure SDMA channel, but this variable does get updated
only during init.
And the issue will occur when driver allocates less number
of buffers during init and application requests more buffers
through REQBUF ioctl; this variable will lead to invalid
configuration of SDMA channel leading to DMA transaction error.

Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
---
Archit/Laurent,
Can you help me to validate this patch on your platform/usecase?

 drivers/media/video/omap/omap_vout_vrfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap/omap_vout_vrfb.c b/drivers/media/video/omap/omap_vout_vrfb.c
index 4be26ab..240d36d 100644
--- a/drivers/media/video/omap/omap_vout_vrfb.c
+++ b/drivers/media/video/omap/omap_vout_vrfb.c
@@ -225,7 +225,7 @@ int omap_vout_prepare_vrfb(struct omap_vout_device *vout,
 	if (!is_rotation_enabled(vout))
 		return 0;

-	dmabuf = vout->buf_phy_addr[vb->i];
+	dmabuf = (dma_addr_t) vout->queued_buf_addr[vb->i];
 	/* If rotation is enabled, copy input buffer into VRFB
 	 * memory space using DMA. We are copying input buffer
 	 * into VRFB memory space of desired angle and DSS will
--
1.7.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] omap_vout: Fix "DMA transaction error" issue when rotation is enabled
  2012-03-09 12:11 [PATCH] omap_vout: Fix "DMA transaction error" issue when rotation is enabled Vaibhav Hiremath
@ 2012-03-14 15:30 ` Laurent Pinchart
  2012-03-16  9:26   ` Hiremath, Vaibhav
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2012-03-14 15:30 UTC (permalink / raw)
  To: Vaibhav Hiremath; +Cc: linux-media, mchehab, archit, linux-omap

Hi Vaibhav,

On Friday 09 March 2012 17:41:57 Vaibhav Hiremath wrote:
> When rotation is enabled and driver is configured in USERPTR
> buffer exchange mechanism, in specific use-case driver reports
> an error,
>    "DMA transaction error with device 0".
> 
> In driver _buffer_prepare funtion, we were using
> "vout->buf_phy_addr[vb->i]" for buffer physical address to
> configure SDMA channel, but this variable does get updated
> only during init.
> And the issue will occur when driver allocates less number
> of buffers during init and application requests more buffers
> through REQBUF ioctl; this variable will lead to invalid
> configuration of SDMA channel leading to DMA transaction error.
> 
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> ---
> Archit/Laurent,
> Can you help me to validate this patch on your platform/usecase?

I've tested the patch by rotating the omap_vout overlay by 90 degrees and 
starting a video stream with 4 buffers. There's no crash, but the kernel 
prints

[77.877807] omapdss DISPC error: FIFO UNDERFLOW on gfx, disabling the overlay
[77.928344] omapdss DISPC error: FIFO UNDERFLOW on vid1, disabling the overlay

The same problem occurs with 3 buffers, which is what the omap_vout driver 
allocates by default.

Without your patch applied I get the same behaviour. Is my test procedure 
wrong ?

>  drivers/media/video/omap/omap_vout_vrfb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/omap/omap_vout_vrfb.c
> b/drivers/media/video/omap/omap_vout_vrfb.c index 4be26ab..240d36d 100644
> --- a/drivers/media/video/omap/omap_vout_vrfb.c
> +++ b/drivers/media/video/omap/omap_vout_vrfb.c
> @@ -225,7 +225,7 @@ int omap_vout_prepare_vrfb(struct omap_vout_device
> *vout, if (!is_rotation_enabled(vout))
>  		return 0;
> 
> -	dmabuf = vout->buf_phy_addr[vb->i];
> +	dmabuf = (dma_addr_t) vout->queued_buf_addr[vb->i];
>  	/* If rotation is enabled, copy input buffer into VRFB
>  	 * memory space using DMA. We are copying input buffer
>  	 * into VRFB memory space of desired angle and DSS will

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] omap_vout: Fix "DMA transaction error" issue when rotation is enabled
  2012-03-14 15:30 ` Laurent Pinchart
@ 2012-03-16  9:26   ` Hiremath, Vaibhav
  0 siblings, 0 replies; 3+ messages in thread
From: Hiremath, Vaibhav @ 2012-03-16  9:26 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media@vger.kernel.org, mchehab@infradead.org,
	Taneja, Archit, linux-omap@vger.kernel.org

On Wed, Mar 14, 2012 at 21:00:25, Laurent Pinchart wrote:
> Hi Vaibhav,
> 
> On Friday 09 March 2012 17:41:57 Vaibhav Hiremath wrote:
> > When rotation is enabled and driver is configured in USERPTR
> > buffer exchange mechanism, in specific use-case driver reports
> > an error,
> >    "DMA transaction error with device 0".
> > 
> > In driver _buffer_prepare funtion, we were using
> > "vout->buf_phy_addr[vb->i]" for buffer physical address to
> > configure SDMA channel, but this variable does get updated
> > only during init.
> > And the issue will occur when driver allocates less number
> > of buffers during init and application requests more buffers
> > through REQBUF ioctl; this variable will lead to invalid
> > configuration of SDMA channel leading to DMA transaction error.
> > 
> > Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> > ---
> > Archit/Laurent,
> > Can you help me to validate this patch on your platform/usecase?
> 
> I've tested the patch by rotating the omap_vout overlay by 90 degrees and 
> starting a video stream with 4 buffers. There's no crash, but the kernel 
> prints
> 
> [77.877807] omapdss DISPC error: FIFO UNDERFLOW on gfx, disabling the overlay
> [77.928344] omapdss DISPC error: FIFO UNDERFLOW on vid1, disabling the overlay
> 
> The same problem occurs with 3 buffers, which is what the omap_vout driver 
> allocates by default.
> 
> Without your patch applied I get the same behaviour. Is my test procedure 
> wrong ?
> 

Laurent,

Thanks for testing, the procedure looks ok to me. I need to look into this issue (need to debug).

Thanks,
Vaibhav


> >  drivers/media/video/omap/omap_vout_vrfb.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/drivers/media/video/omap/omap_vout_vrfb.c
> > b/drivers/media/video/omap/omap_vout_vrfb.c index 4be26ab..240d36d 100644
> > --- a/drivers/media/video/omap/omap_vout_vrfb.c
> > +++ b/drivers/media/video/omap/omap_vout_vrfb.c
> > @@ -225,7 +225,7 @@ int omap_vout_prepare_vrfb(struct omap_vout_device
> > *vout, if (!is_rotation_enabled(vout))
> >  		return 0;
> > 
> > -	dmabuf = vout->buf_phy_addr[vb->i];
> > +	dmabuf = (dma_addr_t) vout->queued_buf_addr[vb->i];
> >  	/* If rotation is enabled, copy input buffer into VRFB
> >  	 * memory space using DMA. We are copying input buffer
> >  	 * into VRFB memory space of desired angle and DSS will
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-03-16  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09 12:11 [PATCH] omap_vout: Fix "DMA transaction error" issue when rotation is enabled Vaibhav Hiremath
2012-03-14 15:30 ` Laurent Pinchart
2012-03-16  9:26   ` Hiremath, Vaibhav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).