This adds standard controls for exposure, analogue gain and digital gain
which will temporarily work in parallel with the custom ones.
Eventually, the custom controls will be removed and only the standard
ones will be used.
The new controls, however, needs a complicated distribution function
that takes all 3 user provided values of exposure, analogue gain and
digital gain as inputs and computes the proper values that will be
written to the sensor registers.
In order to make this process a little more efficient and avoid writing
the same registers 3 times, add a caching mechanism that will avoid
writing a register if its value didn't change.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Add group-hold helper functions for the exposure and gain setting
routines to prepare for the next patches where we need to be able to set
exposure and gains within one single group-hold.
Also, only use group-hold 0 for all operations since the controls are
serialized anyway.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Reviewed-by: Robert Chiras <robert.chiras@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
The UPDATE_MODE_FULL update mode will cause screen flashing one time when update UI.
Now change to UPDATE_MODE_PARTIAL mode to avoid flashing, but the screen maybe dirty
after update UI some times.
Change-Id: If02e60e7af441fb9939528e7345ba134f3573c43
Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
In try_fmt function the color space selection has been added
depending on the incoming configuration from user space.
It selects a valid colorspace by its name or a default one if
incoming configuration is not appropriate. Only default transfer
function, encoding and quantization are supported.
GCM unit uses the configuration from the color space to
define the related registers accordingly.
Change-Id: Ic864e39e2a84ee9bf5063f9ebd7eeac9404490b1
Signed-off-by: Alexi Birlinger <alexi.birlinger@nxp.com>
Reviewed-by: Aymen Sghaier <aymen.sghaier@nxp.com>
When all drivers are built in, the trusty driver will probe after
the vpu/dpu driver probe, which will result in a trusty dump. To solve
this issue, the vpu/dpu driver needs to determine whether the trusty
driver probe successfully before calling the trusty api, otherwise the
probe will be deferred.
Change-Id: I2cd20424e9c70dfff478096b28dfef2ca6eeb816
Signed-off-by: He Zhai <zhai.he@nxp.com>
Change maximum height from 2304 to 4096 to support maximum resolution
4096x4096
Change-Id: Ic96e3f4b5302c25d12616489800775373756ece9
Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
commit 704573851b upstream.
This patch addresses an issue introduced by commit 1a83a716ec ("mm:
krealloc: consider spare memory for __GFP_ZERO") which causes MTE
(Memory Tagging Extension) to falsely report a slab-out-of-bounds error.
The problem occurs when zeroing out spare memory in __do_krealloc. The
original code only considered software-based KASAN and did not account
for MTE. It does not reset the KASAN tag before calling memset, leading
to a mismatch between the pointer tag and the memory tag, resulting in a
false positive.
Example of the error:
==================================================================
swapper/0: BUG: KASAN: slab-out-of-bounds in __memset+0x84/0x188
swapper/0: Write at addr f4ffff8005f0fdf0 by task swapper/0/1
swapper/0: Pointer tag: [f4], memory tag: [fe]
swapper/0:
swapper/0: CPU: 4 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.
swapper/0: Hardware name: MT6991(ENG) (DT)
swapper/0: Call trace:
swapper/0: dump_backtrace+0xfc/0x17c
swapper/0: show_stack+0x18/0x28
swapper/0: dump_stack_lvl+0x40/0xa0
swapper/0: print_report+0x1b8/0x71c
swapper/0: kasan_report+0xec/0x14c
swapper/0: __do_kernel_fault+0x60/0x29c
swapper/0: do_bad_area+0x30/0xdc
swapper/0: do_tag_check_fault+0x20/0x34
swapper/0: do_mem_abort+0x58/0x104
swapper/0: el1_abort+0x3c/0x5c
swapper/0: el1h_64_sync_handler+0x80/0xcc
swapper/0: el1h_64_sync+0x68/0x6c
swapper/0: __memset+0x84/0x188
swapper/0: btf_populate_kfunc_set+0x280/0x3d8
swapper/0: __register_btf_kfunc_id_set+0x43c/0x468
swapper/0: register_btf_kfunc_id_set+0x48/0x60
swapper/0: register_nf_nat_bpf+0x1c/0x40
swapper/0: nf_nat_init+0xc0/0x128
swapper/0: do_one_initcall+0x184/0x464
swapper/0: do_initcall_level+0xdc/0x1b0
swapper/0: do_initcalls+0x70/0xc0
swapper/0: do_basic_setup+0x1c/0x28
swapper/0: kernel_init_freeable+0x144/0x1b8
swapper/0: kernel_init+0x20/0x1a8
swapper/0: ret_from_fork+0x10/0x20
==================================================================
Bug: 390070977
Bug: 391031881
(cherry picked from commit 704573851bhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
linux-6.6.y)
Fixes: 1a83a716ec ("mm: krealloc: consider spare memory for __GFP_ZERO")
Signed-off-by: Qun-Wei Lin <qun-wei.lin@mediatek.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Seiya Wang <seiya.wang@mediatek.com>
Change-Id: Iea0ba629183042d594665ab51b410965963d167e
(cherry picked from commit 6b18f0b574ab3267615ae6ce642d5a7c3c21ac09)
(cherry picked from commit e087ce9a44c0671bf11e86df937821aed4ce995b)
This pick the below patch in rel_6.4.11.p3_20241216.
379b828131 CL1002665 [KERNEL SPACE] NXP: Update previous cl 1002206.
Change kernel version from 6.11 to 6.12 and from 6.9 to 6.10.
[Kaiwen.Sheng]
Change-Id: If89d07fb79e599cfc8c7ebd84cde065d183ba4b9
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
This pick the below patch in rel_6.4.11.p3_20241216.
d05512eb28 CL1002206 [KERNEL SPACE] NXP: Replace with follow_pfnmap APIs
for kernel 6.11 and replace with follow_pte for kernel 6.9.
[Kaiwen.Sheng]
Change-Id: I7666c487000bebec80878a0d1a3dabbf5e7d1b0a
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
This pick the below patch in rel_6.4.11.p3_20241216.
4f4e3b85f1 CL825001 [KERNEL SPACE] [NXP]: Fix a build issue when
CAPTURE_ONLY_MODE is set to 1. By Shiheng.Zhou
Change-Id: Ib136d546a5740ed062e0e82a5c32c3047aaa921b
Signed-off-by: IPD_SCM <IPD_SCM@verisilicon.com>
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
This pick the below patch in rel_6.4.11.p3_20241216.
7e84f1fc25 CL868804 [KERNEL SPACE] 22Q2_NXP: Support CL30 Capture Only
Mode.
Change-Id: Iadcb5c3caa3a1a201f1dc66f9ec9a1e0b8efd6a8
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
This pick the below patch in rel_6.4.11.p3_20241216.
ac4da795ec CL775297 [KERNEL SPACE] 22Q2_NXP: Make capture only work on
Wayland alpha version.
Change-Id: I97e8ce5f3ff902f1123763c8840f26d13c9ecc65
Signed-off-by: Jessie Hao <juan.hao@nxp.com>
The driver allows a 2x2 alignment crop size,
which does not adhere to the Wave6 hardware limitations.
However, the driver still encodes the crop size
according to the Wave6 hardware limitations.
Instead, it includes the conf_win info in the SPS
to indicate the exact crop size.
Driver should report the exact crop size in CAPTURE buffer.
Change-Id: I3978da4a013ea9fbf87865a51f1cd765f5532f58
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reason: UART3 on 8MM has been disabled in commit 68da6a9fd2, this port
will be used in LE Audio, so enable it in imx8mm-evk-iw612.dts
Tested: on 8MM
Change-Id: I756f8c0bb377b3cc74d443e51edfe6051aec518b
Signed-off-by: yunjie <yunjie.jia@nxp.com>
For AVC and HEVC format, support 2x2 pixel alignment
For VP8 format, support 1x1 pixel alignment
Change-Id: I8fae851f80d85f556e34b8b979b1fb2177fb3c03
Signed-off-by: Tao Jiang <nxf88235@lsv051605.swis.nl-cdc01.nxp.com>
Ignore the last empty buffer, otherwise it may fail the android case
Change-Id: Icc3eab88ebc5572685c434b1158d7911f23bf1c7
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
When colorspace change, the resolution or the dpb amount are not
changed. don't need to streamoff capture, just use DEC_CMD_START to
finish source change flow.
Change-Id: I60f286dc0f4848748081e2e91766eb919a3feb3b
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Clear last_buffer_dequeued flag for DEC_CMD_START, as client may use
this cmd to finish source change flow.
Change-Id: Iffd84e5bd58b9cc857bebad188523827aba77f50
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
Follow source change follow if only colorspace is changed, but not the
resolution or dbp amount.
Change-Id: I50025dbc8abcdcd454c7b88cfd370c4e47b90527
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: xiahong.bao <xiahong.bao@nxp.com>
The wave6 decoder support identical size ranges horizontally as
vertically.
Change-Id: Ie5e278b0d5bc9d6e5da8780628da7cba65c81660
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Ming Zhou <ming.zhou@nxp.com>
The hantro decoder can support identical size ranges horizontally as
vertically.
Change-Id: I9c7dcc4345e91129324a79594bd0004e1bc5b8ae
Signed-off-by: Ming Zhou <ming.zhou@nxp.com>
Signed-off-by: Ming Qian <ming.qian@nxp.com>
When colorspace change, but size is not changed, firmware still trigger
a source chagne event.
Implement decoder start cmd.
Then we can follow the dynamic resolution flow to handle colorspace
change.
Change-Id: If0d7a0d14ce9f7d1deaf62e54981c47fda9e5d1a
Signed-off-by: Ming Qian <ming.qian@nxp.com>
alloc_contig_migrate_range has every information to be able to understand
big contiguous allocation latency. For example, how many pages are
migrated, how many times they were needed to unmap from page tables.
This patch adds the trace event to collect the allocation statistics. In
the field, it was quite useful to understand CMA allocation latency.
[akpm@linux-foundation.org: a/trace_mm_alloc_config_migrate_range_info_enabled/trace_mm_alloc_contig_migrate_range_info_enabled]
Link: https://lkml.kernel.org/r/20240228051127.2859472-1-richardycc@google.com
Signed-off-by: Richard Chang <richardycc@google.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org.
Cc: Martin Liu <liumartin@google.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Bug: 315897534
(cherry picked from commit c8b3600312)
[richardycc: slight modification for android change 0de2f42977]
Change-Id: If6c3cd106201fd13683d1dd5afdfa62a48a4dd3b
Signed-off-by: Richard Chang <richardycc@google.com>
Move our existing input sanity checking to the top of sel_write_load()
and add a check to ensure the buffer size is non-zero.
Move a local variable initialization from the declaration to before it
is used.
Minor style adjustments.
Reported-by: Sam Sun <samsun1006219@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Bug: 386755977
Change-Id: I76ec20258a8ef8a2966e98d523b58a0aa8b49bda
(cherry picked from commit 42c7732380)
Signed-off-by: yaozhongmin <yaozhongmin@xiaomi.com>
Add symbol utf8_data_table_new to ensure compatibility with both new and
old utf8 encoding during file lookup.
Bug: 387229724
Bug: 382800956
Change-Id: I75da2a468ac4a51f7bc907633b9c316a72f2b8c2
Signed-off-by: Chunhai Guo <guochunhai@vivo.corp-partner.google.com>
This commit addresses an issue related to below kernel panic where
panic_on_warn is enabled. It is caused by the unnecessary use of WARN_ON
in functionsfs_bind, which easily leads to the following scenarios.
1.adb_write in adbd 2. UDC write via configfs
================= =====================
->usb_ffs_open_thread() ->UDC write
->open_functionfs() ->configfs_write_iter()
->adb_open() ->gadget_dev_desc_UDC_store()
->adb_write() ->usb_gadget_register_driver_owner
->driver_register()
->StartMonitor() ->bus_add_driver()
->adb_read() ->gadget_bind_driver()
<times-out without BIND event> ->configfs_composite_bind()
->usb_add_function()
->open_functionfs() ->ffs_func_bind()
->adb_open() ->functionfs_bind()
<ffs->state !=FFS_ACTIVE>
The adb_open, adb_read, and adb_write operations are invoked from the
daemon, but trying to bind the function is a process that is invoked by
UDC write through configfs, which opens up the possibility of a race
condition between the two paths. In this race scenario, the kernel panic
occurs due to the WARN_ON from functionfs_bind when panic_on_warn is
enabled. This commit fixes the kernel panic by removing the unnecessary
WARN_ON.
Kernel panic - not syncing: kernel: panic_on_warn set ...
[ 14.542395] Call trace:
[ 14.542464] ffs_func_bind+0x1c8/0x14a8
[ 14.542468] usb_add_function+0xcc/0x1f0
[ 14.542473] configfs_composite_bind+0x468/0x588
[ 14.542478] gadget_bind_driver+0x108/0x27c
[ 14.542483] really_probe+0x190/0x374
[ 14.542488] __driver_probe_device+0xa0/0x12c
[ 14.542492] driver_probe_device+0x3c/0x220
[ 14.542498] __driver_attach+0x11c/0x1fc
[ 14.542502] bus_for_each_dev+0x104/0x160
[ 14.542506] driver_attach+0x24/0x34
[ 14.542510] bus_add_driver+0x154/0x270
[ 14.542514] driver_register+0x68/0x104
[ 14.542518] usb_gadget_register_driver_owner+0x48/0xf4
[ 14.542523] gadget_dev_desc_UDC_store+0xf8/0x144
[ 14.542526] configfs_write_iter+0xf0/0x138
Fixes: ddf8abd259 ("USB: f_fs: the FunctionFS driver")
Cc: stable <stable@kernel.org>
Signed-off-by: Akash M <akash.m5@samsung.com>
Link: https://lore.kernel.org/r/20241219125221.1679-1-akash.m5@samsung.c
om
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bug: 383235079
(cherry picked from commit dfc51e48bca475bbee984e90f33fdc537ce09699
https: //git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/
usb-linus)
Change-Id: Ib8ec6cbac0ac0601f75ede2911f00baef099cec1
Signed-off-by: Akash M <akash.m5@samsung.com>