Commit 585c6ed7 authored by Oleksandr Andrushchenko's avatar Oleksandr Andrushchenko Committed by Juergen Gross

drm/xen-front: Pass dumb buffer data offset to the backend

While importing a dmabuf it is possible that the data of the buffer
is put with offset which is indicated by the SGT offset.
Respect the offset value and forward it to the backend.
Signed-off-by: default avatarOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent 6f92337b
...@@ -157,7 +157,8 @@ int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline, ...@@ -157,7 +157,8 @@ int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline,
int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info,
u64 dbuf_cookie, u32 width, u32 height, u64 dbuf_cookie, u32 width, u32 height,
u32 bpp, u64 size, struct page **pages) u32 bpp, u64 size, u32 offset,
struct page **pages)
{ {
struct xen_drm_front_evtchnl *evtchnl; struct xen_drm_front_evtchnl *evtchnl;
struct xen_drm_front_dbuf *dbuf; struct xen_drm_front_dbuf *dbuf;
...@@ -194,6 +195,7 @@ int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, ...@@ -194,6 +195,7 @@ int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info,
req->op.dbuf_create.gref_directory = req->op.dbuf_create.gref_directory =
xen_front_pgdir_shbuf_get_dir_start(&dbuf->shbuf); xen_front_pgdir_shbuf_get_dir_start(&dbuf->shbuf);
req->op.dbuf_create.buffer_sz = size; req->op.dbuf_create.buffer_sz = size;
req->op.dbuf_create.data_ofs = offset;
req->op.dbuf_create.dbuf_cookie = dbuf_cookie; req->op.dbuf_create.dbuf_cookie = dbuf_cookie;
req->op.dbuf_create.width = width; req->op.dbuf_create.width = width;
req->op.dbuf_create.height = height; req->op.dbuf_create.height = height;
...@@ -408,7 +410,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp, ...@@ -408,7 +410,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp,
ret = xen_drm_front_dbuf_create(drm_info->front_info, ret = xen_drm_front_dbuf_create(drm_info->front_info,
xen_drm_front_dbuf_to_cookie(obj), xen_drm_front_dbuf_to_cookie(obj),
args->width, args->height, args->bpp, args->width, args->height, args->bpp,
args->size, args->size, 0,
xen_drm_front_gem_get_pages(obj)); xen_drm_front_gem_get_pages(obj));
if (ret) if (ret)
goto fail_backend; goto fail_backend;
......
...@@ -145,7 +145,7 @@ int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline, ...@@ -145,7 +145,7 @@ int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline,
int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info, int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info,
u64 dbuf_cookie, u32 width, u32 height, u64 dbuf_cookie, u32 width, u32 height,
u32 bpp, u64 size, struct page **pages); u32 bpp, u64 size, u32 offset, struct page **pages);
int xen_drm_front_fb_attach(struct xen_drm_front_info *front_info, int xen_drm_front_fb_attach(struct xen_drm_front_info *front_info,
u64 dbuf_cookie, u64 fb_cookie, u32 width, u64 dbuf_cookie, u64 fb_cookie, u32 width,
......
...@@ -210,7 +210,8 @@ xen_drm_front_gem_import_sg_table(struct drm_device *dev, ...@@ -210,7 +210,8 @@ xen_drm_front_gem_import_sg_table(struct drm_device *dev,
ret = xen_drm_front_dbuf_create(drm_info->front_info, ret = xen_drm_front_dbuf_create(drm_info->front_info,
xen_drm_front_dbuf_to_cookie(&xen_obj->base), xen_drm_front_dbuf_to_cookie(&xen_obj->base),
0, 0, 0, size, xen_obj->pages); 0, 0, 0, size, sgt->sgl->offset,
xen_obj->pages);
if (ret < 0) if (ret < 0)
return ERR_PTR(ret); return ERR_PTR(ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment