RE: [PATCH] V4L2: clear buf when vrfb buf not allocated

2009-11-20 Thread Y, Kishore
> -Original Message-
> From: Hiremath, Vaibhav
> Sent: Wednesday, November 18, 2009 8:44 PM
> To: Y, Kishore; linux-media@vger.kernel.org
> Cc: linux-o...@vger.kernel.org
> Subject: RE: [PATCH] V4L2: clear buf when vrfb buf not allocated
> 
> 
> > -Original Message-
> > From: linux-media-ow...@vger.kernel.org [mailto:linux-media-
> > ow...@vger.kernel.org] On Behalf Of Y, Kishore
> > Sent: Wednesday, November 18, 2009 7:20 PM
> > To: linux-media@vger.kernel.org
> > Cc: linux-o...@vger.kernel.org
> > Subject: [PATCH] V4L2: clear buf when vrfb buf not allocated
> >
> > From 15246e4dfa6853d9aef48a4b8633f93efe40ed81 Mon Sep 17 00:00:00
> > 2001
> > From: Kishore Y 
> > Date: Thu, 12 Nov 2009 20:47:58 +0530
> > Subject: [PATCH] V4L2: clear buf when vrfb buf not allocated
> >
> > buffer memory is set to 0 only for the first time
> > before the vrfb buffer is allocated
> >
> > Signed-off-by:  Kishore Y 
> > ---
> > This patch is dependent on the patch
> > [PATCH 4/4] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top
> > of DSS2
> >
> >  drivers/media/video/omap/omap_vout.c |   10 +++---
> >  1 files changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/media/video/omap/omap_vout.c
> > b/drivers/media/video/omap/omap_vout.c
> > index 7092ef2..0a9fdd7 100644
> > --- a/drivers/media/video/omap/omap_vout.c
> > +++ b/drivers/media/video/omap/omap_vout.c
> > @@ -223,9 +223,11 @@ static int
> > omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout,
> > unsigned int *count, int startindex)
> >  {
> > int i, j;
> > +   int buffer_set;
> >
> > for (i = 0; i < *count; i++) {
> > -   if (!vout->smsshado_virt_addr[i]) {
> > +   buffer_set = vout->smsshado_virt_addr[i];
> > +   if (!buffer_set) {
> > vout->smsshado_virt_addr[i] =
> > omap_vout_alloc_buffer(vout->smsshado_size,
> > &vout->smsshado_phy_addr[i]);
> > @@ -247,8 +249,10 @@ static int
> > omap_vout_allocate_vrfb_buffers(struct omap_vout_device *vout,
> > *count = 0;
> > return -ENOMEM;
> > }
> > -   memset((void *) vout->smsshado_virt_addr[i], 0,
> > -   vout->smsshado_size);
> > +   if (!buffer_set) {
> > +   memset((void *) vout->smsshado_virt_addr[i], 0,
> > +   vout->smsshado_size);
> > +   }
> > }
> [Hiremath, Vaibhav] Why do we need this? Anyway if I understand correctly
> this function is getting called only once during REQBUF or probe, right?
> 
> If you are selecting static_vrfb_allocation through module_params, then
> anyway REQBUF won't call this function again, since the buffers are
> already allocated.
> 
> Thanks,
> Vaibhav
> 

[Kishore] omap_vout_vrfb_buffer_setup has been called from streamon to support 
stop-restart use case without calling REQBUF again. Due to the clear buffer we 
are unable to fill buffer in time before display and see green frame for the 
first time when streaming video.

> > return 0;
> >  }
> > --
> > 1.5.4.3
> >
> >
> > Regards,
> > Kishore Y
> > Ph:- +918039813085
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-
> > media" in
> > the body of a message to majord...@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] V4L2: clear buf when vrfb buf not allocated

2009-11-18 Thread Y, Kishore
>From 15246e4dfa6853d9aef48a4b8633f93efe40ed81 Mon Sep 17 00:00:00 2001
From: Kishore Y 
Date: Thu, 12 Nov 2009 20:47:58 +0530
Subject: [PATCH] V4L2: clear buf when vrfb buf not allocated

buffer memory is set to 0 only for the first time
before the vrfb buffer is allocated

Signed-off-by:  Kishore Y 
---
This patch is dependent on the patch
[PATCH 4/4] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

 drivers/media/video/omap/omap_vout.c |   10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 7092ef2..0a9fdd7 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -223,9 +223,11 @@ static int omap_vout_allocate_vrfb_buffers(struct 
omap_vout_device *vout,
unsigned int *count, int startindex)
 {
int i, j;
+   int buffer_set;
 
for (i = 0; i < *count; i++) {
-   if (!vout->smsshado_virt_addr[i]) {
+   buffer_set = vout->smsshado_virt_addr[i];
+   if (!buffer_set) {
vout->smsshado_virt_addr[i] =
omap_vout_alloc_buffer(vout->smsshado_size,
&vout->smsshado_phy_addr[i]);
@@ -247,8 +249,10 @@ static int omap_vout_allocate_vrfb_buffers(struct 
omap_vout_device *vout,
*count = 0;
return -ENOMEM;
}
-   memset((void *) vout->smsshado_virt_addr[i], 0,
-   vout->smsshado_size);
+   if (!buffer_set) {
+   memset((void *) vout->smsshado_virt_addr[i], 0,
+   vout->smsshado_size);
+   }
}
return 0;
 }
-- 
1.5.4.3


Regards,
Kishore Y
Ph:- +918039813085

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC] [PATCH] V4L2: Allow rotation between stream off-on

2009-11-17 Thread Y, Kishore
This patch is dependent on the patch
[PATCH 4/4] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

>From cda5b97d02784318d89a029a2fde97903610d2b2 Mon Sep 17 00:00:00 2001
From: Kishore Y 
Date: Wed, 11 Nov 2009 19:22:46 +0530
Subject: [PATCH] V4L2: Allow rotation between stream off-on

This patch configures vrfb buffers when streamon ioctl is called
in order to allow changing video rotation among streamoff/streamon
sequences without calling reqbuf ioctl

Signed-off-by: Kishore Y 
---
 drivers/media/video/omap/omap_vout.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index c39c8a7..6118665 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -1800,6 +1800,7 @@ static int vidioc_streamon(struct file *file, void *fh,
struct omap_vout_device *vout = fh;
struct videobuf_queue *q = &vout->vbq;
u32 addr = 0;
+   unsigned int count;
int r = 0;
int t;
struct omapvideo_info *ovid = &vout->vid_info;
@@ -1837,6 +1838,9 @@ static int vidioc_streamon(struct file *file, void *fh,
 
vout->first_int = 1;
 
+   count = vout->buffer_allocated;
+   omap_vout_vrfb_buffer_setup(vout, &count, 0);
+
if (omap_vout_calculate_offset(vout)) {
mutex_unlock(&vout->lock);
return -EINVAL;
-- 
1.5.4.3


Regards,
Kishore Y
Ph:- +918039813085

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC] [PATCH] omap_vout: Change allocated buffer to only needed size

2009-11-17 Thread Y, Kishore
This patch is dependent on the patch
[PATCH 4/4] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

>From eb4302232f15e0af075604a9cf24fcaa9688e8a5 Mon Sep 17 00:00:00 2001
From: Kishore Y 
Date: Tue, 10 Nov 2009 21:44:10 +0530
Subject: [PATCH] omap_vout: Change allocated buffer to only needed size
 This patch change allocation size of IO buffers to allocate
 only needed size depending on pix.width, pix.height and bytes
 per pixel. The buffer size is rounded to allocate always a PAGE_SIZE multiple

Signed-off-by:  Kishore Y 
---
 drivers/media/video/omap/omap_vout.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index a13f65e..8064c2d 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -855,6 +855,8 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, 
unsigned int *count,
 
/* Now allocated the V4L2 buffers */
*size = vout->buffer_size;
+   *size = vout->pix.width * vout->pix.height * vout->bpp;
+   *size = PAGE_ALIGN(*size);
startindex = (vout->vid == OMAP_VIDEO1) ?
video1_numbuffers : video2_numbuffers;
for (i = startindex; i < *count; i++) {
-- 
1.5.4.3


Regards,
Kishore Y
Ph:- +918039813085

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC] [PATCH] omap_vout: default colorspace for RGB565 set to SRGB

2009-11-17 Thread Y, Kishore
This patch is dependent on the patch
[PATCH 4/4] OMAP2/3 V4L2: Add support for OMAP2/3 V4L2 driver on top of DSS2

>From 41b85f02f441771ace6c42ee08475ab7be04eb90 Mon Sep 17 00:00:00 2001
From: Kishore Y 
Date: Wed, 11 Nov 2009 19:47:14 +0530
Subject: [PATCH] omap_vout: default colorspace for RGB565 set to SRGB

Default video format is set to RGB565 and the colorspace is set to
JPEG. Best colorspace for RGB565 is SRGB and hence changed to it.

Signed-off-by: Kishore Y 
---
 drivers/media/video/omap/omap_vout.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap/omap_vout.c 
b/drivers/media/video/omap/omap_vout.c
index 6118665..7092ef2 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -2078,7 +2078,7 @@ static int __init omap_vout_setup_video_data(struct 
omap_vout_device *vout)
pix->bytesperline = pix->width * 2;
pix->sizeimage = pix->bytesperline * pix->height;
pix->priv = 0;
-   pix->colorspace = V4L2_COLORSPACE_JPEG;
+   pix->colorspace = V4L2_COLORSPACE_SRGB;
 
vout->bpp = RGB565_BPP;
vout->fbuf.fmt.width  =  display->panel.timings.x_res;
-- 
1.5.4.3


Regards,
Kishore Y
Ph:- +918039813085

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html