Commit Graph

220 Commits

Author SHA1 Message Date
raiden00pl
5b87fdfb9d Documentation: remove all migrated READMEs 2023-10-29 21:03:54 -03:00
hujun5
061be5f18e refine: move BIT Macro to nuttx/bits.h
The BIT macro is widely used in NuttX,
and to achieve a unified strategy,
we have placed the implementation of the BIT macro
in bits.h to simplify code implementation.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-10-12 14:52:56 +08:00
Xiang Xiao
28dee592a3 video/fb: Add fb_register_device
so the user could register fb device directly instead
go through the sequence of up_fbinitialize/up_fbgetvplane

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-09 13:18:36 +03:00
Xiang Xiao
ee3d2d1c0d video/goldfish: Remove the vsync residual code
forget from patch:
commit bbf5b0bb6d
Author: jianglianfang <jianglianfang@xiaomi.com>
Date:   Tue Aug 15 19:47:14 2023 +0800

    driver/video: adapting Goldfish FB to VSync optimized FB driver

    The circbuf part is implemented by the fb driver, and goldfish needs to
    delete the part related to circbuf and adapt to the interface of the fb
    driver.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-26 22:51:12 +08:00
wanggang26
e930476b4b enable O_CLOEXEC explicit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-22 13:51:00 +08:00
hujun5
1aa42cc7d2 vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock
sched_[un]lock can not prohibit pre-emption in smp

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-21 00:57:51 +08:00
yangsen5
e0873c5a48 drivers/video: Fix crash caused by priv->capture_cb = null
When the upper layer calls goldfish_camera_data_uninit, priv->capture_cb=NULL, but when there is data transmission in goldfish_camera_thread, priv->capture_cb will be called, which will cause a crash.

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-09-20 00:34:54 +08:00
chao an
5026a96cfa nxstyle: cleanup UTF-8 Unicode to ASCII
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-18 11:54:17 -04:00
jianglianfang
bbf5b0bb6d driver/video: adapting Goldfish FB to VSync optimized FB driver
The circbuf part is implemented by the fb driver, and goldfish needs to
delete the part related to circbuf and adapt to the interface of the fb
driver.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-09-12 22:10:10 +08:00
pengyiqiang
e578f3b20d video/fb: add vsync queue
refact vsync queue to support multi fb poll and overlay poll.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-09-12 22:10:10 +08:00
jianglianfang
43ea7e65e1 driver/fb: add fb_get_planeinfo and initialize local variable pinfo
VELAPLATFO-11808

Change-Id: I32db03d52b778cc7dd1784adea0a432976fde6bf
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-09-12 22:10:10 +08:00
pengyiqiang
7485816d6f video/fb: use counter record the num of poll ready
add a count to record the number of pollready.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-09-12 22:10:10 +08:00
yangsen5
f8b19c2030 drivers/video: Modify the properties of the goldfish camera driver kthread_create
1. priority   = SCHED_PRIORITY_DEFAULT
2. stack_size = DEFAULT_TASK_STACKSIZE

Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-09-12 16:28:16 +08:00
wangming9
f05e72324c drivers/video: fix build error on CONFIG_DEBUG_OPTLEVEL="-O3"
Summary
The following compilation error occurs after configuring CONFIG_DEBUG_OPTLEVEL="-O3"
CC:  ping.c video/video.c: In function 'video_ioctl':
video/video.c:2347:22: error: 'control.size' may be used uninitialized [-Werror=maybe-uninitialized]
 2347 |               control->size,
      |                      ^~
video/video.c:2273:28: note: 'control' declared here
 2273 |   struct v4l2_ext_control  control;
      |                            ^~~~~~~

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-09-09 17:08:23 +03:00
yangyalei
fd776e8cee fix wait after vfork return error
vfork use waitpid hang father process,
but waitpid release child processs information by default.
So when user call wait, it return errno 10.

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-09-08 00:53:56 +03:00
chao an
664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
chao an
b60f01a55b inode/i_private: remove all unnecessary cast for i_private
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 08:58:07 +02:00
SPRESENSE
f556cb106a drivers/video: Fix an issue isx019 may freeze
isx019 driver freezes by I2C access in the interrupt context.
This I2C access is intended to stop data output from FPGA.
Delete this I2C access for the following reasons.
- Data output from FPGA does not affect power consumption
- There are no problems in capture restart without data output stop
  since restart is done by image data block first.
2023-08-29 13:37:01 +08:00
chao an
7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
xuxin19
f2f0d7fbad cmake:fix drivers build block during cmake reforming
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-16 22:38:52 +08:00
jianglianfang
5accd7c146 drivers/video: add Goldfish-FB driver
the register definition is described here:
https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT

Goldfish-FB driver is to communicate with Goldfish-FB in QEMU, and push the framebuffer data to the emulator for display on the screen.
test: CONFIG_GOLDFISH_FB =1, and run demo=>lvgldemo widgets

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-08-13 11:51:30 -03:00
yangsen5
ce9f40aeb6 drivers/video: add nuttx goldfish camera driver
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-09 18:30:11 +08:00
yangsen5
d8ca744052 drivers/video: video driver supports NV12
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-03 22:37:53 -07:00
rongyichang
9e4a9fe32b drivers/fb: add fboverlay pandisplay & display area ioctl
1. support doublebuffer swtich for overlay layer
2. Add display area ioctl to scale the active area of the overlay layer
   to a specific region on the LCD through hardware.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-03 10:57:14 -07:00
jianglianfang
b14cb6ccb4 driver/fb: fix that vtable.priv is not freed when fb register failed.
The vtable.priv is better to be assigned after fb is registered sucessfully.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-08-03 03:10:34 -07:00
SPRESENSE
4b966aa1e7 drivers/video: Fix returned errno in error cases
When the value that is out of range is specified in ioctl(VIDIOC_S_CTRL) and
ioctl(VIDIOC_S_EXT_CTRLS), returned value should be not EINVAL but ERANGE.
2023-07-31 03:28:54 -07:00
SPRESENSE
2d2c3eb2cf drivers/video: Initialize flags member of query control APIs
video driver does not support flags member of ioctl(VIDIOC_QUERYCTRL)
and ioctl(VIDIOC_QUERY_EXT_CTRL).
But, ioctl returns with the flags member that has the garbage value.
Add initialization of flags member to avoid return of the garbage value.
2023-07-31 02:56:10 -07:00
yuexinyi
326cf2bf88 drivers/video: add new video driver register api to support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
yuexinyi
56be0ab050 drivers/video: add capture arg to support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
yuexinyi
52859fe10f drivers/video: add unlink api to release driver private data after supporing multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
yuexinyi
96ea877490 drivers/video: video ioctrl api support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00
yuexinyi
baefa5fa6b Revert "drivers/video: Don't need update vbuf_tail in dequeue_vbuf_unsafe"
This reverts commit e15bccaa71.

Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-26 07:45:30 -07:00
lile7
a3db142fbf drivers/video: use kmm_free(buff) to free memory instead of realloc(buff, 0) which is abandoned
ref: 89d61f4eb4

Signed-off-by: lile7 <lile7@xiaomi.com>
2023-07-12 02:33:17 +08:00
chao an
6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00
jianglianfang
73832ab0a4 vnc server: Fix that vnc_updater thread exited caused by readed a null data
When updating the full-screen data, sq_ init() will clear the updqueue and add just one new full-screen data to the updqueue. So when the vnc_updater thread is awakened, it may read a null data due to multiple reading, leading to vnc_updater thread exited , which is not expected.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-25 22:41:47 +08:00
jianglianfang
14c77dce15 fb_driver: add fb_open and fb_close
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-19 21:46:07 +08:00
jianglianfang
73a1066613 vnc_server: set touch.maxpoint to 1 for circbuf_init
set touch.maxpoint to 1 in vnc_server.c for circbuf_init,otherwise
touch_event will circbuf_overwrite a wrong value.
test step:vnc run lvgldemo,test input event

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-19 17:42:05 +08:00
pengyiqiang
26e99ed042 drivers/video/fb: adapt to fbmem dynamic update.
Considering that the future fb needs to achieve dynamic resolution, the address and size of fbmem will be redistributed on the bottom driver side, so remove fbmem, fblen, and bpp cached in fb_chardev_s, and change it to call getplaneinfo every time to re-acquire panel info from the bottom driver. Avoid cache coherency problems.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-12 01:06:52 +08:00
Xiang Xiao
fa8719bb5a Replace all strcat with strlcat
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 09:57:01 +02:00
SPRESENSE
e542ef9175 drivers/video: Support spot position setting
Add new control id V4L2_CID_EXPOSURE_METERING_SPOT_POSITION
to support spot position setting in spot exposure metering.
2023-04-27 17:05:32 +08:00
pengyiqiang
0939634b42 video/fb: fix pollnotify calling crash in advance
When executing up_fbinitialize, the driver may turn on the vsync interrupt. If the vsync interrupt calls fb_pollnotify before executing fb->vtable->priv = fb it will cause null pointer access and crash.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-04-26 11:51:21 +02:00
Xiang Xiao
51dc67ad5f fs: Add g_ prefix for all global file_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
rongyichang
e6490694a1 drivers/video: passthrough unknown ioctl commands for customized scenarios in fb
driver

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-04-22 12:48:46 +08:00
pengyiqiang
0ed82e8380 video/fb: add vsync offset support
Android Documentation: https://source.android.com/docs/core/graphics/implement-vsync#vsync_offset

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-04-22 01:09:09 +08:00
pengyiqiang
621bf54efc drivers/video/fb: fix poll event lost
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-02-24 22:21:09 +08:00
lilei19
38f64f559d change strcpy to strlcpy
Signed-off-by: lilei19 <lilei19@xiaomi.com>
2023-02-24 12:15:40 +08:00
jihandong
a1e04617f8 drivers/video/video: add poll support to capture
support part of Linux std:
https://www.kernel.org/doc/html/v4.9/media/uapi/v4l/func-poll.html

Capture devices set the POLLIN and POLLRDNORM flags in the revents field

Signed-off-by: jihandong <jihandong@xiaomi.com>
2023-02-13 23:17:45 +08:00
jihandong
ae7bc4e300 drivers/video/video: add NONBLOCK support
Signed-off-by: jihandong <jihandong@xiaomi.com>
2023-02-13 23:17:45 +08:00
Peter Bee
1949991fe0 drivers/video: add sequence number to video frames
Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-02-09 23:27:15 +08:00
Peter Bee
2ebccd82b6 drivers/video: add timestamp support
Add support for timestamp and change in related drivers

Signed-off-by: Peter Bee <bijunda1@xiaomi.com>
2023-02-09 23:27:15 +08:00