Skip to contentSkip to conversation

dt-bindings: lcdif: Add compatible for i.MX8MP

PATCH Superseded Marek Vasut 2 participants 3 messages May 19, 2022

Subsystems (5)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Marek Vasut

author maintainer
#0 lore raw

PATCH v3 1/2 dt-bindings: lcdif: Add compatible for i.MX8MP

Add compatible string for i.MX8MP LCDIF variant. This is called LCDIFv3 and is completely different from the LCDIFv3 found in i.MX23 in that it has a completely scrambled register layout compared to all previous LCDIF variants. The new LCDIFv3 also supports 36bit address space. However, except for the complete bit reshuffling, this is still LCDIF and it still works like one.

Cc Alexander Stein <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Peng Fan <[email protected]>
Cc Rob Herring <[email protected]>
Cc Robby Cai <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stefan Agner <[email protected]>

---
V2: No change
V3: No change

---
 Documentation/devicetree/bindings/display/fsl,lcdif.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/display/fsl,lcdif.yaml +1 -0
index 900a56cae80e6..876015a44a1e6 100644
@@ -20,6 +20,7 @@ properties:
           - fsl,imx23-lcdif
           - fsl,imx28-lcdif
           - fsl,imx6sx-lcdif
+          - fsl,imx8mp-lcdif
       - items:
           - enum:
               - fsl,imx6sl-lcdif
Signature · 1 line
2.35.1
author maintainer
#1 lore raw

PATCH v3 2/2 drm: lcdif: Add support for i.MX8MP LCDIF variant

Add support for i.MX8MP LCDIF variant. This is called LCDIFv3 and is completely different from the LCDIFv3 found in i.MX23 in that it has a completely scrambled register layout compared to all previous LCDIF variants. The new LCDIFv3 also supports 36bit address space.

Add a separate driver which is really a fork of MXSFB driver with the i.MX8MP LCDIF variant handling filled in.

Cc Alexander Stein <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Peng Fan <[email protected]>
Cc Robby Cai <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Stefan Agner <[email protected]>

---
V2: - Drop the pitch check from lcdif_fb_create()
- Drop connector caching
- Wait for shadow load bit to be cleared in IRQ handler
- Make all clock mandatory and grab them all by name
- Wait for EN to be cleared in lcdif_disable_controller
- Rename to imx-lcdif
- Move shadow load to atomic_flush
V3: - Invert DE polarity to match MX8MPRM datasheet
- Enable CSC in RGB to YUV mode for MEDIA_BUS_FMT_UYVY8_1X16

---
 drivers/gpu/drm/mxsfb/Kconfig      |  16 +
 drivers/gpu/drm/mxsfb/Makefile     |   2 +
 drivers/gpu/drm/mxsfb/lcdif_drv.c  | 361 ++++++++++++++++++++
 drivers/gpu/drm/mxsfb/lcdif_drv.h  |  47 +++
 drivers/gpu/drm/mxsfb/lcdif_kms.c  | 507 +++++++++++++++++++++++++++++
 drivers/gpu/drm/mxsfb/lcdif_regs.h | 257 +++++++++++++++
 6 files changed, 1190 insertions(+)
 create mode 100644 drivers/gpu/drm/mxsfb/lcdif_drv.c
 create mode 100644 drivers/gpu/drm/mxsfb/lcdif_drv.h
 create mode 100644 drivers/gpu/drm/mxsfb/lcdif_kms.c
 create mode 100644 drivers/gpu/drm/mxsfb/lcdif_regs.h
drivers/gpu/drm/mxsfb/Kconfig +16 -0
index 987170e16ebd6..873551b4552f5 100644
@@ -19,3 +19,19 @@ config DRM_MXSFB
 	  i.MX28, i.MX6SX, i.MX7 and i.MX8M).
 
 	  If M is selected the module will be called mxsfb.
+
+config DRM_IMX_LCDIF
+	tristate "i.MX LCDIFv3 LCD controller"
+	depends on DRM && OF
+	depends on COMMON_CLK
+	select DRM_MXS
+	select DRM_KMS_HELPER
+	select DRM_GEM_CMA_HELPER
+	select DRM_PANEL
+	select DRM_PANEL_BRIDGE
+	help
+	  Choose this option if you have an LCDIFv3 LCD controller.
+	  Those devices are found in various i.MX SoC (i.MX8MP,
+	  i.MXRT).
+
+	  If M is selected the module will be called imx-lcdif.
drivers/gpu/drm/mxsfb/Makefile +2 -0
index 26d153896d720..3fa44059b9d85 100644
@@ -1,3 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0-only
 mxsfb-y := mxsfb_drv.o mxsfb_kms.o
 obj-$(CONFIG_DRM_MXSFB)	+= mxsfb.o
+imx-lcdif-y := lcdif_drv.o lcdif_kms.o
+obj-$(CONFIG_DRM_IMX_LCDIF) += imx-lcdif.o
drivers/gpu/drm/mxsfb/lcdif_drv.c new file +361 -0

361 lines not on this page · raw message

drivers/gpu/drm/mxsfb/lcdif_drv.h new file +47 -0

47 lines not on this page · raw message

drivers/gpu/drm/mxsfb/lcdif_kms.c new file +507 -0

507 lines not on this page · raw message

drivers/gpu/drm/mxsfb/lcdif_regs.h new file +257 -0

257 lines not on this page · raw message

Signature · 1 line
2.35.1
#2 lore raw

Re: [PATCH v3 2/2] drm: lcdif: Add support for i.MX8MP LCDIF variant

I love your patch! Perhaps something to improve:

Hi Marek,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on drm-exynos/exynos-drm-next drm-intel/for-linux-next drm-tip/drm-tip tegra-drm/drm/tegra/for-next v5.18-rc7] [cannot apply to airlied/drm-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/intel-lab-lkp/linux/commits/Marek-Vasut/dt-bindings-lcdif-Add-compatible-for-i-MX8MP/20220519-084546
base:   git://anongit.freedesktop.org/drm/drm drm-next
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220519/[email protected]/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0
reproduce (this is a W=1 build):
        # https://github.com/intel-lab-lkp/linux/commit/85568e7c941f3751b0a6da9e7f14ee9b5593260b
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Marek-Vasut/dt-bindings-lcdif-Add-compatible-for-i-MX8MP/20220519-084546
        git checkout 85568e7c941f3751b0a6da9e7f14ee9b5593260b
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/drm/mxsfb/

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/mxsfb/lcdif_kms.c:461:18: warning: 'lcdif_overlay_plane_formats' defined but not used [-Wunused-const-variable=]
     461 | static const u32 lcdif_overlay_plane_formats[] = {
         |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/lcdif_overlay_plane_formats +461 drivers/gpu/drm/mxsfb/lcdif_kms.c

460

 > 461	static const u32 lcdif_overlay_plane_formats[] = {

462 DRM_FORMAT_XRGB4444,
463 DRM_FORMAT_ARGB4444,
464 DRM_FORMAT_XRGB1555,
465 DRM_FORMAT_ARGB1555,
466 DRM_FORMAT_RGB565,
467 DRM_FORMAT_XRGB8888,
468 DRM_FORMAT_ARGB8888,
469 };
470

Signature · 2 lines
0-DAY CI Kernel Test Service
https://01.org/lkp