public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* DMABUF doesn't work when frame size not equal to the size of GPU bo
@ 2013-12-25  2:15 Chuanbo Weng
  2013-12-27  1:55 ` Chuanbo Weng
  0 siblings, 1 reply; 11+ messages in thread
From: Chuanbo Weng @ 2013-12-25  2:15 UTC (permalink / raw)
  To: linux-media, laurent.pinchart, t.stanislaws

Hi all,

       (My environment is intel platform, HD4000 GPU, kernel 3.10.19,
logitech 270 webcam)
       As title said, I discover this issue when I run the program
shown by Laurent Pinchart:
http://www.mail-archive.com/linux-media@vger.kernel.org/msg54806.html

If the frame is (width, height) = (640, 480), DMABUF works well.
If the frame is (width, height) = (160, 120), v4lfd receives no event.


And I dig into drm kernel code, find that: i915_gem_create will create
a GPU buffer object on intel platform. The size of GPU bo will be
bigger than frame size, for the reason that i915_gem_create will
roundup the bo size to multiple of PAGE_SIZE when the frame is (width,
height) = (160, 120).
For (width, height) = (640, 480), the frame size is already multiple
of PAGE_SIZE, so GPU bo is exactly equal to frame size.

I also dump the uvc driver infomation, there is some infomation i
think maybe important:
uvcvideo: Stream 1 error event 07 01 len 4

Looking forward to the discussion!

Thanks,
Chuanbo Weng

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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2013-12-25  2:15 DMABUF doesn't work when frame size not equal to the size of GPU bo Chuanbo Weng
@ 2013-12-27  1:55 ` Chuanbo Weng
  2013-12-29 15:27   ` Laurent Pinchart
  0 siblings, 1 reply; 11+ messages in thread
From: Chuanbo Weng @ 2013-12-27  1:55 UTC (permalink / raw)
  To: linux-media, laurent.pinchart, t.stanislaws

Ping for reply!

2013/12/25 Chuanbo Weng <strgnm@gmail.com>:
> Hi all,
>
>        (My environment is intel platform, HD4000 GPU, kernel 3.10.19,
> logitech 270 webcam)
>        As title said, I discover this issue when I run the program
> shown by Laurent Pinchart:
> http://www.mail-archive.com/linux-media@vger.kernel.org/msg54806.html
>
> If the frame is (width, height) = (640, 480), DMABUF works well.
> If the frame is (width, height) = (160, 120), v4lfd receives no event.
>
>
> And I dig into drm kernel code, find that: i915_gem_create will create
> a GPU buffer object on intel platform. The size of GPU bo will be
> bigger than frame size, for the reason that i915_gem_create will
> roundup the bo size to multiple of PAGE_SIZE when the frame is (width,
> height) = (160, 120).
> For (width, height) = (640, 480), the frame size is already multiple
> of PAGE_SIZE, so GPU bo is exactly equal to frame size.
>
> I also dump the uvc driver infomation, there is some infomation i
> think maybe important:
> uvcvideo: Stream 1 error event 07 01 len 4
>
> Looking forward to the discussion!
>
> Thanks,
> Chuanbo Weng

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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2013-12-27  1:55 ` Chuanbo Weng
@ 2013-12-29 15:27   ` Laurent Pinchart
  2013-12-31  2:42     ` Chuanbo Weng
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2013-12-29 15:27 UTC (permalink / raw)
  To: Chuanbo Weng; +Cc: linux-media, t.stanislaws

Hi Chuanbo,

On Friday 27 December 2013 09:55:40 Chuanbo Weng wrote:
> > Hi all,
> > 
> > (My environment is intel platform, HD4000 GPU, kernel 3.10.19, logitech
> > 270 webcam)
> > 
> > As title said, I discover this issue when I run the program shown by
> > Laurent Pinchart:
> > http://www.mail-archive.com/linux-media@vger.kernel.org/msg54806.html
> > 
> > If the frame is (width, height) = (640, 480), DMABUF works well.
> > If the frame is (width, height) = (160, 120), v4lfd receives no event.
> > 
> > And I dig into drm kernel code, find that: i915_gem_create will create a
> > GPU buffer object on intel platform. The size of GPU bo will be bigger
> > than frame size, for the reason that i915_gem_create will roundup the bo
> > size to multiple of PAGE_SIZE when the frame is (width, height) = (160,
> > 120). For (width, height) = (640, 480), the frame size is already multiple
> > of PAGE_SIZE, so GPU bo is exactly equal to frame size.

That should in theory not be an issue). This might be a stupid question, but 
have you tried to capture 160x120 images directly (with yavta for instance) 
without using DMABUF ?

> > I also dump the uvc driver infomation, there is some infomation i
> > think maybe important:
> > uvcvideo: Stream 1 error event 07 01 len 4
> > 
> > Looking forward to the discussion!

-- 
Regards,

Laurent Pinchart


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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2013-12-29 15:27   ` Laurent Pinchart
@ 2013-12-31  2:42     ` Chuanbo Weng
  2013-12-31  7:43       ` Tomasz Stanislawski
  0 siblings, 1 reply; 11+ messages in thread
From: Chuanbo Weng @ 2013-12-31  2:42 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media, t.stanislaws

Hi Laurent,


2013/12/29 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> Hi Chuanbo,
>
> On Friday 27 December 2013 09:55:40 Chuanbo Weng wrote:
>> > Hi all,
>> >
>> > (My environment is intel platform, HD4000 GPU, kernel 3.10.19, logitech
>> > 270 webcam)
>> >
>> > As title said, I discover this issue when I run the program shown by
>> > Laurent Pinchart:
>> > http://www.mail-archive.com/linux-media@vger.kernel.org/msg54806.html
>> >
>> > If the frame is (width, height) = (640, 480), DMABUF works well.
>> > If the frame is (width, height) = (160, 120), v4lfd receives no event.
>> >
>> > And I dig into drm kernel code, find that: i915_gem_create will create a
>> > GPU buffer object on intel platform. The size of GPU bo will be bigger
>> > than frame size, for the reason that i915_gem_create will roundup the bo
>> > size to multiple of PAGE_SIZE when the frame is (width, height) = (160,
>> > 120). For (width, height) = (640, 480), the frame size is already multiple
>> > of PAGE_SIZE, so GPU bo is exactly equal to frame size.
>
> That should in theory not be an issue). This might be a stupid question, but
> have you tried to capture 160x120 images directly (with yavta for instance)
> without using DMABUF ?

Thanks for your reply! Please forgive me if it's a stupid question
because I'm new in camera
and v4l2 region. Yes, of course, I have tried to capture 160x120
images using yavta and v4l-utils
without using DMABUF (using MMAP), it works well. So it proves the
camera support this width
and height.I strongly recommend you to tried 160x120 images using
DMABUF on your machine,
because I have tried 3 cameras (two logiteh, one microsoft) and all of
them don't work.
>
>> > I also dump the uvc driver infomation, there is some infomation i
>> > think maybe important:
>> > uvcvideo: Stream 1 error event 07 01 len 4
>> >
>> > Looking forward to the discussion!
>
> --
> Regards,
>
> Laurent Pinchart
>

Thanks,
Chuanbo Weng

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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2013-12-31  2:42     ` Chuanbo Weng
@ 2013-12-31  7:43       ` Tomasz Stanislawski
  2013-12-31 11:21         ` Chuanbo Weng
  0 siblings, 1 reply; 11+ messages in thread
From: Tomasz Stanislawski @ 2013-12-31  7:43 UTC (permalink / raw)
  To: Chuanbo Weng, Laurent Pinchart; +Cc: linux-media

Hi Chuanbo Weng,

I suspect that the problem might be caused by difference
between size of DMABUF object and buffer size in V4L2.
What is the content of v4l2_format returned by VIDIOC_G_FMT?
What is the content of V4l2_buffer structure passed by VIDIOC_QBUF?

Regards,
Tomasz Stanislawski

On 12/31/2013 03:42 AM, Chuanbo Weng wrote:
> Hi Laurent,
> 
> 
> 2013/12/29 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
>> Hi Chuanbo,
>>
>> On Friday 27 December 2013 09:55:40 Chuanbo Weng wrote:
>>>> Hi all,
>>>>
>>>> (My environment is intel platform, HD4000 GPU, kernel 3.10.19, logitech
>>>> 270 webcam)
>>>>
>>>> As title said, I discover this issue when I run the program shown by
>>>> Laurent Pinchart:
>>>> http://www.mail-archive.com/linux-media@vger.kernel.org/msg54806.html
>>>>
>>>> If the frame is (width, height) = (640, 480), DMABUF works well.
>>>> If the frame is (width, height) = (160, 120), v4lfd receives no event.
>>>>
>>>> And I dig into drm kernel code, find that: i915_gem_create will create a
>>>> GPU buffer object on intel platform. The size of GPU bo will be bigger
>>>> than frame size, for the reason that i915_gem_create will roundup the bo
>>>> size to multiple of PAGE_SIZE when the frame is (width, height) = (160,
>>>> 120). For (width, height) = (640, 480), the frame size is already multiple
>>>> of PAGE_SIZE, so GPU bo is exactly equal to frame size.
>>
>> That should in theory not be an issue). This might be a stupid question, but
>> have you tried to capture 160x120 images directly (with yavta for instance)
>> without using DMABUF ?
> 
> Thanks for your reply! Please forgive me if it's a stupid question
> because I'm new in camera
> and v4l2 region. Yes, of course, I have tried to capture 160x120
> images using yavta and v4l-utils
> without using DMABUF (using MMAP), it works well. So it proves the
> camera support this width
> and height.I strongly recommend you to tried 160x120 images using
> DMABUF on your machine,
> because I have tried 3 cameras (two logiteh, one microsoft) and all of
> them don't work.
>>
>>>> I also dump the uvc driver infomation, there is some infomation i
>>>> think maybe important:
>>>> uvcvideo: Stream 1 error event 07 01 len 4
>>>>
>>>> Looking forward to the discussion!
>>
>> --
>> Regards,
>>
>> Laurent Pinchart
>>
> 
> Thanks,
> Chuanbo Weng
> 


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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2013-12-31  7:43       ` Tomasz Stanislawski
@ 2013-12-31 11:21         ` Chuanbo Weng
  2013-12-31 15:19           ` Laurent Pinchart
  0 siblings, 1 reply; 11+ messages in thread
From: Chuanbo Weng @ 2013-12-31 11:21 UTC (permalink / raw)
  To: Tomasz Stanislawski; +Cc: Laurent Pinchart, linux-media

Hi Tomasz,

2013/12/31 Tomasz Stanislawski <t.stanislaws@samsung.com>:
> Hi Chuanbo Weng,
>
> I suspect that the problem might be caused by difference
> between size of DMABUF object and buffer size in V4L2.
Thanks for your reply! I agree with you because my experiment prove it
(Even when
the bo is bigget than frame size, not smaller!!!).
> What is the content of v4l2_format returned by VIDIOC_G_FMT?
The content is V4L2_PIX_FMT_YUYV. (And if the content V4L2_PIX_FMT_MJPEG, this
issue doesn't happen.)
> What is the content of V4l2_buffer structure passed by VIDIOC_QBUF?
The fd in v4l2_buffer structure is fd of gem object created by
DRM_IOCTL_MODE_CREATE_DUMB.
I've upload the program that can reproduce this issue on intel
platform. You just need to clone it from
https://github.com/strgnm/v4l2-dmabuf-test.git
Then build and run as said in README.
>
> Regards,
> Tomasz Stanislawski
>
> On 12/31/2013 03:42 AM, Chuanbo Weng wrote:
>> Hi Laurent,
>>
>>
>> 2013/12/29 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
>>> Hi Chuanbo,
>>>
>>> On Friday 27 December 2013 09:55:40 Chuanbo Weng wrote:
>>>>> Hi all,
>>>>>
>>>>> (My environment is intel platform, HD4000 GPU, kernel 3.10.19, logitech
>>>>> 270 webcam)
>>>>>
>>>>> As title said, I discover this issue when I run the program shown by
>>>>> Laurent Pinchart:
>>>>> http://www.mail-archive.com/linux-media@vger.kernel.org/msg54806.html
>>>>>
>>>>> If the frame is (width, height) = (640, 480), DMABUF works well.
>>>>> If the frame is (width, height) = (160, 120), v4lfd receives no event.
>>>>>
>>>>> And I dig into drm kernel code, find that: i915_gem_create will create a
>>>>> GPU buffer object on intel platform. The size of GPU bo will be bigger
>>>>> than frame size, for the reason that i915_gem_create will roundup the bo
>>>>> size to multiple of PAGE_SIZE when the frame is (width, height) = (160,
>>>>> 120). For (width, height) = (640, 480), the frame size is already multiple
>>>>> of PAGE_SIZE, so GPU bo is exactly equal to frame size.
>>>
>>> That should in theory not be an issue). This might be a stupid question, but
>>> have you tried to capture 160x120 images directly (with yavta for instance)
>>> without using DMABUF ?
>>
>> Thanks for your reply! Please forgive me if it's a stupid question
>> because I'm new in camera
>> and v4l2 region. Yes, of course, I have tried to capture 160x120
>> images using yavta and v4l-utils
>> without using DMABUF (using MMAP), it works well. So it proves the
>> camera support this width
>> and height.I strongly recommend you to tried 160x120 images using
>> DMABUF on your machine,
>> because I have tried 3 cameras (two logiteh, one microsoft) and all of
>> them don't work.
>>>
>>>>> I also dump the uvc driver infomation, there is some infomation i
>>>>> think maybe important:
>>>>> uvcvideo: Stream 1 error event 07 01 len 4
>>>>>
>>>>> Looking forward to the discussion!
>>>
>>> --
>>> Regards,
>>>
>>> Laurent Pinchart
>>>
>>
>> Thanks,
>> Chuanbo Weng
>>
>

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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2013-12-31 11:21         ` Chuanbo Weng
@ 2013-12-31 15:19           ` Laurent Pinchart
  2014-01-02  2:22             ` Chuanbo Weng
  0 siblings, 1 reply; 11+ messages in thread
From: Laurent Pinchart @ 2013-12-31 15:19 UTC (permalink / raw)
  To: Chuanbo Weng; +Cc: Tomasz Stanislawski, linux-media

Hi Chuanbo,

On Tuesday 31 December 2013 19:21:09 Chuanbo Weng wrote:
> 2013/12/31 Tomasz Stanislawski <t.stanislaws@samsung.com>:
> > Hi Chuanbo Weng,
> > 
> > I suspect that the problem might be caused by difference
> > between size of DMABUF object and buffer size in V4L2.
> 
> Thanks for your reply! I agree with you because my experiment prove it
> (Even when the bo is bigget than frame size, not smaller!!!).
> 
> > What is the content of v4l2_format returned by VIDIOC_G_FMT?
> 
> The content is V4L2_PIX_FMT_YUYV. (And if the content V4L2_PIX_FMT_MJPEG,
> this issue doesn't happen.)

Could you please give us the content of all the other fields ?

> > What is the content of V4l2_buffer structure passed by VIDIOC_QBUF?

Same here.

> The fd in v4l2_buffer structure is fd of gem object created by
> DRM_IOCTL_MODE_CREATE_DUMB.
>
> I've upload the program that can reproduce this issue on intel platform. You
> just need to clone it from
> https://github.com/strgnm/v4l2-dmabuf-test.git
> Then build and run as said in README.

-- 
Regards,

Laurent Pinchart


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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2013-12-31 15:19           ` Laurent Pinchart
@ 2014-01-02  2:22             ` Chuanbo Weng
  2014-01-07  8:10               ` Seung-Woo Kim
  2014-01-21 16:12               ` Laurent Pinchart
  0 siblings, 2 replies; 11+ messages in thread
From: Chuanbo Weng @ 2014-01-02  2:22 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Tomasz Stanislawski, linux-media

Hi Laurent and Tomasz,
       As I said in my previous email, you can download the code from
the github address.
I think you can easily reproduce this issue by running my program
(Especially Laurent) and
get more information from this program.
       Could you please tell me whether you have reproduced this issue?


Thanks,
Chuanbo Weng

2013/12/31 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> Hi Chuanbo,
>
> On Tuesday 31 December 2013 19:21:09 Chuanbo Weng wrote:
>> 2013/12/31 Tomasz Stanislawski <t.stanislaws@samsung.com>:
>> > Hi Chuanbo Weng,
>> >
>> > I suspect that the problem might be caused by difference
>> > between size of DMABUF object and buffer size in V4L2.
>>
>> Thanks for your reply! I agree with you because my experiment prove it
>> (Even when the bo is bigget than frame size, not smaller!!!).
>>
>> > What is the content of v4l2_format returned by VIDIOC_G_FMT?
>>
>> The content is V4L2_PIX_FMT_YUYV. (And if the content V4L2_PIX_FMT_MJPEG,
>> this issue doesn't happen.)
>
> Could you please give us the content of all the other fields ?
>
>> > What is the content of V4l2_buffer structure passed by VIDIOC_QBUF?
>
> Same here.
>
>> The fd in v4l2_buffer structure is fd of gem object created by
>> DRM_IOCTL_MODE_CREATE_DUMB.
>>
>> I've upload the program that can reproduce this issue on intel platform. You
>> just need to clone it from
>> https://github.com/strgnm/v4l2-dmabuf-test.git
>> Then build and run as said in README.
>
> --
> Regards,
>
> Laurent Pinchart
>

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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2014-01-02  2:22             ` Chuanbo Weng
@ 2014-01-07  8:10               ` Seung-Woo Kim
  2014-01-07 10:50                 ` Chuanbo Weng
  2014-01-21 16:12               ` Laurent Pinchart
  1 sibling, 1 reply; 11+ messages in thread
From: Seung-Woo Kim @ 2014-01-07  8:10 UTC (permalink / raw)
  To: Chuanbo Weng
  Cc: Laurent Pinchart, Tomasz Stanislawski, linux-media, Seung-Woo Kim

Hello,

On 2014년 01월 02일 11:22, Chuanbo Weng wrote:
> Hi Laurent and Tomasz,
>        As I said in my previous email, you can download the code from
> the github address.
> I think you can easily reproduce this issue by running my program
> (Especially Laurent) and
> get more information from this program.
>        Could you please tell me whether you have reproduced this issue?
> 
> 
> Thanks,
> Chuanbo Weng
> 
> 2013/12/31 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
>> Hi Chuanbo,
>>
>> On Tuesday 31 December 2013 19:21:09 Chuanbo Weng wrote:
>>> 2013/12/31 Tomasz Stanislawski <t.stanislaws@samsung.com>:
>>>> Hi Chuanbo Weng,
>>>>
>>>> I suspect that the problem might be caused by difference
>>>> between size of DMABUF object and buffer size in V4L2.
>>>
>>> Thanks for your reply! I agree with you because my experiment prove it
>>> (Even when the bo is bigget than frame size, not smaller!!!).
>>>
>>>> What is the content of v4l2_format returned by VIDIOC_G_FMT?
>>>
>>> The content is V4L2_PIX_FMT_YUYV. (And if the content V4L2_PIX_FMT_MJPEG,
>>> this issue doesn't happen.)
>>
>> Could you please give us the content of all the other fields ?
>>
>>>> What is the content of V4l2_buffer structure passed by VIDIOC_QBUF?
>>
>> Same here.
>>

Did you check the result of VIDIOC_QBUF? I have similar issue on my
environment, so I added debug log for failure of QBUF as "[media]
videobuf2: Add log for size checking error in __qbuf_dmabuf" to clarify.

As your comment, DRM_IOCTL_MODE_CREATE_DUMB creates buffers aligned with
PAGE_SIZE, and size of DMABUF exported from GEM with PRIME ioctl is same
with the GEM, so the size is aligned with PAGE_SIZE.

In Videobuf2 of V4L2, __qbuf_dmabuf() checks passed buffer size, or
DMABUF size if passed size is 0, with size assigned by queue_setup
callback of the v4l2 driver. The v4l2 driver assigns the size calculated
from resolution and format, and usually *it is not aligned with
PAGE_SIZE* even though internal allocation is aligned. So the check
routine of size in __qbuf_dmabuf() returns failure.

I am not sure about queue_setup of UVC driver, but it seems same issue.

Maybe we can add PAGE_ALIGN for size from queue_setup in the
__qbuf_dmabuf() like __vb2_buf_mem_alloc() or vb2_mmap().

Regards,
- Seung-Woo Kim

>>> The fd in v4l2_buffer structure is fd of gem object created by
>>> DRM_IOCTL_MODE_CREATE_DUMB.
>>>
>>> I've upload the program that can reproduce this issue on intel platform. You
>>> just need to clone it from
>>> https://github.com/strgnm/v4l2-dmabuf-test.git
>>> Then build and run as said in README.
>>
>> --
>> Regards,
>>
>> Laurent Pinchart
>>
> --
> 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
> 

-- 
Seung-Woo Kim
Samsung Software R&D Center
--


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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2014-01-07  8:10               ` Seung-Woo Kim
@ 2014-01-07 10:50                 ` Chuanbo Weng
  0 siblings, 0 replies; 11+ messages in thread
From: Chuanbo Weng @ 2014-01-07 10:50 UTC (permalink / raw)
  To: sw0312.kim; +Cc: Laurent Pinchart, Tomasz Stanislawski, linux-media

Hi Seung-Woo Kim,
       Thanks for your reply!
       I've check VIDIOC_QBUF in my program, and this ioctl returns 0,
which indicate that VIDIOC_QBUF is ok. My issue is that the v4lfd receive
no event when beginning to read frame. (Seems not the same issue as yours)
I suggest you to run my program on your machine, as I said in previous
mail. :)

      The issue happens even when the GPU bo size is bigger than frame size.
This is strange!

       Actually I'm just a user of v4l2, not the driver implementer, so I hope
the guys in mailing-list can help to solve this v4l2 implementation issue.

Thanks,
Chuanbo Weng

2014/1/7 Seung-Woo Kim <sw0312.kim@samsung.com>:
> Hello,
>
> On 2014년 01월 02일 11:22, Chuanbo Weng wrote:
>> Hi Laurent and Tomasz,
>>        As I said in my previous email, you can download the code from
>> the github address.
>> I think you can easily reproduce this issue by running my program
>> (Especially Laurent) and
>> get more information from this program.
>>        Could you please tell me whether you have reproduced this issue?
>>
>>
>> Thanks,
>> Chuanbo Weng
>>
>> 2013/12/31 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
>>> Hi Chuanbo,
>>>
>>> On Tuesday 31 December 2013 19:21:09 Chuanbo Weng wrote:
>>>> 2013/12/31 Tomasz Stanislawski <t.stanislaws@samsung.com>:
>>>>> Hi Chuanbo Weng,
>>>>>
>>>>> I suspect that the problem might be caused by difference
>>>>> between size of DMABUF object and buffer size in V4L2.
>>>>
>>>> Thanks for your reply! I agree with you because my experiment prove it
>>>> (Even when the bo is bigget than frame size, not smaller!!!).
>>>>
>>>>> What is the content of v4l2_format returned by VIDIOC_G_FMT?
>>>>
>>>> The content is V4L2_PIX_FMT_YUYV. (And if the content V4L2_PIX_FMT_MJPEG,
>>>> this issue doesn't happen.)
>>>
>>> Could you please give us the content of all the other fields ?
>>>
>>>>> What is the content of V4l2_buffer structure passed by VIDIOC_QBUF?
>>>
>>> Same here.
>>>
>
> Did you check the result of VIDIOC_QBUF? I have similar issue on my
> environment, so I added debug log for failure of QBUF as "[media]
> videobuf2: Add log for size checking error in __qbuf_dmabuf" to clarify.
>
> As your comment, DRM_IOCTL_MODE_CREATE_DUMB creates buffers aligned with
> PAGE_SIZE, and size of DMABUF exported from GEM with PRIME ioctl is same
> with the GEM, so the size is aligned with PAGE_SIZE.
>
> In Videobuf2 of V4L2, __qbuf_dmabuf() checks passed buffer size, or
> DMABUF size if passed size is 0, with size assigned by queue_setup
> callback of the v4l2 driver. The v4l2 driver assigns the size calculated
> from resolution and format, and usually *it is not aligned with
> PAGE_SIZE* even though internal allocation is aligned. So the check
> routine of size in __qbuf_dmabuf() returns failure.
>
> I am not sure about queue_setup of UVC driver, but it seems same issue.
>
> Maybe we can add PAGE_ALIGN for size from queue_setup in the
> __qbuf_dmabuf() like __vb2_buf_mem_alloc() or vb2_mmap().
>
> Regards,
> - Seung-Woo Kim
>
>>>> The fd in v4l2_buffer structure is fd of gem object created by
>>>> DRM_IOCTL_MODE_CREATE_DUMB.
>>>>
>>>> I've upload the program that can reproduce this issue on intel platform. You
>>>> just need to clone it from
>>>> https://github.com/strgnm/v4l2-dmabuf-test.git
>>>> Then build and run as said in README.
>>>
>>> --
>>> Regards,
>>>
>>> Laurent Pinchart
>>>
>> --
>> 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
>>
>
> --
> Seung-Woo Kim
> Samsung Software R&D Center
> --
>

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

* Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
  2014-01-02  2:22             ` Chuanbo Weng
  2014-01-07  8:10               ` Seung-Woo Kim
@ 2014-01-21 16:12               ` Laurent Pinchart
  1 sibling, 0 replies; 11+ messages in thread
From: Laurent Pinchart @ 2014-01-21 16:12 UTC (permalink / raw)
  To: Chuanbo Weng; +Cc: Tomasz Stanislawski, linux-media

Hi Chuanbo,

On Thursday 02 January 2014 10:22:44 Chuanbo Weng wrote:
> Hi Laurent and Tomasz,
>        As I said in my previous email, you can download the code from
> the github address.
> I think you can easily reproduce this issue by running my program
> (Especially Laurent) and
> get more information from this program.
>        Could you please tell me whether you have reproduced this issue?

I won't have time to reproduce the issue myself. If you want support on this, 
please provide us with the information I've requested in my previous reply.

-- 
Regards,

Laurent Pinchart


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

end of thread, other threads:[~2014-01-21 16:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-25  2:15 DMABUF doesn't work when frame size not equal to the size of GPU bo Chuanbo Weng
2013-12-27  1:55 ` Chuanbo Weng
2013-12-29 15:27   ` Laurent Pinchart
2013-12-31  2:42     ` Chuanbo Weng
2013-12-31  7:43       ` Tomasz Stanislawski
2013-12-31 11:21         ` Chuanbo Weng
2013-12-31 15:19           ` Laurent Pinchart
2014-01-02  2:22             ` Chuanbo Weng
2014-01-07  8:10               ` Seung-Woo Kim
2014-01-07 10:50                 ` Chuanbo Weng
2014-01-21 16:12               ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox