6bf4e59dcf541d80863a00fe64ceba3f0eabda07
[openwrt/staging/stintel.git] /
1 From 813cf104c571bf54e155d6be247c32a8f6aa3e2e Mon Sep 17 00:00:00 2001
2 From: Fancy Fang <chen.fang@nxp.com>
3 Date: Wed, 6 Jun 2018 23:20:43 +0800
4 Subject: [PATCH] MLK-18535-6 drm/imx: core: add LCDIF support
5
6 Allows the LCDIF to be one of the supported client
7 components. And set the 'legacyfb_depth' of LCDIF
8 to be 32.
9
10 Signed-off-by: Fancy Fang <chen.fang@nxp.com>
11 ---
12 drivers/gpu/drm/imx/imx-drm-core.c | 13 +++++++++++++
13 1 file changed, 13 insertions(+)
14
15 --- a/drivers/gpu/drm/imx/imx-drm-core.c
16 +++ b/drivers/gpu/drm/imx/imx-drm-core.c
17 @@ -12,6 +12,7 @@
18 #include <linux/platform_device.h>
19
20 #include <video/imx-ipu-v3.h>
21 +#include <video/imx-lcdif.h>
22
23 #include <drm/drm_atomic.h>
24 #include <drm/drm_atomic_helper.h>
25 @@ -110,6 +111,18 @@ static int compare_of(struct device *dev
26 struct dpu_client_platformdata *pdata = dev->platform_data;
27
28 return pdata->of_node == np;
29 + } else if (strcmp(dev->driver->name, "imx-lcdif-crtc") == 0) {
30 + struct lcdif_client_platformdata *pdata = dev->platform_data;
31 +#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
32 + /* set legacyfb_depth to be 32 for lcdif, since
33 + * default format of the connectors attached to
34 + * lcdif is usually RGB888
35 + */
36 + if (pdata->of_node == np)
37 + legacyfb_depth = 32;
38 +#endif
39 +
40 + return pdata->of_node == np;
41 }
42
43 /* Special case for LDB, one device for two channels */