Skip to content

Commit 585c6ed

Browse files
Oleksandr Andrushchenkojgross1
authored andcommitted
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: Oleksandr Andrushchenko <[email protected]> Acked-by: Noralf Trønnes <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent 6f92337 commit 585c6ed

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

drivers/gpu/drm/xen/xen_drm_front.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline,
157157

158158
int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info,
159159
u64 dbuf_cookie, u32 width, u32 height,
160-
u32 bpp, u64 size, struct page **pages)
160+
u32 bpp, u64 size, u32 offset,
161+
struct page **pages)
161162
{
162163
struct xen_drm_front_evtchnl *evtchnl;
163164
struct xen_drm_front_dbuf *dbuf;
@@ -194,6 +195,7 @@ int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info,
194195
req->op.dbuf_create.gref_directory =
195196
xen_front_pgdir_shbuf_get_dir_start(&dbuf->shbuf);
196197
req->op.dbuf_create.buffer_sz = size;
198+
req->op.dbuf_create.data_ofs = offset;
197199
req->op.dbuf_create.dbuf_cookie = dbuf_cookie;
198200
req->op.dbuf_create.width = width;
199201
req->op.dbuf_create.height = height;
@@ -408,7 +410,7 @@ static int xen_drm_drv_dumb_create(struct drm_file *filp,
408410
ret = xen_drm_front_dbuf_create(drm_info->front_info,
409411
xen_drm_front_dbuf_to_cookie(obj),
410412
args->width, args->height, args->bpp,
411-
args->size,
413+
args->size, 0,
412414
xen_drm_front_gem_get_pages(obj));
413415
if (ret)
414416
goto fail_backend;

drivers/gpu/drm/xen/xen_drm_front.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int xen_drm_front_mode_set(struct xen_drm_front_drm_pipeline *pipeline,
145145

146146
int xen_drm_front_dbuf_create(struct xen_drm_front_info *front_info,
147147
u64 dbuf_cookie, u32 width, u32 height,
148-
u32 bpp, u64 size, struct page **pages);
148+
u32 bpp, u64 size, u32 offset, struct page **pages);
149149

150150
int xen_drm_front_fb_attach(struct xen_drm_front_info *front_info,
151151
u64 dbuf_cookie, u64 fb_cookie, u32 width,

drivers/gpu/drm/xen/xen_drm_front_gem.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ xen_drm_front_gem_import_sg_table(struct drm_device *dev,
210210

211211
ret = xen_drm_front_dbuf_create(drm_info->front_info,
212212
xen_drm_front_dbuf_to_cookie(&xen_obj->base),
213-
0, 0, 0, size, xen_obj->pages);
213+
0, 0, 0, size, sgt->sgl->offset,
214+
xen_obj->pages);
214215
if (ret < 0)
215216
return ERR_PTR(ret);
216217

0 commit comments

Comments
 (0)