linux.git
6 years agoMLK-19500: drm: imx: dcss: fix tracing function
Laurentiu Palcu [Fri, 7 Sep 2018 07:14:57 +0000 (10:14 +0300)]
MLK-19500: drm: imx: dcss: fix tracing function

kzalloc with GFP_KERNEL argument, may sleep. dcss_trace_write() is
called also from interrupt context and sleeping is not acceptable.

This patch will make kzalloc() call atomic.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18848-2: drm: imx: dcss: swap vblank and ctxld_kick interrupts
Laurentiu Palcu [Tue, 4 Sep 2018 10:57:10 +0000 (13:57 +0300)]
MLK-18848-2: drm: imx: dcss: swap vblank and ctxld_kick interrupts

During boot time, the interrupt latency can reach 20ms due to UART
holding the interrupts disabled. If, during this time, VBLANK (LINE_0)
and CTXLD_KICK (LINE_1) are triggered, the handlers will be called in
the order of the irq_steer lines (vblank handler first and ctxld_kick
second). This may lead to "vblank wait timed out" warning messages from
DRM core, because the 50ms wait time is exceeded. Especially when
display is lower than 30fps.

Swapping the interrupt lines will have the ctxld_kick interrupt handler
always be called first, kicking the context loader ON before VBLANK
notification is sent to userspace.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18848-1: drm: imx: dcss: do not turn off DTG LINE0/1 interrupts
Laurentiu Palcu [Fri, 31 Aug 2018 14:00:01 +0000 (17:00 +0300)]
MLK-18848-1: drm: imx: dcss: do not turn off DTG LINE0/1 interrupts

DTG registers are double bufferred. Hence, enabling LINE0/1 interrupts
in DTG in frame 0 will actually activate them in frame 1. Hence, the
LINE0/1 interrupts (vblank and ctxld kick) will be missed in frame 0.

This patch will permanently activate the LINE0/1 interrupts in DTG and
only mask/unmask them at irq_steer controller level (disable_irq/enable_irq).

While at it, do the same change for DPR completion interrupts. Since, these are
only used for tracing purposes, the change is not supposed to affect
driver functionality in any way.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-19460-2: drm: imx: dcss: remove PM_QoS
Laurentiu Palcu [Wed, 5 Sep 2018 13:20:10 +0000 (16:20 +0300)]
MLK-19460-2: drm: imx: dcss: remove PM_QoS

This patch removes PM_QoS request from DCSS driver. This will allow the
A-53 cores to go idle even when DCSS is used.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-19460-1: drm: imx: dcss: lower CTXLD trigger IRQ threshold
Laurentiu Palcu [Wed, 5 Sep 2018 13:12:41 +0000 (16:12 +0300)]
MLK-19460-1: drm: imx: dcss: lower CTXLD trigger IRQ threshold

Currently, the CTXLD IRQ trigger interrupt is set to 98% of the total
vertical frame lines.  This leaves little room for interrupt handling
since the DB trigger point is set to 99%.

This patch moves the CTXLD IRQ trigger to 95%. Hence, if PM_QoS is
disabled, and A-53 cores are allowed to go to idle (hence slightly
bigger interrupt servicing time), we have enough time to handle the
interrupt and arm the CTLXD, before DB trigger point.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-19542: HDP: Fix iMX8QM 4Kp60 failed work with HDR10 TV
Sandor Yu [Tue, 11 Sep 2018 08:11:12 +0000 (16:11 +0800)]
MLK-19542: HDP: Fix iMX8QM 4Kp60 failed work with HDR10 TV

HDP diver force output 10bit YUV420 for HDR10 TV.
But iMX8QM didn't support such function.
So add SOC version check only enable the function for iMX8MQ.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19518-2: HDP API: continues running set mode function if ddc failed
Sandor Yu [Mon, 10 Sep 2018 10:27:43 +0000 (18:27 +0800)]
MLK-19518-2: HDP API: continues running set mode function if ddc failed

Continues running set mode function to support
edid read failed case.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19518-1: HDP: Set no_edid flag when edid read failed
Sandor Yu [Mon, 10 Sep 2018 10:25:09 +0000 (18:25 +0800)]
MLK-19518-1: HDP: Set no_edid flag when edid read failed

Set no_edid flag when edid read failed.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19496-3: HDP: max pixel clock support rate 297MHz for no edid case
Sandor Yu [Mon, 10 Sep 2018 07:40:57 +0000 (15:40 +0800)]
MLK-19496-3: HDP: max pixel clock support rate 297MHz for no edid case

Generally DDC function is not work with no edid.
Add max pixel clock support rate 297MHz for no edid case.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19496-2: HDP: Enable 4Kp60 support for i.MX8QM
Sandor Yu [Mon, 10 Sep 2018 01:16:58 +0000 (09:16 +0800)]
MLK-19496-2: HDP: Enable 4Kp60 support for i.MX8QM

Pixel combiner function is ready in patch set for MLK-19413.
Remove variable is_4kp60 from driver.
4Kp60 are supported for all platforms.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19496-1: HDP API: skip DDC write for iMX8QM A0 soc version
Sandor Yu [Mon, 10 Sep 2018 01:13:30 +0000 (09:13 +0800)]
MLK-19496-1: HDP API: skip DDC write for iMX8QM A0 soc version

DDC function is not ready for iMX8QM A0 soc version.
Skip DDC write.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19495: hdp: Add vendor infoframe
Sandor Yu [Fri, 7 Sep 2018 08:51:21 +0000 (16:51 +0800)]
MLK-19495: hdp: Add vendor infoframe

VIC code check is introduced in 4.14.y,
if a mode is found in HDMI 1.4b 4K modes.
HDMI driver should send its VIC in vendor infoframes.
Add vendor infoframe setting.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19399: HDP API: Merge CDN_1_0_38 API release
Sandor Yu [Thu, 30 Aug 2018 06:55:37 +0000 (14:55 +0800)]
MLK-19399: HDP API: Merge CDN_1_0_38 API release

Merge CDN_1_0_38 release to HDP API.
v1_0_38 release notes:
DP: Added functionality for setting own PHY register values related to
voltage swing and pre-emphasis.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-19468: drm: imx: dcss: fix blkctl setting for B1 silicon
Laurentiu Palcu [Fri, 7 Sep 2018 06:42:38 +0000 (09:42 +0300)]
MLK-19468: drm: imx: dcss: fix blkctl setting for B1 silicon

B1 silicon has a new ID and we need to handle it properly.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-19413-30 drm/imx: hdp: Add dual mode support
Liu Ying [Thu, 30 Aug 2018 08:21:39 +0000 (16:21 +0800)]
MLK-19413-30 drm/imx: hdp: Add dual mode support

This patch adds dual mode support in the i.MX HDP driver.
The single mode and dual mode can be switched dynamically
according to the input video mode(pixel clock rate and
active horizontal display width).

Signed-off-by: Liu Ying <victor.liu@nxp.com>
6 years agoMLK-19419: drm: imx: dcss: Add linear modifier support for all formats
Laurentiu Palcu [Fri, 31 Aug 2018 10:58:01 +0000 (13:58 +0300)]
MLK-19419: drm: imx: dcss: Add linear modifier support for all formats

Tiled formats are supported only for YUV420 semi-planar formats.
However, the other formats should support at least the LINEAR modifier.
Some userspace app may pass on framebuffers with the linear modifier
attached and, currently, this is rejected for YUV422 and RGB formats.

This patch fixes that.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
Reported-by: Jared Hu <jared.hu@nxp.com>
6 years agoMLK-19227-5: hdp: Add mutex for register access function
Sandor Yu [Tue, 28 Aug 2018 07:40:03 +0000 (15:40 +0800)]
MLK-19227-5: hdp: Add mutex for register access function

Both CEC and HPD thread will access HDP register read/write
function, add mutex to support mulit-thread access.

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

6 years agoMLK-19227-4: HDMI: edid function is not supported by i.MX8QM A0 chip
Sandor Yu [Wed, 15 Aug 2018 09:57:45 +0000 (17:57 +0800)]
MLK-19227-4: HDMI: edid function is not supported by i.MX8QM A0 chip

EDID function is not supported by i.MX8QM A0 SOC chip.

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

6 years agoMLK-19227-2: hdmi: Replace is_edid with no_edid
Sandor Yu [Wed, 15 Aug 2018 09:19:17 +0000 (17:19 +0800)]
MLK-19227-2: hdmi: Replace is_edid with no_edid

EDID function are default supported for all platform.
Remove is_edid variable.
Add no_edid for specific case.
such as EDID function is not supported
on iMX8QM ARM2 board with DP-HDMI converter.

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

6 years agoMA-12411 Enable in-fence function for DRM driver on IMX8 platform.
ivan.liu [Thu, 16 Aug 2018 06:54:34 +0000 (14:54 +0800)]
MA-12411 Enable in-fence function for DRM driver on IMX8 platform.

dcss_drm_atomic_commit and dpu_drm_atomic_commit will overide the in-fence.
Remove the common code from the driver to make in-fence can work.
And call pepare_fb() to do the same thing of set dma_buf fence.
The only difference is pepare_fb() won't set dma_buf fence if in-fence exists.

Change-Id: Idbaf3a765321e6d049aa9e39695a450eb0c760f0
Signed-off-by: ivan.liu <xiaowen.liu@nxp.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-19328-2: hdp: add channel map for hdmi audio
Shengjiu Wang [Wed, 29 Aug 2018 02:04:57 +0000 (10:04 +0800)]
MLK-19328-2: hdp: add channel map for hdmi audio

Add channel map for hdmi audio, originally it is in
audio info frame function, but removed by
commit 6b97462b6407 ("MLK-18690-3: hdp api: Remove
info frame API function")

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-19328-1: hdp: fix no sound output in second time
Shengjiu Wang [Wed, 29 Aug 2018 01:57:23 +0000 (09:57 +0800)]
MLK-19328-1: hdp: fix no sound output in second time

Fixes commit 6b97462b6407 ("MLK-18690-3: hdp api: Remove
info frame API function")

The info frame API is removed, so the maximum of state->tmp
is 8.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18995 drm/imx: hdp: Set pixel link vld and sync ctrl in enc->enable/disable
Liu Ying [Tue, 24 Jul 2018 16:26:24 +0000 (00:26 +0800)]
MLK-18995 drm/imx: hdp: Set pixel link vld and sync ctrl in enc->enable/disable

The pixel link validation and sync ctrl enablement should be the last
step to enable the display pipeline which involves the HDP encoder.
So, let's move the pixel link operations from initialization stage to
enc->enable/disable.  Also, the pixel_link_init/deinit hooks are replaced
with pixel_link_validate/invalidate and pixel_link_sync_ctrl_enable/disable,
since the display controller driver has already initialized the pixel link
at the driver probe stage.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit cb234bc95e870a540e2f3a608f743a7e72a3e754)

6 years agoMLK-18992-2 drm/imx: hdp: Don't set pixel link MST address
Liu Ying [Fri, 20 Jul 2018 08:18:52 +0000 (16:18 +0800)]
MLK-18992-2 drm/imx: hdp: Don't set pixel link MST address

The pixel link MST address is set by the display controller driver,
so let's remove the redundant setting from the hdp driver.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit f0f0a1970f2b34ad52fa9cfcb1a4de503fb231d6)

6 years agoMLK-17795: drm: imx: hdp: Fix 10-bit to 8-bit color depth switch on iMX8MQ
Laurentiu Palcu [Fri, 24 Aug 2018 08:17:19 +0000 (11:17 +0300)]
MLK-17795: drm: imx: hdp: Fix 10-bit to 8-bit color depth switch on iMX8MQ

When switching from a 10-bit to an 8-bit color depth, the PHY pixel engine
simply stops functioning correctly 90% of the time. This results in the
HDMI sink not detecting any signal.

This patch will reset the PHY pixel engine after the pipe clocks are ON,
in the bridge enable callback. This will make the pixel engine work
correctly when BPC changes. Resetting the pixel engine before all the pipe
clocks are on, produces no results.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit 72246ac9ccfa2074f4f575292af10d19a58c95c4)

6 years agoMLK-19310: drm: imx: hdp: Add support for 4K50
Oliver Brown [Wed, 22 Aug 2018 14:20:14 +0000 (09:20 -0500)]
MLK-19310: drm: imx: hdp: Add support for 4K50

4K@50 does not currently work. This patch will enable the scambler for
VIC96@50Hz.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit 0f13947a2fb72673b19c9f154eb202a9be916c4f)

6 years agoMLK-19274: drm: imx: dcss: add rotation functionality
Laurentiu Palcu [Mon, 20 Aug 2018 08:27:29 +0000 (11:27 +0300)]
MLK-19274: drm: imx: dcss: add rotation functionality

This patch will allow userspace to rotate planes by setting the
'rotation' property. Generally, 0 and 180 rotations are allowed for
pretty much all 8-bit xRGB and 2-plane YUV420 formats. 90/270 rotations
can be performed only for non-compressed tiled GPU xRGB formats. Tiled
YUV420 formats do not allow rotations at all because these formats need
DTRC for de-tiling and DTRC has no rotation support.

For more info, consult the DPR Features chapter in the reference manual.

Test example:

modetest -M imx-drm -w 27:rotation:4 -w 32:rotation:33 -w 27:alpha:30 -s
42@31:3840x2160-60@XR24 -P 32@31:3840x2160@NV21

The above will perform:
 * 180 degree rotation of primary plane (XR24);
 * vertical flip of first overlay plane (rotate-0 | reflect-y);
 * set primary plane alpha to 30;

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-19120-1 imx: hdp: Add AVPLL support for DisplayPort on iMX8QM
Oliver Brown [Thu, 2 Aug 2018 15:02:18 +0000 (10:02 -0500)]
MLK-19120-1 imx: hdp: Add AVPLL support for DisplayPort on iMX8QM

Add AVPLL support for DisplayPort on iMX8QM.
The AVPLL will be the default pixel clock source for DisplayPort.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-8: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY to Makefile
Oliver Brown [Mon, 16 Jul 2018 14:18:59 +0000 (09:18 -0500)]
MLK-18904-8: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY to Makefile

Adding API_AFE_mcu2_dp.o to the build.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-7: imx: hdp: Changing Reset function
Oliver Brown [Mon, 16 Jul 2018 13:59:41 +0000 (08:59 -0500)]
MLK-18904-7: imx: hdp: Changing Reset function

Reset function parameters are changing to support i.MX8M (MCU2).

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-6: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY to imx-hdp.c
Oliver Brown [Mon, 16 Jul 2018 13:57:16 +0000 (08:57 -0500)]
MLK-18904-6: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY to imx-hdp.c

Adding support for MCU2 DisplayPort to imx-hdp.c.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-5: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY to imx-dp.c
Oliver Brown [Mon, 16 Jul 2018 13:55:00 +0000 (08:55 -0500)]
MLK-18904-5: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY to imx-dp.c

Add support for MCU2 DisplayPort to imx-dp.c.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-4: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY
Oliver Brown [Mon, 16 Jul 2018 13:20:03 +0000 (08:20 -0500)]
MLK-18904-4: imx: hdp: Adding support for i.MX8M (MCU2) DP PHY

Adding DisplayPort support for i.MX8M (MCU2) PHY

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-3: imx: hdp: Moving AFE_check_rate_supported, adding support for i.MX8M...
Oliver Brown [Mon, 16 Jul 2018 13:13:40 +0000 (08:13 -0500)]
MLK-18904-3: imx: hdp: Moving AFE_check_rate_supported, adding support for i.MX8M (MCU2) DP PHY

Moving AFE_check_rate_supported which is used by i.MX8QM and i.MX8M
Adding headers for i.MX8M DP PHY.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-2: imx: hdp: Moving common functions, making private functions static
Oliver Brown [Mon, 16 Jul 2018 13:07:28 +0000 (08:07 -0500)]
MLK-18904-2: imx: hdp: Moving common functions, making private functions static

Moving AFE_check_rate_supported to API_AFE.c (another commit).
Making private functions static to prevent conflicts with iMX8M (MCU2).

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18904-1: hdp: Add memory region for iMX8M reset control
Oliver Brown [Mon, 16 Jul 2018 12:58:25 +0000 (07:58 -0500)]
MLK-18904-1: hdp: Add memory region for iMX8M reset control

Add reset memory region to allow reset of the HDMI/DisplayPort PHY.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18809: drm: imx: dcss: revert the max upscale ratio to 1:8
Laurentiu Palcu [Tue, 24 Jul 2018 13:32:41 +0000 (16:32 +0300)]
MLK-18809: drm: imx: dcss: revert the max upscale ratio to 1:8

The DCSS RM states that the maximum upscale ratio is 1:8. However, DCSS
HW team suggested some time back that upscale ratios of 1:16 could be
achieved with DCSS scaler, though these ratios were not validated.

Unfortunately there are corner cases, when the upscale ratio nears
1:16, that fail. At the recommendation of DCSS designers, we revert the
maximum ratio to 1:8 until further notice.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit bafb5a9481c289951872923d4bbbbcf24a8910b5)

6 years agoMLK-18826: drm: imx: dcss: fix hang when dumping registers
Laurentiu Palcu [Thu, 19 Jul 2018 11:07:14 +0000 (14:07 +0300)]
MLK-18826: drm: imx: dcss: fix hang when dumping registers

If DCSS is suspended, the clocks are disabled. Dumping the registers,
with the following command:

cat /sys/kernel/debug/imx-dcss/dump_registers

will hang the system, because of DTG.

This patch makes sure clocks are enabled before dumping the registers
and will immediately release them afterwards.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18978: drm: imx: dcss: fix warning message
Laurentiu Palcu [Thu, 19 Jul 2018 08:27:12 +0000 (11:27 +0300)]
MLK-18978: drm: imx: dcss: fix warning message

This patch fixes a warning message that's seen during 4.14 compilation.

  CC      drivers/gpu/drm/imx/dcss/dcss-plane.o
drivers/gpu/drm/imx/dcss/dcss-plane.c: In function ‘dcss_plane_atomic_set_base’:
drivers/gpu/drm/imx/dcss/dcss-plane.c:347:4: warning: ‘caddr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    dcss_dec400d_addr_set(dcss_plane->dcss, p1_ba, caddr);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The warning appeared because of a logic error in code that was
introduced by the following commit:

commit a46e1cd7df28 ("MGS-3560 [#imx-913] Enable DRM compression for
mscale board")

The above commit moved a piece of code, that was located under
switch-case branch, under a do-while() loop and converted all the
returns to breaks. However, a break makes the code exit the while loop
and will continue executing the code under the case branch. Hence, caddr
may be used whithout being initialized.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Yong Gan <yong.gan@nxp.com>
6 years agoMLK-18848: drm: imx: dcss: fix kernel oops
Laurentiu Palcu [Thu, 19 Jul 2018 07:32:17 +0000 (10:32 +0300)]
MLK-18848: drm: imx: dcss: fix kernel oops

This patch fixes a NULL pointer dereference error that can happen
randomly, in certain conditions. The reason for the oops were assignments
that were done before checking that the actual pointer was valid...

Additionally, add a crtc check when duplicating the state.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMGS-3560 [#imx-913] Enable DRM compression for mscale board
Yong Gan [Tue, 3 Jul 2018 22:23:51 +0000 (06:23 +0800)]
MGS-3560 [#imx-913] Enable DRM compression for mscale board

Refine the code for compressed format support.

Date: June 29, 2018
Signed-off-by: Yong Gan <yong.gan@nxp.com>
6 years agoMLK-18726-3: drm edid: Add QD980 deivce to edid quirk list
Sandor Yu [Fri, 13 Jul 2018 07:16:25 +0000 (15:16 +0800)]
MLK-18726-3: drm edid: Add QD980 deivce to edid quirk list

Add QD980 to edid quirk list.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18726-2: hdmi audio: HDMI 1.4 CTS 7-31 pass
Sandor Yu [Fri, 13 Jul 2018 07:14:06 +0000 (15:14 +0800)]
MLK-18726-2: hdmi audio: HDMI 1.4 CTS 7-31 pass

CT bits in Audio info frame shall always be set to 0.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18726-1: hdmi: Disable GCP when bpp is 24 to pass CTS 7-19
Sandor Yu [Mon, 2 Jul 2018 07:42:39 +0000 (15:42 +0800)]
MLK-18726-1: hdmi: Disable GCP when bpp is 24 to pass CTS 7-19

Refer to HDMI 1.4 section 6.5.3, non-zero CD data GCP should send in
deep color mode.
Now, when HDMI work in 24bpp, it will send non-zero CD(0x4 for 24bit)
data GCP to protocol analyzer.
It means current HDMI source is working in “24bit deep color mode”.

But HDMI 1.4 CTS 7-19 required DUT should in “No Deep Color support”.
Protocol analyzer expect received zero CD GCP or no GCP.

Disable GCP when bpp is 24 to pass CTS 7-19.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18873: drm: imx: dcss: request PM QoS only when VBLANK is on
Laurentiu Palcu [Thu, 12 Jul 2018 07:29:38 +0000 (10:29 +0300)]
MLK-18873: drm: imx: dcss: request PM QoS only when VBLANK is on

DCSS needs PM QoS in order to keep interrupt latency low. Otherwise,
page flipping will not work smooth enough because CTXLD will not be
triggered in time.

Currently, PM QoS is requested all the time but that does not allow the
CPUs to go idle. Hence, this leads to increased power consumption.

This patch will change how PM QoS is requested by doing it only when
VBLANK is enabled/disabled. The VBLANK interrupt is enabled just before
a commit takes place and disabled after one second after last commit.
This will allow DCSS to function properly and, also, allow CPUs to go
idle whenever there's no buffer submitted.

Exception to this is when DTRC is used (when DCSS is passed tiled
buffers). In this case, PM QoS will always be active, even if no buffer
is submitted, because DTRC banks need to be switched in CTXLD ISR, so
that DCSS does not underrun. DTRC does not have the REPEAT feature, as
the rest of DCSS does.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMA-11589 drm: Implement HDR source metadata atomic set property.
ivan.liu [Tue, 20 Mar 2018 17:15:02 +0000 (01:15 +0800)]
MA-11589 drm: Implement HDR source metadata atomic set property.

set_property calls drm_atomic_helper_connector_set_property.
And it will call atomic_set_property which sets metadata.

Change-Id: Ia264cfb34f4744fe3622d2568cdc5f5cee090554
Signed-off-by: ivan.liu <xiaowen.liu@nxp.com>
6 years agoMLK-18728: drm: imx: hdp: fix 4K@60 on mscale
Laurentiu Palcu [Mon, 2 Jul 2018 10:03:38 +0000 (13:03 +0300)]
MLK-18728: drm: imx: hdp: fix 4K@60 on mscale

On mscale, 4K@60 uses YUV420. However, the following commit:

8eeed3553bd1: MLK-18690-1: hdmi: Rewrite hdmi avi infoframe function

moved to using the kernel built-in infoframe creation routine, instead
of Cadence's one, but skipped handling the various colorspace formats.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18690-3: hdp api: Remove info frame API function
Sandor Yu [Tue, 26 Jun 2018 09:34:52 +0000 (17:34 +0800)]
MLK-18690-3: hdp api: Remove info frame API function

Remove info frame function from CDN API.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18690-2: hdmi: Add audio info frame
Sandor Yu [Tue, 26 Jun 2018 08:49:04 +0000 (16:49 +0800)]
MLK-18690-2: hdmi: Add audio info frame

Add audio info frame for hdp hdmi driver.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18690-1: hdmi: Rewrite hdmi avi infoframe function
Sandor Yu [Tue, 26 Jun 2018 07:07:34 +0000 (15:07 +0800)]
MLK-18690-1: hdmi: Rewrite hdmi avi infoframe function

Remove Cadence AVI infoframe function.
Replace with hdmi avi infoframe api function.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18809: drm: imx: dcss: fix cropping check for linear buffers
Laurentiu Palcu [Tue, 10 Jul 2018 10:11:40 +0000 (13:11 +0300)]
MLK-18809: drm: imx: dcss: fix cropping check for linear buffers

Currently, DCSS driver does not support cropping for linear buffers,
only tiled ones. Current checks return an error only if the submitted
buffer has no modifiers present. However, Weston uses modifiers even for
linear buffers and we need to check for that.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18844: drm: imx: dcss: lower mode change time
Laurentiu Palcu [Tue, 10 Jul 2018 05:24:27 +0000 (08:24 +0300)]
MLK-18844: drm: imx: dcss: lower mode change time

Currently, there's a hardcoded wait time (500ms) after enabling DTG
clocks. This is supposed to avoid VBLANK timeout warning messages.
However, this time is quite big. This patch changes this by lowering this
time as much as possible, with the use of completion events. After
enabling CRTC we just block until the first VBLANK interrupt comes. This
way, we know for sure that we'll never get a VBLANK timeout.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18767: drm: imx: dcss: fix vblank timed out warning
Laurentiu Palcu [Wed, 4 Jul 2018 13:37:08 +0000 (16:37 +0300)]
MLK-18767: drm: imx: dcss: fix vblank timed out warning

The following commit:

f9a03b3 - MLK-17925: drm: imx: dcss: fix tearing

introduced a regression because we does not send VBLANK event if context
loader was not flushed. But this condition is always met immediately
after enabling the CRTC. Hence, when 30FPS modes are selected, it is
possible to exceed the 50ms vblank timeout if the first event is not
sent. That's because 2 x 0.33ms > 50ms. This does not happen for 60fps
modes though.

This patch will force sending the first vblank event even if the context
loader is not completely flushed.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18680-4: drm: imx: dcss: activate DPR completion interrupts
Laurentiu Palcu [Mon, 18 Jun 2018 05:58:01 +0000 (08:58 +0300)]
MLK-18680-4: drm: imx: dcss: activate DPR completion interrupts

This patch activates DPR completion interrupts, just for tracing and
detecting green screen issues.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18680-3: drm: imx: dcss: activate DTRC interrupts for debugging
Laurentiu Palcu [Mon, 25 Jun 2018 11:47:40 +0000 (14:47 +0300)]
MLK-18680-3: drm: imx: dcss: activate DTRC interrupts for debugging

DTRC interrupts will not be used for switching the banks, as the CTXLD
will be used for that, however these are useful for tracing and
debugging green screen issues when DTRC is used.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18680-2: drm: imx: dcss: add some traces
Laurentiu Palcu [Mon, 25 Jun 2018 10:50:30 +0000 (13:50 +0300)]
MLK-18680-2: drm: imx: dcss: add some traces

This patch will add traces for the following events:
 * CTXLD arm, completion and kick;
 * VBLANKs;
 * atomic flushes;
 * plane updates (printing the DPR buffer base address);

These will allow us to measure and analyze where bottlenecks are:
application or driver.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18680-1: drm: imx: dcss: low latency tracing mechanism
Laurentiu Palcu [Mon, 25 Jun 2018 10:43:05 +0000 (13:43 +0300)]
MLK-18680-1: drm: imx: dcss: low latency tracing mechanism

This patch adds a DCSS tracing mechanism that introduces as low latency
as possible, so that it does not affect timings. Instead of text, 64 bit
tags will be logged, together with the system time in nanoseconds. Based
on these, post-processing can be done on any PC to compute deltas,
delays, missed buffers, etc.

Example usage:

echo 1 > /sys/module/imx_dcss_core/parameters/tracing
gplay-1.0 movie.mpg
echo 0 > /sys/module/imx_dcss_core/parameters/tracing

To dump the trace:
cat /sys/kernel/debug/imx-dcss/dump_trace_log > trace.txt

With the help of a scripting language (awk), the trace can then be
post-processed and analyzed on the PC.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18618-2: hdp: Recovery pre video mode after cable plugin
Sandor Yu [Fri, 15 Jun 2018 02:41:47 +0000 (10:41 +0800)]
MLK-18618-2: hdp: Recovery pre video mode after cable plugin

The patch can fix 4Kp60 video mode failed to work afer cable
plugout/in.
DRM driver will not call mode set function if video mode isn't changed.
But for 4Kp60, scrambling and TMDS_Bit_Clock_Ratio should
reconfiguration after cable plugin.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18618-1: hdp: Add faile check for get_table_row
Sandor Yu [Fri, 15 Jun 2018 02:41:05 +0000 (10:41 +0800)]
MLK-18618-1: hdp: Add faile check for get_table_row

Add faile check for get_table_row.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18558-05: hdp: Add pixel clock support range check
Sandor Yu [Wed, 13 Jun 2018 07:40:39 +0000 (15:40 +0800)]
MLK-18558-05: hdp: Add pixel clock support range check

Add hdmi pixel clock support range check for imx8m.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18558-04: hdp: Rename hdmi phy config function
Sandor Yu [Wed, 13 Jun 2018 06:29:15 +0000 (14:29 +0800)]
MLK-18558-04: hdp: Rename hdmi phy config function

Rename imx8qm hdmi phy config function,
add ss28fdsoi postfix.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18558-03: hdp: Add hdmi phy config table for imx8m
Sandor Yu [Mon, 11 Jun 2018 06:59:54 +0000 (14:59 +0800)]
MLK-18558-03: hdp: Add hdmi phy config table for imx8m

Add hdmi phy config table for imx8m.
Rebase imx8m hdmi code to CDN_API_1_0_37.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18558-02: hdp: move common function to hdp API library.
Sandor Yu [Mon, 11 Jun 2018 07:56:48 +0000 (15:56 +0800)]
MLK-18558-02: hdp: move common function to hdp API library.

Move common functions to hdp API library.
Change coding style.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18558-01: hdp: Add NXP copyright
Sandor Yu [Mon, 11 Jun 2018 06:49:42 +0000 (14:49 +0800)]
MLK-18558-01: hdp: Add NXP copyright

Refine comments and coding style.
Add NXP copyright.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18556: hdp: Add default video modes
Sandor Yu [Mon, 11 Jun 2018 06:32:00 +0000 (14:32 +0800)]
MLK-18556: hdp: Add default video modes

Add default video modes if EDID read failed.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17925: drm: imx: dcss: fix tearing
Laurentiu Palcu [Mon, 4 Jun 2018 11:47:36 +0000 (14:47 +0300)]
MLK-17925: drm: imx: dcss: fix tearing

The video tearing appeared only when the application used 2 buffers.
That's because, sometimes, the context loader could be armed after the
DB event came in the frame trace. That made a buffer submitted in frame
N end up on screen in frame N+2 because the context loader waits for the
next DB event. Since vblank events are sent at the end of the frame, by
the time the buffer lands on screen, the application will reuse it while
it's being displayed, hence the tearing effect.

This patch moves the CTXLD trigger moment all the way to the end of the
frame trace, just before DB event arrives. This will leave the
application plenty of time to submit new buffers.

In the event that the trigger moment is missed (application submits a
buffer right at the end of a frame trace), then we're not signalling the
next VBLANK event to application. This way, application will know that
the buffer is still needed and will not submit a new one.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18581: drm: imx: dcss: allow DRM_FORMAT_MOD_LINEAR modifier
Laurentiu Palcu [Wed, 13 Jun 2018 06:36:10 +0000 (09:36 +0300)]
MLK-18581: drm: imx: dcss: allow DRM_FORMAT_MOD_LINEAR modifier

Weston will use this modifier when playing linear formats so we need to
handle it correctly.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18578: hdmi arc: fix noise issue with 96kHz/192kHz.
Shengjiu Wang [Mon, 11 Jun 2018 07:53:32 +0000 (15:53 +0800)]
MLK-18578: hdmi arc: fix noise issue with 96kHz/192kHz.

After enable the boost circuit of tx_ana_ctrl_reg_5, the noise
issue with ARC is gone.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Sandor.yu <sandor.yu@nxp.com>
6 years agoMLK-18368-8: imx-hdmi: change the platform device id for hdmi audio tx
Shengjiu Wang [Wed, 23 May 2018 08:04:19 +0000 (16:04 +0800)]
MLK-18368-8: imx-hdmi: change the platform device id for hdmi audio tx

platform device id of TX is 1, RX is 2.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18368-7: imx-hdmi: change the entry id of meta data
Shengjiu Wang [Tue, 22 May 2018 07:33:54 +0000 (15:33 +0800)]
MLK-18368-7: imx-hdmi: change the entry id of meta data

For entry id of video is 0,  audio is 1, if entry id of meta data is
1, then it conflict with audio.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18368-3: hdp: add CDN_API_InfoframeRemovePacket function
Shengjiu Wang [Tue, 22 May 2018 07:31:07 +0000 (15:31 +0800)]
MLK-18368-3: hdp: add CDN_API_InfoframeRemovePacket function

add function to remove infoframe base on the packet type.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
6 years agoMLK-18355-4: imx hdp: Get cec clk div from SW_CLK_H register
Sandor Yu [Fri, 18 May 2018 07:29:43 +0000 (15:29 +0800)]
MLK-18355-4: imx hdp: Get cec clk div from SW_CLK_H register

Remove get core clock rate code,
get cec clk div from HDMI SW_CLK_H register.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18355-3: HDP API: Add new API function CDN_API_GetClock
Sandor Yu [Fri, 18 May 2018 07:18:09 +0000 (15:18 +0800)]
MLK-18355-3: HDP API: Add new API function CDN_API_GetClock

Add new API function CDN_API_GetClock.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18355-1: hdp-cec: Move imx8 hdp cec driver to mxc folder
Sandor Yu [Thu, 17 May 2018 03:32:51 +0000 (11:32 +0800)]
MLK-18355-1: hdp-cec: Move imx8 hdp cec driver to mxc folder

Move iMX8 HDP CEC driver to MXC folder.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-18267-1: hdmi tx: Fix HDP driver error variable
Sandor Yu [Thu, 12 Apr 2018 03:03:04 +0000 (11:03 +0800)]
MLK-18267-1: hdmi tx: Fix HDP driver error variable

Fix HDP driver configurate error variable.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17893 drm: imx: hdp: Adjust HDMI Vswing
Oliver Brown [Mon, 7 May 2018 18:30:57 +0000 (13:30 -0500)]
MLK-17893 drm: imx: hdp: Adjust HDMI Vswing

The HDMI voltage swing needs to be increased for HDMI compliance.

Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
6 years agoMLK-18163-3: drm: imx: hdp: properly check DC bit depth
Laurentiu Palcu [Wed, 2 May 2018 10:33:37 +0000 (13:33 +0300)]
MLK-18163-3: drm: imx: hdp: properly check DC bit depth

Currently, the code checks if RGB supports 10-bit when it should
actually check that YUV420 supports 10-bit.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit 4064f377b0425fd7ec2c3ed15410ae7fad4077b5)

6 years agoMLK-18163-2: drm: imx: dcss: Fix bit depth checking for YUV420
Laurentiu Palcu [Wed, 2 May 2018 10:29:20 +0000 (13:29 +0300)]
MLK-18163-2: drm: imx: dcss: Fix bit depth checking for YUV420

When YUV420 is used, we need to check that the deep color mode actually
supports the bit depth required. Currently, the code checks the RGB bit
depth.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit 5ac33861906cb7be660cc5c0a0f494194a81275a)

6 years agoMLK-18164: drm: imx: dcss: fix max upscale ratio
Laurentiu Palcu [Thu, 26 Apr 2018 13:43:07 +0000 (16:43 +0300)]
MLK-18164: drm: imx: dcss: fix max upscale ratio

Currently, the maximum upscale ratio is 1:7. However, DCSS can support
upscale ratios up to 1:16, even though the RM states the maximum upscale
ratio is 1:8.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
(cherry picked from commit 361a057ceec0676be069b2150ee533b7ad11227a)

6 years agoMLK-18104: drm: imx: dcss: Fix brightness on some HDMI 1.4 ports
Laurentiu Palcu [Fri, 20 Apr 2018 11:19:56 +0000 (14:19 +0300)]
MLK-18104: drm: imx: dcss: Fix brightness on some HDMI 1.4 ports

Some HDR TVs have multiple HDMI ports but only one of them is HDMI 2.0
compliant, hence HDR capable. The rest are HDMI 1.4.

The HDMI 1.4 ports' supported colorimetry is only REC.709 and REC.601.
However, the supported EOTF in HDR metadata block can be BT.2084 which
should be matched with REC.2020.

This patch makes sure that BT2084 is used only if colorimetry supports
REC.2020. Otherwise, REC.709 will be used.

Additionally, change a message from info to debug. No need for it to
show up all the time.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18115: drm: imx: dcss: fix usage of uninitialized variable
Laurentiu Palcu [Mon, 23 Apr 2018 13:06:41 +0000 (16:06 +0300)]
MLK-18115: drm: imx: dcss: fix usage of uninitialized variable

In certain conditions, i.e. YUV mode, pixel_depth variable will be used
uninitialized. This can lead to unpredictable behavior.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18116: drm: imx: dcss: fix crtc enumeration problem
Laurentiu Palcu [Mon, 23 Apr 2018 08:17:23 +0000 (11:17 +0300)]
MLK-18116: drm: imx: dcss: fix crtc enumeration problem

The following commit:

44b460cfe554 ("drm: imx: remove struct imx_drm_crtc and
imx_drm_crtc_helper_funcs")

removed some functions from imx-drm-core. As a consequence,
the CRTC ports were not detected properly.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-18045-3 drm/imx: dcss: bypass dec400d if 'compressed' is false
Fancy Fang [Sun, 15 Apr 2018 05:14:34 +0000 (13:14 +0800)]
MLK-18045-3 drm/imx: dcss: bypass dec400d if 'compressed' is false

When the fb's modifier is 'DRM_FORMAT_MOD_VIVANTE_SUPER_TILED_FC',
the compression state can be changed to non-compress according to
the 'compressed' field value of 'struct dma_metadata' data. At this
moment, the DEC400D should be bypassed.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-18045-2 drm/imx: dcss: import tile status buffer from 'ts_dma_buf'
Fancy Fang [Mon, 9 Apr 2018 11:36:16 +0000 (19:36 +0800)]
MLK-18045-2 drm/imx: dcss: import tile status buffer from 'ts_dma_buf'

When the fb's gem_obj associated 'dma_buf' field is set with
valid value, the tile status buffer need to be imported with
the 'ts_dma_buf' which is passed from the 'dma_metadata' to
get the tile status buffer start physical address.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-18045-1 drm/imx: dcss: define 'struct dma_metadata' for dec400d config
Fancy Fang [Tue, 17 Apr 2018 02:56:07 +0000 (10:56 +0800)]
MLK-18045-1 drm/imx: dcss: define 'struct dma_metadata' for dec400d config

Define a new struct 'dma_metadata' to hold the config parameters
for DEC400D. This struct data should be passed in from the fb's
first gem_obj's 'dma_buf' field.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
6 years agoMLK-18000: drm: imx: dcss: compute filter coeff based on scaling ratios
Dzung Hoang [Wed, 11 Apr 2018 08:37:47 +0000 (11:37 +0300)]
MLK-18000: drm: imx: dcss: compute filter coeff based on scaling ratios

Currently, scaler filter coefficients are hardcoded. However, they need
to be re-computed, based on input/output resolution as well.

Also, in order to use the scaler 7-tap filter, DPR RTRAM rows need to be
changed accordingly.

Signed-off-by: Dzung Hoang <dzung.hoang@nxp.com>
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-10: drm: imx: dcss: remove unused variable warning
Laurentiu Palcu [Sun, 25 Mar 2018 13:41:52 +0000 (08:41 -0500)]
MLK-17703-10: drm: imx: dcss: remove unused variable warning

dcss_crtc variable was not used anymore and generated a compilation
warning. Remove it.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-9: drm: imx: dcss: align input and output pipe gamut and nonlinearity
Laurentiu Palcu [Fri, 23 Mar 2018 22:36:33 +0000 (17:36 -0500)]
MLK-17703-9: drm: imx: dcss: align input and output pipe gamut and nonlinearity

For better results, output and input pipe gamut and nonlinearity should
match.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-8: drm: imx: dcss: default output pipe gamut to REC709
Laurentiu Palcu [Fri, 23 Mar 2018 22:34:55 +0000 (17:34 -0500)]
MLK-17703-8: drm: imx: dcss: default output pipe gamut to REC709

In case we don't get any information about colorimetry from HDMI sink,
set default gamut to REC709.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-7: drm: imx: dcss: configure output pipe according to what sink supports
Laurentiu Palcu [Fri, 23 Mar 2018 13:25:05 +0000 (08:25 -0500)]
MLK-17703-7: drm: imx: dcss: configure output pipe according to what sink supports

Output pipe tables' configuration was hardcoded. This patch will allow the output
pipe to be configured according to what the sink supports.

Also, since there's no way to pass gamut and nonlinearity settings from userspace,
configure the input pipe as REC2020/REC2084.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-6: drm: imx: dcss: fix output colorimetry in crtc
Laurentiu Palcu [Fri, 23 Mar 2018 13:23:11 +0000 (08:23 -0500)]
MLK-17703-6: drm: imx: dcss: fix output colorimetry in crtc

The detection of the supported output colorimetry was wrong. This patch will
fix that and, also, get rid of the REC2100HLG EOTF setting for now. It produces
bad colors.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-5: drm: imx: dcss: ignore the 8 bit for input pipe
Laurentiu Palcu [Fri, 23 Mar 2018 12:48:13 +0000 (07:48 -0500)]
MLK-17703-5: drm: imx: dcss: ignore the 8 bit for input pipe

Since the input of HDR10 is always 10-bit, ignore 8-bit flags when
setting up the output pipe.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-4: drm: imx: dcss: return the hdr10 table at once
Laurentiu Palcu [Fri, 23 Mar 2018 12:46:48 +0000 (07:46 -0500)]
MLK-17703-4: drm: imx: dcss: return the hdr10 table at once

Don't go through the rest of the list if we found our table. Just return it
immediately.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17703-3: drm: imx: hdp: send the right colorimetry to the sink
Laurentiu Palcu [Thu, 22 Mar 2018 23:10:28 +0000 (18:10 -0500)]
MLK-17703-3: drm: imx: hdp: send the right colorimetry to the sink

Currently, the colorimetry was hardcoded to NONE. However, a sink may support
different types of colorimetry. This patch will allow for the colorimetry to be
set according to what the sink supports.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Sandor Yu <sandor.yu@nxp.com>
6 years agoMLK-17703-2: drm: change HDR metadata infoframe structure
Laurentiu Palcu [Thu, 22 Mar 2018 22:08:10 +0000 (17:08 -0500)]
MLK-17703-2: drm: change HDR metadata infoframe structure

According to ANSI-CTA-861-G specification:
 * EOTF is 8 bit, not 16;
 * metadata type is 8 bit, not 16;
 * There's no "Minimum Content Light Level"

This patch will change the HDR metadata structures to reflect that. Also, this
will fix problems seen on some TVs that were rejecting HDR metadata because
it's size was too big (more than 26 bytes).

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
CC: Sandor Yu <sandor.yu@nxp.com>
6 years agoMLK-17796: hdp: Remove duplicate define variable cur_mode
Sandor Yu [Wed, 14 Mar 2018 02:45:10 +0000 (10:45 +0800)]
MLK-17796: hdp:  Remove duplicate define variable cur_mode

variable cur_mode have define in struct of imx_hdp.video.
so remove it in stuct imx_hdp.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17648-2: drm: imx: dcss: Load the HDR10 from header file
Laurentiu Palcu [Fri, 9 Mar 2018 12:12:58 +0000 (14:12 +0200)]
MLK-17648-2: drm: imx: dcss: Load the HDR10 from header file

This commit allows one to select if a firmware file is used, for loading
the HDR10 tables, or a header. By default, this will be header file.
This is until a proper way of passing the file from bootloader is found.

Also, fix a minor bug which made parsing the tables over the actual data
limit.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17647: drm: imx: dcss: fix the flip_done timed out problem
Laurentiu Palcu [Thu, 8 Mar 2018 09:47:05 +0000 (11:47 +0200)]
MLK-17647: drm: imx: dcss: fix the flip_done timed out problem

The commit:

44c45128 - MLK-17634-1: drm: imx: dcss: send vblank event from ISR

made some changes related to vblank handling. However, it looks like
they were not robust enough and, sometimes, the flip events are not
sent. This happens only when playing videos over Weston.

This patch, effectively, reverts those changes.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
6 years agoMLK-17692-4: imx hdp: Add pixel clock return check
Sandor Yu [Thu, 8 Mar 2018 08:14:36 +0000 (16:14 +0800)]
MLK-17692-4: imx hdp: Add pixel clock return check

Return 0 if pixel clock isn't supported by hdmi phy.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
6 years agoMLK-17692-3: imx hdp: Remove CDN vic table
Sandor Yu [Tue, 6 Mar 2018 09:17:35 +0000 (17:17 +0800)]
MLK-17692-3: imx hdp: Remove CDN vic table

Remove CDN vic table and replace with drm_display_mode.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>