All of lore.kernel.org
 help / color / mirror / Atom feed
* [thud][PATCH] gstreamer1.0*-bad: waylandsink updates for k3 for drm buffers
@ 2019-09-10 21:20 Angela Stegmaier
  2019-09-10 23:48 ` Denys Dmytriyenko
  0 siblings, 1 reply; 2+ messages in thread
From: Angela Stegmaier @ 2019-09-10 21:20 UTC (permalink / raw)
  To: meta-arago

Few changes were needed to support HW decoder (v4l2videodec)
plugin striding and creation for drm buffers.

Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
---
 ...-re-order-buffer-creation-for-drm-buffers.patch | 47 ++++++++++++++++++++++
 ...ink-Update-wldrm-NV12-offsets-and-strides.patch | 42 +++++++++++++++++++
 .../gstreamer1.0-plugins-bad_1.14.4.bbappend       |  2 +
 3 files changed, 91 insertions(+)
 create mode 100644 meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch
 create mode 100644 meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch

diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch
new file mode 100644
index 0000000..d242e72
--- /dev/null
+++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch
@@ -0,0 +1,47 @@
+From aeff52394cddb80acc91ff882e90f4e170646f88 Mon Sep 17 00:00:00 2001
+From: Angela Stegmaier <angelabaker@ti.com>
+Date: Wed, 7 Aug 2019 09:32:16 -0500
+Subject: [PATCH 1/2] waylandsink: re-order buffer creation for drm buffers
+
+We should first try to create the wl_buffer using drm api, and
+then only if it fails, try dmabuf and shm apis. This patch fixes
+the ordering so that the redundant creation does not happen.
+
+Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
+---
+ ext/wayland/gstwaylandsink.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
+index 19ecf4d..470e9d2 100644
+--- a/ext/wayland/gstwaylandsink.c
++++ b/ext/wayland/gstwaylandsink.c
+@@ -772,7 +772,13 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer)
+       "display, creating it", buffer);
+ 
+   format = GST_VIDEO_INFO_FORMAT (&sink->video_info);
+-  if (gst_wl_display_check_format_for_dmabuf (sink->display, format)) {
++
++  if (gst_is_drm_memory (mem)) {
++     wbuf = gst_wl_drm_memory_construct_wl_buffer (mem, sink->display,
++         &sink->video_info);
++  }
++
++  if (!wbuf && gst_wl_display_check_format_for_dmabuf (sink->display, format)) {
+     guint i, nb_dmabuf = 0;
+ 
+     for (i = 0; i < gst_buffer_n_memory (buffer); i++)
+@@ -783,10 +789,6 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer)
+       wbuf = gst_wl_linux_dmabuf_construct_wl_buffer (buffer, sink->display,
+           &sink->video_info);
+   }
+-  if (gst_is_drm_memory (mem)) {
+-     wbuf = gst_wl_drm_memory_construct_wl_buffer (mem, sink->display,
+-         &sink->video_info);
+-  }
+ 
+   if (!wbuf && gst_wl_display_check_format_for_shm (sink->display, format)) {
+     if (gst_buffer_n_memory (buffer) == 1 && gst_is_fd_memory (mem))
+-- 
+1.9.1
+
diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch
new file mode 100644
index 0000000..38a2829
--- /dev/null
+++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch
@@ -0,0 +1,42 @@
+From 76f08c4cd3f1bd35b83b8989bba6a8be31eea89c Mon Sep 17 00:00:00 2001
+From: Angela Stegmaier <angelabaker@ti.com>
+Date: Wed, 7 Aug 2019 09:42:09 -0500
+Subject: [PATCH 2/2] waylandsink: Update wldrm NV12 offsets and strides
+
+Stride may not be the same as width, as the wldrm was assuming.
+Update the NV12 offset and stride calculation to use the actual
+values from the video metadata.
+
+Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
+---
+ ext/wayland/wldrm.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/ext/wayland/wldrm.c b/ext/wayland/wldrm.c
+index 9aca9d5..0b72896 100644
+--- a/ext/wayland/wldrm.c
++++ b/ext/wayland/wldrm.c
+@@ -38,7 +38,10 @@ gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display,
+   {
+     /* NV12 */
+     fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
+-    strides[1] = GST_ROUND_UP_4 (video_width);
++    strides[0] = GST_VIDEO_INFO_PLANE_STRIDE (info, 0);
++    strides[1] = GST_VIDEO_INFO_PLANE_STRIDE (info, 1);
++    offsets[0] = GST_VIDEO_INFO_PLANE_OFFSET (info, 0);
++    offsets[1] = GST_VIDEO_INFO_PLANE_OFFSET (info, 1);
+   }
+   else if(format == GST_VIDEO_FORMAT_I420)
+   {
+@@ -92,7 +95,7 @@ gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display,
+     return NULL;
+   }
+ 
+-  req2.handle = req1.handle,
++  req2.handle = req1.handle;
+ 
+   ret = drmIoctl(display->fd, DRM_IOCTL_GEM_FLINK, &req2);
+   if (ret) {
+-- 
+1.9.1
+
diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend
index 70f5f9b..38f7e63 100644
--- a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend
+++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend
@@ -51,6 +51,8 @@ SRC_URI_append_k3 = " \
     file://0003-kmssink-Add-omapdrm-and-tidss-in-the-list-of-drivers.patch \
     file://0004-waylandsink-Add-drm-support-in-waylandsink.patch \
     file://0005-waylandsink-Add-input-device-support.patch \
+    file://0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch \
+    file://0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch \
 "
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
-- 
1.9.1



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

* Re: [thud][PATCH] gstreamer1.0*-bad: waylandsink updates for k3 for drm buffers
  2019-09-10 21:20 [thud][PATCH] gstreamer1.0*-bad: waylandsink updates for k3 for drm buffers Angela Stegmaier
@ 2019-09-10 23:48 ` Denys Dmytriyenko
  0 siblings, 0 replies; 2+ messages in thread
From: Denys Dmytriyenko @ 2019-09-10 23:48 UTC (permalink / raw)
  To: Angela Stegmaier; +Cc: meta-arago

On Tue, Sep 10, 2019 at 04:20:50PM -0500, Angela Stegmaier wrote:
> Few changes were needed to support HW decoder (v4l2videodec)
> plugin striding and creation for drm buffers.

Both patches are missing Upstream-Status:


> Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
> ---
>  ...-re-order-buffer-creation-for-drm-buffers.patch | 47 ++++++++++++++++++++++
>  ...ink-Update-wldrm-NV12-offsets-and-strides.patch | 42 +++++++++++++++++++
>  .../gstreamer1.0-plugins-bad_1.14.4.bbappend       |  2 +
>  3 files changed, 91 insertions(+)
>  create mode 100644 meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch
>  create mode 100644 meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch
> 
> diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch
> new file mode 100644
> index 0000000..d242e72
> --- /dev/null
> +++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch
> @@ -0,0 +1,47 @@
> +From aeff52394cddb80acc91ff882e90f4e170646f88 Mon Sep 17 00:00:00 2001
> +From: Angela Stegmaier <angelabaker@ti.com>
> +Date: Wed, 7 Aug 2019 09:32:16 -0500
> +Subject: [PATCH 1/2] waylandsink: re-order buffer creation for drm buffers
> +
> +We should first try to create the wl_buffer using drm api, and
> +then only if it fails, try dmabuf and shm apis. This patch fixes
> +the ordering so that the redundant creation does not happen.
> +
> +Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
> +---
> + ext/wayland/gstwaylandsink.c | 12 +++++++-----
> + 1 file changed, 7 insertions(+), 5 deletions(-)
> +
> +diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c
> +index 19ecf4d..470e9d2 100644
> +--- a/ext/wayland/gstwaylandsink.c
> ++++ b/ext/wayland/gstwaylandsink.c
> +@@ -772,7 +772,13 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer)
> +       "display, creating it", buffer);
> + 
> +   format = GST_VIDEO_INFO_FORMAT (&sink->video_info);
> +-  if (gst_wl_display_check_format_for_dmabuf (sink->display, format)) {
> ++
> ++  if (gst_is_drm_memory (mem)) {
> ++     wbuf = gst_wl_drm_memory_construct_wl_buffer (mem, sink->display,
> ++         &sink->video_info);
> ++  }
> ++
> ++  if (!wbuf && gst_wl_display_check_format_for_dmabuf (sink->display, format)) {
> +     guint i, nb_dmabuf = 0;
> + 
> +     for (i = 0; i < gst_buffer_n_memory (buffer); i++)
> +@@ -783,10 +789,6 @@ gst_wayland_sink_show_frame (GstVideoSink * vsink, GstBuffer * buffer)
> +       wbuf = gst_wl_linux_dmabuf_construct_wl_buffer (buffer, sink->display,
> +           &sink->video_info);
> +   }
> +-  if (gst_is_drm_memory (mem)) {
> +-     wbuf = gst_wl_drm_memory_construct_wl_buffer (mem, sink->display,
> +-         &sink->video_info);
> +-  }
> + 
> +   if (!wbuf && gst_wl_display_check_format_for_shm (sink->display, format)) {
> +     if (gst_buffer_n_memory (buffer) == 1 && gst_is_fd_memory (mem))
> +-- 
> +1.9.1
> +
> diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch
> new file mode 100644
> index 0000000..38a2829
> --- /dev/null
> +++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch
> @@ -0,0 +1,42 @@
> +From 76f08c4cd3f1bd35b83b8989bba6a8be31eea89c Mon Sep 17 00:00:00 2001
> +From: Angela Stegmaier <angelabaker@ti.com>
> +Date: Wed, 7 Aug 2019 09:42:09 -0500
> +Subject: [PATCH 2/2] waylandsink: Update wldrm NV12 offsets and strides
> +
> +Stride may not be the same as width, as the wldrm was assuming.
> +Update the NV12 offset and stride calculation to use the actual
> +values from the video metadata.
> +
> +Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
> +---
> + ext/wayland/wldrm.c | 7 +++++--
> + 1 file changed, 5 insertions(+), 2 deletions(-)
> +
> +diff --git a/ext/wayland/wldrm.c b/ext/wayland/wldrm.c
> +index 9aca9d5..0b72896 100644
> +--- a/ext/wayland/wldrm.c
> ++++ b/ext/wayland/wldrm.c
> +@@ -38,7 +38,10 @@ gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display,
> +   {
> +     /* NV12 */
> +     fourcc = GST_MAKE_FOURCC ('N', 'V', '1', '2');
> +-    strides[1] = GST_ROUND_UP_4 (video_width);
> ++    strides[0] = GST_VIDEO_INFO_PLANE_STRIDE (info, 0);
> ++    strides[1] = GST_VIDEO_INFO_PLANE_STRIDE (info, 1);
> ++    offsets[0] = GST_VIDEO_INFO_PLANE_OFFSET (info, 0);
> ++    offsets[1] = GST_VIDEO_INFO_PLANE_OFFSET (info, 1);
> +   }
> +   else if(format == GST_VIDEO_FORMAT_I420)
> +   {
> +@@ -92,7 +95,7 @@ gst_wl_drm_memory_construct_wl_buffer (GstMemory * mem, GstWlDisplay * display,
> +     return NULL;
> +   }
> + 
> +-  req2.handle = req1.handle,
> ++  req2.handle = req1.handle;
> + 
> +   ret = drmIoctl(display->fd, DRM_IOCTL_GEM_FLINK, &req2);
> +   if (ret) {
> +-- 
> +1.9.1
> +
> diff --git a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend
> index 70f5f9b..38f7e63 100644
> --- a/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend
> +++ b/meta-arago-extras/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.4.bbappend
> @@ -51,6 +51,8 @@ SRC_URI_append_k3 = " \
>      file://0003-kmssink-Add-omapdrm-and-tidss-in-the-list-of-drivers.patch \
>      file://0004-waylandsink-Add-drm-support-in-waylandsink.patch \
>      file://0005-waylandsink-Add-input-device-support.patch \
> +    file://0001-waylandsink-re-order-buffer-creation-for-drm-buffers.patch \
> +    file://0002-waylandsink-Update-wldrm-NV12-offsets-and-strides.patch \
>  "
>  
>  PACKAGE_ARCH = "${MACHINE_ARCH}"
> -- 
> 1.9.1
> 
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago


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

end of thread, other threads:[~2019-09-10 23:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 21:20 [thud][PATCH] gstreamer1.0*-bad: waylandsink updates for k3 for drm buffers Angela Stegmaier
2019-09-10 23:48 ` Denys Dmytriyenko

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.