[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1513711816-2618-4-git-send-email-dongwon.kim@intel.com>
Date: Tue, 19 Dec 2017 11:29:20 -0800
From: Dongwon Kim <dongwon.kim@...el.com>
To: linux-kernel@...r.kernel.org
Cc: dri-devel@...ts.freedesktop.org, xen-devel@...ts.xenproject.org,
mateuszx.potrola@...el.com, dongwon.kim@...el.com
Subject: [RFC PATCH 04/60] hyper_dmabuf: new index, k for pointing a right n-th page
Need a new index, k in hyper_dmabuf_extract_pgs function for
picking up a correct n-th page in contigous memory space.
Signed-off-by: Dongwon Kim <dongwon.kim@...el.com>
---
drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c b/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c
index 7cb5c35..3b40ec0 100644
--- a/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c
+++ b/drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c
@@ -39,7 +39,7 @@ static int hyper_dmabuf_get_num_pgs(struct sg_table *sgt)
struct hyper_dmabuf_pages_info *hyper_dmabuf_ext_pgs(struct sg_table *sgt)
{
struct hyper_dmabuf_pages_info *pinfo;
- int i, j;
+ int i, j, k;
int length;
struct scatterlist *sgl;
@@ -57,7 +57,7 @@ struct hyper_dmabuf_pages_info *hyper_dmabuf_ext_pgs(struct sg_table *sgt)
pinfo->frst_ofst = sgl->offset;
pinfo->pages[0] = sg_page(sgl);
length = sgl->length - PAGE_SIZE + sgl->offset;
- i=1;
+ i = 1;
while (length > 0) {
pinfo->pages[i] = nth_page(sg_page(sgl), i);
@@ -71,12 +71,12 @@ struct hyper_dmabuf_pages_info *hyper_dmabuf_ext_pgs(struct sg_table *sgt)
pinfo->pages[i++] = sg_page(sgl);
length = sgl->length - PAGE_SIZE;
pinfo->nents++;
+ k = 1;
while (length > 0) {
- pinfo->pages[i] = nth_page(sg_page(sgl), i);
+ pinfo->pages[i++] = nth_page(sg_page(sgl), k++);
length -= PAGE_SIZE;
pinfo->nents++;
- i++;
}
}
@@ -535,7 +535,8 @@ static int hyper_dmabuf_ops_attach(struct dma_buf* dmabuf, struct device* dev,
printk("hyper_dmabuf::%s Error:send dmabuf sync request failed\n", __func__);
}
- return ret;
+ /* Ignoring ret for now */
+ return 0;
}
static void hyper_dmabuf_ops_detach(struct dma_buf* dmabuf, struct dma_buf_attachment *attach)
--
2.7.4
Powered by blists - more mailing lists