https://elinux.org/index.php?title=R-Car/Tests:KMS-dmabuf&feed=atom&action=history
R-Car/Tests:KMS-dmabuf - Revision history
2024-03-29T02:10:26Z
Revision history for this page on the wiki
MediaWiki 1.31.0
https://elinux.org/index.php?title=R-Car/Tests:KMS-dmabuf&diff=456741&oldid=prev
Laurent.pinchart: Fix formatting of the dmabuf-sharing example
2017-11-15T11:10:27Z
<p>Fix formatting of the dmabuf-sharing example</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 11:10, 15 November 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l67" >Line 67:</td>
<td colspan="2" class="diff-lineno">Line 67:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The following example captures frames in 640x480 resolution from vivid and displays them full screen on the R-Car DU. The -o parameter takes the IDs of the VGA connector and the associated CRTC. You might need to change the values depending on the target system. The modest application (part of libdrm) can be used to list available connectors and CRTCs and retrieve their IDs.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The following example captures frames in 640x480 resolution from vivid and displays them full screen on the R-Car DU. The -o parameter takes the IDs of the VGA connector and the associated CRTC. You might need to change the values depending on the target system. The modest application (part of libdrm) can be used to list available connectors and CRTCs and retrieve their IDs.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><pre></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>$ dmabuf-sharing -i /dev/video0 -f YUYV -S 640,480 -s 640,480@0,0 \</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>$ dmabuf-sharing -i /dev/video0 -f YUYV -S 640,480 -s 640,480@0,0 \</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>           -M rcar-du -o 70:68:640x480 -F YUYV -t 640,480@0,0 \</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>           -M rcar-du -o 70:68:640x480 -F YUYV -t 640,480@0,0 \</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>           -b 4 -e v4l2</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>           -b 4 -e v4l2</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></pre></ins></div></td></tr>
</table>
Laurent.pinchart
https://elinux.org/index.php?title=R-Car/Tests:KMS-dmabuf&diff=456736&oldid=prev
Laurent.pinchart: Fix formatting of the vivid patch
2017-11-15T11:09:25Z
<p>Fix formatting of the vivid patch</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 11:09, 15 November 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l25" >Line 25:</td>
<td colspan="2" class="diff-lineno">Line 25:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The examples below capture frames in 640x480 resolution to ensure maximum compatibility with different displays. That resolution is unfortunately not supported by the vivid driver by default, and requires the following patch to be applied.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The examples below capture frames in 640x480 resolution to ensure maximum compatibility with different displays. That resolution is unfortunately not supported by the vivid driver by default, and requires the following patch to be applied.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"><pre></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>commit 0510bc9bd6177c10c2adfe5764bfbee09def94e6</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>commit 0510bc9bd6177c10c2adfe5764bfbee09def94e6</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Author: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Author: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com></div></td></tr>
<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l35" >Line 35:</td>
<td colspan="2" class="diff-lineno">Line 36:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>     widely supported by displays.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>     widely supported by displays.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div><del style="font-weight: bold; text-decoration: none;"><pre></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>index 01419455e545..c620ea0fe3a9 100644</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>index 01419455e545..c620ea0fe3a9 100644</div></td></tr>
</table>
Laurent.pinchart
https://elinux.org/index.php?title=R-Car/Tests:KMS-dmabuf&diff=456731&oldid=prev
Laurent.pinchart: Update the URL of the upstream samsung-utils git tree and its clone
2017-11-15T11:08:40Z
<p>Update the URL of the upstream samsung-utils git tree and its clone</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 11:08, 15 November 2017</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9" >Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Getting the source code ===</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>=== Getting the source code ===</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>The upstream git tree for the dmabuf-sharing application is git://<del class="diffchange diffchange-inline">git.infradead</del>.org/<del class="diffchange diffchange-inline">users</del>/<del class="diffchange diffchange-inline">kmpark/public</del>-<del class="diffchange diffchange-inline">apps</del>. The cloned tree git://git.ideasonboard.org/samsung-<del class="diffchange diffchange-inline">public-apps</del>.git contains one required additional patch to select the exporter.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>The upstream git tree for the dmabuf-sharing application is git://<ins class="diffchange diffchange-inline">linuxtv</ins>.org/<ins class="diffchange diffchange-inline">snawrocki</ins>/<ins class="diffchange diffchange-inline">samsung</ins>-<ins class="diffchange diffchange-inline">utils.git</ins>. The cloned tree git://git.ideasonboard.org/samsung-<ins class="diffchange diffchange-inline">utils</ins>.git contains one required additional patch to select the exporter.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The application is located in the v4l2-drm-example directory.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The application is located in the v4l2-drm-example directory.</div></td></tr>
</table>
Laurent.pinchart
https://elinux.org/index.php?title=R-Car/Tests:KMS-dmabuf&diff=456726&oldid=prev
Laurent.pinchart: Document dmabuf-sharing usage
2017-11-15T10:56:06Z
<p>Document dmabuf-sharing usage</p>
<p><b>New page</b></p><div>This page describes how to use the dmabuf-sharing application to test buffer sharing between V4L2 and DRM/KMS drivers.<br />
<br />
== Setting up dmabuf-sharing ==<br />
<br />
=== Requirements ===<br />
<br />
The dmabuf-sharing application requires libdrm to be present both on the target system and in the build environment.<br />
<br />
=== Getting the source code ===<br />
<br />
The upstream git tree for the dmabuf-sharing application is git://git.infradead.org/users/kmpark/public-apps. The cloned tree git://git.ideasonboard.org/samsung-public-apps.git contains one required additional patch to select the exporter.<br />
<br />
The application is located in the v4l2-drm-example directory.<br />
<br />
=== Building dmabuf-sharing ===<br />
<br />
To compile the application, run make with the following variables set:<br />
<br />
* CROSS_COMPILE should be set to the cross-compilation prefix of your compiler (e.g. CROSS_COMPILE=aarch64-buildroot-linux-gnu-)<br />
* LIBDRM_DIR should be set to the root of a directory tree that contains the libdrm headers and libraries (e.g. LIBDRM_DIR=$HOME/src/buildroot/output/arm64/staging/)<br />
* KDIR should be set to the root of a directory tree that contains the installed kernel headers (e.g. KDIR=$HOME/src/kernel/ after running <code>make headers_install</code> in that directory)<br />
<br />
=== Patching the kernel ===<br />
<br />
The examples below capture frames in 640x480 resolution to ensure maximum compatibility with different displays. That resolution is unfortunately not supported by the vivid driver by default, and requires the following patch to be applied.<br />
<br />
commit 0510bc9bd6177c10c2adfe5764bfbee09def94e6<br />
Author: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com><br />
Date: Mon Nov 13 05:49:01 2017 +0200<br />
<br />
[HACK] vivid: Accept 640x480 resolution<br />
<br />
This allows displaying the virtual video full screen with a 640x480<br />
resolution. The closest resolution supported by vivid, 640x360, is not<br />
widely supported by displays.<br />
<br />
<pre><br />
diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c<br />
index 01419455e545..c620ea0fe3a9 100644<br />
--- a/drivers/media/platform/vivid/vivid-vid-cap.c<br />
+++ b/drivers/media/platform/vivid/vivid-vid-cap.c<br />
@@ -63,7 +63,7 @@ static const struct vivid_fmt formats_ovl[] = {<br />
};<br />
<br />
/* The number of discrete webcam framesizes */<br />
-#define VIVID_WEBCAM_SIZES 5<br />
+#define VIVID_WEBCAM_SIZES 6<br />
/* The number of discrete webcam frameintervals */<br />
#define VIVID_WEBCAM_IVALS (VIVID_WEBCAM_SIZES * 2)<br />
<br />
@@ -71,6 +71,7 @@ static const struct vivid_fmt formats_ovl[] = {<br />
static const struct v4l2_frmsize_discrete webcam_sizes[VIVID_WEBCAM_SIZES] = {<br />
{ 320, 180 },<br />
{ 640, 360 },<br />
+ { 640, 480 },<br />
{ 1280, 720 },<br />
{ 1920, 1080 },<br />
{ 3840, 2160 },<br />
</pre><br />
<br />
== Using dmabuf-sharing ==<br />
<br />
dmabuf-sharing sources frames from a V4L2 device and pushes them to a DRM/KMS device. It shares buffers between the two devices using dma-buf to achieve zero-copy operation. In the examples below we will use the vivid driver as a frame source to avoid depending on a particular video capture hardware. The command lines assume that the vivid device is accessible through /dev/video0. If other V4L2 devices exist in the system the device node might need to be changed.<br />
<br />
=== V4L2 as an exporter ===<br />
<br />
The following example captures frames in 640x480 resolution from vivid and displays them full screen on the R-Car DU. The -o parameter takes the IDs of the VGA connector and the associated CRTC. You might need to change the values depending on the target system. The modest application (part of libdrm) can be used to list available connectors and CRTCs and retrieve their IDs.<br />
<br />
$ dmabuf-sharing -i /dev/video0 -f YUYV -S 640,480 -s 640,480@0,0 \<br />
-M rcar-du -o 70:68:640x480 -F YUYV -t 640,480@0,0 \<br />
-b 4 -e v4l2</div>
Laurent.pinchart