Fix Coverity issue: CID 21634622: Unchecked return value (CHECKED_RETURN)
Calling pxp_buffer_handle_delete without checking return value,
this patch added the check before use.
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Fix typo introduced from the commit 9a06b8f28f ("LF-9509: dma: pxp_dma_v3:
fix dereference after null check issue") which causes pxp timeout when run
epdc test on MX8ULP EVK ('/unit_tests/Display/mxc_epdc_v2_fb_test.out').
...
[ 223.598322] pxp_dispatch_thread: task is timeout
[ 223.630619] imx_epdc_v2_fb 2db30000.epdc: PxP operation failed due to timeout
[ 223.637898] imx_epdc_v2_fb 2db30000.epdc: Unable to complete PxP update task: pre_prcoess.
Change back to non-inverted RGB565
...
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: G.N. Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit a069b2188d)
In pxp_is_v3(), it call pxp->devdata, but it out of null check for
pxp->devdata, so maybe refer null data when lut_transform is true.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 9a06b8f28f)
When pxp read pixel data by fetch engine and output by store engine.
The performance is very low, about 50Mpixel/s when the bytes of both
read and write burst are the default value 8. While increase both
read and write burst bytes to 64, the performance will be improved
to about 125Mpixel/s.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
(cherry picked from commit 519de8586c)
PXP_IOC_FLUSH_PHYMEM ioctl implements support for cache coherency
of buffers previously allocated by the PXP driver using
PXP_IOC_GET_PHYMEM ioctl, hence associated to its PXP driver
handle.
This change adds the option to handle dma coherency on a dma-buf
issued by a generic exporter.
Handle associated to buffers allocated by PXP driver can not be null.
Therefore null handle is used by implementation as criteria to fall
back onto the dma-buf file descriptor passed in arguments, keeping
the backward compatibility.
Signed-off-by: Julien Vuillaumier <julien.vuillaumier@nxp.com>
Reviewed-by: G.N. Zhou <guoniu.zhou@nxp.com>
When input format of PS engine is monochrome, such as Y8 or Y4,
the low 16 bits of PS_VBUF are used as the U/V data in the data
path instead of sourcing U/V data from external buffers. In this
case it represents a fixed value for U/V data.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
When run g2d sample test, pxp will report timeout issue. The reason
is that BGRA32 format is used in the case and driver will select AS
engine as input source. But from PXP datasheet, As can't do a simple
copy operation since it usually need to co-work with PS engine which
mean the output pixel value will determined by both AS and PS, such
as raster operation "AS OR PS" which usually used in legacy blending
operation. So add this workaround to fix this issue.
Reproduce steps:
/opt/g2d_samples/g2d_wayland_shm_test
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
PS engine doesn't support RGB format with alpha channel, so it will discard
alpha value in RGBA/ARGB when PXP carry data from source to destination. The
workaround enable ALPHA_A porter_duff and use source blend mode, so it will
keep the alpha component as same in source buffer.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
The case is that source buffer is YUYV format and need to convert it
to ABGR32 and do rotation operation. But it will fail due to the reason
as bellow:
Driver will select PS as input engine according to input format(YUYV)
and OUT engine will be used as output engine since PS can't work with
STORE engine, but OUT engine don't support ABGR32 format.
When do rotation operation, ROTATION2(iMX93 reference manual) will be
selected first, but it only can work with fetch engine due to PXP's
limitation(TKT0603343), so driver need to clean it and select ROTATION1
engine to do the rotation operation.
This patch fix this issue by adding ABGR32 format for OUT engine and
selecting ROTATION1 for PS/AS engine
Reproduce steps as bellow and run on iMX93 platform:
/opt/g2d_samples/g2d_basic_test
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
PXP block size is selected as 16x16 pixels by default in order to request
data more efficient. So driver also need to set each module which support
block size to 16x16. This patch is used to set input fetch engine block
size to 16x16.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Fill input fetch engine upper left X-coordinate(in pixels) of the active
surface of the total input memory by frame boundary size when user don't
configure them.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Enable input fetch engine arbitration bit for iMX93 platform when use its
two channel simultaneously since only one AXI bus interface is connected
to PXP fetch engine channel in order to balance system performance. For
other platform which use PXP don't have this design, so set arbitration
bit as platform data and only enable it for iMX93 platform(TKT0601126).
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
The selected modules by user case in PXP pipeline will be configured
and enabled in pxp_2d_task_config() , so don't need to enable unused
modules and re-enable the used modules in pxp_start()
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
The offset of U/V relative to Y buffer address base in PS engine is
wrong when format is multi-plane YUV format and crop enabled. So
correct it.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
../drivers/dma/pxp/pxp_device.c: In function 'pxp_dmabuf_ops_map':
../drivers/dma/pxp/pxp_device.c:666:40: error: 'struct dma_buf' has no member named 'lock'
666 | struct mutex *lock = &db_attach->dmabuf->lock;
| ^~
../drivers/dma/pxp/pxp_device.c:666:15: warning: unused variable 'lock' [-Wunused-variable]
666 | struct mutex *lock = &db_attach->dmabuf->lock;
| ^~~~
Remove internal dma-buf lock as it's removed in new framework and dma-buf reservation
is guaranteed to be locked by importers during the mapping operations.
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Guoniu.zhou <guoniu.zhou@nxp.com>
CSC2 engine in PXP has IC bug(TKT272216) and fixed after 7D PXP version.
Driver update new CSC coefficient provided by PXP IP owner(MLK-25625-02).
But when run e-ink case, it can't do clear operation after applying the
patch. We don't know reason until now, so add a temporary patch to fix it
and will remove after finding the root cause.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Since upstream commit 7938f421816 ("dma-buf-map: Rename to iosys-map")
the dma-buf-map names need to be updated.
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Select block size to 16x16 pixel blocks for PXP primary path in order
to improve PXP performance
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Config block size to 16x16 for input fetch and store engine in order to
improve PXP performance
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Config write burst size to 64 bytes in order to improve PXP performance
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Correct csc2 coefficient due to PXP issue(TKT272216). It apply to PXP
version after than iMX7D
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Tested-by: Jared Hu <jared.hu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
In current pxp driver, U and V address are caculated by driver when input/output
format is multi-plane format, such as NV12. But for some cases, user space want
to set U and V address by themself, so expose multi address settting for the case
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Tested-by: Jared Hu <jared.hu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
CC drivers/dma/pxp/pxp_device.o
drivers/dma/pxp/pxp_device.c:358:8: warning: implicit conversion from enumeration type
'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
DMA_TO_DEVICE,
To reproduce the warnings:
1) Install clang 12:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12
2) Build kernel with clang:
export PATH=/usr/lib/llvm-12/bin/:$PATH LLVM=1
make ARCH=arm64 imx_v8_defconfig
make ARCH=arm64
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
drivers/dma/pxp/pxp_dma_v3.c:7769:15: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((output == enode->adjvex)) {
~~~~~~~^~~~~~~~~~~~~~~~
drivers/dma/pxp/pxp_dma_v3.c:7769:15: note: remove extraneous parentheses around the comparison to silence this warning
if ((output == enode->adjvex)) {
~ ^ ~
drivers/dma/pxp/pxp_dma_v3.c:7769:15: note: use '=' to turn this equality comparison into an assignment
if ((output == enode->adjvex)) {
To reproduce the warnings:
1) Install clang 12:
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 12
2) Build kernel with clang:
export PATH=/usr/lib/llvm-12/bin/:$PATH LLVM=1
make ARCH=arm64 imx_v8_defconfig
make ARCH=arm64
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
Fixed together with LF-5068, just make the coverity checking system no complain.
actually there's no potential issue for out-of-bounds access.
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: G.N. Zhou <guoniu.zhou@nxp.com>
In linux-nxp repo, -Wimplicit-fallthrough is set to 5, so it causes
warning for /* fall through */ in switch case statement. So the patch
is used to fix it
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
When pxp driver probe, it will do software reset and reconfigure
operation. For iMX8ULP, power domain will be turned off in runtime
suspend and the status will be missed, so need to do software reset
and reconfigure operation again. But for other platform, such as 7D,
it's not necessary.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Fix segmentation fault when run pxp lib unit test on iMX8ULP platform
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by : Robby.Cai <robby.cai@nxp.com>
Fix data type mismatch issue when PXP driver run on arm64 platform
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by : Robby.Cai <robby.cai@nxp.com>
Due to PXP is used in iMX6, iMX7 Serial platform and they are 32 bits arm
platform, so add the dependency for PXP driver.
In iMX8ULP, it also integrate PXP and it's 64 bits arm platform, so remove
the dependency for it.
Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com>
Reviewed-by : Robby.Cai <robby.cai@nxp.com>
Coverity issue ID: 379372
As only one overlayer supported, the initialization for ol_param
need to be adjusted accordingly.
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
Fix the following build warning:
../drivers/dma/pxp/pxp_dma_v3.c: In function 'pxp_store_shift_ctrl_config':
../drivers/dma/pxp/pxp_dma_v3.c:1700:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
shift_bypass = 1;
~~~~~~~~~~~~~^~~
../drivers/dma/pxp/pxp_dma_v3.c:1701:3: note: here
case PXP_PIX_FMT_YVYU:
^~~~
../drivers/dma/pxp/pxp_dma_v3.c:1705:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
shift_bypass = 1;
~~~~~~~~~~~~~^~~
../drivers/dma/pxp/pxp_dma_v3.c:1706:3: note: here
case PXP_PIX_FMT_NV61:
^~~~
Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>