drm/etnaviv: rework linear window offset calculation
authorLucas Stach <l.stach@pengutronix.de>
Mon, 3 May 2021 10:24:22 +0000 (12:24 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 3 May 2021 14:14:40 +0000 (16:14 +0200)
commit4bfdd2aa67fbfba09d7c32a4c7fd4c5eb1052bce
treed2906b7425c93d31c13358fa7f92486b43731294
parent0e63302dc1438e6f2846d1cd5f2fc36a28a824df
drm/etnaviv: rework linear window offset calculation

The current calculation based on the required_dma mask can be significantly
off, so that the linear window only overlaps a small part of the DRAM
address space. This can lead to the command buffer being unmappable, which
is obviously bad.

Rework the linear window offset calculation to be based on the command buffer
physical address, making sure that the command buffer is always mappable.

Tested-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c