drm/prime: Support page array >= 4GB
authorjsg <jsg@openbsd.org>
Mon, 26 Feb 2024 00:00:17 +0000 (00:00 +0000)
committerjsg <jsg@openbsd.org>
Mon, 26 Feb 2024 00:00:17 +0000 (00:00 +0000)
From Philip Yang
4ff8ec01a86568ffa5b8825bfe51c4d0d1379286 in linux-6.6.y/6.6.18
b671cd3d456315f63171a670769356a196cf7fd0 in mainline linux

sys/dev/pci/drm/drm_prime.c

index d526e61..25812a3 100644 (file)
@@ -849,7 +849,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);