diff options
Diffstat (limited to 'drivers/gpu/drm/xen/xen_drm_front_shbuf.c')
-rw-r--r-- | drivers/gpu/drm/xen/xen_drm_front_shbuf.c | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c index 19914dde4b3d..d5705251a0d6 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c +++ b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c @@ -89,10 +89,6 @@ void xen_drm_front_shbuf_free(struct xen_drm_front_shbuf *buf) } kfree(buf->grefs); kfree(buf->directory); - if (buf->sgt) { - sg_free_table(buf->sgt); - kvfree(buf->pages); - } kfree(buf); } @@ -350,17 +346,6 @@ static int grant_references(struct xen_drm_front_shbuf *buf) static int alloc_storage(struct xen_drm_front_shbuf *buf) { - if (buf->sgt) { - buf->pages = kvmalloc_array(buf->num_pages, - sizeof(struct page *), GFP_KERNEL); - if (!buf->pages) - return -ENOMEM; - - if (drm_prime_sg_to_page_addr_arrays(buf->sgt, buf->pages, - NULL, buf->num_pages) < 0) - return -EINVAL; - } - buf->grefs = kcalloc(buf->num_grefs, sizeof(*buf->grefs), GFP_KERNEL); if (!buf->grefs) return -ENOMEM; @@ -396,12 +381,6 @@ xen_drm_front_shbuf_alloc(struct xen_drm_front_shbuf_cfg *cfg) struct xen_drm_front_shbuf *buf; int ret; - /* either pages or sgt, not both */ - if (unlikely(cfg->pages && cfg->sgt)) { - DRM_ERROR("Cannot handle buffer allocation with both pages and sg table provided\n"); - return NULL; - } - buf = kzalloc(sizeof(*buf), GFP_KERNEL); if (!buf) return NULL; @@ -413,7 +392,6 @@ xen_drm_front_shbuf_alloc(struct xen_drm_front_shbuf_cfg *cfg) buf->xb_dev = cfg->xb_dev; buf->num_pages = DIV_ROUND_UP(cfg->size, PAGE_SIZE); - buf->sgt = cfg->sgt; buf->pages = cfg->pages; buf->ops->calc_num_grefs(buf); |