<div dir="ltr">Hi Seung Woo,<div><br></div><div style>I had posted the same solution at <a href="http://lists.freedesktop.org/archives/dri-devel/2013-January/034119.html">http://lists.freedesktop.org/archives/dri-devel/2013-January/034119.html</a>.</div>
<div style>This has been pulled in drm-intel-next.</div><div style><br></div><div style>regards,</div><div style>Rahul Sharma.</div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 26, 2013 at 2:18 PM, Seung-Woo Kim <span dir="ltr"><<a href="mailto:sw0312.kim@samsung.com" target="_blank">sw0312.kim@samsung.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Allocating scatter table with sg_alloc_table() does not consider<br>
contiguous pages. Because sg_alloc_table_from_pages() merges<br>
contigous pages into a signle scatter entry, this patch fixes to<br>
allocate scatter table with it from drm_prime_pages_to_sg().<br>
<br>
Signed-off-by: Seung-Woo Kim <<a href="mailto:sw0312.kim@samsung.com">sw0312.kim@samsung.com</a>><br>
---<br>
drivers/gpu/drm/drm_prime.c | 8 ++------<br>
1 files changed, 2 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c<br>
index 366910d..8c098a3 100644<br>
--- a/drivers/gpu/drm/drm_prime.c<br>
+++ b/drivers/gpu/drm/drm_prime.c<br>
@@ -401,21 +401,17 @@ int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data,<br>
struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages)<br>
{<br>
struct sg_table *sg = NULL;<br>
- struct scatterlist *iter;<br>
- int i;<br>
int ret;<br>
<br>
sg = kmalloc(sizeof(struct sg_table), GFP_KERNEL);<br>
if (!sg)<br>
goto out;<br>
<br>
- ret = sg_alloc_table(sg, nr_pages, GFP_KERNEL);<br>
+ ret = sg_alloc_table_from_pages(sg, pages, nr_pages,<br>
+ 0, PAGE_SIZE * nr_pages, GFP_KERNEL);<br>
if (ret)<br>
goto out;<br>
<br>
- for_each_sg(sg->sgl, iter, nr_pages, i)<br>
- sg_set_page(iter, pages[i], PAGE_SIZE, 0);<br>
-<br>
return sg;<br>
out:<br>
kfree(sg);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.4.1<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Rahul Sharma,<br>email to: <a href="mailto:rahul.sharma@samsung.com" target="_blank">rahul.sharma@samsung.com</a><br>Samsung India.
</div>