linux.git
6 years agoMLK-17473-1 drm/fourcc: add modifier for vivante compressed tiled layout
Fancy Fang [Wed, 17 Jan 2018 09:00:23 +0000 (17:00 +0800)]
MLK-17473-1 drm/fourcc: add modifier for vivante compressed tiled layout

Add a new fb modifier for Vivante compressed and tiled
pixle layout which can be decompressed by DEC400D module
in DCSS.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-17289-5: hdmi cec: change cec driver architecture
Sandor Yu [Fri, 22 Dec 2017 10:10:31 +0000 (18:10 +0800)]
MLK-17289-5: hdmi cec: change cec driver architecture

Change hdmi cec driver architecture.
Embedded cec function to hdmi driver.
Rewrite cec_read and cec_write fucntion
to support both imx8qm and imx8mq cec.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Also include MLK-17289-6: hdp drm: Add cec register/unregister function

Add cec register/unregister function in hdp drm driver.
Add is_cec variable to check cec function setting in dtb.

Squashed MLK-17289-5 and MLK-17289-6 from imx_4.9.y because they only
build together.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
6 years agoMLK-17289-4: hdp api: Add hdmi cec base address
Sandor Yu [Fri, 22 Dec 2017 10:08:24 +0000 (18:08 +0800)]
MLK-17289-4: hdp api: Add hdmi cec base address

Add hdmi cec base address.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17289-3: hdmi fb: change mem variable type
Sandor Yu [Fri, 22 Dec 2017 10:07:53 +0000 (18:07 +0800)]
MLK-17289-3: hdmi fb: change mem variable type

Change mem variable type.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17289-2: hdp drm: Add mem variable
Sandor Yu [Fri, 22 Dec 2017 10:06:43 +0000 (18:06 +0800)]
MLK-17289-2: hdp drm: Add mem variable

Add mem variable in struct imx_hdp,
and move regs_base and ss_base to struct mem.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17289-1: hdp: change struct mem variable type to pointer
Sandor Yu [Fri, 22 Dec 2017 10:04:58 +0000 (18:04 +0800)]
MLK-17289-1: hdp: change struct mem variable type to pointer

Change struct mem variable type to pointer in struct state.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17468-2: hdp: Enable imx8qm hdmi/dp 4kp30 support
Sandor Yu [Mon, 29 Jan 2018 08:43:16 +0000 (16:43 +0800)]
MLK-17468-2: hdp: Enable imx8qm hdmi/dp 4kp30 support

Add link rate select function.
Change max support pixel clock rate to 297MHz(4kp30).

Because edid read function is not enabled.
For such TV that max support 1080p60 or 720p60,
the followed cmdline mode should be added to kernel boot args:
video=HDMI-A-1:1920x1080-32@60 or
video=HDMI-A-1:1280x720-32@60

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17468-1: dptx: remove CDN_API_Get_PIXEL_FREQ_KHZ_ClosetVal
Sandor Yu [Mon, 29 Jan 2018 08:41:21 +0000 (16:41 +0800)]
MLK-17468-1: dptx: remove CDN_API_Get_PIXEL_FREQ_KHZ_ClosetVal

Remove CDN_API_Get_PIXEL_FREQ_KHZ_ClosetVal function,
replace with vic_table.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17461-3: hdp: Remove pixel clock root setting
Sandor Yu [Thu, 25 Jan 2018 08:27:54 +0000 (16:27 +0800)]
MLK-17461-3: hdp: Remove pixel clock root setting

HDMI pixel clock reparent function have implemented in dts,
remove clock root set function from hdp driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
6 years agoMLK-17456-2: hdmi: Remove debug log
Sandor Yu [Wed, 24 Jan 2018 11:23:04 +0000 (19:23 +0800)]
MLK-17456-2: hdmi: Remove debug log

Remove debug log

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17456-1: hdp: Enable EDID read function for imx8mq hdmi
Sandor Yu [Wed, 24 Jan 2018 11:18:16 +0000 (19:18 +0800)]
MLK-17456-1: hdp: Enable EDID read function for imx8mq hdmi

-Enable EDID read function for imx8mq hdmi.
-Add video mode check.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17401: drm: imx: dcss: fix scaling issue
Laurentiu Palcu [Fri, 19 Jan 2018 07:49:07 +0000 (09:49 +0200)]
MLK-17401: drm: imx: dcss: fix scaling issue

Under certain circumstances (corner cases) the scaling fractions were
not set properly. This patch fixes this.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17368-4: drm: imx: dcss: add modifier checks
Laurentiu Palcu [Fri, 12 Jan 2018 13:23:38 +0000 (15:23 +0200)]
MLK-17368-4: drm: imx: dcss: add modifier checks

This patch activates modifiers in CRTC and adds checks in the
atomic_check() callback so that only the allowed modifiers are accepted.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17368-3: drm: imx: dcss: Add support for tiled formats
Laurentiu Palcu [Fri, 12 Jan 2018 13:18:51 +0000 (15:18 +0200)]
MLK-17368-3: drm: imx: dcss: Add support for tiled formats

This patch effectively enables DTRC module in DCSS to decode tiled
formats from VPU:
 * uncompressed G1;
 * uncompressed G2;
 * compressed G2;

Compressed G2 formats need to pass on the decompression table offsets,
by using the 'dtrc_dec_ofs' property. This is a 64 bit value like below:

64--------48----------32---------16---------0
|<- chroma table ofs ->|<- luma table ofs ->|

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17368-2: drm: imx: dcss: split dcss_ctxld_write
Laurentiu Palcu [Fri, 12 Jan 2018 11:56:58 +0000 (13:56 +0200)]
MLK-17368-2: drm: imx: dcss: split dcss_ctxld_write

In order for DTRC to work properly, we need to be able to write the DCTL
registers (to switch banks), just before activating CTXLD. However,
__dcss_ctxld_enable() function is usually called from irq context, or
whn the mutex is taken. Hence, create a function the can be called from
irq context.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17368-1: drm: add fourcc codes for Verisilicon tiled formats
Bing Song [Fri, 5 Jan 2018 06:33:51 +0000 (08:33 +0200)]
MLK-17368-1: drm: add fourcc codes for Verisilicon tiled formats

These formats will be used by VPU and DCSS.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17257-2: drm: imx: dcss: use the WRSCL/RDSRC modules
Laurentiu Palcu [Tue, 19 Dec 2017 11:38:44 +0000 (13:38 +0200)]
MLK-17257-2: drm: imx: dcss: use the WRSCL/RDSRC modules

This patch makes the necessary changes so that, for downscaling ratios
more than 3:1 and up to 7:1 (for video) and 5:1 (for graphics), the
WRSCL/RDSRC path will be used. This way the DRAM bandwidth will be lower
and spread evenly across the frame time.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17257-1: drm: imx: dcss: Add WRSCL/RDSRC modules
Laurentiu Palcu [Tue, 19 Dec 2017 11:33:32 +0000 (13:33 +0200)]
MLK-17257-1: drm: imx: dcss: Add WRSCL/RDSRC modules

WRSCL and RDSRC modules will be needed when downscaling ratios starting
from 3:1 up to 7:1 are needed. Otherwise, if the usual scaling path is
used, the DRAM bandwidth needed will be too much and performance will be
affected.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17274: drm: imx: dcss: use_global_alpha not working if channel
Laurentiu Palcu [Wed, 20 Dec 2017 13:13:33 +0000 (15:13 +0200)]
MLK-17274: drm: imx: dcss: use_global_alpha not working if channel
already enabled

If the channel is already enabled, or it doesn't need a mode set, then
the dcss_dtg_global_alpha_changed() will always return false for formats
with per-pixel alpha. Hence, the plane will not be updated. This patch
removes the check for image format and the check will be done for all
image formats.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17232-2: drm: imx: dcss: ignore SB_PEND_DISP_ACTIVE interrupt
Laurentiu Palcu [Mon, 18 Dec 2017 06:22:25 +0000 (08:22 +0200)]
MLK-17232-2: drm: imx: dcss: ignore SB_PEND_DISP_ACTIVE interrupt

There is a logic error in the DCSS B0 silicon and this interrupt does
not behave as it's supposed to. Ignore for now.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17232-1: drm: imx: dcss: Fix context loader settings for LCD panel
Laurentiu Palcu [Thu, 14 Dec 2017 13:35:02 +0000 (15:35 +0200)]
MLK-17232-1: drm: imx: dcss: Fix context loader settings for LCD panel

If the vfront/vback porches are small are vsync length is small, the
dis_ulc_y is also small. Hence, the DB trigger setting will be
inappropriate and the DB context will not be able to load in time.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17231-3: drm: imx: dcss: drop runtime autosuspend feature
Laurentiu Palcu [Tue, 12 Dec 2017 11:08:36 +0000 (13:08 +0200)]
MLK-17231-3: drm: imx: dcss: drop runtime autosuspend feature

This was needed when using the mode_set_nofb() callback. Since
everything was moved to crtc_enable() callback, runtime autosuspend
can be dropped.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17231-2: drm: imx: dcss: Do not use mode_set_nofb callback
Laurentiu Palcu [Tue, 12 Dec 2017 11:06:35 +0000 (13:06 +0200)]
MLK-17231-2: drm: imx: dcss: Do not use mode_set_nofb callback

This callback is not suitable for drivers using runtime PM. Move
everything in the crtc_enable() callback.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17231-1: drm: imx: dcss: set own KMS commit_tail callback
Laurentiu Palcu [Tue, 12 Dec 2017 10:13:27 +0000 (12:13 +0200)]
MLK-17231-1: drm: imx: dcss: set own KMS commit_tail callback

According to documentation, for the default commit_tail helper:

 * Note that the default ordering of how the various stages are called is to
 * match the legacy modeset helper library closest. One peculiarity of that is
 * that it doesn't mesh well with runtime PM at all.
 *
 * For drivers supporting runtime PM the recommended sequence is instead ::
 *
 *     drm_atomic_helper_commit_modeset_disables(dev, state);
 *
 *     drm_atomic_helper_commit_modeset_enables(dev, state);
 *
 *     drm_atomic_helper_commit_planes(dev, state,
 *                                     DRM_PLANE_COMMIT_ACTIVE_ONLY);

This patch creates our own commit_tail() callback and changes the order of the
commit_modeset callbacks, as instructed.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17206 hdp: Disable firmware hdp loading
Oliver Brown [Thu, 14 Dec 2017 00:16:08 +0000 (18:16 -0600)]
MLK-17206 hdp: Disable firmware hdp loading

Disabling HDP firmware loading except for debug.
Added simple checks to test HDP firmware status.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-17107-03: hdp: return unknow status if cable detect failed
Sandor Yu [Mon, 11 Dec 2017 09:10:48 +0000 (17:10 +0800)]
MLK-17107-03: hdp: return unknow status if cable detect failed

Return unknow status to connector if hdp cable detect function
failed to get cable status.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit d16c633b1be1326b3583632c5279ea6b34ed3ec2)

6 years agoMLK-17107-02: hdmi: Add api function return check
Sandor Yu [Mon, 11 Dec 2017 08:32:29 +0000 (16:32 +0800)]
MLK-17107-02: hdmi: Add api function return check

Add api function return check to hdmi api call.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit cba6f4fc6f382731fabf938fb9e03db1c17b1666)

Conflicts:
drivers/gpu/drm/imx/hdp/imx-hdmi.c

6 years agoMLK-17107-01: hdp api: Add return value check for hdmi api
Sandor Yu [Mon, 11 Dec 2017 08:27:38 +0000 (16:27 +0800)]
MLK-17107-01: hdp api: Add return value check for hdmi api

Add return value check for hdmitx api.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit fa29a23b5327e2739389c12e3d6ae54298c10c2f)

Conflicts:
drivers/mxc/hdp/API_HDMITX.c

6 years agoMLK-17805: drm: imx: dcss: fix resume without HDMI cable
Laurentiu Palcu [Fri, 8 Dec 2017 13:54:19 +0000 (15:54 +0200)]
MLK-17805: drm: imx: dcss: fix resume without HDMI cable

When no HDMI cable is in, the device is runtime suspended. Hence,
there's nothing to resume in this case.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17140-2: drm: imx: dcss: Change CTXLD trigger values
Laurentiu Palcu [Fri, 8 Dec 2017 12:42:05 +0000 (14:42 +0200)]
MLK-17140-2: drm: imx: dcss: Change CTXLD trigger values

After activating the PM QoS, the old triggers didn't work anymore. Also,
this will remove a hardcoded value that might not work for all
resolutions.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17140-1: drm: imx: dcss: add PM QoS
Laurentiu Palcu [Thu, 7 Dec 2017 10:57:19 +0000 (12:57 +0200)]
MLK-17140-1: drm: imx: dcss: add PM QoS

PM QoS is needed so that cpuidle doesn not influence DCSS performance.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMMFMWK-7806: drm: imx: dcss: check up/down scale ratios
Laurentiu Palcu [Wed, 6 Dec 2017 09:03:50 +0000 (11:03 +0200)]
MMFMWK-7806: drm: imx: dcss: check up/down scale ratios

When scaling up/down, DCSS has limits that cannot be exceeded. This
patch adds checks before the plane is updated and rejects those planes
that exceed the up/down scale limits.

Currently, the limit is 3:1 for downscaling and 1:3 for upscaling for
both video and graphics channels.

When support for WR_SCL/RD_SRC will be added, these limits will increase
to the following values:
 * video: 7:1 downscale, 1:7 upscale
 * graphics: 5:1 downscale, 1:5 upscale

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-15110-1 drm/fourcc: Add Amphion tiled layout format modifier
Liu Ying [Thu, 3 Aug 2017 08:00:46 +0000 (16:00 +0800)]
MLK-15110-1 drm/fourcc: Add Amphion tiled layout format modifier

Amphion VPU has a tiled layout using 8x128 pixel vertical strips,
where each strip contains 1x16 groups of 8x8 pixels in a row-major layout.

Signed-off-by: Song Bing <bing.song@nxp.com>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-17126-4: hdp: Fix V/Hsync polarity issue
Sandor Yu [Fri, 8 Dec 2017 08:16:48 +0000 (16:16 +0800)]
MLK-17126-4: hdp: Fix V/Hsync polarity issue

Remove v/hsync polarity adjust function.
Add pixel link mux configuration function for imx8qm.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17126-3: hdmi api: Fix h/v sync polarity issue
Sandor Yu [Fri, 8 Dec 2017 08:41:21 +0000 (16:41 +0800)]
MLK-17126-3: hdmi api: Fix h/v sync polarity issue

Fix H/V Sync polarity issue.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17126-2: hdp: Support imx8qm HDMI function
Sandor Yu [Thu, 7 Dec 2017 10:04:03 +0000 (18:04 +0800)]
MLK-17126-2: hdp: Support imx8qm HDMI function

Add phy reset before hdmi/dp phy init.
Reparent hdmi pixel clock to av_pll.
Combine DP and HDMI ipg clock function.
Add DP and HDMI pixel clock set rate function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17126-1: hdp api: workaround for imx8qm HDMI DDC R/W issue
Sandor Yu [Fri, 8 Dec 2017 06:54:26 +0000 (14:54 +0800)]
MLK-17126-1: hdp api: workaround for imx8qm HDMI DDC R/W issue

HDMI DDC R/W function is not supported by imx8qm HDMI FW.
Skip the function for imx8qm before the issue is fixed in FW.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17003: hdmi: More delay need for hdmi phy init
Sandor Yu [Tue, 28 Nov 2017 10:01:39 +0000 (18:01 +0800)]
MLK-17003: hdmi: More delay need for hdmi phy init

DRM core waits for 50ms for a vblank interrupt to come
after changing the mode. But in video mode change from
4Kp60 to 480p60 case, the VBLANK interrupt is not coming
in 50ms, drm core driver will dump the followed warning
information.

[ 1034.956833] [CRTC:25] vblank wait timed out
[ 1034.961069] ------------[ cut here ]------------
[ 1034.965702] WARNING: CPU: 0 PID: 3485 at
/home/bamboo/build/4.9.51-8mq-beta/fsl-imx-internal-xwayland/temp_build_dir/build_fsl-imx-internal-xwayland/tmp/work-shared/imx8mqevk/kernel-source/drivers/gpu/drm/drm_atomic_helper.c:1140
drm_atomic_helper_wait_for_vblanks+0x230/0x238
[ 1034.990111] Modules linked in: 8021q garp stp mrp galcore(O) ipv6
[ 1034.996289]
[ 1034.997785] CPU: 0 PID: 3485 Comm: modetest Tainted: G        W  O
4.9.51-imx_4.9.51_imx8m_beta+gaf29127 #1
[ 1035.007783] Hardware name: Freescale i.MX8MQ EVK (DT)
[ 1035.012832] task: ffff8000b6c49900 task.stack: ffff8000b64cc000
[ 1035.018751] PC is at drm_atomic_helper_wait_for_vblanks+0x230/0x238
[ 1035.025016] LR is at drm_atomic_helper_wait_for_vblanks+0x230/0x238
[ 1035.031281] pc : [<ffff0000085a6b08>] lr : [<ffff0000085a6b08>]
pstate: 00000145
[ 1035.038673] sp : ffff8000b64cfa50
[ 1035.041985] x29: ffff8000b64cfa50 x28: 0000000000000000
[ 1035.047316] x27: 0000000000000000 x26: ffff8000b86c4820
[ 1035.052646] x25: 0000000000000090 x24: 0000000000006d57
[ 1035.057976] x23: 0000000000000018 x22: ffff8000b86c3800
[ 1035.063306] x21: ffff8000b955fc00 x20: ffff8000b64f1180
[ 1035.068637] x19: 0000000000000000 x18: 0000000000000010
[ 1035.073967] x17: 0000000000000000 x16: 0000000000000000
[ 1035.079297] x15: 0000000000000006 x14: ffff00008937abc7
[ 1035.084628] x13: ffff00000937abd5 x12: 0000000000000007
[ 1035.089959] x11: 000000000000022f x10: 0000000005f5e0ff
[ 1035.095289] x9 : 0000000000000230 x8 : 6974207469617720
[ 1035.100619] x7 : 6b6e616c6276205d x6 : ffff00000937abf6
[ 1035.105949] x5 : 0000000000000000 x4 : 0000000000000000
[ 1035.111279] x3 : 0000000000000000 x2 : ffff8000b64cc000
[ 1035.116609] x1 : ffff8000b64cc000 x0 : 000000000000001f
[ 1035.121938]
[ 1035.123428] ---[ end trace d3bf25e791b7a9c7 ]---
[ 1035.128043] Call trace:
[ 1035.130488] Exception stack(0xffff8000b64cf880 to 0xffff8000b64cf9b0)
[ 1035.136928] f880: 0000000000000000 0001000000000000 ffff8000b64cfa50
ffff0000085a6b08
[ 1035.144756] f8a0: 0000000000000002 0000000000000004 ffff00000937cfe8
000000000000001f
[ 1035.152584] f8c0: ffff00000937a000 ffff000008f67838 ffff8000b64cf970
ffff0000081009f0
[ 1035.160412] f8e0: 0000000000000000 ffff8000b64f1180 ffff8000b955fc00
ffff8000b86c3800
[ 1035.168240] f900: 0000000000000018 0000000000006d57 0000000000000090
ffff8000b86c4820
[ 1035.176067] f920: 000000000000001f ffff8000b64cc000 ffff8000b64cc000
0000000000000000
[ 1035.183895] f940: 0000000000000000 0000000000000000 ffff00000937abf6
6b6e616c6276205d
[ 1035.191723] f960: 6974207469617720 0000000000000230 0000000005f5e0ff
000000000000022f
[ 1035.199551] f980: 0000000000000007 ffff00000937abd5 ffff00008937abc7
0000000000000006
[ 1035.207377] f9a0: 0000000000000000 0000000000000000
[ 1035.212255] [<ffff0000085a6b08>]
drm_atomic_helper_wait_for_vblanks+0x230/0x238
[ 1035.219562] [<ffff0000085a96a0>]
drm_atomic_helper_commit_tail+0x50/0x68
[ 1035.226261] [<ffff0000085a971c>] commit_tail+0x64/0x80
[ 1035.231398] [<ffff0000085a97f8>] drm_atomic_helper_commit+0xa8/0x108
[ 1035.237752] [<ffff0000085ec468>] dcss_drm_atomic_commit+0x100/0x148
[ 1035.244018] [<ffff0000085c8308>] drm_atomic_commit+0x50/0x60
[ 1035.249676] [<ffff0000085a9d28>]
drm_atomic_helper_set_config+0x88/0xc8
[ 1035.256290] [<ffff0000085bb5f8>]
drm_mode_set_config_internal+0x68/0xf8
[ 1035.262903] [<ffff0000085bc9dc>] drm_mode_setcrtc+0x38c/0x450
[ 1035.268649] [<ffff0000085b3ba8>] drm_ioctl+0x198/0x448
[ 1035.273788] [<ffff0000081f067c>] do_vfs_ioctl+0xa4/0x748
[ 1035.279099] [<ffff0000081f0dac>] SyS_ioctl+0x8c/0xa0
[ 1035.284064] [<ffff000008082f4c>] __sys_trace_return+0x0/0x4

Added more delay for hdmi phy init will fixed the issue.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17032-2: drm: imx: dcss: fix runtime suspend/resume
Laurentiu Palcu [Wed, 29 Nov 2017 11:27:23 +0000 (13:27 +0200)]
MLK-17032-2: drm: imx: dcss: fix runtime suspend/resume

If the DCSS core is runtime suspended, but the display-subsystem is not,
we need to resume the DCSS core before setting up DTG and SUBSAM
modules.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16992-2: drm: imx: dcss: enable/disable all clocks during suspend/resume
Laurentiu Palcu [Mon, 27 Nov 2017 07:45:52 +0000 (09:45 +0200)]
MLK-16992-2: drm: imx: dcss: enable/disable all clocks during suspend/resume

Clocks were not properly disabled during suspend. This patch will
disable all clocks during suspend.

Also, remove the hardcoded clocks' rates. These will be set through DTB.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16992-1: drm: imx: dcss: Do not request bus_freq twice
Laurentiu Palcu [Mon, 27 Nov 2017 06:38:26 +0000 (08:38 +0200)]
MLK-16992-1: drm: imx: dcss: Do not request bus_freq twice

Make sure we request/release the bus_freq exactly once.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16946-4: hdp: Add mutex for mailbox access
Sandor Yu [Fri, 24 Nov 2017 09:59:00 +0000 (17:59 +0800)]
MLK-16946-4: hdp: Add mutex for mailbox access

Add mutex for mailbox access.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16946-2: hdmi: Enable cable hotplug detect function
Sandor Yu [Thu, 23 Nov 2017 06:39:53 +0000 (14:39 +0800)]
MLK-16946-2: hdmi: Enable cable hotplug detect function

-Enable HDMI/DP cable hotplug detect function.
-Remove HPD polling thread function.
-Move HDMI/DP FW init and download function
before hdmi drm register.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16946-1: hdp: Reduce timeout counter for hdp functions
Sandor Yu [Thu, 23 Nov 2017 04:26:32 +0000 (12:26 +0800)]
MLK-16946-1: hdp: Reduce timeout counter for hdp functions

Reduce hdp function r/w timeout counter.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16953: drm: imx: dcss: Add propriety to change global alpha priority
Laurentiu Palcu [Fri, 24 Nov 2017 14:59:20 +0000 (16:59 +0200)]
MLK-16953: drm: imx: dcss: Add propriety to change global alpha priority

This patch adds 'use_global_alpha' property to the primary plane, so that
one can choose whether to use global alpha instead of per-pixel alpha,
when the framebuffer has per-pixel alpha.

Framebuffers that do not have per-pixel alpha will always use global
alpha.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16954: drm: imx: dcss: adjust context loader trigger values
Laurentiu Palcu [Fri, 24 Nov 2017 13:03:28 +0000 (15:03 +0200)]
MLK-16954: drm: imx: dcss: adjust context loader trigger values

Apparently, when DCSS has to fight for data on the bus with other
processes, exists the risk for the scaler to freeze. Previous setting
used the documentation recommendation for setting the DB context loader
trigger time. Unfortunately, with that value, under high stress, the RGB
planes will go black and scaler will freeze.

This patch sets the SB/DB context loader triggers to a values
obtained through repeated tests that proved to provide the best user
experience (i.e. planes will not go black).

However, the underlining issue remains and HW needes to prioritize the
DCSS read operations.

With this workaround, under high stress, the RGB planes may experience
some flickering but they will not freeze.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16942-1: hdmi-cec: Update clock rate to 133MHz
Sandor Yu [Wed, 22 Nov 2017 07:22:12 +0000 (15:22 +0800)]
MLK-16942-1: hdmi-cec: Update clock rate to 133MHz

After apply HDMI FW ROM patch to mscale B0.
The HDMI core clock will run at 133MHz.
Update hdmi cec clock rate.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit 4198c8f6677eff3e6e50ca17f3d1b7f6e6f8b8c3)

6 years agoMLK-16941: hdmi: check video mode with cmdline mode
Sandor Yu [Wed, 22 Nov 2017 10:29:31 +0000 (18:29 +0800)]
MLK-16941: hdmi: check video mode with cmdline mode

when EDID function is disabled, the cmdline mode is
the max support video mode.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit 4bdf485762441578a50a1b1586777f1291dd32e5)

6 years agoMLK-16932: hdp: Add 720x480p60 video mode support
Sandor Yu [Wed, 22 Nov 2017 03:37:17 +0000 (11:37 +0800)]
MLK-16932: hdp: Add 720x480p60 video mode support

Add 720x480p60 video mode to default support modelist.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16928: drm: dcss: fix modesetting issues
Laurentiu Palcu [Tue, 21 Nov 2017 13:00:28 +0000 (15:00 +0200)]
MLK-16928: drm: dcss: fix modesetting issues

DTG needs to be completely stopped before changing the display
resolution through modesetting. If DTG is not stopped, any change in
resolution could result in unpredictable results, like split screen,
etc.

This patch fixes that by introducing a completion signaling mechanism so
that we can signal the DRM CRTC when DCSS core is done stopping DTG.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16927: drm: imx: dcss: Add basic plane checks
Laurentiu Palcu [Tue, 21 Nov 2017 10:22:18 +0000 (12:22 +0200)]
MLK-16927: drm: imx: dcss: Add basic plane checks

Currently, there are no plane checks and the user can try set up a plane
with a CRTC size that is actually bigger than the current CRTC mode.
Because, currently, the driver does not support cropping, all planes
with CRTC sizes bigger than the actual CRTC mode will be rejected.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16922-2: drm: imx: dcss: call DCSS runtime PM routines
Laurentiu Palcu [Tue, 21 Nov 2017 07:32:25 +0000 (09:32 +0200)]
MLK-16922-2: drm: imx: dcss: call DCSS runtime PM routines

When CRTC is disabled/enabled, the runtime PM routines should be called.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16922-1: drm: dcss: Add DCSS core power management support
Laurentiu Palcu [Tue, 21 Nov 2017 07:31:09 +0000 (09:31 +0200)]
MLK-16922-1: drm: dcss: Add DCSS core power management support

This patch support for suspend/resume and runtime PM in DCSS driver
core.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16923-2: drm: imx: dcss: Add possibility to debug BLKCTL registers
Laurentiu Palcu [Fri, 10 Nov 2017 08:07:28 +0000 (10:07 +0200)]
MLK-16923-2: drm: imx: dcss: Add possibility to debug BLKCTL registers

When debugging it's useful to be able to see the DCSS registers. BLKCTL
was not added to the list of modules supporting this feature. This patch
adds it.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16923-1: drm: imx: dcss: dont't use static vars in blkctl
Laurentiu Palcu [Fri, 10 Nov 2017 07:52:08 +0000 (09:52 +0200)]
MLK-16923-1: drm: imx: dcss: dont't use static vars in blkctl

If, in the future, a platform will have two DCSS controllers, having
static variables holding various settings will not work out. Add a
private structure instead.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16924: hdp: Disable HDP hotplug detect thread temporary
Sandor Yu [Tue, 21 Nov 2017 09:03:28 +0000 (17:03 +0800)]
MLK-16924: hdp: Disable HDP hotplug detect thread temporary

HDMI Fw is unstable, hotplug detect thread may
blocked at hdmi mailbox access.
Disable hotplug detect thread function temporary.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16911: drm: imx: dcss: do not advertise modifiers
Laurentiu Palcu [Mon, 20 Nov 2017 09:51:13 +0000 (11:51 +0200)]
MLK-16911: drm: imx: dcss: do not advertise modifiers

Since support for tiled formats has not been added to DCSS DRM driver,
do not allow usage of FB modifiers by userspace.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16906: drm: imx: core: add possiblity to detect if chip has DCSS
Laurentiu Palcu [Fri, 17 Nov 2017 09:03:52 +0000 (11:03 +0200)]
MLK-16906: drm: imx: core: add possiblity to detect if chip has DCSS

The Mscale Display Controller Subsystem does not support RGB565.
However, the default legacy FB pixel depth is 16. Hence, the users would
have to add a kernel cmdline option to set it to 32bpp:
imxdrm.legacyfb_depth=32

This patch changes imx-drm-core to detect if platform has DCSS and, if
it does, set the FB pixel depth to 32, so that user does not have to.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16908-3: hdmi phy: Remove debug log
Sandor Yu [Mon, 20 Nov 2017 09:23:30 +0000 (17:23 +0800)]
MLK-16908-3: hdmi phy: Remove debug log

Remove debug log

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16908-2: hdp: Support video modeset
Sandor Yu [Mon, 20 Nov 2017 09:12:05 +0000 (17:12 +0800)]
MLK-16908-2: hdp: Support video modeset

Add HDMI PHY configurated function to mode set.
Add 720p60, 2160p30 and 2160p60 video mode to default video modes.
Rewrite mode valid function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16908-1: hdmitx: Support hdmi 2.0 to hdmi 1.4 reconfiguration
Sandor Yu [Mon, 20 Nov 2017 08:42:12 +0000 (16:42 +0800)]
MLK-16908-1: hdmitx: Support hdmi 2.0 to hdmi 1.4 reconfiguration

Add HDMI 2.0 to HDMI 1.4 reconfiguration.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16887-1: drm: imx: hdp: add aux config for HDMI ARC
Shengjiu Wang [Fri, 17 Nov 2017 07:24:06 +0000 (15:24 +0800)]
MLK-16887-1: drm: imx: hdp: add aux config for HDMI ARC

Add aux config for HDMI ARC, the config is from the HDMI usr
guide

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-16888: hdp audio: support multi-type audio
Sandor Yu [Fri, 17 Nov 2017 08:30:53 +0000 (16:30 +0800)]
MLK-16888: hdp audio: support multi-type audio

Add audio_type variable to support different audio type.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16886: hdp: Disable EDID function
Sandor Yu [Fri, 17 Nov 2017 08:14:07 +0000 (16:14 +0800)]
MLK-16886: hdp: Disable EDID function

Disable EDID function temporary
because edid read is unstable on some boards.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16834-03: hdmi/dp phy: Enable additional PLL loop Amplifier.
Sandor Yu [Thu, 16 Nov 2017 03:48:38 +0000 (11:48 +0800)]
MLK-16834-03: hdmi/dp phy: Enable additional PLL loop Amplifier.

Addresses the PLL lock issue found on many devices.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit 5e16126749b90e3e53fc8872b87d310ce808f84e)

6 years agoMLK-16819-2: defconfig: Add CEC config
Sandor Yu [Wed, 15 Nov 2017 08:03:30 +0000 (16:03 +0800)]
MLK-16819-2: defconfig: Add CEC config

Add CEC to defconfig.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16819-1: CEC: Add HDMI CEC driver
Sandor Yu [Wed, 15 Nov 2017 07:55:30 +0000 (15:55 +0800)]
MLK-16819-1: CEC: Add HDMI CEC driver

Add iMX8 HDMI CEC function.
Support CEC MSG TX and RX function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16748-02: HDMI: Support iMX8MQ HDMI in HDMI DRM driver
Sandor Yu [Fri, 13 Oct 2017 07:37:19 +0000 (15:37 +0800)]
MLK-16748-02: HDMI: Support iMX8MQ HDMI in HDMI DRM driver

-Add iMX8MQ HDMI function support in iMX8 HDMI DRM driver.
-EDID read function supported for iMX8MQ.
-Move iMX8QM clock management functions and pixel link
setting functions to iMX8QM SOC specific struct.
-replace printk with pr_info, dev_warn and dev_err.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Changes made during rebase to 4.19:
 * removed drm_edid_to_eld call as it's redundant;
 * replaced drm_mode_connector_update_edid_property with
   drm_connector_update_edid_property;

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16748-01: HDMI: Add iMX8MQ HDMI PHY config function
Sandor Yu [Fri, 13 Oct 2017 04:33:10 +0000 (12:33 +0800)]
MLK-16748-01: HDMI: Add iMX8MQ HDMI PHY config function

Add iMX8MQ HDMI PHY configuration source code
to iMX8 HDMI DRM driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16675-5: drm: imx: dcss: fix BLKCTL for B0 silicon
Laurentiu Palcu [Wed, 8 Nov 2017 08:23:28 +0000 (10:23 +0200)]
MLK-16675-5: drm: imx: dcss: fix BLKCTL for B0 silicon

B0 silicon brings some changes in the BLKCTL registers that need to be
properly used for B0 to work. This patch adds support for that.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16675-4: arm64: defconfig: compile DRM DCSS driver
Laurentiu Palcu [Thu, 19 Oct 2017 13:23:15 +0000 (16:23 +0300)]
MLK-16675-4: arm64: defconfig: compile DRM DCSS driver

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16597: hdmi: Fix kernel dump issue
Sandor Yu [Tue, 17 Oct 2017 11:13:23 +0000 (19:13 +0800)]
MLK-16597: hdmi: Fix kernel dump issue

Kernel will dump when CONFIG_CC_STACKPROTECTOR_STRONG is enable.

[    2.675537] CDN_API_HDMITX_Set_Mode_blocking ret = 0
[    2.675550] Kernel panic - not syncing: stack-protector: Kernel stack
is corrupted in: ffff000008ad5a50
[    2.675550]
[    2.675557] CPU: 2 PID: 1553 Comm: kworker/2:2 Not tainted
4.9.56-641868-gead64f8 #12
[    2.675559] Hardware name: Freescale i.MX8MQ EVK (DT)
[    2.675576] Workqueue: events deferred_probe_work_func
[    2.675578] Call trace:
[    2.675587] [<ffff00000808974c>] dump_backtrace+0x0/0x1d0
[    2.675594] [<ffff000008089930>] show_stack+0x14/0x1c
[    2.675602] [<ffff000008401650>] dump_stack+0x8c/0xac
[    2.675609] [<ffff0000081b0b24>] panic+0x13c/0x2a8
[    2.675617] [<ffff0000080c5ec4>] print_tainted+0x0/0xa4
[    2.675624] [<ffff000008ad5a50>] Afe_write+0x0/0x50
[    2.675632] [<ffff00000849aff0>] hdmi_init.constprop.3+0x188/0x1d0
[    2.675638] [<ffff00000849b264>] imx_hdmi_probe+0x22c/0x2ac
[    2.675645] [<ffff0000086d543c>] platform_drv_probe+0x50/0xc8
[    2.675650] [<ffff0000086d3530>] driver_probe_device+0x218/0x2b8
[    2.675655] [<ffff0000086d3710>] __device_attach_driver+0x98/0xe8
[    2.675660] [<ffff0000086d126c>] bus_for_each_drv+0x60/0xb0
[    2.675665] [<ffff0000086d31bc>] __device_attach+0xd4/0x128
[    2.675669] [<ffff0000086d38f8>] device_initial_probe+0x10/0x18
[    2.675674] [<ffff0000086d275c>] bus_probe_device+0x90/0x98
[    2.675679] [<ffff0000086d2bf0>] deferred_probe_work_func+0x7c/0xb0
[    2.675685] [<ffff0000080e1580>] process_one_work+0x144/0x434
[    2.675690] [<ffff0000080e1ec4>] worker_thread+0x200/0x4a4
[    2.675696] [<ffff0000080e81f0>] kthread+0xf0/0x104
[    2.675701] [<ffff000008082e80>] ret_from_fork+0x10/0x50

It is cause by array variable access exceed.
Fixed it with correct array size.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-13946-2: hdp: add i2s clock for imx8qm hdmi audio
Shengjiu Wang [Thu, 12 Oct 2017 05:58:51 +0000 (13:58 +0800)]
MLK-13946-2: hdp: add i2s clock for imx8qm hdmi audio

hdmi audio need to enable the i2s clock and i2s_bypass clock

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-16538-4: defconfig: Add hdmi/dp driver to default kernel build
Sandor Yu [Fri, 29 Sep 2017 06:05:32 +0000 (14:05 +0800)]
MLK-16538-4: defconfig: Add hdmi/dp driver to default kernel build

Default enable hdmi/dp drm dirver.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16570-2: hdmi audio: Add hdmi audio config function
Sandor Yu [Wed, 11 Oct 2017 11:05:13 +0000 (19:05 +0800)]
MLK-16570-2: hdmi audio: Add hdmi audio config function

Add hdmi audio config function to hdmi driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16570-1: hdp: Add hdp audio config function
Sandor Yu [Wed, 11 Oct 2017 11:00:58 +0000 (19:00 +0800)]
MLK-16570-1: hdp: Add hdp audio config function

Add hdp audio config function to hdp driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16538-3: hdmi/dp: Add imx8qm hdmi/dp driver
Sandor Yu [Fri, 29 Sep 2017 06:22:36 +0000 (14:22 +0800)]
MLK-16538-3: hdmi/dp: Add imx8qm hdmi/dp driver

Add hdmi/dp drm architecture driver.
HDMI and DP driver can work in imx8qm ARM2 board.
The driver support basic hotplug function.
Default working mode is 1080p60.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
Changes made during 4.19 rebase:
 * replaced drm_mode_connector_attach_encoder with drm_connector_attach_encoder;

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16538-2: hdmi api: Relocate hdmi api soure code
Sandor Yu [Fri, 29 Sep 2017 06:16:27 +0000 (14:16 +0800)]
MLK-16538-2: hdmi api: Relocate hdmi api soure code

-Relocate hdmi api source code from drivers/video/fbdev/mxc/cdn_hdp
to drivers/mxc/hdp.
-Add displayport and hdcp api function.
-Move t28hpc_hdmitx function from api source code folder
to hdmi fb driver folder.
-Update imx8 hdmi fb driver according api source code change.
-Sync api source code with CDN_API_1_0_33 release.

Acked-by: Robby Cai <robby.cai@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16184: hdmi: Add timeout check to hdmi initialize
Sandor Yu [Thu, 10 Aug 2017 10:51:10 +0000 (18:51 +0800)]
MLK-16184: hdmi: Add timeout check to hdmi initialize

Add timeout check for hdmi FW alive function to avoid
kernel booting hang for that board without HDMI FW.

CDN_API_General_Test_Echo_Ext_blocking is the first
function that calling mailbox.
Add timeout to the function to avoid kernel booting hang
for that board without HDMI ROM patch.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16119-01: fbdev: Add mx8 hdmi driver
Sandor Yu [Tue, 1 Aug 2017 09:41:01 +0000 (17:41 +0800)]
MLK-16119-01: fbdev: Add mx8 hdmi driver

Add hdmi api code from cadence.
Add mx8 hdmi driver.
Basic hdmi function:
no hotplug and no video mode dynamic change.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-16675-3: drm: imx: register mscale DCSS driver with IMX DRM core
Laurentiu Palcu [Thu, 19 Oct 2017 09:30:51 +0000 (12:30 +0300)]
MLK-16675-3: drm: imx: register mscale DCSS driver with IMX DRM core

To be used, the iMX8M DCSS driver has to be "registered" with the IMX
DRM core.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16675-2: drm: imx: add mscale DCSS drm driver
Laurentiu Palcu [Thu, 19 Oct 2017 09:29:54 +0000 (12:29 +0300)]
MLK-16675-2: drm: imx: add mscale DCSS drm driver

This patch adds DRM KMS support for i.MX8M's DCSS.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-16675-1: drm: imx: add mscale DCSS core driver
Laurentiu Palcu [Thu, 19 Oct 2017 09:27:23 +0000 (12:27 +0300)]
MLK-16675-1: drm: imx: add mscale DCSS core driver

This patch adds base suport for i.MX8M's Display Controller
subsystem(DCSS). It has built-in DPR, Scaler and HDR10 modules. Also, it
features a video Decompression and Tile to Raster Conversion (DTRC) unit,
as well as a graphics pixel decompression infrastracture (DEC400D).

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMGS-4653 upgrade 6.2.4.p4 gpu driver for L4.19
Xianzhong [Fri, 29 Mar 2019 07:28:13 +0000 (15:28 +0800)]
MGS-4653 upgrade 6.2.4.p4 gpu driver for L4.19

source branch: gpu-viv6/fsl_6.2.4.p4
commit: 5d4888f3d031ced5923839345f82973cb3e74663

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
6 years agoMLK-21274-3 drm/bridge: sec-dsim: add defer probe support
Fancy Fang [Thu, 28 Mar 2019 14:54:12 +0000 (22:54 +0800)]
MLK-21274-3 drm/bridge: sec-dsim: add defer probe support

Since the dsi panel device is not a component, so its driver
loading can be before or after the other display components
binding randomly. So add defer probing for sec dsim bridge
attach to support the case that the panel driver is loaded
after sec dsim binding.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21274-2 drm/bridge: sec-dsim: remove bridge assign for encoder
Fancy Fang [Thu, 28 Mar 2019 14:56:29 +0000 (22:56 +0800)]
MLK-21274-2 drm/bridge: sec-dsim: remove bridge assign for encoder

Remove the bridge assignment for encoder before the bridge
attach during the sec dsim bind stage, since if the bridge
attach succeeds, the assignment will be done in the attach,
or if attach fails, the encoder's bridge field should be
set to NULL, otherwise below warning message printed:

[    1.034614] WARNING: CPU: 1 PID: 1 at drivers/gpu/drm/drm_bridge.c:150 drm_bridge_detach+0x4c/0x54
[    1.043570] Modules linked in:
[    1.046630] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.19.30-03537-g02a6fac0da96 #338
[    1.054544] Hardware name: FSL i.MX8MM EVK board (DT)
[    1.059595] pstate: 60000005 (nZCv daif -PAN -UAO)
[    1.064386] pc : drm_bridge_detach+0x4c/0x54
[    1.068657] lr : drm_encoder_cleanup+0x28/0xa4
[    1.073099] sp : ffff00000807b9d0
[    1.076412] x29: ffff00000807b9d0 x28: ffff80007ab3ba80
[    1.081725] x27: 0000000000000039 x26: ffff80007a8a3080
[    1.087039] x25: ffff80007ab3ba88 x24: ffff80007ab6c800
[    1.092352] x23: 00000000ffffffed x22: ffff000008f1c518
[    1.097665] x21: ffff80007ab6c800 x20: ffff80007ab3ba88
[    1.102978] x19: 0000000000000000 x18: 0000000000000000
[    1.108291] x17: 0000000000000001 x16: 00000000000000fc
[    1.113604] x15: 0000000000000000 x14: 64697262206d6973
[    1.118917] x13: 642063657320646e x12: 6962206f74206465
[    1.124230] x11: ffffffffffffffff x10: 0000000000000006
[    1.129543] x9 : 0000000000000005 x8 : 000000000000068e
[    1.134856] x7 : 7320646e6962206f x6 : ffff000008668de4
[    1.140169] x5 : 0000000000000000 x4 : 0000000000000000
[    1.145481] x3 : ffffffffffffffff x2 : 0000000000000000
[    1.150794] x1 : 31cae07dd51c2b00 x0 : ffff80007a7bd580
[    1.156107] Call trace:
[    1.158555]  drm_bridge_detach+0x4c/0x54
[    1.162478]  drm_encoder_cleanup+0x28/0xa4
[    1.166574]  imx_sec_dsim_bind+0x1c4/0x1f8
[    1.170673]  component_bind_all+0xfc/0x24c
[    1.174770]  imx_drm_bind+0xa0/0x134
[    1.178346]  try_to_bring_up_master+0x148/0x1a8
[    1.182877]  component_add+0x9c/0x174
[    1.186539]  lcdif_crtc_probe+0x20/0x3c
[    1.190376]  platform_drv_probe+0x4c/0xb0
[    1.194385]  really_probe+0x21c/0x2b4
[    1.198047]  driver_probe_device+0xa8/0xfc
[    1.202143]  __driver_attach+0xd4/0xd8
[    1.205892]  bus_for_each_dev+0x64/0xc0
[    1.209728]  driver_attach+0x20/0x28
[    1.213303]  bus_add_driver+0x1c0/0x224
[    1.217140]  driver_register+0x68/0x120
[    1.220976]  __platform_driver_register+0x4c/0x54
[    1.225682]  lcdif_crtc_driver_init+0x18/0x20
[    1.230040]  do_one_initcall+0x58/0x168
[    1.233877]  kernel_init_freeable+0x1b4/0x274
[    1.238235]  kernel_init+0x10/0x104
[    1.241724]  ret_from_fork+0x10/0x18
[    1.245300] ---[ end trace a1ee52d990264440 ]---

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21274-1 gpu/imx: lcdif: set 'dma_mask' for client devices
Fancy Fang [Wed, 27 Mar 2019 11:28:41 +0000 (19:28 +0800)]
MLK-21274-1 gpu/imx: lcdif: set 'dma_mask' for client devices

Since the client devices are allocated manually in this driver,
its 'dma_mask' will not be initialized before its probe start,
and this will cause the dma configure for the client devices to
give a warning message "DMA mask not set". So make 'dma_mask' to
point to its 'coherent_dma_mask' by default to avoid this warnning.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-21150-4 drm/bridge: sec-dsim: a general way to compute PLL PMS
Fancy Fang [Sun, 17 Mar 2019 04:16:26 +0000 (12:16 +0800)]
MLK-21150-4 drm/bridge: sec-dsim: a general way to compute PLL PMS

A fixed PLL PMS setting for attached panel is obviously not
enough for any other mipi panel which needs a different PLL
output clock frequency, and besides, for the CEA-861 standard
display modes, the 'pll_pms' table also can not cover all the
modes requirements. So a general way is created to solve this
problem which can provide an optimum solution to output a PLL
bit clock to match the request frequency in a maximum degree
and also satisfy the input clock and intermediate clocks limit
according to the PLL specification.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a73fdd5e48fe0df47685cfc197fe66edc1e28405)

6 years agoMLK-21150-3 drm/bridge: sec-dsim: add a new property 'pref-rate'
Fancy Fang [Fri, 15 Mar 2019 04:09:58 +0000 (12:09 +0800)]
MLK-21150-3 drm/bridge: sec-dsim: add a new property 'pref-rate'

Add a new property 'pref-rate' support which can be used to
assign a different clock frequency for the DPHY PLL reference
clock in the dtb file. And if this property does not exist,
the default clock frequency for the reference clock will be
used. And according to the spec, the DPHY PLL reference clk
frequency should be in [6MHz, 300MHz] range.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit a9fafe8108505f8a1580af898ff5fa9c26d03680)

6 years agoMLK-21150-2 drm/bridge: sec-dsim: refine hblank word count compute
Fancy Fang [Fri, 15 Mar 2019 03:23:46 +0000 (11:23 +0800)]
MLK-21150-2 drm/bridge: sec-dsim: refine hblank word count compute

When there is no existing horizontal blanking word counts in
'dsim_hblank_par' tables, these data requires to be computed
according to the 'hfp', 'hbp' and 'hsa' timings which are in
pixel unit. So the pixel unit data requires to be converted
to word count unit data correctly to match the PLL output clk
frequency.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit af9ab0d4362d9298978e2ac62033f65ea1cc09ed)

6 years agoMLK-21150-1 drm/bridge: sec-dsim: change uint64_t clk fields to uint32_t
Fancy Fang [Fri, 15 Mar 2019 02:33:35 +0000 (10:33 +0800)]
MLK-21150-1 drm/bridge: sec-dsim: change uint64_t clk fields to uint32_t

Change the 'bit_clk' and 'pix_clk' fields of struct sec_mipi_dsim
and the 'bit_clk' field of struct dsim_pll_pms from 'uint64_t' type
to 'uint32_t' type, since first, these two fields are in KHz unit,
and so 32 bit unsigned integer is enough to hold the data values,
and second, use 32 bit integer can simplify related clocks compute.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 3e62c748a531ca5eacbf6a616d3a979be5222b9c)

6 years agoMLK-20687 drm/bridge: sec-dsim: correct LPM config for Long Packet
Fancy Fang [Mon, 7 Jan 2019 02:29:42 +0000 (10:29 +0800)]
MLK-20687 drm/bridge: sec-dsim: correct LPM config for Long Packet

According to the test, the Low Power Mode config should be
done before the Long Packet payload is written to SFR FIFO.
Otherwise, the packet send out by DSIM is not correct. This
should be the DSIM implementation behaviour.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c7833c3920264c32934870bc49006348be9ad397)

6 years agoMLK-20438 drm/bridge: sec-dsim: remove 'FORCEBTA' for packet send
Fancy Fang [Sat, 1 Dec 2018 09:08:20 +0000 (17:08 +0800)]
MLK-20438 drm/bridge: sec-dsim: remove 'FORCEBTA' for packet send

Configure 'FORCEBTA' mandatorily for every packet send may
cause some packet send timeout in a low possibility. And
until now, this timeout issue only happens during panel
disable callback with the below error log:

"
imx_sec_dsim_drv 32e10000.mipi_dsi: wait pkthdr tx done time out
panel-raydium-rm67191 32e10000.mipi_dsi.0: [drm:rad_panel_disable] *ERROR* Failed to enter sleep mode (-16)
imx_sec_dsim_drv 32e10000.mipi_dsi: panel disable failed: -16
panel-raydium-rm67191 32e10000.mipi_dsi.0: [drm:rad_panel_unprepare] *ERROR* Panel still enabled!
imx_sec_dsim_drv 32e10000.mipi_dsi: panel unprepare failed: -1
"

The root cause for this error is not clear, but remove
'FORCEBTA' can avoid it and won't cause any side effect.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 811696087681cd45a8150afff7a8da3a2a6eb113)

6 years agoMLK-20337 drm/imx: lcdif: block 'active CRTC with no plane' commit
Fancy Fang [Mon, 26 Nov 2018 11:17:51 +0000 (19:17 +0800)]
MLK-20337 drm/imx: lcdif: block 'active CRTC with no plane' commit

When an atomic commit contains an active CRTC with no plane,
it may cause two potential issues:

First, this CRTC will fetch its last attached plane data
or has no data can be fetched depending on the plane
driver's atomic_disable() implementation.

Second, this CRTC's 'plane_changed' will be false during
the whole commit tail stage, and this will make vblank
wait to be bypassed which directly causes the later wait
flip done timeout.

So add this commit case check to the LCDIF CRTC's atomic
check to block this kind of commits.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e4b792704c1ed48296f135fdab47070c4987881b)

6 years agoMLK-20416-2 video: fbdev: mxc: add RM68191 MIPI panel support
Fancy Fang [Tue, 20 Nov 2018 05:00:54 +0000 (13:00 +0800)]
MLK-20416-2 video: fbdev: mxc: add RM68191 MIPI panel support

The Driver IC 'RM68191' is used in the MIPI panel
'RK055IQH042' whose default mode is '540x960@60Hz'.
So this commit adds a new FBDEV driver for 'RM68191'
and enables the 'RK055IQH042' panel on IMX7ULP1-EVKB
platform with Northwest MIPI DSI controller.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 8d529576c51cf38e32d48dbc88834d688e06fc8b)

6 years agoMLK-20416-1 video: fbdev: mxc: add RM68200 MIPI panel support
Fancy Fang [Mon, 12 Nov 2018 14:25:24 +0000 (22:25 +0800)]
MLK-20416-1 video: fbdev: mxc: add RM68200 MIPI panel support

The Driver IC 'RM68200' is used in the MIPI panel
'RK055AHD042' whose default mode is '720x1280@60Hz'.
So this commit adds a new FBDEV driver for 'RM68200'
and enables the 'RK055AHD042' panel on IMX7ULP1-EVKB
platform with Northwest MIPI DSI controller.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 277bc948aa17a43285c340399bdaf7f099926677)

6 years agoMLK-19819-2 Revert "MLK-19318 drm/imx: lcdif: avoid log print when no device attached"
Fancy Fang [Tue, 9 Oct 2018 09:26:43 +0000 (17:26 +0800)]
MLK-19819-2 Revert "MLK-19318 drm/imx: lcdif: avoid log print when no device attached"

This reverts commit 05d335b07bab856b34317acbe3e3b9d9f58946ce, since the
commit e07309cfdc567623a3f0cde6b79b972910248152 (MLK-19819-1 drm/imx:
lcdif: bypass atomic check when CRTC is disabled) can cover the function
that commit 05d335b07bab856b34317acbe3e3b9d9f58946ce can provide.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 1201a0e8194da559703d64a26aa346a8de387baa)

6 years agoMLK-19819-1 drm/imx: lcdif: bypass atomic check when CRTC will be disabled
Fancy Fang [Tue, 9 Oct 2018 07:33:04 +0000 (15:33 +0800)]
MLK-19819-1 drm/imx: lcdif: bypass atomic check when CRTC will be disabled

On 4.14.y kernel branch, the DRM framework has been modified that
when no CONNECTOR attach to CRTC, the fb creation wil be deferred
until some CONNECTOR has been detected via hotplug. And the system
suspend workflow is also affected accordingly, if the CRTC atomic
check fails, the display-subsystem suspend also will be caused to
fail. So bypass the 'bus_format' check when CRTC is going to be
disabled.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6d54c414c2226bebe7201c69a67891eb4fcc5449)

6 years agoMLK-19318 drm/imx: lcdif: avoid log print when no device attached
Fancy Fang [Fri, 31 Aug 2018 03:27:29 +0000 (11:27 +0800)]
MLK-19318 drm/imx: lcdif: avoid log print when no device attached

In the 'lcdif_crtc_atomic_check()', when the 'bus_format' is
zero which means that there is no valid display peripherals
attached to LCDIF, return directly to avoid below error log
to make noises, since the error log is not cared in this case.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 25d2b80f637af06094f56c60d46404af3b7ff381)
(cherry picked from commit 535a7256a3eae059398acaa040f42a4aa650bbea)

6 years agoMLK-19400-2 drm/imx: sec-dsim_imx: alter 'rpm_suspended' to a counter
Fancy Fang [Wed, 29 Aug 2018 02:58:19 +0000 (10:58 +0800)]
MLK-19400-2 drm/imx: sec-dsim_imx: alter 'rpm_suspended' to a counter

Since the DSIM's runtime PM suspend() and resume() callbacks
are also called during system PM suspend() and resume(), it
is necessary to use a counter to record the suspended depth,
and 'rpm_suspended' field can be used as this purpose which
can help to detect and avoid runtime suspend and resume calls
mismatch caused problems, by changing the 'rpm_suspended' to
be an atomic integer from a boolean type.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 91a8e6c8f63db328fbc752b1659bdaa67ee5c8d5)
(cherry picked from commit 09f6ef5494d5fec7e3949bd80e4b51200b60dee3)