Commit Graph

6 Commits

Author SHA1 Message Date
Liu Ying
13c71ee35e LF-4887-6 drm/imx: lcdif: Add MPU interface(8080 mode) support
This patch adds MPU interface(8080 mode) support in the LCDIF driver
so that LCDIF may send frames to the sec-dsim MIPI DSI controller embedded
in i.MX8mm/mn via that interface.  From the MIPI DSI controller perspective,
the input interface is called S-i80(Synchronous i80 Interface).

The general idea is to leverage the self refresh(SR) helpers offered by the
DRM core to make the external display device enter self refresh mode and
hence disable LCDIF when appropriate.  The relevant DRM connectors'
conn_state->self_refresh_aware flags are inspected to determine whether to
use MPU interface or DOTCLK interface(also called RGB interface).

Since LCDIF will be disabled when the self refresh is active and the data
is transferred at modest rate, there are below known limitations:

1) The cur_frame_done interrupt comes at a lower frequency than the
   display vsync signal frequency due to the low data transfer rate.
   So, vblank events cannot reflect the real vsync pulses of the external
   display.

2) Screen tearing phenomenon can be seen, because the frame update is
   asynchronous to the external display self refresh and the LCDIF
   controller does not support the 'Tearing Effect' mechanism.

3) The fbdev emulation and boot logo can not be updated onto screen in
   time, because the external display often enters self refresh mode at
   those stages.  The boot logo will show up until the next time when
   frame is sent to the external display via the MPU interface, e.g., when
   the next framebuffer pan display operation is done after the logo is
   ready in framebuffer.  Like the below command line, writing to the
   framebuffer sys node 'pan' frequently at background may make the
   framebuffer emulation be a bit responsive.

while true; do echo 0,0 > /sys/class/graphics/fb0/pan; sleep 1; done &

Cc: Sandor Yu <Sandor.yu@nxp.com>
Cc: Wujian sun <wujian.sun_1@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2023-10-30 17:59:54 +08:00
Fancy Fang
80207c0d16 LF-2653 drm/imx: lcdif: implement mode_valid() for CRTC
Add mode_valid() implementation for CRTC to filter out any
mode which cannot be supported by LCDIF. Only check the
CEA and DMT modes for pixel clock round rate is same with
the value from mode.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit d9be4b3d3b)
[ Liu Ying: Squash a build fix due to rebase upon v5.19-rc7 ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2023-10-30 17:59:53 +08:00
Fancy Fang
3dc5958234 MLK-19158-2 drm/imx: lcdif: improve output bus format config
According to LCDIF specification, the input pixel data
width and the output pixel data width can be different,
and this conversion is done by LCDIF automatically. So
config the output data width according to the requested
bus format from the encoder, instead to be same with the
input pixel data width.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit bfd27f6d71d86a7f2fc8314f082565db3682b925)
2023-10-30 17:59:49 +08:00
Fancy Fang
aae912d4d4 MLK-19152-1 gpu: imx: lcdif: realize fb horizontal crop via Pigeon Mode
According to the LCDIF specification, the Legacy Mode does not
support cropping function in the horizontal direction, so add
Pigeon Mode which can support this kind of function. And when
enable this mode, the legacy horizontal timings configuration
should use stride value but not the active width, and related
pigeon configuration should use the active width but not the
stride value.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e6da9542693dd585972897f62748a101f5726a74)
2023-10-30 17:59:49 +08:00
Fancy Fang
6943ec08e7 MLK-18560 drm/imx: lcdif: refine bus format sanity check for plane
Add an function to get the LCDIF controller supported bus
formats according to the pixel format bpp. And change the
bus format sanity check in the plane's atomic check to see
if the bus format required by the peripheral attached to
LCDIF can be supported by LCDIF.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2023-10-30 17:59:48 +08:00
Fancy Fang
e7706d8f95 MLK-18535-3 gpu: imx: add LCDIF core driver
The LCDIF core driver is responsible to provide controller
registers configuration and create the platform devices for
the child port nodes. And the platform devices later will
attach to the corresponding DRM/KMS drivers via name match.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
[ Aisheng: Kconfig & Makefile update for a clean base ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
[ Liu Ying: Remove drm_get_format_name() ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Liu Ying: Rename driver from imx-lcdif to imx8mm-lcdif ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Liu Ying: Use SET_LATE_SYSTEM_SLEEP_PM_OPS ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Liu Ying: Change CONFIG_IMX_LCDIF_CORE to CONFIG_IMX8MM_LCDIF_CORE ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
2023-10-30 17:59:48 +08:00