1
0
Fork 0
Commit Graph

3646 Commits (redonkable)

Author SHA1 Message Date
Robin Gong c7c3d861c4 MLK-20205-1: dmaengine: fsl-edma-v3: fix NULL pointer dereference
Fix 'null pointer dereferences issue' reported by coverity(CID-1477441).

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-11-08 18:11:09 +08:00
Robin Gong 96c043b789 MLK-19931-3: dmaengine: imx-sdma: fix potential kernel crash in cyclic
Fix potential kernel crash issue  on imx-sdma as fsl-edma-v3.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 53d2794ec0 MLK-19931-2: dmaengine: fsl-edma: fix potential kernel crash in cyclic
Fix potential kernel crash issue  on fsl-edma as fsl-edma-v3.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong aa725898e0 MLK-19931-1: dmaengine: fsl-edma-v3: fix potential kernel crash in cyclic
There is one potential race condition in virt-dma framework as below:
terminate dma channel after the last dma done interrupt, but before
vchan_complete tasklet scheduled, thus the free-ed 'vd' (free in
fsl_edma3_terminate_all) maybe still be touched in vchan_complete()
which cause NULL pointer crash.
  Kernel community noticed this issue and fix it at virt-dma level:
https://patchwork.kernel.org/patch/10057791/. To avoid backport too
much patches, set 'vc->cyclic = NULL' in terminate dma channel
interfaces to fix such issue easily.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Han Xu faf31389b8 MLK-19897: dma: mxs-dma: update mxs-dma filter function to filter out the unrelated dma channels
update mxs-dma filter function to firstly filter the dma channels only for mxs-dma, rather than checking unrelated dma chans in following code.

Signed-off-by: Han Xu <han.xu@nxp.com>
2018-10-29 11:10:38 +08:00
Han Xu 60b3c73d73 MLK-19742: dma: apbh-dma: switch from dma_coherent to dma_pool
Switch from dma_coherent API to dma_pool API for APBH dma driver.

Got the following warnings with the previous dma_alloc_coherent,

alloc_contig_range: [xxx, yyy) PFNs busy

This implementation create one dma_pool dedicate for all following
dma_alloc and avoid keeping allocate available memories.

Signed-off-by: Han Xu <han.xu@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 14412271b5 MLK-19734-3: dmaengine: imx-sdma: change fifo offset of fifo_num
Multi-fifo scripts will change offset of fifo_num from 8 to 12 for
enlarging the max watermark from 8 to 128, which could utilize more
FIFO space as possible as it can. New 'watermarklevel' defined as
below:

  ;;    bit0~11: wartermark level(wml*fifo_number)
  ;;    bit15~12: fifo number
  ;;    bit16~19: fifo offset
  ;;    bit27~24: sw done selector
  ;;    bit23: sw done enabled

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
(cherry picked from commit 786c8bd56324463cb94ce2c11a83689de0058ca0)
2018-10-29 11:10:38 +08:00
Robin Gong 6e5d978428 MLK-19734-1: sdma: add multi-fifo scripts for i.mx6
Add multi-fifo script for i.mx6 instead of dual fifo script, because
there is one hardware issue inside SSI ip and switch between dual fifo
and single fifo could workaroud it, so add multi-fifo scripts.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
(cherry picked from commit 85bb6546ff8cb1fc323e568d689a1e078eaca8fa)
2018-10-29 11:10:38 +08:00
Robin Gong 4a3ebbdc7c MLK-19451: dmaengine: imx-sdma: remove mdelay(1)
commit 7f3ff14b7e ("dmaengine: imx-sdma: add 1ms delay to ensure
SDMA channel is stopped") add 1ms delay to ensure no dma done interrupt
come in after channel disabled. This 1ms may cause SAI underrun issue
between two times playback, because ALSA framework stop SAI module after
dma terminate, thus the 1ms timing window trigger continuous 'underrun'
interrupt. Actually, don't need 1ms delay anymore since virt-dma could
handle the interrupt after channel terminated.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 9424bb5b8d MLK-19418-3: dmaengine: imx-sdma: remove context load in sdma_channel_resume
Since sdma_resume will restore all context in case sdma power off after
suspend, sdma_channel_resume does not need to restore again. Besides,
'suspend_off' can be removed too.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 5481ee381e MLK-19418-2: dmaengine: imx-sdma: make sure firmware loaded
request_firmware_nowait() is async so that can't make sure sdma firmware
loaded when sdma_resume return back. Add wait code to make sure firmware
ready.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 07621cace3 MLK-19418-1: dmaengine: imx-sdma: set static context switch before channel0 running
Context switch mode should be set to static before channel0 running
after sdma bootup. Do that after sdma power up again in case mega/fast
mix off.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Jason Liu 1e78cec700 MLK-19078 dma: fsl-edma-v3: set the swap correctly
The swap is swapped between the i.MX8QM RevA and RevB
this patch handle this difference to set swap correctly
otherwise, the eDMA will not work on the i.MX8QM RevB

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
(cherry picked from commit 5f4d3549e5f61cb8e3c14dbeb406acfcccf32886)
2018-10-29 11:10:38 +08:00
Robin Gong 5b6d0b4941 MLK-19022-2: dmaengine: fsl-edma-v3: add device_synchronize
Add device_synchronize for edma driver, since some driver such as
Audio need it to make sure dma done callback never come out after
resource related with dma channel free-ed by Audio driver. Android
team report such issue on MA-12087.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
(cherry picked from commit 483519c063b08fc1ce0dd297b6c186799cf639d6)
2018-10-29 11:10:38 +08:00
Robin Gong cf342d178a MLK-19022-1: dmaengine: fsl-edma: add device_synchronize
Add device_synchronize for edma driver, since some driver such as
Audio need it to make sure dma done callback never come out after
resource related with dma channel free-ed by Audio driver.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
(cherry picked from commit cd2d1200280fe573ac4eac5e27675f1b2ea638c4)
2018-10-29 11:10:38 +08:00
Leonard Crestez 6347aab298 MLK-18918: dma: imx-sdma: Mark fw_loaded false on resume
When the sdma engine is suspended firmware might get lost and need to be
reloaded. Right now fw_loaded is set to false in suspend code and SDMA
is disabled until FW is reloaded on resume.

However when entering standby mode the firmware is not lost, the resume
code detects this situation and skips reloading firmware and restoring
contexts. Unfortunately this incorrectly leaves fw_loaded set to false
so SDMA is unusable after a standby.

Fix by setting fw_loaded to false at the start of sdma_resume instead
of the end of sdma_suspend. This is the point at which we know that
firmware was lost and needs reloading.

Fixes: c5e50134e7b1 ("MLK-18315-1 dma: imx-sdma: add fw_loaded check")

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 7bc0d435f6 MLK-18449: dmaengine: imx-sdma:add sw_done support
Add new cell for sw_done/sw_done_selector, because PDM need enable
software done feature in sdma script.
The new fourth cell defined as below:
	Bit31: sw_done
	Bit15~bit0: selector
For example: 0x80000000 means sw_done enabled for done0 sector which
is for PDM on i.mx8mm.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 6bec0d14bb MLK-18248: dma: fsl-edma-v3: avoid touch unused edma channel
Avoid touch unused edma channel register in susped/resume, otherwise,
kernel crash if XRDC enabled in scfw.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 4a0afd17a0 MLK-18315-1 dma: imx-sdma: add fw_loaded check
Return failure if sdma firmware not loaded from rootfs before
any dma transfer started indeed. That assume no any dma tranfser
started in any driver probe function. Otherwise, some driver such
as spi may probe failed or defered probe until sdma firmware loaded
from rootfs.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong bdd127ec68 MLK-17977: dma: imx-sdma: fix race condition descriptor freed during cyclic interrupt
In SMP, the current running descriptor maybe freeed during done interrupt
because 'sdmac->vc.lock' will be unlock before driver callback run, thus
'sdmac->desc' maybe NULL and the memory also freeed if channel terminaed
in that time(sdma_terminate_all()), unfortunately, the local 'desc' in
sdma_update_channel_loop() which gets the old value of 'sdmac->desc'
still used to count 'desc->buftail', that cause memory currupt as below.

Check 'sdmac->desc' instead of local 'desc' in the while(), so do nothing
in this corner case. That make sense since this channel was already
terminated and no one care the callback coming after that.

[ 1863.117625] Unable to handle kernel paging request at virtual address bfffa1002
[ 1863.117629] pgd = ffff800008e1e000
[ 1863.117634] [bfffa1002] *pgd=0000000092ae8003, *pud=0000000000000000
[ 1863.117638] Internal error: Oops: 96000005 [#1] PREEMPT SMP
[ 1863.117646] Modules linked in: ath10k_pci ath10k_core ath
[ 1863.117653] CPU: 0 PID: 23381 Comm: id.printspooler Not tainted 4.9.78 #1
[ 1863.117654] Hardware name: Freescale i.MX8MQ EVK (DT)
[ 1863.117657] task: ffff80005249de80 task.stack: ffff8000506e4000
[ 1863.117670] PC is at sdma_int_handler+0x16c/0x34c
[ 1863.117674] LR is at sdma_int_handler+0x158/0x34c
[ 1863.117677] pc : [<ffff000008549b20>] lr : [<ffff000008549b0c>] pstate: 600001c5
[ 1863.117678] sp : ffff80005ff62eb0
[ 1863.117683] x29: ffff80005ff62eb0 x28: ffff80004e748300
[ 1863.117686] x27: 0000000000000003 x26: 0000000000000001
[ 1863.117690] x25: ffff800056a64018 x24: 0000000000000002
[ 1863.117694] x23: ffff800056a64258 x22: 0000000000000001
[ 1863.117698] x21: 0000000000000000 x20: ffff800056a64258
[ 1863.117701] x19: ffff800056a641b8 x18: 0000000000000008
[ 1863.117705] x17: 0000e2b0dbd9baa4 x16: 0000e2b0dbdd9dd0
[ 1863.117709] x15: 000000000000088e x14: 000000007173d1d8
[ 1863.117713] x13: 0000e2b0b97d1760 x12: 0000e2b0cd0794e0
[ 1863.117716] x11: 0000000000000008 x10: 0000000000000040
[ 1863.117720] x9 : 0000000040000000 x8 : 0012355ad191c9ca
[ 1863.117724] x7 : ffffffffa540c8fe x6 : 0000000000000018
[ 1863.117727] x5 : 000000003b9ac9ff x4 : 0000000000000000
[ 1863.117731] x3 : 0000000ffff80000 x2 : 0000000000000000
[ 1863.117735] x1 : 0000000bfffa0000 x0 : 0000000bfffa1000
[ 1863.117737]
[ 1863.117737] SP: 0xffff80005ff62e30:

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou bcf745002f MLK-17938: pxp: pxp will hang when output height is 8
When output height is eight, yscale of ps engine will be
over two, it not support by pxp.

According to pxp doc, a factor greater than 2 is not
supported with the bilinear filter. so correct it when
this case happen in order to ensure that pxp will be
not hang up.

Reviewed-by: Robby.cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou dceff7dc13 MLK-17487: pxp: fix pxp yuv to yuv generate color dots issue
When PxP convert yuyv to nv12 format, some color dots will
introdue to output image. IC recommend that YCBCR_MODE and
BYPASS bit of CSC1_COEF0 should be 1.

Reviewed-by: robby.cai <robby.cai@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 7dd310e1e4 MLK-17782 dma: fsl-edma-v3: fix issue reported by Coverity
Fix below issue reported by Coverity, actually, don't need this
condition check here, remove it.

CID undefined (#1 of 1): Wrong operator used (CONSTANT_EXPRESSION_RESULT)operator_confusion:
(16UL /* 1UL << 4 */) | (__u16)(__le16)tcd->csr is always 1/true regardless of the values of its operand.
This occurs as the logical first operand of "&&".

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang dbcb42ac83 MLK-16224-5: dma: imx-sdma: support mulit fifo script
The type IMX_DMATYPE_MULTI_SAI is used for SAI multi-fifo mode,
in this mode, the fifo num parameter is configured through
dma_slave_config

The watermark definition is:
bit0~7: wartermark level
bit8~11: fifo number
bit16~19: fifo offset
bit27~24: sw done selector
bit23: sw done enabled

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Robin Gong<yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong a8547abdc1 MLK-17385: dma: imx-sdma: update sdma script for multi fifo on SAI
update sdma script for multi fifo SAI on i.mx8MQ.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 2b3f5aa4e8 MLK-17094 dma: fsl-edma-v3: add suspend/resume to restore back channel registers
Add suspend to save channel registers and resume to restore them back since
edmav3 may powered off in suspend.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang f0a3e266e6 MLK-16885-1: DMA: imx-sdma: update the buswidth that is supported
update buswidth that is supported by sdma.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Nicolin Chen b3fe080fe7 dmaengine: imx-sdma: Correct src_addr_widths and directions
The driver already supports DMA_DEV_TO_DEV in sdma_config(),
DMA_SLAVE_BUSWIDTH_2_BYTES and DMA_SLAVE_BUSWIDTH_1_BYTE in
sdma_prep_slave_sg(). So this patch adds them to the lists.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2018-10-29 11:10:38 +08:00
Robin Gong a328859d81 MLK-16841-1: dma: imx-sdma: add clock ration 1:1 check
On i.mx8 mscale B0 chip, AHB/SDMA clock ratio 2:1 can't be supportted,
since SDMA clock ration has to be increased to 250Mhz, AHB can't reach
to 500Mhz, so use 1:1 instead.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Han Xu 8ac8243ce8 MLK-16786: dma: mxs-dma: fix the unbalanced runtime pm counter
mxs-dma init function will call runtime pm init, the redundant
pm_runtime_force_resume will mess up the counter. Also remove some
unnecessary code.

Signed-off-by: Han Xu <han.xu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>

During 4.14 rebase squashed the following:

MLK-16800: dma: mxs-dma: correctly handle mxs-dma clock

enable mxs-dma clock before HW reset and disable clock after it.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
2018-10-29 11:10:38 +08:00
Han Xu 89e6459a3e MLK-16769-4: dma: mxs-dma: enable runtime PM for mxs-dma
enable runtime pm for mxs-dma

 BuildInfo:
  - SCFW 60e110f9, IMX-MKIMAGE e131af10, ATF
  - U-Boot 2017.03-imx_4.9.51_8qm_beta1_8qxp_alpha+gfcc9bdc

Signed-off-by: Han Xu <han.xu@nxp.com>
2018-10-29 11:10:38 +08:00
Han Xu a5b5c43a8a MLK-16769-3: dma: mxs-dma: clean up the i.MX7D clock code
There is only one clock need to be handled after the clock code change
for i.MX7D. remove the redundant code.

Signed-off-by: Han Xu <han.xu@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 0e73380335 MLK-16482: dma: fsl-edma-v3: Fix RCU issue while playing Audio
That's caused by commit 593034f1b908 ("MLK-16437: dma: fsl-edma-v3:
fix kernel crash while edma interrupt trigger after channel disabled").
Because fsl_chan->vchan.lock will be hold always and trigger RCU report
as below:

1571.3  Playing WAVE '/mnt/nfs/vte_mx82/../test_stream/esai_stream/48k16bit-six.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 6
1571.5  [ 4642.698771] INFO: rcu_preempt detected stalls on CPUs/tasks:
1571.6  [ 4642.704443] 0-...: (1 GPs behind) idle=2c5/140000000000000/0 softirq=155373/155374 fqs=2541
1571.7  [ 4642.712967] (detected by 2, t=5252 jiffies, g=104259, c=104258, q=22)
1571.8  [ 4642.719501] Task dump for CPU 0:
1571.9  [ 4642.722724] aplay R running task 0 15723 15721 0x00000202
1571.10  [ 4642.729786] Call trace:
1571.11  [ 4642.732239] [<ffff0000080855e4>] __switch_to+0x8c/0xa0
1571.12  [ 4642.737379] [<ffff0000084e3a48>] dma_chan_put+0x70/0xa0
1571.13  [ 4642.742603] [<ffff0000084e3aac>] dma_release_channel+0x34/0xa0
1571.14  [ 4642.748435] [<ffff000008972240>] fsl_asrc_dma_hw_free+0x38/0x50
1571.15  [ 4642.754358] [<ffff000008960568>] soc_pcm_hw_free+0x110/0x1a8
1571.16  [ 4642.760013] [<ffff000008963bcc>] dpcm_fe_dai_hw_free+0x6c/0xe0
1571.17  [ 4642.765844] [<ffff000008948ae8>] snd_pcm_common_ioctl1+0xb40/0xce0
1571.18  [ 4642.772028] [<ffff000008948e64>] snd_pcm_playback_ioctl1+0x1dc/0x310
1571.19  [ 4642.778378] [<ffff000008948fc0>] snd_pcm_playback_ioctl+0x28/0x40
1571.20  [ 4642.784470] [<ffff0000081ee0a4>] do_vfs_ioctl+0xa4/0x748
1571.21  [ 4642.789784] [<ffff0000081ee7d4>] SyS_ioctl+0x8c/0xa0
1571.22  [ 4642.794745] [<ffff000008082f4c>] __sys_trace_return+0x0/0x4
1571.23  [ 4705.718740] INFO: rcu_preempt detected stalls on CPUs/tasks:
1571.24  [ 4705.724420] 0-...: (1 GPs behind) idle=2c5/140000000000000/0 softirq=155373/155374 fqs=10407
1571.25  [ 4705.733030] (detected by 1, t=21010 jiffies, g=104259, c=104258, q=119)

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reported-by: Jason Liu <jason.hui.liu@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Fixes: 593034f1b908 ("MLK-16437: dma: fsl-edma-v3: fix kernel crash
while edma interrupt trigger after channel disabled").
2018-10-29 11:10:38 +08:00
Robin Gong 34b8196453 MLK-16437: dma: fsl-edma-v3: fix kernel crash while edma interrupt trigger after channel disabled
edma interrupt may come after channel terminated, so should ignore
interrupts, else kernel crash as below since fsl_chan->edesc set
to NULL when terminate.

 606.837306] Unable to handle kernel NULL pointer dereference at virtual address 00000060
[  606.845411] pgd = ffff000009295000
[  606.848814] [00000060] *pgd=00000008bfffe003[  606.852906] , *pud=00000008bfffd003
 , *pmd=0000000000000000[  606.858395]
[  606.859885] Internal error: Oops: 96000006 1 PREEMPT SMP
[  606.865460] Modules linked in:
[  606.868522] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.11-03371-g9904ea0 #42
[  606.875832] Hardware name: Freescale i.MX8QXP LPDDR4 ARM2 (DT)
[  606.881662] task: ffff000009120680 task.stack: ffff000009110000
[  606.887588] PC is at fsl_edma3_tx_handler+0x50/0x150

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Tested-by: Daniel Baluta <daniel.baluta@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 69bc7b70c1 MLK-16374-4: PxP: add AS and PS engine colorkey support
Enable PS and AS colorkey function if user enable and
set colorkey parameters of s0 and overlay buffer.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit f2ed3bfca1)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 67ba643b77 MLK-16374-3: PxP: improve stride parameter setting compatible
In pxp lib, the unit of stride parameter is pixel and stride
is not equal with width parameter of out buffer in some cases.

In order to use latest pxp lib in old version rootfs, PXP_DEVICE_LEGACY
macro is used to distinguish pxp drvier version. Because the
new pxp driver define a new variable and pxp lib can know this
through PXP_DEVICE_LEGACY, and determine if use it.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 91da74e81c)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 9b314cfc70 MLK-16374-2: PxP: add new format support for as and out buffer
1) add PXP_PIX_FMT_BGRA32 format support for AS buffer
2) add PXP_PIX_FMT_BGRA32 format support for OUT buffer

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 4eeefd54cd)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou fa1f4a56fa MLK-16374-1: PxP: add alpha blending back compatible
In support of both g2d and pxp lib alpha blending, there
must be two alpha blending versions. So there is one rule
that user should obey for different usage cases.

  1) g2d alpha blending: user should set combine_enable
      member of struct pxp_proc_data.
  2) pxp lib alpha blending: user should set combine_enable
     member of struct pxp_layer_param if the pxp_layer_param
     describe overlay buffer parameters.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 7c62393a55)
2018-10-29 11:10:38 +08:00
Robin Gong d19c131e14 MLK-16327-1: dma: fsl-edma-v3: make exclusive channel name for all edma channels
Since there are multi edmav3 instances on i.mx8, every edma channel name
is better unique.But so far, all edma channel name is 'edma-channel(id)-
tx',thus some edma channels which share the same channel id but different
edma instance will show the same channel name in kernel and this is not
friendly to debug in kernel.
  Now the edma channel name(interrupt-names property) is define in dts
as below:
        "edmaX-chanX-Xx"
             |     | |---> receive/transmit, r or t
             |     |---> channel id, the max number is 32
             |---> edma controller instance, 0, 1, 2,..etc
and get below correct name with 'cat /proc/interrupts':
 43:          0          0          0          0     GICv3 466 Level     edma0-chan8-rx
 44:          0          0          0          0     GICv3 467 Level     edma0-chan9-tx
 45:         79          0          0          0     GICv3 468 Level     edma0-chan10-rx
 46:        311          0          0          0     GICv3 469 Level     edma0-chan11-tx
 47:          0          0          0          0     GICv3 470 Level     edma0-chan12-rx
 48:          0          0          0          0     GICv3 471 Level     edma0-chan13-tx
 49:          0          0          0          0     GICv3 472 Level     edma0-chan14-rx
 50:          0          0          0          0     GICv3 473 Level     edma0-chan15-tx
 51:          0          0          0          0     GICv3 406 Level     edma2-chan0-tx
 52:          0          0          0          0     GICv3 407 Level     edma2-chan1-tx
 53:          0          0          0          0     GICv3 408 Level     edma2-chan2-tx
 54:          0          0          0          0     GICv3 409 Level     edma2-chan3-tx
 55:          0          0          0          0     GICv3 410 Level     edma2-chan4-tx
 56:          0          0          0          0     GICv3 411 Level     edma2-chan5-tx
 57:          0          0          0          0     GICv3 442 Level     edma2-chan6-rx, edma2-chan7-tx

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 6afef859cf MLK-16348: PxP: fix background issue
There was no pxp background register setting, so the
background we see always black.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit d3ee45e267)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 13bff5f49c MMFMWK-7674: PxP: add YVU420P support
PxP PS engine support YUV420 format, but not YVU420. The difference
between two format is U and V, if we exchange U and V base address,
the PxP driver can also support YVU420 format.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit cbc71da10a)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 0d58c7a015 MLK-16276: PxP: Improve code compatibility
g2d code has different parameter setting about stride parameter.
For compatibility with all cases of using PxP, we need add this
improved feature.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 53c8ffffec)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 286043a046 MLK-16252: PxP: fix video shift issue
If pxp use crop x/y valuse as the upper left coordinate in
out buffer, pxp driver only need to write out buffer base
address to pxp out_buf register. If pxp driver use zero as
ps_ulc register value, pxp out_buf register need an offset
added with out buffer base address.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 14c988f1eb)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 0a084db3f2 MLK-16217: PXP: fix pxp rotate yuv formate video issue
Because of IC limitation, pxp only can use rotation0 engine to
do rotation operation.

Correct coordinate settings of ps and out buffer.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 13f9c31be7 MLK-16104-2 dma: imx-sdma: add index for multi sdma devices case
On i.mx8mscale, there are two sdma instances here, and common dma
frameowrk will get channel dynamicly from any available channel whatever
it's from the first sdma device or the second sdma device. But actually,
some IP like SAI only work in sdma2 not sdma1. To make sure get sdma
channel from the right sdma device, add index to match.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong 564725e48e MLK-16104-1 dma: imx-sdma: add i.mx8m for multi sdma devices
Add i.mx8m for multi sdma devices.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 39f81bd194 MLK-16045: pxp: add lut function in pxp data flow path
When do epdc colormap test, the epdc need pxp lut function. But
if the data flow through mux0->mux1...or mux0->mux2..., the pxp
can not trigger interrupt but mux0->mux3... can. This issue only
occures on imx7d, so I set a constant data path when using lut function.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2018-10-29 11:10:38 +08:00
Robin Gong eed183baf5 MLK-15305-2: dma: imx-sdma: force to load context in sdma_config
Force to load context in sdma_config whatever context loaded or not,
since some configuration may change when the upper driver call sdma_config
such as bus width.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
(cherry picked from commit ee8930b657af0c9ce2cfb1a521530c7d31016675)
2018-10-29 11:10:38 +08:00
Guoniu.Zhou dda914f809 MLK-15962: pxp-v3: fix pxp operation timeout issue
PxP block on imx6sll, imx6ull is different with imx7d, the node
path_ctrl should be different. So add path_ctrl for 6sll, 6ull.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou cc872e02ac MLK-15337: pxp-v3: add pxp v3 crop feature
Add pxp v3 crop feature support.
Update the pxp_dma.h file.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2018-10-29 11:10:38 +08:00