dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/etnaviv: move linear window on MC1.0 parts if necessary
@ 2016-12-02 11:29 Lucas Stach
  2016-12-02 12:06 ` Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas Stach @ 2016-12-02 11:29 UTC (permalink / raw)
  To: dri-devel; +Cc: Marek Vasut, Russell King

On i.MX6SX the physical memory is placed above the 2GB mark, so the GPU
linear window has to be moved for the GPU to work at all. This doesn't
mix with the FAST_CLEAR feature, as the TS unit doesn't take the linear
window offset into account and will corrupt memory when used with a
non-zero offset.

Move the linear window if it's necessary for the GPU to work, but avoid
announcing FAST_CLEAR support to userspace in this case.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
index b1254f885fed..4b697ad8bd64 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
@@ -639,6 +639,10 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
 			gpu->memory_base = PHYS_OFFSET;
 		else
 			gpu->memory_base = dma_mask - SZ_2G + 1;
+	} else if (PHYS_OFFSET >= SZ_2G) {
+		dev_info(gpu->dev, "Need to move linear window on MC1.0, disabling TS\n");
+		gpu->memory_base = PHYS_OFFSET;
+		gpu->identity.features &= ~chipFeatures_FAST_CLEAR;
 	}
 
 	ret = etnaviv_hw_reset(gpu);
-- 
2.10.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/etnaviv: move linear window on MC1.0 parts if necessary
  2016-12-02 11:29 [PATCH] drm/etnaviv: move linear window on MC1.0 parts if necessary Lucas Stach
@ 2016-12-02 12:06 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2016-12-02 12:06 UTC (permalink / raw)
  To: Lucas Stach, dri-devel; +Cc: Russell King

On 12/02/2016 12:29 PM, Lucas Stach wrote:
> On i.MX6SX the physical memory is placed above the 2GB mark, so the GPU
> linear window has to be moved for the GPU to work at all. This doesn't
> mix with the FAST_CLEAR feature, as the TS unit doesn't take the linear
> window offset into account and will corrupt memory when used with a
> non-zero offset.
> 
> Move the linear window if it's necessary for the GPU to work, but avoid
> announcing FAST_CLEAR support to userspace in this case.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

On MX6SX:
Tested-by: Marek Vasut <marex@denx.de>

> ---
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> index b1254f885fed..4b697ad8bd64 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c
> @@ -639,6 +639,10 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu)
>  			gpu->memory_base = PHYS_OFFSET;
>  		else
>  			gpu->memory_base = dma_mask - SZ_2G + 1;
> +	} else if (PHYS_OFFSET >= SZ_2G) {
> +		dev_info(gpu->dev, "Need to move linear window on MC1.0, disabling TS\n");
> +		gpu->memory_base = PHYS_OFFSET;
> +		gpu->identity.features &= ~chipFeatures_FAST_CLEAR;
>  	}
>  
>  	ret = etnaviv_hw_reset(gpu);
> 


-- 
Best regards,
Marek Vasut
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-02 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-02 11:29 [PATCH] drm/etnaviv: move linear window on MC1.0 parts if necessary Lucas Stach
2016-12-02 12:06 ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).