Camera Driver Porting¶
This topic gives a high-level overview of changes in Jetson Linux release 34 that may impact camera driver development when kernel version 4.9 is replaced by kernel version 5.10. It is intended to assist camera driver developers who must migrate to the new kernel version.
For more details, see the source code released with the BSP and the documentation in the BSP distribution’s directory kernel/kernel-5.10/Documentation/
.
For additional information about kernel 5.10, see the description of changes in Linux 5.1 on the Kernelnewbies web site.
Configuration Changes¶
This table summarizes Linux configuration changes from kernel version 4.9 to version.
Environment variable | Kernel 5.10 | Kernel 4.9 |
---|---|---|
CONFIG_MEDIA |
CONFIG_MEDIA_PLATFORM_SUPPORT=y |
N/A |
CONFIG_TEGRA_GRHOST |
CONFIG_TEGRA_GRHOST_NVCSI=y |
N/A |
CONFIG_VIDEO |
CONFIG_VIDEO_ISC=m |
N/A |
CONFIG_VIDEO (sensor) |
CONFIG_NV_VIDEO_IMX185=m |
CONFIG_VIDEO_IMX185=m |
CONFIG_THERMAL_GOV |
N/A | CONFIG_THERMAL_GOV_CONTINUOUS=y |
Sensor Driver File Name Changes¶
This table describes files whose names have changed from kernel version 4.9 to version 5.10.
Kernel 5.10 | Kernel 4.9 |
---|---|
nv_imx185.c |
imx185.c |
nv_imx268.c |
imx268.c |
nv_imx318.c |
imx318.c |
nv_ov9281.c |
ov9281.c |
nv_ov10823.c |
ov10823.c |
nv_ov23850.c |
ov23850.c |
nv_imx390.c |
imx390.c |
nv_imx219.c |
imx219.c |
nv_imx274.c |
imx274.c |
nv_lc898212 |
lc898212 |
nv_ov5693.c |
ov5693.c |
Guarding Kernel Version-Specific Code¶
NVIDIA-specific kernel code in kernel/nvidia/
is guarded by checks that compare the LINUX_VERSION_CODE
macro against KERNEL_VERSION(x, x, x)
.
These are the important changes in the new driver that is protected by this comparison of macros:
Adapting the new Power Domain framework in drivers and corresponding header inclusions. The use of
powergate_id
is dropped, astegra_powergate
is deprecated in kernel version 5.10.The following table shows paths for the functions used in the current and previous kernel versions.
Kernel 5.10 Kernel 4.9 kernel/kernel-5.10/include/linux/pm_domain.h
kernel/kernel-4.9/include/linux/tegra_pm_domains.h
Adapting VI drivers to V4L2 framework changes to replace video buffer state, and changes to time related v4l2-ctl APIs and structures. Some examples are listed in the table below.
Kernel 5.10 Kernel 4.9 ktime_get_ts64
getrawmonotonic()
struct timespec64
struct timespec
ns_to_timespec64
ns_to_timespec
VB2_BUF_STATE_ERROR
VB2_BUF_STATE_REQUEUEING
VFL_TYPE_VIDEO
kernel/kernel-4.9/
include/media/v4l2-dev.h
VFL_TYPE_GRABBER
kernel/kernel-5.10/
include/media/v4l2-dev.h
V4l2 ctl API changes:
kernel/kernel-5.10/
drivers/media/v4l2-core/v4l2-ctrls.c
V4l2 ctl API changes:
kernel/kernel-4.9/
drivers/media/v4l2-core/v4l2-ctrls.c
V4L2 structure changes:
kernel/kernel-5.10/
include/media/v4l2-async.h
V4L2 structure changes:
kernel/kernel-4.9/
include/media/v4l2-async.h
Modified enum type for C-PHY and D-PHY in
v4l2_mbus_config
:/dev-main_l4t/kernel/kernel-5.10/
include/media/v4l2-mediabus.h
v4l2_mbus_type
for kernel version 4.9:kernel/kernel-4.9/
include/media/v4l2-mediabus.h
Adapting to changes in debugfs APIs. For function definitions, see the files listed in the table below.
Kernel 5.10 Kernel 4.9 kernel/kernel-5.10/
fs/debugfs/file.c
kernel/kernel-4.9/
fs/debugfs/file.c
Adapting to replacement of kmap APIs with
vmap dma_buf
APIs. For API definitions, see the files listed in the table below.Kernel 5.10 Kernel 4.9 kernel/kernel-5.10/
drivers/dma-buf/dma-buf.c
kernel/kernel-4.9/
drivers/dma-buf/dma-buf.c
dev_err() Function¶
The definition of dev_err()
has changed. For more information, see the files listed below.
Kernel 5.10 | Kernel 4.9 |
---|---|
|
|
I2C API¶
I2C API changes are listed below.
Kernel 5.10 | Kernel 4.9 |
---|---|
|
|
|
|
NVIDIA Capture Driver Code Path¶
Some of the capture mode driver file paths for channel configuration (VI, ISP) have changed.
Kernel 5.10 | Kernel 4.9 |
---|---|
|
|