aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/ipu-v3/ipu-di.c
diff options
context:
space:
mode:
authorSebastian Reichel <sebastian.reichel@collabora.com>2021-04-29 00:29:50 +0200
committerPhilipp Zabel <p.zabel@pengutronix.de>2021-05-10 16:39:54 +0200
commit94dfec48fca756cef90263a03e81f24dae24a5c6 (patch)
tree5caa755bfb7e6323a8e86c4d3ac767d74bddf996 /drivers/gpu/ipu-v3/ipu-di.c
parentdrm/imx: Annotate dma-fence critical section in commit path (diff)
downloadlinux-dev-94dfec48fca756cef90263a03e81f24dae24a5c6.tar.xz
linux-dev-94dfec48fca756cef90263a03e81f24dae24a5c6.zip
drm/imx: Add 8 pixel alignment fix
Some standard resolutions like 1366x768 do not work properly with i.MX6 SoCs, since the horizontal resolution needs to be aligned to 8 pixels (so 1360x768 or 1368x768 would work). This patch allocates framebuffers allocated to 8 pixels. The extra time required to send the extra pixels are removed from the blank time. In order to expose the correct display size to userspace, the stride is increased without increasing the width. Without this patch systems with this display resolution hang indefinitely during boot up. Suggested-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20210428222953.235280-3-sebastian.reichel@collabora.com Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/ipu-v3/ipu-di.c')
-rw-r--r--drivers/gpu/ipu-v3/ipu-di.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-di.c b/drivers/gpu/ipu-v3/ipu-di.c
index e617f60afeea..666223c6bec4 100644
--- a/drivers/gpu/ipu-v3/ipu-di.c
+++ b/drivers/gpu/ipu-v3/ipu-di.c
@@ -506,6 +506,13 @@ int ipu_di_adjust_videomode(struct ipu_di *di, struct videomode *mode)
{
u32 diff;
+ if (!IS_ALIGNED(mode->hactive, 8) &&
+ mode->hfront_porch < ALIGN(mode->hactive, 8) - mode->hactive) {
+ dev_err(di->ipu->dev, "hactive %d is not aligned to 8 and front porch is too small to compensate\n",
+ mode->hactive);
+ return -EINVAL;
+ }
+
if (mode->vfront_porch >= 2)
return 0;