dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: dri-devel@lists.freedesktop.org
Cc: tomi.valkeinen@ti.com, Jyri Sarha <jsarha@ti.com>,
	laurent.pinchart@ideasonboard.com
Subject: [PATCH] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats
Date: Tue, 7 Feb 2017 16:41:20 +0200	[thread overview]
Message-ID: <1486478480-1966-1-git-send-email-jsarha@ti.com> (raw)

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, 1 byte per pixel color format appear 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>
---
 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..61daef6 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_to_bpp(color_mode) > 8) {
+		/*
+		  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, 1 byte per pixel color format appear 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 (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

             reply	other threads:[~2017-02-07 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 14:41 Jyri Sarha [this message]
2017-02-08 11:25 ` [PATCH] drm/omapdrm: dispc: Refuse x-decimation above 4 for all but 8-bit formats Laurent Pinchart
2017-02-08 11:49   ` Tomi Valkeinen
2017-02-08 13:36   ` Jyri Sarha
2017-02-08 13:51 ` Tomi Valkeinen
2017-02-08 18:03   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486478480-1966-1-git-send-email-jsarha@ti.com \
    --to=jsarha@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).