1 From 0dac780379228396a19048544b9e53d5aa407583 Mon Sep 17 00:00:00 2001
2 From: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com>
3 Date: Mon, 29 Jul 2019 17:08:31 +0900
4 Subject: [PATCH 3/3] compositor-drm: get stride from drm_get_dma_fd_from_view
6 Modify drm_get_dma_fd_from_view to get buffer stride.
8 Signed-off-by: Veeresh Kadasani <external.vkadasani@jp.adit-jv.com>
10 libweston/compositor-drm.c | 5 +++--
11 libweston/compositor-drm.h | 2 +-
12 2 files changed, 4 insertions(+), 3 deletions(-)
14 diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
15 index 2b99db5..ec2765f 100644
16 --- a/libweston/compositor-drm.c
17 +++ b/libweston/compositor-drm.c
18 @@ -5421,7 +5421,7 @@ drm_output_set_seat(struct weston_output *base,
21 drm_get_dma_fd_from_view(struct weston_output *base,
22 - struct weston_view *ev)
23 + struct weston_view *ev, int *buf_stride)
25 struct drm_backend *b = to_drm_backend(base->compositor);
26 struct weston_buffer *buffer = ev->surface->buffer_ref.buffer;
27 @@ -5444,6 +5444,7 @@ drm_get_dma_fd_from_view(struct weston_output *base,
28 fprintf(stderr, "failed to get drm_fb from dmabuf\n");
31 + *buf_stride=current->strides[0];
33 else if(ev->surface->buffer_ref.buffer->legacy_buffer) {
34 bo = gbm_bo_import(b->gbm, GBM_BO_IMPORT_WL_BUFFER,
35 @@ -5458,7 +5459,7 @@ drm_get_dma_fd_from_view(struct weston_output *base,
36 weston_log("failed to get drm_fb from bo\n");
40 + *buf_stride=current->strides[0];
43 weston_log("Buffer is not supported\n");
44 diff --git a/libweston/compositor-drm.h b/libweston/compositor-drm.h
45 index a82a2a9..c2461b3 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.
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);
56 static inline const struct weston_drm_output_api *