Commit Graph

206 Commits

Author SHA1 Message Date
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
Gustavo Henrique Nihei e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
Xiang Xiao 55679aec5f drivers/camera: Support the private data for imgsensor and imgdata
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-31 08:04:39 +01:00
liushuai25 ea67dafd93 Fix scope issues with "switch ... case"
Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
2023-01-14 13:38:37 +08:00
liushuai25 57295d750d Use C89 compatible initializer and modify code format
Signed-off-by: liushuai25 <liushuai25@xiaomi.com>

Update drivers/video/mipidsi/mipi_dsi_device.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-01-13 23:10:56 +08:00
liushuai25 6b729487fb feat: add mipidsi support
add mipi dsi subsystem support.

reference links:
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_mipi_dsi.c
https://github.com/torvalds/linux/blob/master/include/video/mipi_display.h

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
2023-01-13 23:10:56 +08:00
zhanghongyu 48c9d10336 net_socket: add accept4 function
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-01-11 23:28:08 +08:00
Xiang Xiao 1a59f4ed00 mm/map: Remove the unnessary map.h inclusion in various drivers
and Fix include/nuttx/mm/map.h:55:28: error: 'struct task_group_s' declared inside parameter list will not be visible outside of this definition or declaration

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-05 16:06:53 +02:00
Xiang Xiao 7179d57026 fs: Check offset and length more carefully in mmap callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao b0a0ba3ad7 fs: Move mmap callback before truncate in [file|mountpt]_operations
since mmap may exist in block_operations, but truncate may not,
moving mmap beforee truncate could make three struct more compatible

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 17:43:59 +02:00
Xiang Xiao 779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
Jukka Laitinen f33dc4df3f Change FIOC_MMAP into file operation call
- Add mmap into file_operations and remove it from ioctl definitions.
- Add mm_map structure definitions to support future unmapping
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
Jukka Laitinen 41e9df2f3e Add ftruncate into file operation calls
- Add truncate into file_operations
- Move truncate to be common for mountpt_operations and file_operations
- Modify all drivers to initialize the operations struct accordingly

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-02 11:23:20 -03:00
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