aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Yang <Philip.Yang@amd.com>2023-08-21 16:02:01 -0400
committerChristian König <christian.koenig@amd.com>2024-02-13 16:36:04 +0100
commitb671cd3d456315f63171a670769356a196cf7fd0 (patch)
treecef3120600d427ad4fc3a88b03b8888e0863b671
parent2c80a2b715df75881359d07dbaacff8ad411f40e (diff)
downloadlinux-integrator-b671cd3d456315f63171a670769356a196cf7fd0.tar.gz
drm/prime: Support page array >= 4GB
Without unsigned long typecast, the size is passed in as zero if page array size >= 4GB, nr_pages >= 0x100000, then sg list converted will have the first and the last chunk lost. Signed-off-by: Philip Yang <Philip.Yang@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> CC: stable@vger.kernel.org Signed-off-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230821200201.24685-1-Philip.Yang@amd.com
-rw-r--r--drivers/gpu/drm/drm_prime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 834a5e28abbe59..7352bde299d547 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -820,7 +820,7 @@ struct sg_table *drm_prime_pages_to_sg(struct drm_device *dev,
if (max_segment == 0)
max_segment = UINT_MAX;
err = sg_alloc_table_from_pages_segment(sg, pages, nr_pages, 0,
- nr_pages << PAGE_SHIFT,
+ (unsigned long)nr_pages << PAGE_SHIFT,
max_segment, GFP_KERNEL);
if (err) {
kfree(sg);