mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-19 09:52:31 +01:00
project:build.sh: Added fastboot support; custom modifications to U-Boot and kernel implemented using patches.
project:cfg:BoardConfig_IPC: Added fastboot BoardConfig file and firmware post-scripts, distinguishing between the BoardConfigs for Luckfox Pico Pro and Luckfox Pico Max. project:app: Added fastboot_client and rk_smart_door for quick boot applications; updated rkipc app to adapt to the latest media library. media:samples: Added more usage examples. media:rockit: Fixed bugs; removed support for retrieving data frames from VPSS. media:isp: Updated rkaiq library and related tools to support connection to RKISP_Tuner. sysdrv:Makefile: Added support for compiling drv_ko on Luckfox Pico Ultra W using Ubuntu; added support for custom root filesystem. sysdrv:tools:board: Updated Buildroot optional mirror sources, updated some software versions, and stored device tree files and configuration files that undergo multiple modifications for U-Boot and kernel separately. sysdrv:source:mcu: Used RISC-V MCU SDK with RT-Thread system, mainly for initializing camera AE during quick boot. sysdrv:source:uboot: Added support for fastboot; added high baud rate DDR bin for serial firmware upgrades. sysdrv:source:kernel: Upgraded to version 5.10.160; increased NPU frequency for RV1106G3; added support for fastboot. Signed-off-by: luckfox-eng29 <eng29@luckfox.com>
This commit is contained in:
@@ -1325,12 +1325,6 @@ static int vim2m_probe(struct platform_device *pdev)
|
||||
vfd->lock = &dev->dev_mutex;
|
||||
vfd->v4l2_dev = &dev->v4l2_dev;
|
||||
|
||||
ret = video_register_device(vfd, VFL_TYPE_VIDEO, 0);
|
||||
if (ret) {
|
||||
v4l2_err(&dev->v4l2_dev, "Failed to register video device\n");
|
||||
goto error_v4l2;
|
||||
}
|
||||
|
||||
video_set_drvdata(vfd, dev);
|
||||
v4l2_info(&dev->v4l2_dev,
|
||||
"Device registered as /dev/video%d\n", vfd->num);
|
||||
@@ -1353,12 +1347,20 @@ static int vim2m_probe(struct platform_device *pdev)
|
||||
media_device_init(&dev->mdev);
|
||||
dev->mdev.ops = &m2m_media_ops;
|
||||
dev->v4l2_dev.mdev = &dev->mdev;
|
||||
#endif
|
||||
|
||||
ret = video_register_device(vfd, VFL_TYPE_VIDEO, 0);
|
||||
if (ret) {
|
||||
v4l2_err(&dev->v4l2_dev, "Failed to register video device\n");
|
||||
goto error_m2m;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MEDIA_CONTROLLER
|
||||
ret = v4l2_m2m_register_media_controller(dev->m2m_dev, vfd,
|
||||
MEDIA_ENT_F_PROC_VIDEO_SCALER);
|
||||
if (ret) {
|
||||
v4l2_err(&dev->v4l2_dev, "Failed to init mem2mem media controller\n");
|
||||
goto error_dev;
|
||||
goto error_v4l2;
|
||||
}
|
||||
|
||||
ret = media_device_register(&dev->mdev);
|
||||
@@ -1373,11 +1375,13 @@ static int vim2m_probe(struct platform_device *pdev)
|
||||
error_m2m_mc:
|
||||
v4l2_m2m_unregister_media_controller(dev->m2m_dev);
|
||||
#endif
|
||||
error_dev:
|
||||
error_v4l2:
|
||||
video_unregister_device(&dev->vfd);
|
||||
/* vim2m_device_release called by video_unregister_device to release various objects */
|
||||
return ret;
|
||||
error_v4l2:
|
||||
error_m2m:
|
||||
v4l2_m2m_release(dev->m2m_dev);
|
||||
error_dev:
|
||||
v4l2_device_unregister(&dev->v4l2_dev);
|
||||
error_free:
|
||||
kfree(dev);
|
||||
|
||||
@@ -330,6 +330,28 @@ static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *a
|
||||
return vivid_vid_out_g_fbuf(file, fh, a);
|
||||
}
|
||||
|
||||
/*
|
||||
* Only support the framebuffer of one of the vivid instances.
|
||||
* Anything else is rejected.
|
||||
*/
|
||||
bool vivid_validate_fb(const struct v4l2_framebuffer *a)
|
||||
{
|
||||
struct vivid_dev *dev;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n_devs; i++) {
|
||||
dev = vivid_devs[i];
|
||||
if (!dev || !dev->video_pbase)
|
||||
continue;
|
||||
if ((unsigned long)a->base == dev->video_pbase &&
|
||||
a->fmt.width <= dev->display_width &&
|
||||
a->fmt.height <= dev->display_height &&
|
||||
a->fmt.bytesperline <= dev->display_byte_stride)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static int vidioc_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *a)
|
||||
{
|
||||
struct video_device *vdev = video_devdata(file);
|
||||
@@ -850,8 +872,12 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst,
|
||||
|
||||
/* how many inputs do we have and of what type? */
|
||||
dev->num_inputs = num_inputs[inst];
|
||||
if (dev->num_inputs < 1)
|
||||
dev->num_inputs = 1;
|
||||
if (node_type & 0x20007) {
|
||||
if (dev->num_inputs < 1)
|
||||
dev->num_inputs = 1;
|
||||
} else {
|
||||
dev->num_inputs = 0;
|
||||
}
|
||||
if (dev->num_inputs >= MAX_INPUTS)
|
||||
dev->num_inputs = MAX_INPUTS;
|
||||
for (i = 0; i < dev->num_inputs; i++) {
|
||||
@@ -868,8 +894,12 @@ static int vivid_detect_feature_set(struct vivid_dev *dev, int inst,
|
||||
|
||||
/* how many outputs do we have and of what type? */
|
||||
dev->num_outputs = num_outputs[inst];
|
||||
if (dev->num_outputs < 1)
|
||||
dev->num_outputs = 1;
|
||||
if (node_type & 0x40300) {
|
||||
if (dev->num_outputs < 1)
|
||||
dev->num_outputs = 1;
|
||||
} else {
|
||||
dev->num_outputs = 0;
|
||||
}
|
||||
if (dev->num_outputs >= MAX_OUTPUTS)
|
||||
dev->num_outputs = MAX_OUTPUTS;
|
||||
for (i = 0; i < dev->num_outputs; i++) {
|
||||
|
||||
@@ -609,4 +609,6 @@ static inline bool vivid_is_hdmi_out(const struct vivid_dev *dev)
|
||||
return dev->output_type[dev->output] == HDMI;
|
||||
}
|
||||
|
||||
bool vivid_validate_fb(const struct v4l2_framebuffer *a);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -452,6 +452,12 @@ void vivid_update_format_cap(struct vivid_dev *dev, bool keep_controls)
|
||||
tpg_reset_source(&dev->tpg, dev->src_rect.width, dev->src_rect.height, dev->field_cap);
|
||||
dev->crop_cap = dev->src_rect;
|
||||
dev->crop_bounds_cap = dev->src_rect;
|
||||
if (dev->bitmap_cap &&
|
||||
(dev->compose_cap.width != dev->crop_cap.width ||
|
||||
dev->compose_cap.height != dev->crop_cap.height)) {
|
||||
vfree(dev->bitmap_cap);
|
||||
dev->bitmap_cap = NULL;
|
||||
}
|
||||
dev->compose_cap = dev->crop_cap;
|
||||
if (V4L2_FIELD_HAS_T_OR_B(dev->field_cap))
|
||||
dev->compose_cap.height /= 2;
|
||||
@@ -909,6 +915,8 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selection
|
||||
struct vivid_dev *dev = video_drvdata(file);
|
||||
struct v4l2_rect *crop = &dev->crop_cap;
|
||||
struct v4l2_rect *compose = &dev->compose_cap;
|
||||
unsigned orig_compose_w = compose->width;
|
||||
unsigned orig_compose_h = compose->height;
|
||||
unsigned factor = V4L2_FIELD_HAS_T_OR_B(dev->field_cap) ? 2 : 1;
|
||||
int ret;
|
||||
|
||||
@@ -1025,17 +1033,17 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selection
|
||||
s->r.height /= factor;
|
||||
}
|
||||
v4l2_rect_map_inside(&s->r, &dev->fmt_cap_rect);
|
||||
if (dev->bitmap_cap && (compose->width != s->r.width ||
|
||||
compose->height != s->r.height)) {
|
||||
vfree(dev->bitmap_cap);
|
||||
dev->bitmap_cap = NULL;
|
||||
}
|
||||
*compose = s->r;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (dev->bitmap_cap && (compose->width != orig_compose_w ||
|
||||
compose->height != orig_compose_h)) {
|
||||
vfree(dev->bitmap_cap);
|
||||
dev->bitmap_cap = NULL;
|
||||
}
|
||||
tpg_s_crop_compose(&dev->tpg, crop, compose);
|
||||
return 0;
|
||||
}
|
||||
@@ -1276,7 +1284,14 @@ int vivid_vid_cap_s_fbuf(struct file *file, void *fh,
|
||||
return -EINVAL;
|
||||
if (a->fmt.bytesperline < (a->fmt.width * fmt->bit_depth[0]) / 8)
|
||||
return -EINVAL;
|
||||
if (a->fmt.height * a->fmt.bytesperline < a->fmt.sizeimage)
|
||||
if (a->fmt.bytesperline > a->fmt.sizeimage / a->fmt.height)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Only support the framebuffer of one of the vivid instances.
|
||||
* Anything else is rejected.
|
||||
*/
|
||||
if (!vivid_validate_fb(a))
|
||||
return -EINVAL;
|
||||
|
||||
dev->fb_vbase_cap = phys_to_virt((unsigned long)a->base);
|
||||
|
||||
Reference in New Issue
Block a user