All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats
@ 2017-02-08 14:08 Jyri Sarha
  2017-02-08 18:11 ` Laurent Pinchart
  2017-02-16 12:11 ` Tomi Valkeinen
  0 siblings, 2 replies; 3+ messages in thread
From: Jyri Sarha @ 2017-02-08 14:08 UTC (permalink / raw)
  To: dri-devel; +Cc: tomi.valkeinen, Jyri Sarha, laurent.pinchart

Let's disable all scaling that requires horizontal decimation with
higher factor than 4, until we have better estimates of what we can
and can not do. However, NV12 color format appears to work Ok with
all decimation factors.

When decimating horizontally by more that 4 the dss is not able to
fetch the data in burst mode. When this happens it is hard to tell if
there enough bandwidth. Despite what theory says this appears to be
true also for 16-bit color formats.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
Chnages since first version:
- "color_mode_to_bpp(color_mode) > 8" -> "color_mode != OMAP_DSS_COLOR_NV12"
  - commit message and comment updated too
- improve error print

 drivers/gpu/drm/omapdrm/dss/dispc.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 5554b72..d956e626 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2506,6 +2506,25 @@ static int dispc_ovl_calc_scaling_44xx(unsigned long pclk, unsigned long lclk,
 		return -EINVAL;
 	}
 
+	if (*decim_x > 4 && color_mode != OMAP_DSS_COLOR_NV12) {
+		/*
+		 * Let's disable all scaling that requires horizontal
+		 * decimation with higher factor than 4, until we have
+		 * better estimates of what we can and can not
+		 * do. However, NV12 color format appears to work Ok
+		 * with all decimation factors.
+		 *
+		 * When decimating horizontally by more that 4 the dss
+		 * is not able to fetch the data in burst mode. When
+		 * this happens it is hard to tell if there enough
+		 * bandwidth. Despite what theory says this appears to
+		 * be true also for 16-bit color formats.
+		 */
+		DSSERR("Not enough bandwidth, too much downscaling (x-decimation factor %d > 4)", *decim_x);
+
+		return -EINVAL;
+	}
+
 	*core_clk = dispc.feat->calc_core_clk(pclk, in_width, in_height,
 				out_width, out_height, mem_to_mem);
 	return 0;
-- 
1.9.1

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

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

* Re: [PATCH v2] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats
  2017-02-08 14:08 [PATCH v2] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats Jyri Sarha
@ 2017-02-08 18:11 ` Laurent Pinchart
  2017-02-16 12:11 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2017-02-08 18:11 UTC (permalink / raw)
  To: Jyri Sarha; +Cc: tomi.valkeinen, dri-devel

Hi Jyri,

Thank you for the patch.

On Wednesday 08 Feb 2017 16:08:06 Jyri Sarha wrote:
> Let's disable all scaling that requires horizontal decimation with
> higher factor than 4, until we have better estimates of what we can
> and can not do. However, NV12 color format appears to work Ok with
> all decimation factors.
> 
> When decimating horizontally by more that 4 the dss is not able to
> fetch the data in burst mode. When this happens it is hard to tell if
> there enough bandwidth. Despite what theory says this appears to be
> true also for 16-bit color formats.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> Chnages since first version:
> - "color_mode_to_bpp(color_mode) > 8" -> "color_mode != OMAP_DSS_COLOR_NV12"
> - commit message and comment updated too
> - improve error print
> 
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
> b/drivers/gpu/drm/omapdrm/dss/dispc.c index 5554b72..d956e626 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -2506,6 +2506,25 @@ static int dispc_ovl_calc_scaling_44xx(unsigned long
> pclk, unsigned long lclk, return -EINVAL;
>  	}
> 
> +	if (*decim_x > 4 && color_mode != OMAP_DSS_COLOR_NV12) {
> +		/*
> +		 * Let's disable all scaling that requires horizontal
> +		 * decimation with higher factor than 4, until we have
> +		 * better estimates of what we can and can not
> +		 * do. However, NV12 color format appears to work Ok
> +		 * with all decimation factors.
> +		 *
> +		 * When decimating horizontally by more that 4 the dss
> +		 * is not able to fetch the data in burst mode. When
> +		 * this happens it is hard to tell if there enough
> +		 * bandwidth. Despite what theory says this appears to
> +		 * be true also for 16-bit color formats.
> +		 */
> +		DSSERR("Not enough bandwidth, too much downscaling (x-
decimation factor
> %d > 4)", *decim_x); +
> +		return -EINVAL;
> +	}
> +
>  	*core_clk = dispc.feat->calc_core_clk(pclk, in_width, in_height,
>  				out_width, out_height, mem_to_mem);
>  	return 0;

-- 
Regards,

Laurent Pinchart

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

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

* Re: [PATCH v2] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats
  2017-02-08 14:08 [PATCH v2] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats Jyri Sarha
  2017-02-08 18:11 ` Laurent Pinchart
@ 2017-02-16 12:11 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2017-02-16 12:11 UTC (permalink / raw)
  To: Jyri Sarha, dri-devel; +Cc: laurent.pinchart


[-- Attachment #1.1.1: Type: text/plain, Size: 921 bytes --]

On 08/02/17 16:08, Jyri Sarha wrote:
> Let's disable all scaling that requires horizontal decimation with
> higher factor than 4, until we have better estimates of what we can
> and can not do. However, NV12 color format appears to work Ok with
> all decimation factors.
> 
> When decimating horizontally by more that 4 the dss is not able to
> fetch the data in burst mode. When this happens it is hard to tell if
> there enough bandwidth. Despite what theory says this appears to be
> true also for 16-bit color formats.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
> Chnages since first version:
> - "color_mode_to_bpp(color_mode) > 8" -> "color_mode != OMAP_DSS_COLOR_NV12"
>   - commit message and comment updated too
> - improve error print
> 
>  drivers/gpu/drm/omapdrm/dss/dispc.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)

Thanks, I've picked this up.

 Tomi


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-08 14:08 [PATCH v2] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats Jyri Sarha
2017-02-08 18:11 ` Laurent Pinchart
2017-02-16 12:11 ` Tomi Valkeinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.