Bump configuration for Guppy 7.0.4
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0020-compositor-drm-get-stride-from-drm_get_dma_fd_from_view.patch
1 From 6e86c28fa61f8f80c9df6cad64af669fefc657c7 Mon Sep 17 00:00:00 2001
2 From: Naoko Tanibata <tnaoko@jp.adit-jv.com>
3 Date: Fri, 17 May 2019 21:37:21 +0900
4 Subject: [PATCH 1/1] compositor-drm: get stride from drm_get_dma_fd_from_view
5
6 Modify drm_get_dma_fd_from_view to get buffer stride.
7
8 Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com>
9 Signed-off-by: Naoko Tanibata <tnaoko@jp.adit-jv.com>
10 ---
11  libweston/compositor-drm.c | 4 +++-
12  libweston/compositor-drm.h | 2 +-
13  2 files changed, 4 insertions(+), 2 deletions(-)
14
15 diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
16 index 0692aa8..b82e903 100644
17 --- a/libweston/compositor-drm.c
18 +++ b/libweston/compositor-drm.c
19 @@ -2645,7 +2645,7 @@ drm_output_set_seat(struct weston_output *base,
20  
21  static int
22  drm_get_dma_fd_from_view(struct weston_output *base,
23 -                          struct weston_view *ev)
24 +                          struct weston_view *ev, int *buf_stride)
25  {
26         struct drm_backend *b = to_drm_backend(base->compositor);
27         struct weston_buffer *buffer = ev->surface->buffer_ref.buffer;
28 @@ -2682,6 +2682,7 @@ drm_get_dma_fd_from_view(struct weston_output *base,
29                         fprintf(stderr, "failed to get drm_handle\n");
30                         return -1;
31                 }
32 +               *buf_stride=gbm_dmabuf.stride;
33         }
34         else if(ev->surface->buffer_ref.buffer->legacy_buffer) {
35                 bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER,
36 @@ -2705,6 +2706,7 @@ drm_get_dma_fd_from_view(struct weston_output *base,
37                         gbm_bo_destroy(bo);
38                         return -1;
39                 }
40 +               *buf_stride=current->stride;
41         }
42         else {
43                 weston_log("Buffer is not supported\n");
44 diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h
45 index 960b844..08122b2 100644
46 --- a/libweston/compositor-drm.h
47 +++ b/libweston/compositor-drm.h
48 @@ -84,7 +84,7 @@ struct weston_drm_output_api {
49           *  The dma fd is got from weston_view.
50          *  Returns fd on success, -1 on failure.
51          */
52 -       int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view);
53 +       int (*get_dma_fd_from_view)(struct weston_output *output, struct weston_view *view, int *buf_stride);
54  };
55  
56  static inline const struct weston_drm_output_api *
57 -- 
58 2.7.4
59