1
0
Fork 0
Commit Graph

112 Commits (redonkable)

Author SHA1 Message Date
Fancy Fang 1a04575706 gpu: imx: lcdif: fix build warnings if CONFIG_PM_SLEEP off
When CONFIG_PM_SLEEP is disabled, the suspend and resume hooks
are implemented as dummy functions, but GCC will report below
build warnings:

drivers/gpu/imx/lcdif/lcdif-common.c:731:12: warning: ‘imx_lcdif_suspend’ defined but not used [-Wunused-function]
 static int imx_lcdif_suspend(struct device *dev)
            ^
drivers/gpu/imx/lcdif/lcdif-common.c:735:12: warning: ‘imx_lcdif_resume’ defined but not used [-Wunused-function]
 static int imx_lcdif_resume(struct device *dev)
            ^

So remove these dummy functions to avoid these build warnings.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2019-11-25 15:59:36 +08:00
Fancy Fang 2b13ac2aba drm/imx: lcdif: change DISPMIX reset for IMX8MN
According to the design spec for IMX8MN platform, the GPR reset
module for DISPMIX has some changes. So the reset code should be
adjusted accordingly. This is a temporary solution and will be
improved later.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2019-11-25 15:59:34 +08:00
Fancy Fang 4d24275a91 MLK-19158-3 gpu: imx: lcdif: fix output order for 16bpp BGR formats
The 16bpp BGR order pixel formats 'DRM_FORMAT_ABGR1555' and
'DRM_FORMAT_XBGR1555' also require to be re-ordered to RGB
order for display, just like the format 'DRM_FORMAT_BGR565'
does.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f5cc4f4699570fe697d21cb47c54aa91b82c8458)
2019-11-25 15:59:24 +08:00
Fancy Fang 028b9481aa 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)
2019-11-25 15:59:24 +08:00
Fancy Fang 5757e468fc 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)
2019-11-25 15:59:22 +08:00
Fancy Fang e662645ff4 MLK-19112 gpu: imx: lcdif: change 'rpm_suspended' to be atomic counter
Change the 'rpm_suspended' field to be an atomic type from
boolean type to make it have the counting ability which can
help to detect and avoid runtime suspend and resume calls
mismatch caused problems.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit dece6fbe51f9c0ea3cd42c52e1c174bd26ae70f1)
2019-11-25 15:59:21 +08:00
Fancy Fang dc64834b84 MLK-19017-4 gpu: imx: lcdif: add rpm status check for suspend/resume
Add runtime PM status check during runtime suspend and resume
to avoid unnecessary jobs if it is already in that state which
can avoid below kernel warnings during system suspend if it is
alreay in runtime suspended state:

[   21.772969] ------------[ cut here ]------------
[   21.772982] WARNING: CPU: 3 PID: 3328 at drivers/clk/clk.c:594 clk_core_disable+0x80/0x88
[   21.772986] Modules linked in:
[   21.772988]
[   21.772993] CPU: 3 PID: 3328 Comm: rtcwakeup.out Not tainted 4.9.88-05410-g9fa23e9ada2a #135
[   21.772995] Hardware name: FSL i.MX8MM EVK board (DT)
[   21.772997] task: ffff800074358c80 task.stack: ffff80007b40c000
[   21.773000] PC is at clk_core_disable+0x80/0x88
[   21.773003] LR is at clk_core_disable_lock+0x20/0x34
[   21.773005] pc : [<ffff0000084e1430>] lr : [<ffff0000084e1a5c>] pstate: 800001c5
[   21.773007] sp : ffff80007b40fa90
[   21.773010] x29: ffff80007b40fa90 x28: 0000000000000000
[   21.773014] x27: 0000000000000002 x26: ffff000009395000
[   21.773017] x25: ffff00000863473c x24: ffff0000092de3d0
[   21.773021] x23: ffff80007a53f870 x22: 0000000000000000
[   21.773024] x21: ffff00000862877c x20: ffff80007a049400
[   21.773027] x19: 0000000000000140 x18: 0000000000000002
[   21.773031] x17: 0000ffff93824858 x16: ffff00000822a200
[   21.773034] x15: 0000463fe3000000 x14: 0000000000000000
[   21.773037] x13: 0000000000000000 x12: 0000000000000000
[   21.773040] x11: 0000000000000000 x10: 0000000000000000
[   21.773044] x9 : 0000000040000000 x8 : 0000000000210d00
[   21.773047] x7 : 0000000000000000 x6 : 0010ed7f00000000
[   21.773051] x5 : ffff80007a53f9a8 x4 : 0000000000000000
[   21.773054] x3 : 0000000010c110c0 x2 : 0000000000000000
[   21.773057] x1 : 0000000000000000 x0 : ffff80007a049400
[   21.773058]
[   21.773060] ---[ end trace 4a8e187491f145ed ]---
[   21.773062] Call trace:
[   21.773065] Exception stack(0xffff80007b40f8b0 to 0xffff80007b40f9e0)
[   21.773068] f8a0:                                   0000000000000140 0000ffffffffffff
[   21.773071] f8c0: ffff80007b40fa90 ffff0000084e1430 00000000800001c5 000000000000003d
[   21.773074] f8e0: ffff80007b475c00 ffff80007b40c000 ffff80007b40c000 000000018020001e
[   21.773077] f900: ffff000008c53cec ffff80007b40c000 ffff80007b40f950 ffff0000085d3b9c
[   21.773081] f920: ffff80007b40f9b0 ffff0000085f3728 ffff80007b475c00 ffff80007b475c00
[   21.773084] f940: ffff80007b40f990 ffff0000085f2430 ffff80007b475c00 ffff80007abf8800
[   21.773087] f960: ffff80007a049400 0000000000000000 0000000000000000 0000000010c110c0
[   21.773090] f980: 0000000000000000 ffff80007a53f9a8 0010ed7f00000000 0000000000000000
[   21.773092] f9a0: 0000000000210d00 0000000040000000 0000000000000000 0000000000000000
[   21.773095] f9c0: 0000000000000000 0000000000000000 0000000000000000 0000463fe3000000
[   21.773098] [<ffff0000084e1430>] clk_core_disable+0x80/0x88
[   21.773101] [<ffff0000084e1a5c>] clk_core_disable_lock+0x20/0x34
[   21.773104] [<ffff0000084e1a8c>] clk_disable+0x1c/0x24
[   21.773110] [<ffff0000085c73a0>] lcdif_disable_clocks+0x1c/0x60
[   21.773113] [<ffff0000085c7718>] imx_lcdif_suspend+0x10/0x24
[   21.773118] [<ffff0000086287a0>] platform_pm_suspend+0x24/0x50
[   21.773123] [<ffff000008633b58>] dpm_run_callback.isra.12+0x30/0x8c
[   21.773126] [<ffff0000086345d4>] __device_suspend+0x110/0x278
[   21.773129] [<ffff000008635800>] dpm_suspend+0x114/0x240
[   21.773132] [<ffff000008635bfc>] dpm_suspend_start+0x6c/0x78
[   21.773137] [<ffff000008104e28>] suspend_devices_and_enter+0xbc/0x534
[   21.773139] [<ffff0000081054f8>] pm_suspend+0x258/0x2f4
[   21.773142] [<ffff000008104030>] state_store+0x80/0xf4
[   21.773147] [<ffff0000083e7ce8>] kobj_attr_store+0x14/0x24
[   21.773153] [<ffff00000825d974>] sysfs_kf_write+0x40/0x48
[   21.773156] [<ffff00000825cd48>] kernfs_fop_write+0xb8/0x1cc
[   21.773160] [<ffff0000081e2d00>] __vfs_write+0x28/0x110
[   21.773163] [<ffff0000081e3ae4>] vfs_write+0xa8/0x1a8
[   21.773166] [<ffff0000081e4ea0>] SyS_write+0x44/0xa0
[   21.773170] [<ffff0000080838d8>] __sys_trace_return+0x0/0x4
[   21.773184] ------------[ cut here ]------------
[   21.773188] WARNING: CPU: 3 PID: 3328 at drivers/clk/clk.c:476 clk_core_unprepare+0x88/0x98
[   21.773190] Modules linked in:
[   21.773192]
[   21.773195] CPU: 3 PID: 3328 Comm: rtcwakeup.out Tainted: G        W       4.9.88-05410-g9fa23e9ada2a #135
[   21.773196] Hardware name: FSL i.MX8MM EVK board (DT)
[   21.773198] task: ffff800074358c80 task.stack: ffff80007b40c000
[   21.773201] PC is at clk_core_unprepare+0x88/0x98
[   21.773204] LR is at clk_unprepare+0x28/0x34
[   21.773206] pc : [<ffff0000084e1320>] lr : [<ffff0000084e3130>] pstate: 60000145
[   21.773208] sp : ffff80007b40faa0
[   21.773211] x29: ffff80007b40faa0 x28: 0000000000000000
[   21.773215] x27: 0000000000000002 x26: ffff000009395000
[   21.773218] x25: ffff00000863473c x24: ffff0000092de3d0
[   21.773221] x23: ffff80007a53f870 x22: 0000000000000000
[   21.773225] x21: ffff00000862877c x20: ffff80007aafbf80
[   21.773228] x19: ffff80007aafb298 x18: 0000000000000002
[   21.773232] x17: 0000ffff93824858 x16: ffff00000822a200
[   21.773235] x15: 0000463fe3000000 x14: 0000000000000000
[   21.773238] x13: 0000000000000000 x12: 0000000000000000
[   21.773241] x11: 0000000000000000 x10: 0000000000000000
[   21.773245] x9 : 0000000040000000 x8 : 0000000000210d00
[   21.773248] x7 : 0000000000000000 x6 : 0010ed7f00000000
[   21.773251] x5 : ffff80007a53f9a8 x4 : ffff00000944b000
[   21.773255] x3 : 0000000000000000 x2 : ffff800074358c80
[   21.773258] x1 : 0000000000000000 x0 : ffff80007a049400
[   21.773259]
[   21.773260] ---[ end trace 4a8e187491f145ee ]---
[   21.773262] Call trace:
[   21.773264] Exception stack(0xffff80007b40f8c0 to 0xffff80007b40f9f0)
[   21.773267] f8c0: ffff80007aafb298 0000ffffffffffff ffff80007b40faa0 ffff0000084e1320
[   21.773270] f8e0: 0000000060000145 000000000000003d ffff80007b40c000 000000018020001e
[   21.773273] f900: ffff000008c53cec ffff80007b40c000 ffff80007b40f950 ffff0000085d3b9c
[   21.773276] f920: ffff80007b40f9b0 ffff0000085f3728 ffff80007b475c00 ffff80007b475c00
[   21.773279] f940: ffff80007b40f990 ffff0000085f2430 ffff80007b475c00 ffff80007abf8800
[   21.773282] f960: ffff80007a049400 0000000000000000 ffff80007a049400 0000000000000000
[   21.773285] f980: ffff800074358c80 0000000000000000 ffff00000944b000 ffff80007a53f9a8
[   21.773288] f9a0: 0010ed7f00000000 0000000000000000 0000000000210d00 0000000040000000
[   21.773291] f9c0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[   21.773293] f9e0: 0000000000000000 0000463fe3000000
[   21.773296] [<ffff0000084e1320>] clk_core_unprepare+0x88/0x98
[   21.773299] [<ffff0000084e3130>] clk_unprepare+0x28/0x34
[   21.773303] [<ffff0000085c73a8>] lcdif_disable_clocks+0x24/0x60
[   21.773306] [<ffff0000085c7718>] imx_lcdif_suspend+0x10/0x24
[   21.773309] [<ffff0000086287a0>] platform_pm_suspend+0x24/0x50
[   21.773312] [<ffff000008633b58>] dpm_run_callback.isra.12+0x30/0x8c
[   21.773315] [<ffff0000086345d4>] __device_suspend+0x110/0x278
[   21.773318] [<ffff000008635800>] dpm_suspend+0x114/0x240
[   21.773321] [<ffff000008635bfc>] dpm_suspend_start+0x6c/0x78
[   21.773324] [<ffff000008104e28>] suspend_devices_and_enter+0xbc/0x534
[   21.773327] [<ffff0000081054f8>] pm_suspend+0x258/0x2f4
[   21.773329] [<ffff000008104030>] state_store+0x80/0xf4
[   21.773332] [<ffff0000083e7ce8>] kobj_attr_store+0x14/0x24
[   21.773336] [<ffff00000825d974>] sysfs_kf_write+0x40/0x48
[   21.773339] [<ffff00000825cd48>] kernfs_fop_write+0xb8/0x1cc
[   21.773342] [<ffff0000081e2d00>] __vfs_write+0x28/0x110
[   21.773345] [<ffff0000081e3ae4>] vfs_write+0xa8/0x1a8
[   21.773347] [<ffff0000081e4ea0>] SyS_write+0x44/0xa0
[   21.773350] [<ffff0000080838d8>] __sys_trace_return+0x0/0x4

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a6bac9bdebbdecf56575f6e361ad8f54e5263b95)
2019-11-25 15:59:19 +08:00
Fancy Fang 81441846b4 MLK-19017-3 gpu: imx: add system pm support for LCDIF
Implement the suspend()/resume() callbacks to support system
power management functions for LCDIF.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 7e00487012753cb370eab4ff5c05f76f7361297f)
2019-11-25 15:59:19 +08:00
Fancy Fang 4ba532e2cd MLK-19017-2 gpu: imx: add DISPMIX power domain support for LCDIF
After the DISPMIX power domain enabled, all the related registers
will drop their values once runtime pm suspend called. So in the
pm runtime resume process, the LCDIF de-reset and some init jobs
need to be done, and these jobs are no longer necessary to be done
during probe stage anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f83aaaecaeb54d8b1231be2cb7175ce58682dae7)
2019-11-25 15:59:18 +08:00
Fancy Fang 51c5292731 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>
2019-11-25 15:59:17 +08:00
Fancy Fang fe5a554200 gpu: imx: lcdif: break Kconfig recursive dependency
After adding LCDIF DRM/KMS driver, there will be a Kconfig recursive
dependency loop:

drivers/media/v4l2-core/Kconfig:7:error: recursive dependency detected!
drivers/media/v4l2-core/Kconfig:7:      symbol VIDEO_V4L2 depends on I2C
drivers/i2c/Kconfig:8:  symbol I2C is selected by FB_DDC
drivers/video/fbdev/Kconfig:63: symbol FB_DDC depends on FB
drivers/video/fbdev/Kconfig:12: symbol FB is selected by DRM_KMS_FB_HELPER
drivers/gpu/drm/Kconfig:75:     symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPER
drivers/gpu/drm/Kconfig:69:     symbol DRM_KMS_HELPER is selected by DRM_IMX
drivers/gpu/drm/imx/Kconfig:2:  symbol DRM_IMX depends on IMX_LCDIF_CORE
drivers/gpu/imx/lcdif/Kconfig:1:        symbol IMX_LCDIF_CORE depends on RESET_CONTROLLER
drivers/reset/Kconfig:5:        symbol RESET_CONTROLLER is selected by QCOM_SCM
drivers/firmware/Kconfig:218:   symbol QCOM_SCM is selected by VIDEO_QCOM_VENUS
drivers/media/platform/Kconfig:482:     symbol VIDEO_QCOM_VENUS depends on V4L_MEM2MEM_DRIVERS
drivers/media/platform/Kconfig:165:     symbol V4L_MEM2MEM_DRIVERS depends on VIDEO_V4L2

Making IMX_LCDIF_CORE select RESET_CONTROLLER instead of depending on it
breaks this loop.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2019-11-25 15:59:16 +08:00
Fancy Fang 6cd1ebf267 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>
2019-11-25 15:59:14 +08:00
Liu Ying aed0e27470 gpu: Move ipu-v3 to imx folder
The new imx folder may contain ipu-v3 and dpu common drivers.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Aisheng: fix source path ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:59:13 +08:00
Dong Aisheng 2c302d969b MLK-22156-3 gpu: ipu-v3: move new ipu file ipu-ic-csc.c under gpu/imx
Caused by f208b26e61 ("gpu: ipu-v3: ipu-ic: Fully describe colorspace conversions")

make[5]: *** No rule to make target 'drivers/gpu/imx/ipu-v3/ipu-ic-csc.o', needed by 'drivers/gpu/imx/ipu-v3/built-in.a'.  Stop.
make[5]: *** Waiting for unfinished jobs....
../scripts/Makefile.build:498: recipe for target 'drivers/gpu/imx/ipu-v3' failed
make[4]: *** [drivers/gpu/imx/ipu-v3] Error 2
../scripts/Makefile.build:498: recipe for target 'drivers/gpu/imx' failed

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:59:12 +08:00
Liu Ying 722e39a6a6 gpu: Move ipu-v3 to imx folder
The new imx folder may contain ipu-v3 and dpu common drivers.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Aisheng: fix source path ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:59:09 +08:00
Liu Ying 615237a7b7 gpu: imx: Add imx8 pixel combiner support
This patch adds i.MX8 pixel combiner driver support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:43 +08:00
Liu Ying e5b7df5e23 gpu: Move ipu-v3 to imx folder
The new imx folder may contain ipu-v3 and dpu common drivers.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Aisheng: fix source path ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:58:42 +08:00
Liu Ying 97a558deb1 MLK-21378-2 gpu: imx: Add imx8_dprc support
Fast-forward imx8_dprc driver from imx_4.14.y.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Liu Ying: scfw call updates and other small tweaks for upgrade]
2019-11-25 15:58:39 +08:00
Liu Ying 7724e0e059 MLK-21378-1 gpu: imx: Add imx8_prg support
Fast-forward imx8_prg driver from imx_4.14.y.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:38 +08:00
Liu Ying 12a79131ea gpu: Move ipu-v3 to imx folder
The new imx folder may contain ipu-v3 and dpu common drivers.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Aisheng: fix source path ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:58:38 +08:00
Liu Ying 072e3bcb7b gpu: imx: dpu: common: Initialize SCU misc settings in dpu_resume()
To make sure SCU misc settings are in valid status at system resume
stage, let's initialize them in dpu_resume().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:36 +08:00
Liu Ying 9e023db2ce LF-73 gpu: imx: dpu: sc misc: Initialze KACHUNK_CNT as needed by blit engine
The KACHUNK_CNT SCU misc setting is for DPU blit engine's prefetch engine.
It represents how many cycles are needed to trigger prefetch engine after
DPU shadow being loaded.  Set it to be 32, which is recommended and tested.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:35 +08:00
Liu Ying 7cb714ff4b gpu: imx: dpu: sc misc: Rename dpu_pxlink_init() to dpu_sc_misc_init()
The SCU misc settings of DC subsystem contain pixel link settings
and other settings, like DC sync mode and KACHUNK_CNT.  So, it would
be better to rename dpu_pxlink_init() to dpu_sc_misc_init(), which
includes initialization code for all SCU misc settings of DC subsystem.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:34 +08:00
Liu Ying 9b76f38f10 gpu: imx: dpu: sc misc: Rename dpu_sc_misc_init() to dpu_sc_misc_get_handle()
The function dpu_sc_misc_init() actually gets the SCU handle only.
So, renaming it to dpu_sc_misc_get_handle() better reflects what it does.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:33 +08:00
Liu Ying 8c154b03a5 gpu: imx: framegen: Don't enable/disable pixlnk when driving special encoder
The LVDS encoder driver for i.MX8qxp SoC needs to enable/disable pixel link
in order to meet some sequence requirements, otherwise, display artifacts
will be seen on LVDS display.  This patch avoids to enable/disable pixel
link in the FrameGen driver for this special encoder.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:33 +08:00
Liu Ying 212aa6d7e4 gpu: imx: dpu: common: Add flag has_dual_ldb in struct dpu_data
i.MX8qxp LDB dual channel mode uses two LDB channels from two LDB
instances, while i.MX8qm LDB uses two LDB channels from one LDB
instance.  So, this patch adds flag has_dual_ldb in struct dpu_data
so that it can be used to tell the difference.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:32 +08:00
Liu Ying 334bbd5df8 gpu: imx: dpu: framegen: Cache encoder_type in struct dpu_framegen
This patch caches encoder_type in struct dpu_framegen when we
call framegen_cfg_videomode().  This cached type can be used
later when determining whether to enable pixel link in the
FrameGen driver or not.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:32 +08:00
Liu Ying 0b9e3fb177 gpu: imx: dpu: disengcfg: Do HW initialization in dpu_dec_init()
This patch does DisEngCFG initialization in dpu_dec_init()
by calling _dpu_dec_init() in it.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:31 +08:00
Liu Ying 77a77f3723 drm/imx: dpu: plane: Add color properties support
As DPU fetchunits support ITU601(limited range)/ITU601_FR(full range)
and ITU709(limited range) YUV to RGB color space conversions, we may
add color encoding and color range properties support for planes.
Considering software backward compatibility, the default color encoding
is set to ITU601 with full color range.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:31 +08:00
Liu Ying 68e0ff911a drm/imx: dpu: plane: Support multiple pixel blend modes
This patch adds mulitple pixel blend modes for DPU plane.
The modes are "None", "Pre-multiplied" and "Coverage".

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:31 +08:00
Liu Ying 8d0c853756 drm/imx: dpu: kms: Support proper default blend mode
Without the new blend modes("None", "Pre-multiplied" and "Coverage")
introduced in the below commit, the old userspace assumes alpha in
pixel is per-premultiplied by default.  So, let's support the default
blend mode properly.

commit a5ec8332d4 ("drm: Add per-plane pixel blend mode property")

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:29 +08:00
Liu Ying 1a04cd435d gpu: imx: dpu: extdst: Add extdst_pixengcfg_syncmode_master() helper
This patch adds extdst_pixengcfg_syncmode_master() helper support
so that the callers may control if a extdst is master or slave
when it works in sync mode.  The bit16 of extdst's PIXENGCFG_STATIC
register controls this and it's a part of sync mode fixup logic.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:28 +08:00
Liu Ying 5705389c71 gpu: imx: dpu: framegen: Add framegen_syncmode_fixup() helper
Bit7 of framegen's SECSTATCONFIG register is used to control
the sync mode fixup logic implemented in framegen.  This patch
adds framegen_syncmode_fixup() helper so that the callers
may enable/disable the fixup logic for a framegen.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:27 +08:00
Liu Ying 40b282a223 gpu: imx: dpu: common: Provide store9 to client pdev via pdata
Store9 unit can be shared bewteen display engine(for sync mode fixup)
and blit engine.  It's proper to get the store resource in the DPU
common driver and then provide it to client platform device via
platform data.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:26 +08:00
Liu Ying c735596b06 gpu: imx: dpu: common: Add store9 support for sync mode fixup
Bit16 of store9's PIXENGCFG_STATIC register is used to control
the sync mode fixup logic implemented in store9.  So, let's
add store9 support in the DPU core driver and export a function
for users to enable/disable the fixup logic.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:26 +08:00
Liu Ying 3ecace4942 gpu: imx: dpu: common: Set master stream id to be 1 for i.MX8QM DPU
This patch sets master stream id to be 1 for i.MX8QM DPU.
The master stream id is used when FrameGen works in sync mode.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:25 +08:00
Liu Ying a1ab21d2fc gpu: imx: dpu: Add pixel combiner support
This patch adds pixel combiner support in the DPU core driver.
Users may get and enable/disable/control a pixel combiner instant
via tcon functions and may tell if it is needed in a specific usecase
via the dpu_get_syncmode_min_prate() and dpu_get_singlemode_max_width()
helpers.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:23 +08:00
Liu Ying 3849ba0a44 gpu: imx: tcon: Add side-by-side support
This patch adds side-by-side support for tcon so that
two tcons can participate in the dual display streams
to work with pixel combiner to drive a high pixel rate
display.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:21 +08:00
Liu Ying f98fa2a052 gpu: imx: dpu: framegen: Add side-by-side support
This patch adds side-by-side support for framegen so that
two framegens can work in sync mode to participate in the
dual display streams to drive a high pixel rate display
via a pixel combiner.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:21 +08:00
Liu Ying 4436810703 gpu: imx: dpu: sc misc: Add helper dpu_pxlink_set_dc_sync_mode() support
This patch adds helper dpu_pxlink_set_dc_sync_mode() support
so that callers may enable or disable DC sync mode.
In DC sync mode, high pixel rate video mode can be supported
by combining two display streams together.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:20 +08:00
Liu Ying 069fb8f384 gpu: imx: dpu: tcon: Add tcon_is_master/slave() helpers support
This patch adds tcon_is_master/slave() helpers support so that
callers may know if a tcon is a master or slave tcon.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:20 +08:00
Liu Ying 698aeb479b gpu: imx: dpu: extdst: Add extdst_is_master() helper support
This patch adds extdst_is_master() helper support so that
callers may know if a extdst is a master extdst or not.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:19 +08:00
Liu Ying 3baeefbcae gpu: imx: dpu: framegen: Add framegen_is_master/slave() helper support
This patch adds framegen_is_master/slave() helpers support so that
callers may know if a framegen is a master or slave framegen.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:19 +08:00
Liu Ying 83ca944de6 gpu: imx: dpu: common: Add helper dpu_get_master_stream_id() support
This patch adds helper dpu_get_master_stream_id() support
so that callers may know the master stream when FrameGen
works in sync mode.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:18 +08:00
Liu Ying ad25687906 gpu: imx: dpu: common: Introduce master_stream_id in struct dpu_data
This patch introduces master_stream_id flag in struct dpu_data
so that master stream can be chosen when FrameGen works in sync mode.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:18 +08:00
Liu Ying 53c5342fbc gpu: imx: dpu: common: Add di_grp_id in display client pdev's data
This patch adds a new di_grp_id entry in display client pdev's data
so that the relevant display platform driver may know the display
group ID of the display device.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:17 +08:00
Liu Ying ee63aa8251 gpu: imx: dpu: Add helpers to peek at auxiliary display submodules
This patch adds dpu_aux_{unit}_peek() helpers so that callers
may peek at auxiliary display submodules.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:14 +08:00
Liu Ying ed071c82ec drm/imx: dpu: kms: Support full screen CRTC background
The CRTC background should be full screen instead of partial
screen, because the DRM core is likely to add configurable
background color support in the future.  We may cover the full
screen with ConstFrame0/1, upon which builds planes.  With this,
it is easier to compute each plane's layer offset vs CRTC start
point and all ConstFrame units can be controlled by CRTC.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:12 +08:00
Liu Ying 75e35bcb99 gpu: imx: dpu: framegen: Add helpers to get/clear sec chan status
This patch adds two helpers to get and clear FrameGen secondary channel
status respectively.  Via the two helpers, users may know if there is
empty FIFO read request on this channel or not after getting the status.
And, if yes, users may choose to clear the status.  According to the IP
spec, the empty FIFO read request indicates that data stream from a Fetch
unit(e.g., AXI bandwidth not sufficient) fell down.  Assuming the display
driver sets things up properly, the falling down is very likely caused by
the insufficient AXI bandwidth, that is, display underrun.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:11 +08:00
Liu Ying c2dd2db4ef drm/imx: dpu: crtc: Evade the first dumb frame for DPR/PRG errata
To workaround the errata TKT320950, DPR/PRG need to evade the first dumb frame
which is generated by DPU.  The way we achieve that is to bypass TCON(but set
the TCON sync signals and KA_CHUCK strobe signal up) before enabling the DPU
display controller, and then 1) enable the display controller, 2) wait for the
frame index starting to move and 3) finally switch TCON to operation mode.
Steps 1) to 3) should be done within a frame, so we disable local irq and
preemption to make sure we don't relinquish CPU during the procedure.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:06 +08:00
Liu Ying accaed25e2 gpu: imx: dpu: Access regs in display engine units wo holding mutex
We don't need holding mutex when accessing registers in display engine
units, because KMS is the only relevant client driver and it has ww mutex
mechansim to ensure there is no race condition on the CRTC resources.
Also, we are naturally safe when the driver initializes the units at the
probe and system power management stages.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:06 +08:00
Liu Ying f53dd7a041 gpu: imx: dpu: fetchunit: Add DPR support
This patch adds DPR support for fetchunit in the DPU base driver.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:05 +08:00
Liu Ying 35b8f4aa7c gpu: imx: dpu: fetchunit: Use TKT343664&TKT339017's fixups for ->set_src_stride()
This patch uses TKT343664&TKT339017's fixups for ->set_src_stride().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:05 +08:00
Liu Ying 8212c85a3c gpu: imx: dpu: fetchunit: Use TKT343664&TKT339017's fixups for ->set_baseaddress()
This patch uses TKT343664&TKT339017's fixups for ->set_baseaddress().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:04 +08:00
Liu Ying acbd004cf4 gpu: imx: dpu: fetchunit: Use TKT343664's fixup for ->set_burstlength()
This patch uses TKT343664 burst size fixup for ->set_burstlength().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:03 +08:00
Liu Ying 2458abce7a gpu: imx: dpu: fetchunit: Add helper for TKT339017 to fixup stride
This patch adds helper fetchunit_stride_fixup_tkt339017() for
TKT339017 to fixup stride.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:02 +08:00
Liu Ying c33e9faa20 gpu: imx: dpu: fetchunit: Add helper for TKT343664 to fixup burst size
This patch adds helper fetchunit_burst_size_fixup_tkt343664() for
TKT343664 to fixup burst size.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:02 +08:00
Xianzhong a571b89dea MLK-15321-1 gpu: imx: dpu: Add dpu blit engine device
Implement Blt engine as DRM renderer.
Add dpu blit engine device. And as dpu bliteng has
no device tree node, so to set dpu's of_node as the
platform data for imx-drm component compare_of.

Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Acked-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:58:00 +08:00
Sandor Yu 4d6bbfd527 gpu: imx: dpu: framegen: add disp_lpcg clock
Add disp_lpcg clock.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2019-11-25 15:57:58 +08:00
Liu Ying 568ed66cac gpu: imx: dpu: framegen: Use bypass clock when display encoder type is TMDS
This patch sets display clock's parent to bypass clock when display
encoder type is TMDS, otherwise, to pll clock when other types of
encoder.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:57:57 +08:00
Liu Ying 583c9de66e gpu: imx: Add dpu common driver support
The dpu is found in i.MX8qm/qxp SoCs.
It has a display controller and a blit engine to support graphics.
This patch adds dpu common driver support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-11-25 15:57:52 +08:00
Liu Ying 2a3e3aa8d8 gpu: Move ipu-v3 to imx folder
The new imx folder may contain ipu-v3 and dpu common drivers.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
[ Aisheng: fix source path ]
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2019-11-25 15:57:51 +08:00