diff options
author | Eric Anholt <eric@anholt.net> | 2019-04-19 03:10:12 +0300 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2019-05-16 19:24:34 +0300 |
commit | 091d62831793c3a1be6ae46aa888e7551e0818ad (patch) | |
tree | 6edbc04b4f09d47742a6971d2ea17d9748a0f2ec /drivers/gpu/drm/v3d/v3d_drv.c | |
parent | 145986ec566b002359243702962b917e7506d44b (diff) | |
download | linux-091d62831793c3a1be6ae46aa888e7551e0818ad.tar.xz |
drm/v3d: Set the correct DMA mask according to the MMU's limits.
On 7278, we've got 40 bits to work with.
Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190419001014.23579-2-eric@anholt.net
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_drv.c')
-rw-r--r-- | drivers/gpu/drm/v3d/v3d_drv.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index df66c90a0102..747fb6205ba8 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -239,9 +239,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) struct drm_device *drm; struct v3d_dev *v3d; int ret; + u32 mmu_debug; u32 ident1; - dev->coherent_dma_mask = DMA_BIT_MASK(36); v3d = kzalloc(sizeof(*v3d), GFP_KERNEL); if (!v3d) @@ -258,6 +258,10 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) if (ret) goto dev_free; + mmu_debug = V3D_READ(V3D_MMU_DEBUG_INFO); + dev->coherent_dma_mask = + DMA_BIT_MASK(30 + V3D_GET_FIELD(mmu_debug, V3D_MMU_PA_WIDTH)); + ident1 = V3D_READ(V3D_HUB_IDENT1); v3d->ver = (V3D_GET_FIELD(ident1, V3D_HUB_IDENT1_TVER) * 10 + V3D_GET_FIELD(ident1, V3D_HUB_IDENT1_REV)); |