diff mbox series

[v3,6/8] drm/omap: cleanup OMAP_BO_SCANOUT use

Message ID 20191007112555.25278-7-jjhiblot@ti.com
State Superseded
Headers show
Series None | expand

Commit Message

Jean-Jacques Hiblot Oct. 7, 2019, 11:25 a.m. UTC
From: Tomi Valkeinen <tomi.valkeinen@ti.com>

omap_gem_new() has a comment about OMAP_BO_SCANOUT which does not make
sense. Also, for the TILER case, we drop OMAP_BO_SCANOUT flag for some
reason.

It's not clear what the original purpose of OMAP_BO_SCANOUT is, but
presuming it means "scanout buffer, something that can be consumed by
DSS", this patch cleans up the above issues.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_gem.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Jean-Jacques Hiblot Oct. 8, 2019, 3:57 p.m. UTC | #1
On 07/10/2019 13:25, Jean-Jacques Hiblot wrote:
> From: Tomi Valkeinen <tomi.valkeinen@ti.com>
>
> omap_gem_new() has a comment about OMAP_BO_SCANOUT which does not make
> sense. Also, for the TILER case, we drop OMAP_BO_SCANOUT flag for some
> reason.
>
> It's not clear what the original purpose of OMAP_BO_SCANOUT is, but
> presuming it means "scanout buffer, something that can be consumed by
> DSS", this patch cleans up the above issues.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>   drivers/gpu/drm/omapdrm/omap_gem.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
> index 4e8fcfdff3a0..27e0a2f8508a 100644
> --- a/drivers/gpu/drm/omapdrm/omap_gem.c
> +++ b/drivers/gpu/drm/omapdrm/omap_gem.c
> @@ -1155,7 +1155,6 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
>   		 * Tiled buffers are always shmem paged backed. When they are
>   		 * scanned out, they are remapped into DMM/TILER.
>   		 */
> -		flags &= ~OMAP_BO_SCANOUT;
>   		flags |= OMAP_BO_MEM_SHMEM;
>   
>   		/*
> @@ -1166,9 +1165,8 @@ struct drm_gem_object *omap_gem_new(struct drm_device *dev,
>   		flags |= tiler_get_cpu_cache_flags();
>   	} else if ((flags & OMAP_BO_SCANOUT) && !priv->has_dmm) {
>   		/*
> -		 * OMAP_BO_SCANOUT hints that the buffer doesn't need to be
> -		 * tiled. However, to lower the pressure on memory allocation,
> -		 * use contiguous memory only if no TILER is available.
> +		 * If we don't have DMM, we must allocate scanout buffers
> +		 * from contiguous DMA memory.
>   		 */
>   		flags |= OMAP_BO_MEM_DMA_API;
>   	} else if (!(flags & OMAP_BO_MEM_DMABUF)) {
Reviewed-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index 4e8fcfdff3a0..27e0a2f8508a 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -1155,7 +1155,6 @@  struct drm_gem_object *omap_gem_new(struct drm_device *dev,
 		 * Tiled buffers are always shmem paged backed. When they are
 		 * scanned out, they are remapped into DMM/TILER.
 		 */
-		flags &= ~OMAP_BO_SCANOUT;
 		flags |= OMAP_BO_MEM_SHMEM;
 
 		/*
@@ -1166,9 +1165,8 @@  struct drm_gem_object *omap_gem_new(struct drm_device *dev,
 		flags |= tiler_get_cpu_cache_flags();
 	} else if ((flags & OMAP_BO_SCANOUT) && !priv->has_dmm) {
 		/*
-		 * OMAP_BO_SCANOUT hints that the buffer doesn't need to be
-		 * tiled. However, to lower the pressure on memory allocation,
-		 * use contiguous memory only if no TILER is available.
+		 * If we don't have DMM, we must allocate scanout buffers
+		 * from contiguous DMA memory.
 		 */
 		flags |= OMAP_BO_MEM_DMA_API;
 	} else if (!(flags & OMAP_BO_MEM_DMABUF)) {