]> git.baikalelectronics.ru Git - kernel.git/commit
drm/msm: Fix wrong size calculation
authorXianting Tian <xianting.tian@linux.alibaba.com>
Wed, 12 Jan 2022 12:33:34 +0000 (20:33 +0800)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tue, 25 Jan 2022 02:45:59 +0000 (05:45 +0300)
commit467a5e65b04075744824da99ee80e4f98271405c
tree94722b15b6abd23ee145b622b575df1e07a75c36
parent0ad48b51d511819a5dd1327f37b8403dfccf6332
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 <xianting.tian@linux.alibaba.com>
Fixes: 34966f288423 ("drm/msm: add support for "stolen" mem")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20220112123334.749776-1-xianting.tian@linux.alibaba.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/msm_drv.c