Commit Graph

226 Commits

Author SHA1 Message Date
f77b02b897 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>
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
063fef88f3 MLK-19472 VPU: Adjust V4L2_MEMORY_DMABUF of Encoder driver for Android
Adjust V4L2_MEMORY_DMABUF of Encoder driver for Android by changing
luma and chroma base address

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:33:47 +08:00
ce11789e9c MLK-19459 VPU: workaround for vpu encoder to drop useless data
workaround for vpu encoder to drop useless data

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:33:47 +08:00
6dd5c1b4c9 MLK-19444 VPU: Decrease encoder wait time from 1s to 10ms and remove
vpu_set_power for QXP in probe function

Decrease encoder wait time from 1s to 10ms and remove vpu_set_power for
QXP in probe function

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:33:40 +08:00
e17ed92830 MGS-4197 [#imx-1160] fix suspend failure with ctrl-C
do not set interruptable when from power management

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:33:39 +08:00
570683987d MLK-19398 - [i.MX8MM/Hantro] Hantro library crash when doing suspend and resume stress test
Replace wait_event_interruptible_timeout()/wake_up_interruptible_all() with wait_event_timeout()/wake_up_all()
So one complete decode process will be guranteed to avoid potential assert be triggered.

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 64634b90c6f6b15a97b9cae91b0e6099970cee55)
2019-02-12 10:33:39 +08:00
21c2a9c270 MLK-19403 VPU: Fix some decoder and encoder code bugs
Fix some decoder and encoder code bugs as follows:
- change vpu_stop_streaming to prevent deleting repeated entry
- reduce wait time for encoder from 5s to 1s
- change vpu_suspend to correct the calling of vpu_set_power() function
- change vpu_next_free_instance() to depart QM from QXP

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 77a85c0fdeecac5042147d4e842e6a60240a745e)
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
92f1233652 MLK-19328-1: hdp: fix no sound output in second time
Fixes commit 6b97462b64 ("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>
2019-02-12 10:33:35 +08:00
190d52ee4c MLK-19353 VPU: Rename VPU firmware binary
Rename VPU firmware binary, change from 'vpu_fw_imx8qxp_xxx.bin' to
'vpu_fw_imx8_xxx.bin'

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit d645e79676e178674e27c7706cf7080de5fdf3b8)
2019-02-12 10:33:33 +08:00
63cb8864a3 MA-12227 [#imx-848] Refine dma-buf metadata setting
Refine dma-buf metadata setting to support framebuffer compression

Change-Id: Ia0ab9224d789c4b620e33a6f1c28483025a136ce
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
2019-02-12 10:33:31 +08:00
2db1a0dda9 MA-12482-1 [#imx-1138] Fix kernel panic on gpu6.2.4.p2
VSI missing this patch in gpu6.2.4.p2, it will cause
drm_gem_object_unreference_unlocked(gem_obj) call two
times in function viv_ioctl_gem_unlock.

Kernel panic log:
[   38.419720] [<ffff00000860cac0>] drm_gem_object_release+0x40/0x48
[   38.419853] [<ffff0000013d4804>] viv_gem_free_object+0x64/0x98 [galcore]
[   38.419861] [<ffff00000860c524>] drm_gem_object_free+0x20/0x50
[   38.419868] [<ffff00000860c5f0>] drm_gem_object_unreference_unlocked+0x50/0x11c
[   38.419975] [<ffff0000013d505c>] viv_ioctl_gem_unlock+0xbc/0x108 [galcore]
[   38.419981] [<ffff00000860dc44>] drm_ioctl+0x1e0/0x468
[   38.419992] [<ffff000008264b7c>] do_vfs_ioctl+0xb8/0x8d4
[   38.419997] [<ffff00000826541c>] SyS_ioctl+0x84/0x98
[   38.420005] [<ffff000008083780>] el0_svc_naked+0x34/0x38

Change-Id: I799c84e9f71e46012dd6befc02f7d3d694ed57e3
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
2019-02-12 10:33:31 +08:00
b9eae51a7a MGS-4166 [#imx-1145] Fix coverity errors
Fix potential Resource leaks and memory illegal access issues.

Signed-off-by Yong Gan <yong.gan@ncp.com>
2019-02-12 10:33:30 +08:00
52555e5d7d MGS-4162 [#imx-1143] fix suspend stuck with false negative
While investigating MLK-18894 ran a large number of suspend iterations
on imx6qp-sdb with rc2 kernel. After ~6 hours it hung while suspending
devices and sysrq-T showed the following trace for rtcwake:

The gckHARDWARE_SetPowerManagementState function seems hung waiting for
gckHARDWARE_QueryIdle. Inside the gckHARDWARE_QueryIdle there is a check
which looks like this:
rtcwake         D    0  7090    561 0x00000001
[<809d5fc8>] (__schedule) from [<809d6380>] (schedule+0x48/0xb0)
[<809d6380>] (schedule) from [<809d9d3c>] (schedule_hrtimeout_range_clock+0xc8/0x13c)
[<809d9d3c>] (schedule_hrtimeout_range_clock) from [<809d9df0>] (schedule_hrtimeout+0x20/0x28)
[<809d9df0>] (schedule_hrtimeout) from [<807168c4>] (gckOS_Delay.part.3+0x64/0x6c)
[<807168c4>] (gckOS_Delay.part.3) from [<8071813c>] (gckOS_Delay+0x18/0x20)
[<8071813c>] (gckOS_Delay) from [<8073f08c>] (gckHARDWARE_SetPowerManagementState+0x838/0xb70)
[<8073f08c>] (gckHARDWARE_SetPowerManagementState) from [<8071df18>] (gpu_suspend+0x74/0xe4)
[<8071df18>] (gpu_suspend) from [<804fb9e8>] (dpm_run_callback+0x3c/0xdc)

/* Test if address is inside the last WAIT/LINK sequence. */
if ((address >= Hardware->lastWaitLink)
&& (address <= Hardware->lastWaitLink + 16)

Stepping through using the debugger (screenshot attached) this function
seems to return non-idle with both address lastWaitLink and being equal
to 0xFFFFFFF0. As far as I can tell the intention seems to be that the
check should pass but 0xFFFFFFF0 + 16 overflows back to zero so the
second part of the check fails because 0xFFFFFFF0 is not less than or
equal to 0.

Adding some prints to GPU code it seems that it's normal for these
values to be >0xFFFFe000. When they (randomly) hit 0xFFFFFFF0 exactly
the idle check will incorrectly fail and suspend will hang.

Actually, it is wrong when address reach to Hardware->lastWaitLink + 16,
because the address shall be either Hardware->lastWaitLink(wait command)
or Hardware->lastWaitLink + 8 (link command).

Fix the end address offset with 8 or 16 (extra 8 bytes for L2 flush).

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:33:30 +08:00
21c144dad5 MLK-19285 VPU: Add level and profile support for encoder and loop
support for encoder

- Add level and profile for h264 encoder, level is mapped like level 5.1
to uLevel 51 for firmware except 1b to uLevel 14
- Add check for the function enc_mem_alloc() to ensure buffers are
allocated once to prevent memory leak
- modify streamoff() streamon() update_yuv_addr() and report_stream_done()
function to enable loop for encoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
2019-02-12 10:33:29 +08:00
48d3651ba3 MGS-4147 [#imx-1117] Don't try to de-register OPP entries when we don't have them in the first place
Commit 7103962dbc would return success even though we
don't have a OPP array (i.e., i.MX6). This patch completes that
in de-register part.

Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
2019-02-12 10:33:29 +08:00
afdb5d2637 MGS-4130 [#imx-1133] Cannot pass the stress test of low bus suspend/resume.
Add delay time and retry to make sure the Power state was changed.

Signed-off-by Yong Gan <yong.gan@ncp.com>

(cherry picked from commit 59a836f35807f5c09c98cf3be318ac49526bcf69)
2019-02-12 10:33:29 +08:00
648b068a90 MLK-19226 VPU: Add support for i.MX8QM B0 vpu decoder and encoder
Add support for i.MX8QM B0 vpu decoder and encoder and it is compatiable
with i.MX8QXP B0 VPU.

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit f2d7823da29c55644299eea84a2e866ea188c698)
2019-02-12 10:33:27 +08:00
8dfd457aa8 MLK-19206 VPU: Modify the action for disable recoder
Modify the action for disable recoder

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 64302c586a541f8effc1e16427f50ec490918a9d)
2019-02-12 10:33:27 +08:00
32509b9e62 MGS-3785-1 [#imx-990] test_buffers in OCL1.2 CTS crash on 850D
Allocate the real size of the buffer instead of whole page to aviod GPU
overwrite.

Date: 10th Aug, 2018
Signed-off-by: Ella Feng <ella.feng@nxp.com>
2019-02-12 10:33:16 +08:00
05ed5881e6 MGS-4120 [#ccc] Enable GPU workaround on 4GB LPDDR4 platform
Added a flagbits in soc_platform to workaround Soc platform. Add a
check for memory address beyond 4G for 850d mscale.

Date: 10th Aug, 2018
Signed-off-by: Ella Feng <ella.feng@nxp.com>
2019-02-12 10:33:16 +08:00
5b550b4ca3 MGS-3527 [#imx-1078] Rename fence to dma_fence
Support the kernel 4.9.y in fsl_6.2.4.p2.

Signed-off-by: Yong Gan<yong.gan@nxp.com>
2019-02-12 10:33:13 +08:00
e6e9bec1a9 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>
2019-02-12 10:33:09 +08:00
0a306b3ba4 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>
2019-02-12 10:33:08 +08:00
5797a70f41 MGS-4125 [#imx-320] fix 6sx suspend/resume stuck issue
6sx gpu need reserve command to flush cache before power-off,
there is no way to perform force sync in power broadcast mode.

command buffer will be exhausted with repeat suspend/resume,
need pull up power to flush command buffer before suspend.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:33:08 +08:00
76f7e500c0 MGS-4111 [#imx-1117] Fix displaying wrong governor values on 8QP
On 8QP we don't have the OVERDRIVE governor, only NOMINAL and
UNDERDRIVE.  We set the current initial governor to OVERDRIVE, but also
display incorrect governor names relative to the clocks assigned in OPP
tuples.  This patch address this situation by determining which governor
should be used at start-up and fixes displaying the governors
available for use.

This patch also sets the initial clock rate, in case the assigned-clock
rates for the cores are different than the ones found in the
operating-points (OPP). While this shouldn't be a real use-case this
allows testing different OPP tuples to mimic a OPP array for 8QP.

Signed-off-by: Marius Vlad <marius-cristian.vlad@nxp.com>
2019-02-12 10:33:07 +08:00
49f7904786 MLK-19136 VPU: Modify vpu encoder code for Android
- Add sync frame flags
- modify width & height value when get format after set format for capture
- modify poll function
- decrease MIN_BUFFER_COUNT count to 3
- change file license

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 378f251af9ccd6b94b48ff88582b9044c9ac367d)
2019-02-12 10:33:06 +08:00
80ed12a185 MGS-3527-2 [#imx-885] enable android native fence for Weston sync
Fixed the build break for android platform.
set ANDROID_NATIVE_FENCE_SYNC to be 2.

Date: Aug 6, 2018
Signed-off-by: Yong Gan<yong.gan@nxp.com>
2019-02-12 10:33:05 +08:00
3278256b1e MLK-19121 - [i.MX8QXP/VPU]: Add low-latency support
Add variable 'b_dis_reorder' to control reorder
Add flush start code for low-latnecy
Add module parameter 'vpu_frm_depth' to allow user config input depth
Add some useful frame count, including decode/display delay
Refine debug level

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit a99e27af849c99aaf753cdad86d7a54da750ccc6)
2019-02-12 10:33:05 +08:00
d67eef9312 MLK-18982 VPU: Add support for vp6, vp8, spk, divx, mjpeg
Add support for vp6, vp8, spk, divx, mjpeg by adding start code

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit b943cabf2255d93c04cec9795a1b9bcbe2b656ec)
2019-02-12 10:33:04 +08:00
5e2b69e26a MLK-18954 VPU: Add support for H263 and VC1
Add support for VC1 by adding start code and adjust transfer format for
H263

Signed-off-by: Huang Chaofan <chaofan.huang@nxp.com>
(cherry picked from commit 5bf003ce4fda812286eb9dc2f365e2608bfd5bad)
2019-02-12 10:33:04 +08:00
3928af1918 MGS-3255-43 [#ccc] fix gpu user memory corruption
fix memory overwrite since out of range in last page,
remove dma_sync_single_for_device to avoid over-touch.

this fix QM gpu crash with test_buffers stress case.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:33:04 +08:00
20995ddf9c MLK-19090-2 - [i.MX8MM/Hantro]: Power management enhancement
Refine source contained in CONFIG_DEVICE_THERMAL_XXX to adjust clock dynamically
g1 and g2 clock will be adjusted independently
Default, the macro not enabled

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 0f335c55d074831a2cee56bf247774b76f2d6fdf)
2019-02-12 10:33:03 +08:00
34032493b8 MLK-19090 - [i.MX8MM/Hantro]: Power management enhancement
Handle g1 and g2 power independently:
Add instance context to record which core(g1 or g2) is used
Check and power off unused core in ioctl operation

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 7eba7e6bb7fef9180a18c4860230addd1c24f0c7)
2019-02-12 10:33:03 +08:00
ecdefbefff MLK-19005-2 - [i.MX8MM/Hantro]: Conformace test failed when decoder and encoder run simultaneously
Disable irq during poweron stage to avoid unexpected irq triggered
One mutex is added accordingly to handle the operation

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 7c938b8e956b1b4e3b2cc5b21aa378c27e0eee8f)
2019-02-12 10:33:03 +08:00
b793203fb1 MGS-4105 [#imx-1104] fix OPP failure log in gpu kernel
not a problem without operating-points in gpu device entry,
need disable error message for frequency scaling failure.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:33:02 +08:00
cc50467d73 MGS-4103 [#imx-1070] fix gpu axi bus error on 6sx
only add the padding pages for user pageable memory,

Revert "MGS-4022 [#imx-1070] fix kernel panic with opencl test_buffers"
This reverts commit 9253786bcfd2fa17132c5057a18eb75b10ea3336.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:32:57 +08:00
035c1590e6 MLK-19058 - [I.MX8QXP/VPU]: Refine negotiation protocol to avoid camera reset before start
Set default colorspace value in v4l2_ioctl_try_fmt()

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 52221438736a3ede393ba1682eadc292d3a73977)
2019-02-12 10:32:57 +08:00
6237540c26 MGS-3255-41 gpu: fix 6.2.4.p2 test_buffer failures
fix read buffer fence node for hw copy,
add cpu cache line check for write buffer,
invalidate cache after pipeline complete,
flush head and tail pages for user memory.

fix 630a849f3a4087a98b0425c261f474d178150307
 "MGS-3255-39 [#ccc] fix opencl cache issue"

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:32:57 +08:00
62531599fa MGS-4022 [#imx-1070] fix kernel panic with opencl test_buffers
the user memory will add the padding pages to meet hardware alignment,
need set non-contiguous flag to avoid contigous mapping in GPU MMU.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:32:56 +08:00
6f08ad897e - MLK-19004 - [i.MX8QXP/VPU]: Add self-defined EOS tag instead of standard tag
Add self-defined EOS tag for some formats, includes: Mpeg2 and Mjpeg

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 6550b3dca4eaf6c42c38234a6e8bbf09072d9f54)
2019-02-12 10:32:55 +08:00
64d0d30c1e MLK-19005 - [i.MX8MM/Hantro]: Conformace test failed when decoder and encoder run simultaneously
Add assert operaiton in reset functions, include g1/g2/h1

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
(cherry picked from commit 122bac4f05092cf5fe1684c7300248662c393cf9)
2019-02-12 10:32:50 +08:00
6a53e5e367 MA-11957 [Android] Rename fence to dma_fence
Rename fence interfaces to dma_fence to match with the upstream
commit, f54d186700 ("dma-buf: Rename struct fence to dma_fence"),
changes.
Fix compile issue sync_timeline_create is not defined.

Change-Id: I0f89a089f11131070f96a5ddc922938f4b28615f
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
2019-02-12 10:32:43 +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
bbf3d583f9 MGS-3904 gpu: integrate vivante 6.2.4.p2 driver
version upgrade from 6.2.4.p1.150331 to 6.2.4.p2.163672

fixed gpu kernel panic for CONFIG_ARM64_SW_TTBR0_PAN,
support frequency query for gpu shader and core.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
2019-02-12 10:32:40 +08:00
66a96cfc29 MLK-18890-2 - [i.MX8MM/Hantro]: Implement hx280enc compat_ioctl
Add _IOC_NR for all ioctl command to avoid overflow.

Signed-off-by: xiahong.bao <xiahong.bao@nxp.com>
(cherry picked from commit 9c362b56617119cb1807845ecee18fb06d2113d3)
2019-02-12 10:32:39 +08:00
cb0a8170d9 MLK-18890 - [i.MX8MM/Hantro]: Implement hx280enc compat_ioctl
Implement 32bit compat_ioctl for hantro h1 encoder.

Signed-off-by: xiahong.bao <xiahong.bao@nxp.com>
(cherry picked from commit 32001e5aded2bff7cfcd0c675c8605c117498fe2)
2019-02-12 10:32:39 +08:00
9b2458f592 MLK-18869 - [i.MX8MM/Hantro]: Integrate 20180710 release
Implement different sync method, replace previous signal with ioctl
Related functions were added

(cherry-pick from : adc4bc267e5c3a33ca802de83e2693638a7be8e8)

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
2019-02-12 10:32:39 +08:00
341094e992 MLK-18829 mxc IPUv3: vdoa: Replace module_init() with subsys_initcall()
For 4.14 kernel, it turns out that the vdoa driver cannot use
module_init(), otherwise, the driver's probe function cannot be
called.  Using subsys_initcall() makes the probe function be
successfully called, just like the ipu_common driver.  Note that
the mxc_ipu.o object consists of the ipu_common driver and the
vdoa driver.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2019-02-12 10:32:38 +08:00