]> git.baikalelectronics.ru Git - kernel.git/commit
drm: omapdrm: Export correct scatterlist for TILER backed BOs
authorIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Fri, 19 Nov 2021 08:06:20 +0000 (10:06 +0200)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 8 Dec 2021 08:04:25 +0000 (10:04 +0200)
commit1932b156ae48713490ab2e3f2722d8cd59a1a209
tree5b70ed58afb249840e838c346bddc953d40f3e15
parente5b4bbc05416ed113af13e0d76e9e59620c342b4
drm: omapdrm: Export correct scatterlist for TILER backed BOs

Memory of BOs backed by TILER is not contiguous, but omap_gem_map_dma_buf()
exports it like it is. This leads to (possibly) invalid memory accesses if
another device imports such a BO.

Fix that by providing sg that correctly describes TILER memory layout.
Align TILER allocations to page, so importer to be able to correctly set
its MMU if have one. Set export size accounting for the alignment. Also,
make sure to destroy sg on unpin, as it is no longer valid.

Tested on Motorola Droid4 by using GPU (sgx540) to render.

Suggested-by: Matthijs van Duin <matthijsvanduin@gmail.com>
Signed-off-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1637309180-31032-1-git-send-email-ivo.g.dimitrov.75@gmail.com
drivers/gpu/drm/omapdrm/omap_gem.c
drivers/gpu/drm/omapdrm/omap_gem.h
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c