Skip to content

Commit 0a727b4

Browse files
Xianting Tianlumag
authored andcommitted
drm/msm: Fix wrong size calculation
For example, memory-region in .dts as below, reg = <0x0 0x50000000 0x0 0x20000000> We can get below values, struct resource r; r.start = 0x50000000; r.end = 0x6fffffff; So the size should be: size = r.end - r.start + 1 = 0x20000000 Signed-off-by: Xianting Tian <[email protected]> Fixes: 072f1f9 ("drm/msm: add support for "stolen" mem") Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 170b222 commit 0a727b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/msm/msm_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static int msm_init_vram(struct drm_device *dev)
461461
of_node_put(node);
462462
if (ret)
463463
return ret;
464-
size = r.end - r.start;
464+
size = r.end - r.start + 1;
465465
DRM_INFO("using VRAM carveout: %lx@%pa\n", size, &r.start);
466466

467467
/* if we have no IOMMU, then we need to use carveout allocator.

0 commit comments

Comments
 (0)