Commit Graph

467 Commits

Author SHA1 Message Date
0e8e5229e7 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>
2019-02-12 10:33:49 +08:00
768d12033b 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>
2019-02-12 10:33:49 +08:00
0f282c378c 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>
2019-02-12 10:33:49 +08:00
387a950fec 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>
2019-02-12 10:33:49 +08:00
cb3b6fa8a2 MLK-19484 drm/imx: dpu: crtc: Correct master extdst when plane_ed is slave
This patch corrects master extdst when the relevant plane_ed of
the CRTC is slave.  This is code change only because there is no
real usecase supported by existing hardwares may trigger the issue.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:48 +08:00
17a05d10cd 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>
2019-02-12 10:33:44 +08:00
e644b20c35 MLK-19413-29 drm/imx: dpu: kms: Add pixel combiner support
This patch adds pixel combiner support in the DPU KMS driver.
Pretty much logics are implemented to allocate/organize the
CRTC resources(extdst, framegen, tcon, pixel combiner, etc)
and plane resources(extdst, fetchunit, layerblend, etc) which
are needed to drive a high pixel rate display via pixel combiner.
Additional logics are implemented to support sync up mode fixup
found in the new version of DPU IP.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:44 +08:00
940726cd13 MLK-19413-28 drm/imx: dpu: crtc: Export more dpu crtc information from dpu-crtc.h
This patch moves several basic structures and helpers of DPU CRTC from
the DPU CRTC driver to dpu-crtc.h so that more DPU CRTC information can
be exported there.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:44 +08:00
d84dd1e1a2 MLK-19413-21 drm/imx: dpu: crtc: Peek auxiliary CRTC resources
Cache the auxiliary CRTC resources in struct dpu_crtc via the
dpu_aux_{unit}_peek() helpers so that the DPU CRTC driver may
use them later.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:43 +08:00
fcb9e51e91 MLK-19413-20 drm/imx: dpu: crtc: Set crtc group id
The DPU CRTC device driver may get the CRTC group id from
the pdata of the device.  Let's cache it in struct dpu_crtc
so that the driver may use it later.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:43 +08:00
9a169f8229 MLK-19413-18 gpu: imx: tcon: Add side-by-side support
This patch adds side-by-side support for tcon so that
two tcons can participate in the dual display streams
to work with pixel combiner to drive a high pixel rate
display.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:43 +08:00
aacb8b4de8 MLK-19413-17 gpu: imx: dpu: framegen: Add side-by-side support
This patch adds side-by-side support for framegen so that
two framegens can work in sync mode to participate in the
dual display streams to drive a high pixel rate display
via a pixel combiner.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:43 +08:00
929179b1f2 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>
2019-02-12 10:33:39 +08:00
db21056872 MLK-19409 drm/imx: dpu: crtc: Remove stream_id argument from dpu_crtc_get_resources()
The dpu_crtc argument of dpu_crtc_get_resources() contains the stream ID
information, so it's unnecessary to pass the stream_id argument to this
function.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:37 +08:00
6e19e3a427 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)
2019-02-12 10:33:36 +08:00
71a7f03246 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)
2019-02-12 10:33:36 +08:00
d812bfeeb2 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)
2019-02-12 10:33:35 +08:00
8c09153836 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>
2019-02-12 10:33:35 +08:00
c35d4e7a78 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 6b97462b64 ("MLK-18690-3: hdp api: Remove
info frame API function")

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2019-02-12 10:33:35 +08:00
b98e60027b MLK-19176 drm/imx: dpu: plane: Correct fetchunit's src_x/y for linear pix fmts
For framebuffer linear pixel formats, we calculate the buffer address
with an offset to do framebuffer start point x/y cropping.  This way,
the src_x/y seen by fetchunit(including prefetch engine, if used) can
be zero.  The reason why it still works with the existing nonzero
settings is very likely that the fetchunit or prefetch engine may
discard the initial invalid pixels by looking at the correct buffer
address, frame stride, frame width and frame height.  However, it
would be good to correct the mistake in driver.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 8847a9b7c2)
2019-02-12 10:33:35 +08:00
d0796bff82 MLK-19114-2 gpu: imx: imx8-prefetch: Remove has_prefetech_fixup from devtypes
There are prefetch engine fixups embedded in the updated i.MX8QM silicons.
So, prefetch engines in all i.MX8 variants should be the same.  Let's
remove has_prefetech_fixup from devtypes which is no more needed.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit 875c31a70f)
2019-02-12 10:33:34 +08:00
3297381a22 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 cb234bc95e)
2019-02-12 10:33:34 +08:00
816e5c7113 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 f0f0a1970f)
2019-02-12 10:33:34 +08:00
7319691b7c MLK-19162 drm/imx: dpu: crtc: Set IRQ_DISABLE_UNLAZY flag to interrupt status
Comparing to 4.9 kernel, the generic irq chip core of 4.14 kernel
imposes more strict check on !irqd_irq_masked(&desc->irq_data) when
it tries to unmask an irq via unmask_irq().  For irq chips without
implementing ->irq_enable() and ->irq_disable() callbacks, like the
DPU irq chip, the IRQ_DISABLE_UNLAZY flag has to be set to irq status,
otherwise, irqs cannot be enabled again after disablement(due to things
like system power management).

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:33:32 +08:00
2c1b65f4ca 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)
2019-02-12 10:33:32 +08:00
0cf1c6e5ea 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)
2019-02-12 10:33:30 +08:00
d64ff2b2f6 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>
2019-02-12 10:33:29 +08:00
9f1bb92091 MLK-19158-5 drm/imx: lcdif: add bus format check to CRTC's check
Add the check to LCDIF CRTC atomic check for the requested bus
format by encoder with the bus format which can be supported by
LCDIF CRTC to refuse unsupported case.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit e98afe9b6b20c2494c8570427b7811ed9ce202e8)
2019-02-12 10:33:19 +08:00
facd1962b0 MLK-19158-4 drm/imx: lcdif: remove bus format check from PLANE's check
Since the LCDIF output data width can be different from the data
width of input pixel data, so the bus format check in the plane's
atomic check is not correct anymore, and need to be removed.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 2245702e7905fa7b75aec92fdbb9ffeb33bdb6de)
2019-02-12 10:33:19 +08:00
a5940ee5db MLK-19158-2 drm/imx: lcdif: improve output bus format config
According to LCDIF specification, the input pixel data
width and the output pixel data width can be different,
and this conversion is done by LCDIF automatically. So
config the output data width according to the requested
bus format from the encoder, instead to be same with the
input pixel data width.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit bfd27f6d71d86a7f2fc8314f082565db3682b925)
2019-02-12 10:33:19 +08:00
db574fd09d MLK-19158-1 drm/imx: sec-dsim_imx: add bus format check for ENCODER
The connector's 'display_info' usually includes all the bus
formats the display peripheral device can be accepted. And
the DRM adjusted display mode's 'private_flags' includes
bus format the DSIM bridge requested according to the DSI
device display format. Add the bus format check to the DSIM
encoder's atomic check to make sure these two bus formats
have intersection.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6d804db82b95411ebad9fcfb43b3acecee5941d9)
2019-02-12 10:33:18 +08:00
0649fa3e27 MLK-19199 drm/imx: lcdif: replace FB width usage for cropping
According to the comments of 'struct drm_framebuffer', its
'width' field refers to the logical width of the visible
area of the framebuffer. This may be unequal to the total
pixels number of a line. So use the 'pitches' field to
replace 'width' for the horizontal cropping feature.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 9a2bbbf971ed79b32ae1c7da2d62b8a72f3ccffd)
2019-02-12 10:33:18 +08:00
5e8ca37e2f 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>
2019-02-12 10:33:10 +08:00
789e351403 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>
2019-02-12 10:33:09 +08:00
3d0568f5a9 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>
2019-02-12 10:33:09 +08:00
c7dc31fd36 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>
2019-02-12 10:33:09 +08:00
8804501367 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>
2019-02-12 10:33:09 +08:00
c1498a70b7 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>
2019-02-12 10:33:09 +08:00
59748d76fe 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>
2019-02-12 10:33:09 +08:00
3bdf9efa9f MLK-19152-3 drm/imx: lcdif: add horizontal crop support to plane update
Add horizontal cropping support when atomic plane update is
running, and if the attached CRTC needs modeset. And if the
width of visible portion of plane is equal to the fb surface
width, the Pigeon Mode will be disabled, so cropping will be
disabled.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 30672b2b18a07a2926979cc533cbb84ea4a642dd)
2019-02-12 10:33:07 +08:00
c399d83491 MLK-19152-2 drm/imx: lcdif: force 'mode_changed' when fb width changed
In DRM atomic modeset check, it will not check the fb's width
change, so in later atomic commit, it will not disable the CRTC
which has no mode changed. But for LCDIF, the fb width related
registers configuration can not be done when LCDIF is running.
So force 'mode_changed' to be true when fb width changed.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 518ff82756a39ff2d2f750596295baa4f5fca4c5)
2019-02-12 10:33:07 +08:00
364fd1879c MLK-19083 drm/imx: lcdif: remove untrue condition for pixel format set
After supporting DISPMIX power domain, the LCDIF runtime
resume callback always write '0' to 'LCDIF_CTRL' register
which will clear previous pixel format related setting.
So the previous condition by comparing format change for
setting pixel format during plane atomic update is not
true anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 5f84c69799456f28fd8182fd156e9067921e9a4e)
2019-02-12 10:33:02 +08:00
b6f7433f5b MLK-19017-7 drm/imx: sec-dsim_imx: add rpm status check for suspend/resume
Add runtime PM status check during runtime suspend and resume
to avoid unnecessary jobs if it is already in that state which
can avoid possible kernel warnings of clock disable/unprepare
mismatch during system suspend if it is alreay in runtime
suspended state.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 6f95c6fdc0de2fd4fe1d835c164f5e3cfb23e17d)
2019-02-12 10:33:02 +08:00
549fb9fb7d MLK-19017-6 drm/imx: add system pm support for SEC DSIM
Implement the suspend()/resume() callbacks to support system
power management functions for SEC DSIM.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit db3e9faa0278af6de5aaac008478123d0ebecb73)
2019-02-12 10:33:01 +08:00
1f80017f23 MLK-19017-5 drm/imx: add DISPMIX power domain support for SEC DSIM
After the DISPMIX power domain enabled, all the related registers
will drop their values once runtime pm suspend called. So in the
pm runtime resume process, the SEC DSIM de-reset and some init jobs
need to be done, and these jobs are no longer necessary to be done
during probe bind anymore.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 7a7f17f5fb66135629ef20a2b4780dfef2f0f0ce)
2019-02-12 10:33:01 +08:00
884680d1de MLK-18605-14 drm/imx: lcdif: adjust 'max_height' for '1080x1920' mode
Change the maximum height limitation to 1920 to support
'1080x1920' resolution mode. It is a temporary work
around and will be improved later.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 44d0209e97e0c574af30dd7a7d7e059d4ddf996d)
2019-02-12 10:33:00 +08:00
02d09a29a5 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>
2019-02-12 10:32:44 +08:00
9dceb37da1 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>
2019-02-12 10:32:44 +08:00
2342e5d1b0 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>
2019-02-12 10:32:40 +08:00
46df4351e0 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>
2019-02-12 10:32:40 +08:00