/* Source format is fixed, we cannot change it */ if (req_fmt->pad == ISC_SCALER_PAD_SOURCE) {
req_fmt->format = isc->scaler_format[ISC_SCALER_PAD_SOURCE]; return 0;
}
/* There is no limit on the frame size on the sink pad */
v4l_bound_align_image(&req_fmt->format.width, 16, UINT_MAX, 0,
&req_fmt->format.height, 16, UINT_MAX, 0, 0);
if (req_fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
v4l2_try_fmt = v4l2_subdev_state_get_format(sd_state,
req_fmt->pad);
*v4l2_try_fmt = req_fmt->format; /* Trying on the sink pad makes the source pad change too */
v4l2_try_fmt = v4l2_subdev_state_get_format(sd_state,
ISC_SCALER_PAD_SOURCE);
*v4l2_try_fmt = req_fmt->format;
v4l_bound_align_image(&v4l2_try_fmt->width,
16, isc->max_width, 0,
&v4l2_try_fmt->height,
16, isc->max_height, 0, 0); /* if we are just trying, we are done */ return 0;
}
/* The source pad is the same as the sink, but we have to crop it */
isc->scaler_format[ISC_SCALER_PAD_SOURCE] =
isc->scaler_format[ISC_SCALER_PAD_SINK];
v4l_bound_align_image
(&isc->scaler_format[ISC_SCALER_PAD_SOURCE].width, 16,
isc->max_width, 0,
&isc->scaler_format[ISC_SCALER_PAD_SOURCE].height, 16,
isc->max_height, 0, 0);
/* * All formats supported by the ISC are supported by the scaler. * Advertise the formats which the ISC can take as input, as the scaler * entity cropping is part of the PFE module (parallel front end)
*/ if (code->index < isc->formats_list_size) {
code->code = isc->formats_list[code->index].mbus_code; return 0;
}
ret = media_entity_pads_init(&isc->scaler_sd.entity,
ISC_SCALER_PADS_NUM,
isc->scaler_pads); if (ret < 0) {
dev_err(isc->dev, "scaler sd media entity init failed\n"); return ret;
}
ret = v4l2_device_register_subdev(&isc->v4l2_dev, &isc->scaler_sd); if (ret < 0) {
dev_err(isc->dev, "scaler sd failed to register subdev\n"); return ret;
}
return ret;
}
EXPORT_SYMBOL_GPL(isc_scaler_init);
int isc_scaler_link(struct isc_device *isc)
{ int ret;
ret = media_create_pad_link(&isc->current_subdev->sd->entity,
isc->remote_pad, &isc->scaler_sd.entity,
ISC_SCALER_PAD_SINK,
MEDIA_LNK_FL_ENABLED |
MEDIA_LNK_FL_IMMUTABLE);
if (ret < 0) {
dev_err(isc->dev, "Failed to create pad link: %s to %s\n",
isc->current_subdev->sd->entity.name,
isc->scaler_sd.entity.name); return ret;
}
dev_dbg(isc->dev, "link with %s pad: %d\n",
isc->current_subdev->sd->name, isc->remote_pad);
ret = media_create_pad_link(&isc->scaler_sd.entity,
ISC_SCALER_PAD_SOURCE,
&isc->video_dev.entity, ISC_PAD_SINK,
MEDIA_LNK_FL_ENABLED |
MEDIA_LNK_FL_IMMUTABLE);
if (ret < 0) {
dev_err(isc->dev, "Failed to create pad link: %s to %s\n",
isc->scaler_sd.entity.name,
isc->video_dev.entity.name); return ret;
}
dev_dbg(isc->dev, "link with %s pad: %d\n", isc->scaler_sd.name,
ISC_SCALER_PAD_SOURCE);
return ret;
}
EXPORT_SYMBOL_GPL(isc_scaler_link);
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.