Commit Graph

158 Commits

Author SHA1 Message Date
pengyiqiang
72fdea5c13 video/fb: initializes the info structure
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-12-21 01:16:55 +02:00
Peter Bee
2b11fd585f drivers/video: fix typo
Wrong buf used

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-20 17:00:44 +08:00
jihandong
8e6185f4ad driver/fb: support linux info.
add struct fix_screeninfo and var_screeninfo, and related ioctl,
macro.

Signed-off-by: jihandong <jihandong@xiaomi.com>
2022-12-20 15:54:00 +08:00
Xiang Xiao
243983328a drivers/video: Correct the code style
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
21e35362a3 drivers/video: Add stop_capture function
and ensure imgsensor_ops_s::stop_capture get called

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
eb4dabaac6 drivers/video: Check th size for IMGSENSOR_CTRL_TYPE_U[8|16|32]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
4773eec916 drivers/video: Move the clip operation from video_s_selection to validate_frame_setting
to ensure the validation is same for VIDIOC_S_SELECTION, VIDIOC_S_PARM and VIDIOC_S_FMT

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
10d79195ba drivers/video: Replace malloc/realloc/free with kmm_[malloc/realloc/free]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
ec1cbed9b0 drivers/video: Zero all fields in an output struct
and don't zero fields which is used as input

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
5eb8189c26 drivers/video: Remove validate_frame_setting NULL check from video_[s|try]_fmt
since the check is already done in validate_frame_setting

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-17 20:43:07 +08:00
Xiang Xiao
1555c9b8f8 drivers/video: Zero next field of dequeued buffer before return dequeue_vbuf_unsafe
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
e15bccaa71 drivers/video: Don't need update vbuf_tail in dequeue_vbuf_unsafe
since it is already done in video_framebuff_queue_container

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
01d7f44480 drivers/video: Merge vbuf_next assignment in video_framebuff_queue_container
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
d09f1fb186 drivers/video: Keep the old state in case of fail
and ensure the internal state get clear if sz equals zero

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
ae3cadf03c drivers/video: Skip all action if video_framebuff_realloc_container doesn't change the container size
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Xiang Xiao
aa20b1e8bd drivers/video: Zero all video_framebuff_t fields in video_framebuff_init
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-13 21:38:22 +02:00
Peter Bee
77504aa1b5 drivers/video: minor fix
Fix missing header for bool in imgsensor.h and FAR in video.c

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-09 23:37:49 +08:00
Peter Bee
31347da187 drivers/video: add support for V4L2 mmap-ed buffer
Support V4L2_MEMORY_MMAP memory mode

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-07 01:21:46 +08:00
Xiang Xiao
f142cf0e55 drivers/video: Remove memset from cleanup_streamresources
since initialize_streamresources will do it

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
99311ed6a5 drivers/video: Should do uninitialization if is_initialized is true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
92e72f8624 drivers/video: Return zero if gamma curve isn't supported in initialize_scene_gamma
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Xiang Xiao
c8868b3745 drivers/video: Return 0 in case g_video_sensor_ops or get_supported_value is NULL
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-12-05 10:35:26 +01:00
Peter Bee
c26fd6565d drivers/video: enhance v4l2 compatibility
Add common BSD v4l2 header file
Complete ioctls according to standard v4l2 drivers

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-03 02:48:01 +08:00
Peter Bee
87e16c3694 drivers/video: add support for yuv420p
Add calc functions for buffer size (yuv420p is 6Byte/4px)

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
Peter Bee
365b1f4bb8 drivers/video: add support for YUYV format
Add YUYV format which is used by most USB Cameras

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2022-12-02 13:18:20 +08:00
FASTSHIFT
0ae242aa8d drivers/video/fb: add poll support
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2022-12-01 15:08:03 +08:00
Xiang Xiao
6d30726a1b Remove the unnecessary "return;" at the end of function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-27 22:23:50 +01:00
Xiang Xiao
3453fe799d Fix video/max7456.c:775:19: error: unused function '__mx7_write_reg__dmm'
video/max7456.c:792:19: error: unused function '__mx7_write_reg__dmdi'
video/max7456.c:809:19: error: unused function '__mx7_write_reg__dmah'
video/max7456.c:826:19: error: unused function '__mx7_write_reg__dmal'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-20 14:34:44 +01:00
anjiahao
a4563b8744 Fix the coding style and typo issue
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-14 09:34:04 +09:00
anjiahao
d07792a343 Initialize global mutext/sem by NXMUTEX_INITIALIZER and SEM_INITIALIZER
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-14 09:34:04 +09:00
chao an
4f7f70598a drviers/video: driver lock should in pairs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-03 14:43:12 +01:00
yinshengkai
85f727f232 tools: replace INCDIR to Makefile variable
In the past, header file paths were generated by the incdir command
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
Xiang Xiao
a98949d0f6 Fix video/video.c:1458:52: error: implicit conversion from enumeration type 'enum v4l2_buf_type' to different enumeration type 'imgsensor_stream_type_t' (aka 'enum imgsensor_stream_type_e') [-Werror,-Wenum-conversion]
ret = g_video_sensor_ops->validate_frame_setting(type, nr_fmt, sf, &si);
       ~~~~~~~~~~~~~~~~~~                         ^~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-31 13:10:09 +01:00
Xiang Xiao
09da04d7d2 Fix video/video.c:1458:52: error: implicit conversion from enumeration type 'enum v4l2_buf_type' to different enumeration type 'imgsensor_stream_type_t' (aka 'enum imgsensor_stream_type_e') [-Werror,-Wenum-conversion]
ret = g_video_sensor_ops->validate_frame_setting(type, nr_fmt, sf, &si);
       ~~~~~~~~~~~~~~~~~~                         ^~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 16:03:35 +01:00
anjiahao
d7b4e91dda Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init
2.Fix some style issue

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-30 13:56:52 +01:00
SPRESENSE
6eb0ef618d drivers/video/isx019: Use clock function instead of gettimeofday
Change to use clock_systime_timespec() to avoid using libc API
from the driver layer.
2022-10-26 03:57:26 +08:00
SPRESENSE
8a0ce3f000 drivers/video/isx019: Fix incorrect JPEG DQT table 2022-10-26 03:57:26 +08:00
SPRESENSE
5e4e8f6809 drivers/video/isx019: Fix white balance control and capability 2022-10-26 03:57:26 +08:00
SPRESENSE
d57324473e drivers/video/isx019: Increase waiting time for HW initialization 2022-10-26 03:57:26 +08:00
SPRESENSE
254139bcec drivers/video/isx012: Add missing FAR qualifier 2022-10-26 03:57:26 +08:00
SPRESENSE
e48f8be8c5 drivers/video/isx012: Support clip feature 2022-10-26 03:57:26 +08:00
SPRESENSE
277c8e368b drivers/video: Update API to dump register for debug 2022-10-26 03:57:26 +08:00
SPRESENSE
1332bdb9a7 drivers/video: Add get frame interval API 2022-10-26 03:57:26 +08:00
anjiahao
5724c6b2e4 sem:remove sem default protocl
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
Xiang Xiao
6b31918b42 Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:51:45 +02:00
Xiang Xiao
dca5a3483f drivers: Destroy mutex and sem in the error path
also correct the order to ensure the memory free is last step

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
anjiahao
d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Xiang Xiao
40ef5bc6db libc: Move queue.h from include to include/nuttx
to avoid the conflict with libuv's queue.h

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-26 08:04:58 +02:00
Huang Qi
e4e3208180 Replace all strncpy with strlcpy for safety
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-25 13:38:36 +08:00
Huang Qi
70c0672598 vncserver: Support keyboard driver
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-07-12 10:05:15 -03:00