Skip to content

Commit

Permalink
ipu6: ipu-isys-video video node support for camera subdev
Browse files Browse the repository at this point in the history
        - ipu-isys-video.c:
            - control for enhanced node support by pipeline subdevices enumerating
            - inheritance of sub-device controls within same vc
            - s/g_parm ioctl ops to set/get fps on subdev
            - vidioc_enum_framesizes - implement remote sensor polling
            - vidioc_enum_frameintervals - implement remote sensor polling
            - vidioc_enum_fmt - select only sub-device formats
            - vidioc_s_fmt_vid_cap_mplane - set remote link format
            - vidioc_try_fmt_vid_cap_mplane - try remote format
            - link validation for isys entities intel#134
            - metadata support for D4XX_META format
            - dual link external entity support for aggregated streaming

	- ipu-isys-csi2-be-soc.c: link validation intel#134
	    - CSI2 BE SOC has multiple formats on capture pads that's the point
	      where it match external pad0 format which will inherit format
              from CSI-2 external entity.
	- ipu-isys-csi2.c: link validation intel#134
	    - inherit format from CSI-2 external entity.
	    - dual link support
        - ipu-isys.h: V4L2_CID_IPU_ENUMERATE_LINK
        - ipu-isys-video.h: ipu_isys_video.enum_link_state state for link enumeration by vc
	- ipu-psys.c: fix compilation issue on kernel 5.15
	    - Resloves ipu-psys: MODULE_IMPORT_NS(DMA_BUF) for kernel 5.15 intel#77
	- ipu-isys-queue.c:
	    - Move firmware bring-up from video open to queue start streaming.
	      This will increase firmware stability for start-stop toggling
              without closing video node for all streams.
	    - Move firmware shutdown from video close to queue stop streaming
	      Improves recovery process for multithread processes
              that not close video handle.
        - ipu-isys.c: debugfs create subdevices dynamically
	- ipu6-acpi-pdata.c: fix suffix to match port number

Signed-off-by: Dmitry Perchanov <[email protected]>
  • Loading branch information
dmipx committed Aug 9, 2023
1 parent 9ef6f49 commit b599331
Show file tree
Hide file tree
Showing 9 changed files with 1,066 additions and 188 deletions.
31 changes: 31 additions & 0 deletions drivers/media/pci/intel/ipu-isys-csi2-be-soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,38 @@ static struct v4l2_subdev_ops csi2_be_soc_sd_ops = {
.pad = &csi2_be_soc_sd_pad_ops,
};

static int csi2_be_soc_link_validate(struct media_link *link)
{
struct media_pipeline *media_pipe;
struct ipu_isys_pipeline *ip;
struct v4l2_subdev *source_sd;
struct v4l2_subdev *sink_sd;
struct v4l2_subdev_format fmt = { 0 };

int rval;

if (!link->sink->entity || !link->source->entity)
return -EINVAL;
media_pipe = media_entity_pipeline(link->sink->entity);
if (!media_pipe)
return -EINVAL;

ip = to_ipu_isys_pipeline(media_pipe);
source_sd = media_entity_to_v4l2_subdev(link->source->entity);
sink_sd = media_entity_to_v4l2_subdev(link->sink->entity);

fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;

fmt.pad = CSI2_PAD_SOURCE;
rval = v4l2_subdev_call(source_sd, pad, get_fmt, NULL, &fmt);

fmt.pad = CSI2_BE_SOC_PAD_SINK;
rval = v4l2_subdev_call(sink_sd, pad, set_fmt, NULL, &fmt);
return v4l2_subdev_link_validate(link);
}

static struct media_entity_operations csi2_be_soc_entity_ops = {
.link_validate = csi2_be_soc_link_validate,
};

static void csi2_be_soc_set_ffmt(struct v4l2_subdev *sd,
Expand Down
22 changes: 22 additions & 0 deletions drivers/media/pci/intel/ipu-isys-csi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ static int csi2_link_validate(struct media_link *link)
struct ipu_isys_pipeline *ip;
struct v4l2_subdev *source_sd;
struct v4l2_subdev *sink_sd;
struct v4l2_subdev_format fmt = { 0 };
int rval = 0;

if (!link->sink->entity || !link->source->entity)
return -EINVAL;
Expand All @@ -343,13 +345,33 @@ static int csi2_link_validate(struct media_link *link)
to_ipu_isys_csi2(media_entity_to_v4l2_subdev(link->sink->entity));

ip = to_ipu_isys_pipeline(media_pipe);
if (ip && ip->external && ip->external->entity) {
if (ip->external == link->source) {
dev_dbg(&csi2->isys->adev->dev, "%s:%d: ip external entity: %s link source: %s ip->vc: %d proceed with validation\n", __func__, __LINE__, ip->external->entity->name, link->source->entity->name, ip->vc);
} else {
dev_dbg(&csi2->isys->adev->dev, "%s:%d: ip external entity: %s link source: %s ip->vc: %d skip validation\n", __func__, __LINE__, ip->external->entity->name, link->source->entity->name, ip->vc);
return 0;
}
}
csi2->receiver_errors = 0;
ip->csi2 = csi2;
ipu_isys_video_add_capture_done(ip, csi2_capture_done);
source_sd = media_entity_to_v4l2_subdev(link->source->entity);
sink_sd = media_entity_to_v4l2_subdev(link->sink->entity);

if (!source_sd)
return -ENODEV;
/* source is external entity, get it's format */
fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
fmt.pad = CSI2_PAD_SINK;
rval = v4l2_subdev_call(source_sd, pad, get_fmt, NULL, &fmt);

/* set csi2 format for the same as external entity */
rval = v4l2_subdev_call(sink_sd, pad, set_fmt, NULL, &fmt);

rval = v4l2_subdev_link_validate(link);
if (rval)
return rval;

if (strncmp(source_sd->name, IPU_ISYS_ENTITY_PREFIX,
strlen(IPU_ISYS_ENTITY_PREFIX)) != 0) {
Expand Down
Loading

0 comments on commit b599331

Please sign in to comment.