diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2018-05-15 16:09:15 +0200 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2018-08-06 15:23:50 +0200 |
commit | 6ae9c84ff249f2756086e71405375fd06124cf1f (patch) | |
tree | ed9dfa0ee971aa8ab0d9f762fb3f72a1263c55c0 /drivers/gpu/drm/etnaviv | |
parent | 9d3cce1e8b8561fed5f383d22a4d6949db4eadbe (diff) | |
download | lwn-6ae9c84ff249f2756086e71405375fd06124cf1f.tar.gz lwn-6ae9c84ff249f2756086e71405375fd06124cf1f.zip |
drm/etnaviv: mmuv2: use memset32 to init scratch page
Replace the open-coded scratch page initialization loop with memset32
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c b/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c index 71fbc1f96cb6..f1c88d8ad5ba 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c @@ -119,8 +119,7 @@ static size_t etnaviv_iommuv2_unmap(struct etnaviv_iommu_domain *domain, static int etnaviv_iommuv2_init(struct etnaviv_iommuv2_domain *etnaviv_domain) { - u32 *p; - int ret, i; + int ret; /* allocate scratch page */ etnaviv_domain->base.bad_page_cpu = @@ -131,9 +130,9 @@ static int etnaviv_iommuv2_init(struct etnaviv_iommuv2_domain *etnaviv_domain) ret = -ENOMEM; goto fail_mem; } - p = etnaviv_domain->base.bad_page_cpu; - for (i = 0; i < SZ_4K / 4; i++) - *p++ = 0xdead55aa; + + memset32(etnaviv_domain->base.bad_page_cpu, 0xdead55aa, + SZ_4K / sizeof(u32)); etnaviv_domain->pta_cpu = dma_alloc_wc(etnaviv_domain->base.dev, SZ_4K, &etnaviv_domain->pta_dma, |