diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2018-01-22 14:28:10 +0300 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2018-03-09 14:22:38 +0300 |
commit | 1137bef67a11d2e5a4f44ce87b6e4dd1fb7a0163 (patch) | |
tree | 36e420b39c46a20ee01ef735569b65f0ec57b016 /drivers/gpu/drm/etnaviv/etnaviv_buffer.c | |
parent | c997c3df0e89f710f2d7ad9197e5e3c5e3ecc4e4 (diff) | |
download | linux-1137bef67a11d2e5a4f44ce87b6e4dd1fb7a0163.tar.xz |
drm/etnaviv: add function to load the initial PTA state
On GPUs with the security feature the MTLB config is stored in the PTA.
Add a function to trigger the initial PTA load through the FE.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_buffer.c')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_buffer.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c index 99ad2f073c6e..bfc6d4aa3b7c 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_buffer.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_buffer.c @@ -215,6 +215,24 @@ u16 etnaviv_buffer_config_mmuv2(struct etnaviv_gpu *gpu, u32 mtlb_addr, u32 safe return buffer->user_size / 8; } +u16 etnaviv_buffer_config_pta(struct etnaviv_gpu *gpu) +{ + struct etnaviv_cmdbuf *buffer = &gpu->buffer; + + lockdep_assert_held(&gpu->lock); + + buffer->user_size = 0; + + CMD_LOAD_STATE(buffer, VIVS_MMUv2_PTA_CONFIG, + VIVS_MMUv2_PTA_CONFIG_INDEX(0)); + + CMD_END(buffer); + + buffer->user_size = ALIGN(buffer->user_size, 8); + + return buffer->user_size / 8; +} + void etnaviv_buffer_end(struct etnaviv_gpu *gpu) { struct etnaviv_cmdbuf *buffer = &gpu->buffer; |