drm/etnaviv: fix DMA direction handling for cached RW buffers
[ Upstream commit 58979ad6330a70450ed78837be3095107d022ea9 ]
The dma sync operation needs to be done with DMA_BIDIRECTIONAL when
the BO is prepared for both read and write operations.
Fixes: a8c21a5451
("drm/etnaviv: add initial etnaviv DRM driver")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
6ef4f1e981
commit
cd105977b1
@ -364,9 +364,11 @@ static void *etnaviv_gem_vmap_impl(struct etnaviv_gem_object *obj)
|
||||
|
||||
static inline enum dma_data_direction etnaviv_op_to_dma_dir(u32 op)
|
||||
{
|
||||
if (op & ETNA_PREP_READ)
|
||||
op &= ETNA_PREP_READ | ETNA_PREP_WRITE;
|
||||
|
||||
if (op == ETNA_PREP_READ)
|
||||
return DMA_FROM_DEVICE;
|
||||
else if (op & ETNA_PREP_WRITE)
|
||||
else if (op == ETNA_PREP_WRITE)
|
||||
return DMA_TO_DEVICE;
|
||||
else
|
||||
return DMA_BIDIRECTIONAL;
|
||||
|
Loading…
Reference in New Issue
Block a user