ioremap has provided non-cached semantics by default since the Linux 2.6
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Upstream removed 32bit timespec to deal with y2038 issue.
Update MXC drivers to deal with the change.
Signed-off-by: Li Yang <leoyang.li@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
If the resolution is too bit to support,
driver should report an error event,
so application can do the cancel flow
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
1. make sure mu interrupt in the fifo has been handled.
2. make sure event in the fifo has been handled.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
don't alloc dma in the message handler.
because it may block the event
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
don't clear the pic end flag as it should be cleared by firmware.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
don't lock around cancel_work_sync, otherwise may cause dead lock.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
make the fw_flow_mutex a local mutex instead of a global mutex.
the global may cause dead lock when there are one instance
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
gputop patch added gcvDB_CONTIGUOUS and gcvDB_COMMAND_BUFFER types,
these need create more system memory to maintain database frequently,
gpu out of memory issue happen when run openGL ES CTS on imx6 boards,
this patch can avoid system memory allocation for new database types,
combine gcvDB_CONTIGUOUS memory type into video memory database,
remove gcvDB_COMMAND_BUFFER as not in database counters.
Fix "LF-165 [#imx-1870] gputop counter test failed"
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
need check memory object type when remove database,
Fix "LF-165 [#imx-1870] gputop counter test failed"
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Fix Coverity issue of uninitialized variable, which is introduced by
"LF-165 [#imx-1870] gputop counter test failed"
Date: 10 Jan, 2020
Signed-off-by: Ella Feng <ella.feng@nxp.com>
Use gcmPTR_TO_UINT64() for converting pointer to int for both 64 bit and 32 bit system.
Fix previous patch, "LF-165 [#imx-1870] gputop counter test failed".
Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
Signed-off-by: Ella Feng <ella.feng@nxp.com>
When add buffer to queue which status should be active.
When firmware release one buffer, could re-add it to queue if
its status is active.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: ming_qian <ming.qian@nxp.com>
Add 'FRAME_SKIP' status to record 'MEDIA_PLAYER_SKIPPED_FRAME_ID'
frame. Instead of use 'FRAME_READY' that will lead to this buffer
no chance to re-add to available buffer queue.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
msg hasn't process in time
firmware write event message to message buffer, and trigger an interrupt,
driver will read the message and store it into a fifo. and call queue_work.
If the work is scheduling but have exited the while loop,
it may cause the event won't be processed until another event received.
So in some case, the stream may hang
as the next event is depends on the driver process the current event.
vpu_windsor may have the same issue.
Signed-off-by: Ming Qian <ming.qian@nxp.com>
currently, vpu encoder only support integer frame rate,
we need improve the firmware to support fractional frame rate
so extends the range of frame rate from integers to real numbers
Signed-off-by: Ming Qian <ming.qian@nxp.com>
export fw log via debugfs
the fw log can help us debug some firmware issue.
keep consistent with the decoder
Signed-off-by: Ming Qian <ming.qian@nxp.com>
coreInfoArray use offset as coreIndex, not use hardware core
Fix: 8744fe58453c("MGS-5372 [#imx-1708] Fix the VX/CL apps hang for 865 GPU/VIP
")
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
1M GPU MMU pages are used for flat mapping by default,
there is no performance benefit for dynamic mapping.
disabled 1M MMU page to fix unstable GPU problems.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Some drm common code changed, gpu driver need do the matched update on 5.4 kernel.
1. Some drm API name changed.
drm_gem_object_unreference_unlocked() rename as drm_gem_object_put_unlocked().
drm_dev_unref() rename as drm_dev_put().
2. Drm/prime remove DRIVER_PRIME, driver needs do the matched update.
3. API gem_prime_export remove input parameter "struct drm_device *dev".
Signed-off-by: Richard Liu <xuegang.liu@nxp.com>
BUG25711 CL244484 Android CTS: some cases fail in gles2/gles3
group on imx815 AndroidP/wayland BUG25710 CL244484 [vkcts1.1.3]:fail when run
"dEQP-VK.glsl.limits.near_max.fragment_input.*" on 815 wayland BUG25646
CL244484 [vkcts1.1.3]:dEQP-VK.glsl.limits.near_max.fragment_input.* fail on
815 wayland
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
In low-latency mode, donot need set end_flag if scode type is
BUFFLUSH_PADDING_TYPE. Otherwise, firmware will ignore frame
threshold then may affect another instance performance.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
Acked-by: ming_qian <ming.qian@nxp.com>
export frame threshold of frame mode,
and then we can modify the threshold without update firmware.
It can be used for debug
Signed-off-by: ming_qian <ming.qian@nxp.com>
Acked-by: <shijie.qin@nxp.com>
we should reinit the completion before send command
who may trigger the completion,
otherwise it may be reinit after complete in certain timing,
then led to timeout
use private workqueue instead of public workqueue
Signed-off-by: ming_qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
Check the space of cmd buffer before write cmd,
if the wptr equals to rptr, it'll be treated as empty,
so we can't write to full.
Signed-off-by: ming_qian <ming.qian@nxp.com>
Acked-by: Shijie Qin <shijie.qin@nxp.com>
- If frame ID is MEDIA_PLAYER_SKIPPED_FRAME_ID, need skip this frame,
also need skip its tsm at the same time.
- Fixed coverity issue: CID 6344236 (#2 of 2): Buffer not null
terminated (BUFFER_SIZE_WARNING).
- Remove two deaded code about ctx pointer check.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: ming_qian <ming.qian@nxp.com>
* origin/mxc/vpu: (44 commits)
LF-80:[8QM_MEK/8QXP_MEK]mxc:vpu_malone:clear eos flag when output streamoff
MLK-22999 mxc: vpu_malone: release debugfs after open to avoid memory leak
MLK-22991 mxc: vpu_malone vpu_windsor: check is vpu poweroff when suspend
MLK-22963 mxc vpu_windsor: fix call vzalloc during spinlock
MLK-22945 mxc vpu_malone: disable decode ctx before release it.
...
* origin/mxc/sim: (23 commits)
sim: emvsim: add multi power domain support
MLK-22217 mxc: emvsim: add value adjustment for cwt/bwt timer
MLK-22216 mxc: emvsim: last character need be transmitted separately with no guard time
MLK-22215 mxc: emvsim: correct irq mask and clear irq status before receiving
MLK-22214 mxc: emvsim: clean up the code in ATR stage
...
There are no u/v planars in the pixel formats
IPU_PIX_FMT_BGRA4444/IPU_PIX_FMT_BGRA5551/IPU_PIX_FMT_AYUV,
so we should explicitly get zero u/v_offset from __ipu_ch_offset_calc()
for those pixel formats. Without this patch, '-EINVAL' will be
returned from __ipu_ch_offset_calc() as the function return value
and input parameter u/v_offset will not be touched, which is not a
good behavior, because the caller is likely to ignore the function
return value and take the u/v_offset as valid value. The MXC IPUv3 fb
driver is a such kind of caller, which may get the u/v_offset
for those pixel formats without checking the function return value,
and hence wrongly pass the u/v_offset to PRE driver(finally causes
malfunction).
Signed-off-by: Liu Ying <victor.liu@nxp.com>
This patch forwards IPUv3 common driver from imx_4.19.y kernel.
This includs IPUv3 common, IPUv3 prefetch engine and VDOA support.
[ Liu Ying: Fixed a minor build warning for PRE driver. ]
Signed-off-by: Liu Ying <victor.liu@nxp.com>
If use dma pool when iram does not exist, the iram_pool will be NULL.
The previous version of lib/genalloc.c will check the pointer status
first. In 5.4, it will not check NULL pointer.
Therefore, add NULL check here.
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Upstream rejected ARCH_FSL_IMX8QM so just depend on ARCH_MXC or
COMPILE_TEST.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Because CONFIG_ARCH_MXC_ARM64 is not used since 4.19, add devtype in
imx_mlb_hwdata to distinguish between imx6 and imx8 platform when init
the ipg and hclk clocks.
Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Add ipg & hclk clock for imx8 mlb due to IP integration difference.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
(cherry picked from commit 599dfce3bf486ed65ccd3b63bca4ffba92cab15e)
Due to IP integration difference, there are 2 ahb irqs
for imx6 and only 1 ahb irq for imx8. This patch makes
mlb driver compatible with irq difference.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
mlb 6 pin mode is not supported in current release,
so remove clk for mlb 6 pin mode.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
alloc mlb data buffer from dma pool when iram doesn't exist
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
As a result that the wrong operation is used for the mlb status
in mlb_isr(), some results are independent of their operations.
for example:
rx_cis = (cdt_val[2] & ~MASK) >> SHIFT, where, MASK = 0xf0000000
and SHIFT = 28. So, the result is always 0 regardless of the values
of its operands.
This patch fixes the operation for mlb status in mlb_isr().
(reported by coverity check)
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
After coverity code check, it tips:
unsigned_compare: This less-than-zero comparison of an unsigned value is
never true.
Interrupt variable must be signed type.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
As per commit 6aa7de0591 ("locking/atomics: COCCINELLE/treewide: Convert
trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()"), replace
ACCESS_ONCE with READ_ONCE to fix the compilation errors.
drivers/mxc/mlb/mxc_mlb.c: In function ‘mlb_rx_isr’:
drivers/mxc/mlb/mxc_mlb.c:1664:9: error: implicit declaration of function ‘ACCESS_ONCE’; did you mean ‘READ_ONCE’? [-Werror=implicit-function-declaration]
tail = ACCESS_ONCE(rx_rbuf->tail);
^~~~~~~~~~~
READ_ONCE
CC drivers/of/of_mdio.o
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Add mlb support on imx_4.1.y. The files are copied from imx_3.14.y.
Signed-off-by: Gao Pan <b54642@freescale.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
(cherry picked from commit 24e36b318a29d85c0c4491076416343ade1f344e)
Add value adjustment for cwt/bwt timer, otherwise it will fail with
ultimate cwt/bwt value.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
It can't receive when transmitting on EMVSIM IP. ICC will send response
quickly when Terminal transmits last character with guard time. If the
response came to Terminal before the guard time expired, the Terminal
would not receive the respone. So should transmit last character with no
guard time.
This patch intends to fix the communication failure when setting guard
time.
This will cause about 1 ETU delay before transmitting last character
(according to timing measured), but it does not matter.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Should read TS character before updating value of GPCNT1, because TS
character will also cost 12 etus.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Shouldn't clear PEF/FEF flag in irq handler as they are just a flag which
can't trigger interrupt. And they will be check later in irq handler.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Once detected a valid TS, the ICM bit is cleared and the data format bit,
IC bit , is set to appropriate value depending on the data format
detected using the initial character.
When TS is 0x3B (direct convention) in cold reset, and then become 0x3F
(inverse convention) in warm reset, it will not in ICM mode.
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Enable CWT for ATR, and switch to RX_DATA_IM to detect receiving data
in fifo.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Card Presence Detect Status Bit SPDP in EMV_SIM_PCSR is
synchronized by two posedge of low_ref_clk which is 32KHz.
So there should be 1.5 low_ref_clk cycles(about 90us) before
reading SPDP Bit.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
The EMVSIM module is designed to facilitate communication to
Smart Cards compatible to the EMV ver4.3 standard and compatible
with ISO/IEC 7816-3 Standard.
This patch adds driver to support EMVSIM module for imx8.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
Kernel space cannot access user space memory directly.
In fact, the issue always exited. Since 4.4, the kernel
handle the action as page abort.
Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
SIM1 IOMUX is changed into reset state in LPSR mode.As a result,
sim can't work again.
This patch sets sim1 IOMUX to default state after existing from LPSR mode.
(cherry-picked from commit 8e237775cd413645bfd806e4c648954e1a773a2d)
Signed-off-by: Gao Pan <b54642@freescale.com>
sim_activate() process is contained in the cold reset.
Thus, it is redundant and should be removed.
This patch also adds comments to cold reset process.
Signed-off-by: Gao Pan <b54642@freescale.com>
The API devm_request_and_ioremap meets compile error
on branch imx_4.1.y. It is recommend to replace the api
with devm_ioremap_resource.
Signed-off-by: Gao Pan <b54642@freescale.com>
The EMV4.3 has strict requirement about the reset sequence. The old code use the mdelay, udelay to
achievet, which is not precise enough. Replace it with the timer interrupt. The EMV4.3 requires
40000~45000 clock cycles duration when reset is low.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from a006fe283c8b97f0a711cb0829bfbdaaf4a5f31f)
In EMV4.3 after warm/cold reset, there would be a receiving window. The receiving
window would be 42000 clock length.If the receiving window expires without receiving
one byte, IFD need to take actions as EMV4.3 spec. The driver need to support this
to identify the sequence of the receiving window expiring event and the receiving event.
Since theinterrupt latency in linux OS is not certain, we need to tune this setting to
pass the cases. Current tuning parameter can work.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from faf1d8d881a6ad2c6b88fdf312cef142996937c1)
The CWT timer is used to detect the the character interval in the data traffic.
When tx, SIM IP can guarantee the interval based our setting. When RX, we need
to enalbe the CWT timer to check whether the interval is in the range. This patch
fix this.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 9c92dfd070e7427eb1e0166f368b89b4a7ac1bff)
Modify the driver to support the SIM on i.MX6UL-EVK platform. The main modification is:
1. Add port index to support different port on platform.
2. Add POS-CARD support. The POS card has external IC to assert when SVEN to low. Add support.
3. Using a function to calculate the strict timing delay.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 17d1315b0704e2db63ee6bd7aaefa0c796f53104)
Add the option to enable SIM driver build.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
Signed-off-by: Gao Pan <b45643@freescale.com>
(cherry picked from 0f7a6fa3c141bfc7333d9056639b7a5b1154ed1d)
This driver is based on the current code which runs the the EMV test on the i.MX258 platform.
Since there are still many cases that can't pass on the i.MX258 and i.MX7d platform. The
driver will need to be improved after per-test work. Just check in as a base code. There
would be definitly some timing improvement work to do in the future.
Signed-off-by: Luwei Zhou <b45643@freescale.com>
(cherry picked from 3ac1ad5b2a68ecb052ccacca4ac7459ead04415e)
if the eos flag is not clear after output streamoff,
it may cause firmware hang with multi instances
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
VPU decoder driver create some debug fs,
but don't set the release function,
in open function, it will alloc some memory,
it should be freed when release function is called.
otherwise, memory will be leaked.
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: Zhou Peng <eagle.zhou@nxp.com>
the csr register 'CM0Px_CPUWAIT' will be cleared to '1' after
reset(poweroff then poweron), hence we could check is vpu poweroff
when suspend according to this value.
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
Reviewed-by: ming_qian <ming.qian@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
platform vzalloc may call wait_completion to sleep,
but sleep is forbidden during spinlock,
so use mutex instead
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
If close is called without calling streamoff,
the status of decode is enable,
some buffer status may be wrong.
disable before release it will avoid such error.
Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
Add a missing semicolon. This missing semicolon is not breaking the
build in defconfig since the next MODULE_DEVICE_TABLE() expand to an
empty string, so the next semicolon is used. When this macro expands
to a non-empty string, the build breaks. This was found by a
"make allmodconfig" build.
Signed-off-by: Julien Olivain <julien.olivain@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
Add a missing semicolon. This missing semicolon is not breaking the
build in defconfig since the next MODULE_DEVICE_TABLE() expand to an
empty string, so the next semicolon is used. When this macro expands
to a non-empty string, the build breaks. This was found by a
"make allmodconfig" build.
Signed-off-by: Julien Olivain <julien.olivain@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
Upstream rejected per-SOC kconfig symbols such as CONFIG_ARCH_FSL_IMX8MQ
so just use CONFIG_ARCH_MXC instead.
There is already an ARM64 check in drivers/mxc/Kconfig so this
shouldn't change anything except that we can drop CONFIG_ARCH_FSL_IMX8MQ
from linux-nxp tree.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Acked-by: Zhou Peng <eagle.zhou@nxp.com>
If the writeable flag is not change synchronously,
the flag may not changed correct,
it'll case the encode stream hang.
It's likely to happen when small resolution stream do suspend.
Signed-off-by: ming_qian <ming.qian@nxp.com>
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
- Enable mailbox for vpu decoder
The mailbox of mu_m0 is used by imx8qxp and imx8qm
- Unify code between 4.19 and 5.x
Update code from 4.19
Separate sc and mu contents to vpu_mu.h/vpu_mu.c
Separate pm_domain contents to vpu_pm.h/vpu_pm.c
Add kfifo for better hold received mu message
Sync v4l2 change
Use ktime_get_real_ts64() replace do_gettimeofday()
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
- Enable mailbox for vpu encoder
The mailbox of mu1_m0 is used by imx8qxp
The mailbox of mu2_m0 are used by imx8qm
- Unify code between 4.19 and 5.x
Update code from 4.19
Separate sc and mu contents to vpu_encoder_mu.h/.c
Separate pm_domain contents to vpu_encoder_pm.h/.c
Add kfifo for better hold received mu message
Sync v4l2 change
Signed-off-by: Shijie Qin <shijie.qin@nxp.com>
compat_ptr() depends on CONFIG_COMPAT.
Make hx280enc_ioctl() conditionally compiled to avoid a build
break in case CONFIG_COMPAT is not defined.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
fix dma_alloc_attrs failure issue:
need to set valid device pointer instead of null pointer in
parameters of functions: dma_alloc_coherent/dma_free_coherent
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Due to below commit:
7e98b7b542 ("media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap, out}_mplane")
We met the following build error:
../drivers/mxc/vpu_malone/vpu_b0.c:1721:2: error: unknown field ‘vidioc_enum_fmt_vid_cap_mplane’ specified in initializer
.vidioc_enum_fmt_vid_cap_mplane = v4l2_ioctl_enum_fmt_vid_cap_mplane,
^
../drivers/mxc/vpu_malone/vpu_b0.c:1722:2: error: unknown field ‘vidioc_enum_fmt_vid_out_mplane’ specified in initializer
.vidioc_enum_fmt_vid_out_mplane = v4l2_ioctl_enum_fmt_vid_out_mplane,
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Fix build error for kernel 5.x:
- power domain adjustment
use dev_pm_domain_attach_by_name()/device_link_add
- remove sc fw api
comment fuse related function
- definition of vb2_qbuf() changed
set 'media_device' for vb2_qbuf()
- 'vidioc_g_crop'/'vidioc_s_crop' removed
comment function 'v4l2_ioctl_g_crop'
- remove legacy macro, such as 'VB2_BUF_STATE_PREPARED'
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
Fix build error for kernel 5.x:
- power domain adjustment
use dev_pm_domain_attach_by_name()/device_link_add
- remove sc fw api
comment fuse related function
- definition of vb2_qbuf() changed
set 'media_device' for vb2_qbuf()
- 'vidioc_g_crop' removed
comment function 'v4l2_ioctl_g_crop'
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: In function ‘show_buffer_info’:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:3951:23: error: ‘VB2_BUF_STATE_REQUEUEING’ undeclared (first use in this function)
" %d:requeueing,", VB2_BUF_STATE_REQUEUEING);
Due to this macro was removed by the following commit:
commit c6e4e2c403
Author: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Date: Thu Feb 28 07:35:46 2019 -0500
media: vb2: drop VB2_BUF_STATE_REQUEUEING
The last user of this state has been converted, so we can now drop
this. Requeueing causes the queue to become unordered, which causes
problems with requests and (in the future) fences.
Since it is no longer needed, just get rid of this.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: In function ‘show_buffer_info’:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:4001:21: error: ‘VB2_BUF_STATE_PREPARED’ undeclared (first use in this function)
" %d:prepared,", VB2_BUF_STATE_PREPARED);
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: At top level:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1415:2: error: unknown field ‘vidioc_g_crop’ specified in initializer
.vidioc_g_crop = vpu_enc_v4l2_ioctl_g_crop,
^
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1415:2: warning: initialization from incompatible pointer type
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1415:2: warning: (near initialization for ‘vpu_enc_v4l2_ioctl_ops.vidioc_dqbuf’)
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1416:2: error: unknown field ‘vidioc_s_crop’ specified in initializer
.vidioc_s_crop = vpu_enc_v4l2_ioctl_s_crop,
^
Module owner can double check later if need implement the same function
in other callbackes.
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c: In function ‘vpu_enc_v4l2_ioctl_qbuf’:
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1048:8: warning: passing argument 2 of ‘vb2_qbuf’ from incompatible pointer type
ret = vb2_qbuf(&q_data->vb2_q, buf);
^
In file included from ../include/media/v4l2-mem2mem.h:20:0,
from ../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:47:
../include/media/videobuf2-v4l2.h:144:5: note: expected ‘struct media_device *’ but argument is of type ‘struct v4l2_buffer *’
int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev,
^
../drivers/mxc/vpu_windsor/vpu_encoder_b0.c:1048:8: error: too few arguments to function ‘vb2_qbuf’
ret = vb2_qbuf(&q_data->vb2_q, buf);
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/vpu_malone/vpu_b0.c: In function ‘v4l2_ioctl_qbuf’:
../drivers/mxc/vpu_malone/vpu_b0.c:920:8: warning: passing argument 2 of ‘vb2_qbuf’ from incompatible pointer type
ret = vb2_qbuf(&q_data->vb2_q, buf);
^
In file included from ../include/media/v4l2-mem2mem.h:20:0,
from ../drivers/mxc/vpu_malone/vpu_b0.c:47:
../include/media/videobuf2-v4l2.h:144:5: note: expected ‘struct media_device *’ but argument is of type ‘struct v4l2_buffer *’
int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev,
^
../drivers/mxc/vpu_malone/vpu_b0.c:920:8: error: too few arguments to function ‘vb2_qbuf’
ret = vb2_qbuf(&q_data->vb2_q, buf);
^
In file included from ../include/media/v4l2-mem2mem.h:20:0,
from ../drivers/mxc/vpu_malone/vpu_b0.c:47:
../include/media/videobuf2-v4l2.h:144:5: note: declared here
int vb2_qbuf(struct vb2_queue *q, struct media_device *mdev,
^
../drivers/mxc/vpu_malone/vpu_b0.c: At top level:
../drivers/mxc/vpu_malone/vpu_b0.c:1150:2: error: unknown field ‘vidioc_g_crop’ specified in initializer
.vidioc_g_crop = v4l2_ioctl_g_crop,
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
../drivers/mxc/hantro/hantrodec.c: In function ‘hantrodec_ioctl’:
../drivers/mxc/hantro/hantrodec.c:1033:62: error: macro "access_ok" passed 3 arguments, but takes just 2
err = !access_ok(VERIFY_WRITE, (void *) arg, _IOC_SIZE(cmd));
^
../drivers/mxc/hantro/hantrodec.c:1033:10: error: ‘access_ok’ undeclared (first use in this function)
err = !access_ok(VERIFY_WRITE, (void *) arg, _IOC_SIZE(cmd));
^
../drivers/mxc/hantro/hantrodec.c:1033:10: note: each undeclared identifier is reported only once for each function it appears in
../drivers/mxc/hantro/hantrodec.c:1035:61: error: macro "access_ok" passed 3 arguments, but takes just 2
err = !access_ok(VERIFY_READ, (void *) arg, _IOC_SIZE(cmd));
^
CC drivers/mtd/nand/raw/nand_base.o
CC drivers/irqchip/irq-mvebu-odmi.o
CC drivers/mtd/nand/raw/nand_legacy.o
../drivers/mxc/hantro/hantrodec.c: In function ‘get_hantro_core_desc32’:
../drivers/mxc/hantro/hantrodec.c:1266:61: error: macro "access_ok" passed 3 arguments, but takes just 2
if (!access_ok(VERIFY_READ, up, sizeof(struct core_desc_32)) ||
^
../drivers/mxc/hantro/hantrodec.c:1266:7: error: ‘access_ok’ undeclared (first use in this function)
if (!access_ok(VERIFY_READ, up, sizeof(struct core_desc_32)) ||
^
../drivers/mxc/hantro/hantrodec.c: In function ‘put_hantro_core_desc32’:
../drivers/mxc/hantro/hantrodec.c:1280:62: error: macro "access_ok" passed 3 arguments, but takes just 2
if (!access_ok(VERIFY_WRITE, up, sizeof(struct core_desc_32)) ||
^
../drivers/mxc/hantro/hantrodec.c:1280:7: error: ‘access_ok’ undeclared (first use in this function)
if (!access_ok(VERIFY_WRITE, up, sizeof(struct core_desc_32)) ||
^
../scripts/Makefile.build:278: recipe for target 'drivers/mxc/hantro/hantrodec.o' failed
make[4]: *** [drivers/mxc/hantro/hantrodec.o] Error 1
../scripts/Makefile.build:489: recipe for target 'drivers/mxc/hantro' failed
make[3]: *** [drivers/mxc/hantro] Error 2
../scripts/Makefile.build:489: recipe for target 'drivers/mxc' failed
make[2]: *** [drivers/mxc] Error 2
make[2]: *** Waiting for unfinished jobs...
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
gpu_probe set coherent_dma_mask with 40BIT configuration,
L5.4 dma_alloc_wc will return physical address beyond 4GB,
that will cause GPU hang and kernel panic problem on QM.
default coherent_dma_mask is 32BIT, can meet GPU requirement,
this patch remove coherent_dma_mask setting from GPU driver.
Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
fix the gpu dump when enable vProfile on 8MN_EVK
Date: 7th Nov ,2019
Signed-off-by Ya Zhou <ya.zhou@nxp.com>
(cherry picked from commit 053c97c0387673c4e730d9b2f780f8cde5fcdf5b)
Update the imx platform gpu driver to accommodate layerscape soc,
so that both platform can share the same platform driver.
Signed-off-by: Tang Yuantian <andy.tang@nxp.com>
dummy draw is required for 8MM GPU errata - HBN1285,
this fix shall be applied for GPU power-up transition,
otherwise GPU shader hang with the unnecessary flush.
check GPU MMU state to enable dummy draw fix only.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
When vm_mmap fail, code jump to OnError with error status and userLogical variable != 0.
Then _CMAFSLUnmapUser is called with a invalid virtual address (MdlMap->vmaAddr) and cause panic.
Check userLogical to avoid GPU kernel panic for error handling.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
Fix GPU memory problem when disable CMA allocator,
set LINUX_CMA_FSL=0 in gc_hal_kernel_platform_imx.config
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
there are lots of PFNs busy message when run GPU tests:
[ 622.370671] alloc_contig_range: [4ea70, 4ea7c) PFNs busy
[ 626.518072] alloc_contig_range: [4ea90, 4ea9c) PFNs busy
this problem is related with CMA migration for fragments,
move CMA allocator after GFP to avoid memory migration,
also fix CMA preempt for contiguous memory request.
can improve CTS and gpubench benchmarks on M850D.
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit ad77ed61b72c8362b04361acd2deb685fee15436)
When alloc NonContiguous1MPages, if malloc fail, need free the pages to avoid memory leak
Date: 24 Oct, 2019
Signed-off-by: Xianzhong Li <xianzhong.li@nxp.com>
The intension of this code is that, if current core is null, go to get the next one.
If it's already the last one, no need to do this.
Date: 23 Oct, 2019
Signed-off-by: Ella Feng <ella.feng@nxp.com>
The SCU API used in this file is for 4.19 kernel version and need to upgrade,
Need to modify the method to distinguish 8QM.8QXP by compatible string
drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx.c
This api was removed from kernel. Use new instead.
../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c: In function ‘gckOS_GetTime’:
../drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c:3006:5: error: implicit declaration of function ‘do_gettimeofday’ [-Werror=implicit-function-declaration]
do_gettimeofday(&tv);
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>