armbian_build/patch/kernel/archive/meson-6.9/0047-drm-meson-Use-24-bits-per-pixel-for-the-framebuffer-.patch
2024-06-06 13:32:13 +02:00

68 lines
2.5 KiB
Diff

From 31af191867e9272d80820cc452e3c209a24713fa Mon Sep 17 00:00:00 2001
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Date: Sun, 26 Apr 2020 00:00:09 +0200
Subject: [PATCH 47/96] drm/meson: Use 24 bits per pixel for the framebuffer on
Meson8/8b/8m2
All SoC generations before GXBB don't have a way to configure the
alpha value for DRM_FORMAT_XRGB8888 and DRM_FORMAT_XBGR8888. These
formats have an X component instead of an alpha component. On
Meson8/8b/8m2 there is no way to configure the alpha value to use
instead of the X component. This results in the fact that the
formats with X component are only supported on GXBB and newer. Use
24 bits per pixel and therefore DRM_FORMAT_RGB888 to get a
working framebuffer console.
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
drivers/gpu/drm/meson/meson_drv.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 17a5cca00..60298cf3b 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -159,6 +159,30 @@ static void meson_vpu_init(struct meson_drm *priv)
writel_relaxed(value, priv->io_base + _REG(VPU_WRARB_MODE_L2C1));
}
+static void meson_fbdev_setup(struct meson_drm *priv)
+{
+ unsigned int preferred_bpp;
+
+ /*
+ * All SoC generations before GXBB don't have a way to configure the
+ * alpha value for DRM_FORMAT_XRGB8888 and DRM_FORMAT_XBGR8888. These
+ * formats have an X component instead of an alpha component. On
+ * Meson8/8b/8m2 there is no way to configure the alpha value to use
+ * instead of the X component. This results in the fact that the
+ * formats with X component are only supported on GXBB and newer. Use
+ * 24 bits per pixel and therefore DRM_FORMAT_RGB888 to get a
+ * working framebuffer console.
+ */
+ if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_M8) ||
+ meson_vpu_is_compatible(priv, VPU_COMPATIBLE_M8B) ||
+ meson_vpu_is_compatible(priv, VPU_COMPATIBLE_M8M2))
+ preferred_bpp = 24;
+ else
+ preferred_bpp = 32;
+
+ drm_fbdev_dma_setup(priv->drm, preferred_bpp);
+}
+
struct meson_drm_soc_attr {
struct meson_drm_soc_limits limits;
const struct soc_device_attribute *attrs;
@@ -362,7 +386,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
if (ret)
goto uninstall_irq;
- drm_fbdev_dma_setup(drm, 32);
+ meson_fbdev_setup(priv);
return 0;
--
2.45.1