From: Seung-Woo Kim <sw0312.kim@samsung.com>
To: Chuanbo Weng <strgnm@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Tomasz Stanislawski <t.stanislaws@samsung.com>,
linux-media@vger.kernel.org,
Seung-Woo Kim <sw0312.kim@samsung.com>
Subject: Re: DMABUF doesn't work when frame size not equal to the size of GPU bo
Date: Tue, 07 Jan 2014 17:10:09 +0900 [thread overview]
Message-ID: <52CBB661.9080509@samsung.com> (raw)
In-Reply-To: <CAFu4+mWp7eKpW66XLQmPMoan8Uqf+K8eietsOjJ9R7TaCOV52g@mail.gmail.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
--
next prev parent reply other threads:[~2014-01-07 8:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2014-01-07 10:50 ` Chuanbo Weng
2014-01-21 16:12 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52CBB661.9080509@samsung.com \
--to=sw0312.kim@samsung.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=strgnm@gmail.com \
--cc=t.stanislaws@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.