Fix most for kernel 4.14
[AGL/meta-agl-demo.git] / recipes-graphics / wayland / weston / 0003-gst-recorder-Use-USERPTR-instead-of-DMABUF-for-VSP-o.patch
index 095507c..6f8d1dc 100644 (file)
@@ -1,4 +1,4 @@
-From ab3cf8044667bff4a9e2e5108c55dd198fa353be Mon Sep 17 00:00:00 2001
+From f450d78f49ab55149b6b64251dd4c4f1ad04c9aa Mon Sep 17 00:00:00 2001
 From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
 Date: Thu, 11 May 2017 12:05:56 +0900
 Subject: [PATCH 3/4] gst-recorder: Use USERPTR instead of DMABUF for VSP
@@ -10,14 +10,14 @@ are required for each output, the VSP cannot allocate these buffers
 externally.  The encoder provides its own buffers in USERPTR mode, so
 switch to that.
 ---
src/gst-recorder.c | 100 +++++++++++++++++++++++++++++++++--------------------
libweston/gst-recorder.c | 100 +++++++++++++++++++++++++++++------------------
  1 file changed, 63 insertions(+), 37 deletions(-)
 
-diff --git a/src/gst-recorder.c b/src/gst-recorder.c
-index 2e3b359..271fb69 100644
---- a/src/gst-recorder.c
-+++ b/src/gst-recorder.c
-@@ -314,7 +314,7 @@ vsp_init(const char *devname)
+diff --git a/libweston/gst-recorder.c b/libweston/gst-recorder.c
+index d46d4f0..d2cf8dc 100644
+--- a/libweston/gst-recorder.c
++++ b/libweston/gst-recorder.c
+@@ -311,7 +311,7 @@ vsp_init(const char *devname)
                weston_log("failed to open subdev '%s'\n", buf);
                goto error_media;
        }
@@ -26,7 +26,7 @@ index 2e3b359..271fb69 100644
        {
                weston_log("failed to open device '%s'\n", media_entity_get_devname(entity));
                goto error_media;
-@@ -467,7 +467,8 @@ vsp_request_buffers(vsp_data_t *vsp, vsp_port_n port, unsigned int num)
+@@ -464,7 +464,8 @@ vsp_request_buffers(vsp_data_t *vsp, vsp_port_n port, unsigned int num)
        memset(&reqbuf, 0, sizeof(reqbuf));
        reqbuf.type = (port == VSP_PORT_INPUT) ?
                V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE : V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
@@ -36,7 +36,7 @@ index 2e3b359..271fb69 100644
        reqbuf.count = num;
        if (ioctl(fd, VIDIOC_REQBUFS, &reqbuf) < 0) {
                weston_log("VSP: %s REQBUFS failed: %d\n",
-@@ -539,7 +540,8 @@ vsp_input_buffer_dequeue_dmafd(vsp_data_t *vsp)
+@@ -536,7 +537,8 @@ vsp_input_buffer_dequeue_dmafd(vsp_data_t *vsp)
  
  /* ...enqueue output buffer */
  static int
@@ -46,7 +46,7 @@ index 2e3b359..271fb69 100644
  {
        vsp_media_pad_t    *pad = &vsp->output;
        struct v4l2_plane   planes[2];
-@@ -549,16 +551,23 @@ vsp_output_buffer_queue_dmafd(vsp_data_t *vsp, int i, int dmafd[])
+@@ -546,16 +548,23 @@ vsp_output_buffer_queue_dmafd(vsp_data_t *vsp, int i, int dmafd[])
        memset(&buf, 0, sizeof(buf));
        memset(planes, 0, sizeof(planes));
        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
@@ -74,7 +74,7 @@ index 2e3b359..271fb69 100644
                return -1;
        }
  
-@@ -567,7 +576,7 @@ vsp_output_buffer_queue_dmafd(vsp_data_t *vsp, int i, int dmafd[])
+@@ -564,7 +573,7 @@ vsp_output_buffer_queue_dmafd(vsp_data_t *vsp, int i, int dmafd[])
  
  /* ...dequeue output buffer */
  static int
@@ -83,7 +83,7 @@ index 2e3b359..271fb69 100644
  {
        vsp_media_pad_t    *pad = &vsp->output;
        struct v4l2_buffer  buf;
-@@ -577,12 +586,12 @@ vsp_output_buffer_dequeue_dmafd(vsp_data_t *vsp)
+@@ -574,12 +583,12 @@ vsp_output_buffer_dequeue_dmafd(vsp_data_t *vsp)
        memset(&buf, 0, sizeof(buf));
        memset(planes, 0, sizeof(planes));
        buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
@@ -98,7 +98,7 @@ index 2e3b359..271fb69 100644
                return -1;
        }
  
-@@ -879,33 +888,25 @@ err:
+@@ -876,33 +885,25 @@ err:
  }
  
  static int
@@ -140,7 +140,7 @@ index 2e3b359..271fb69 100644
        }
  
        *ret_buf = buf;
-@@ -959,7 +960,7 @@ gst_recorder_create(struct gst_recorder_settings *settings)
+@@ -956,7 +957,7 @@ gst_recorder_create(struct gst_recorder_settings *settings)
  
        /* omx */
        ptr += sprintf(ptr,
@@ -149,7 +149,7 @@ index 2e3b359..271fb69 100644
                "video/x-h264,width=%d,height=%d ! ",
                r->set->bitrate, r->set->crop.width, r->set->crop.height);
  
-@@ -1012,6 +1013,12 @@ gst_recorder_create(struct gst_recorder_settings *settings)
+@@ -1009,6 +1010,12 @@ gst_recorder_create(struct gst_recorder_settings *settings)
                                        "framerate", GST_TYPE_FRACTION, 0, DEFAULT_FPS,
                                        NULL), NULL);
  
@@ -257,5 +257,5 @@ index 2e3b359..271fb69 100644
 +      return ret;
  }
 -- 
-1.9.1
+2.9.2