Lines Matching full:pad

43  * restricts the total number of streams in a pad, although the stream ID is
177 static inline int check_pad(struct v4l2_subdev *sd, u32 pad) in check_pad() argument
181 if (pad >= sd->entity.num_pads) in check_pad()
186 /* allow pad 0 on subdevices not registered as media entities */ in check_pad()
187 if (pad > 0) in check_pad()
193 u32 which, u32 pad, u32 stream) in check_state() argument
197 if (!v4l2_subdev_state_get_format(state, pad, stream)) in check_state()
221 return check_which(format->which) ? : check_pad(sd, format->pad) ? : in check_format()
222 check_state(sd, state, format->which, format->pad, format->stream); in check_format()
230 sd->ops->pad->get_fmt(sd, state, format); in call_get_fmt()
238 sd->ops->pad->set_fmt(sd, state, format); in call_set_fmt()
248 return check_which(code->which) ? : check_pad(sd, code->pad) ? : in call_enum_mbus_code()
249 check_state(sd, state, code->which, code->pad, code->stream) ? : in call_enum_mbus_code()
250 sd->ops->pad->enum_mbus_code(sd, state, code); in call_enum_mbus_code()
260 return check_which(fse->which) ? : check_pad(sd, fse->pad) ? : in call_enum_frame_size()
261 check_state(sd, state, fse->which, fse->pad, fse->stream) ? : in call_enum_frame_size()
262 sd->ops->pad->enum_frame_size(sd, state, fse); in call_enum_frame_size()
272 return check_which(fie->which) ? : check_pad(sd, fie->pad) ? : in call_enum_frame_interval()
273 check_state(sd, state, fie->which, fie->pad, fie->stream) ? : in call_enum_frame_interval()
274 sd->ops->pad->enum_frame_interval(sd, state, fie); in call_enum_frame_interval()
284 return check_which(sel->which) ? : check_pad(sd, sel->pad) ? : in check_selection()
285 check_state(sd, state, sel->which, sel->pad, sel->stream); in check_selection()
293 sd->ops->pad->get_selection(sd, state, sel); in call_get_selection()
301 sd->ops->pad->set_selection(sd, state, sel); in call_set_selection()
311 return check_which(fi->which) ? : check_pad(sd, fi->pad) ? : in check_frame_interval()
312 check_state(sd, state, fi->which, fi->pad, fi->stream); in check_frame_interval()
320 sd->ops->pad->get_frame_interval(sd, state, fi); in call_get_frame_interval()
328 sd->ops->pad->set_frame_interval(sd, state, fi); in call_set_frame_interval()
331 static int call_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, in call_get_frame_desc() argument
339 ret = sd->ops->pad->get_frame_desc(sd, pad, fd); in call_get_frame_desc()
343 dev_dbg(sd->dev, "Frame descriptor on pad %u, type %s\n", pad, in call_get_frame_desc()
376 return check_pad(sd, edid->pad); in check_edid()
381 return check_edid(sd, edid) ? : sd->ops->pad->get_edid(sd, edid); in call_get_edid()
386 return check_edid(sd, edid) ? : sd->ops->pad->set_edid(sd, edid); in call_set_edid()
389 static int call_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_s_dv_timings() argument
395 return check_pad(sd, pad) ? : in call_s_dv_timings()
396 sd->ops->pad->s_dv_timings(sd, pad, timings); in call_s_dv_timings()
399 static int call_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_g_dv_timings() argument
405 return check_pad(sd, pad) ? : in call_g_dv_timings()
406 sd->ops->pad->g_dv_timings(sd, pad, timings); in call_g_dv_timings()
409 static int call_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_query_dv_timings() argument
415 return check_pad(sd, pad) ? : in call_query_dv_timings()
416 sd->ops->pad->query_dv_timings(sd, pad, timings); in call_query_dv_timings()
425 return check_pad(sd, cap->pad) ? : in call_dv_timings_cap()
426 sd->ops->pad->dv_timings_cap(sd, cap); in call_dv_timings_cap()
435 return check_pad(sd, dvt->pad) ? : in call_enum_dv_timings()
436 sd->ops->pad->enum_dv_timings(sd, dvt); in call_enum_dv_timings()
439 static int call_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad, in call_get_mbus_config() argument
442 return check_pad(sd, pad) ? : in call_get_mbus_config()
443 sd->ops->pad->get_mbus_config(sd, pad, config); in call_get_mbus_config()
479 * Create state-management wrapper for pad ops dealing with subdev state. The
544 .pad = &v4l2_subdev_call_pad_wrappers,
750 return v4l2_subdev_call(sd, pad, get_fmt, state, format); in subdev_do_ioctl()
764 return v4l2_subdev_call(sd, pad, set_fmt, state, format); in subdev_do_ioctl()
777 sel.pad = crop->pad; in subdev_do_ioctl()
782 sd, pad, get_selection, state, &sel); in subdev_do_ioctl()
802 sel.pad = crop->pad; in subdev_do_ioctl()
808 sd, pad, set_selection, state, &sel); in subdev_do_ioctl()
822 return v4l2_subdev_call(sd, pad, enum_mbus_code, state, in subdev_do_ioctl()
833 return v4l2_subdev_call(sd, pad, enum_frame_size, state, in subdev_do_ioctl()
844 return v4l2_subdev_call(sd, pad, get_frame_interval, state, fi); in subdev_do_ioctl()
857 return v4l2_subdev_call(sd, pad, set_frame_interval, state, fi); in subdev_do_ioctl()
867 return v4l2_subdev_call(sd, pad, enum_frame_interval, state, in subdev_do_ioctl()
879 sd, pad, get_selection, state, sel); in subdev_do_ioctl()
893 sd, pad, set_selection, state, sel); in subdev_do_ioctl()
899 return v4l2_subdev_call(sd, pad, get_edid, edid); in subdev_do_ioctl()
905 return v4l2_subdev_call(sd, pad, set_edid, edid); in subdev_do_ioctl()
911 return v4l2_subdev_call(sd, pad, dv_timings_cap, cap); in subdev_do_ioctl()
917 return v4l2_subdev_call(sd, pad, enum_dv_timings, dvt); in subdev_do_ioctl()
921 return v4l2_subdev_call(sd, pad, query_dv_timings, 0, arg); in subdev_do_ioctl()
924 return v4l2_subdev_call(sd, pad, g_dv_timings, 0, arg); in subdev_do_ioctl()
930 return v4l2_subdev_call(sd, pad, s_dv_timings, 0, arg); in subdev_do_ioctl()
1028 if (!v4l2_subdev_has_op(sd, pad, set_routing)) { in subdev_do_ioctl()
1042 rval = v4l2_subdev_call(sd, pad, set_routing, state, in subdev_do_ioctl()
1264 v4l2_subdev_link_validate_get_format(struct media_pad *pad, u32 stream, in v4l2_subdev_link_validate_get_format() argument
1272 sd = media_entity_to_v4l2_subdev(pad->entity); in v4l2_subdev_link_validate_get_format()
1275 fmt->pad = pad->index; in v4l2_subdev_link_validate_get_format()
1283 ret = v4l2_subdev_call(sd, pad, get_fmt, state, fmt); in v4l2_subdev_link_validate_get_format()
1293 static void __v4l2_link_validate_get_streams(struct media_pad *pad, in __v4l2_link_validate_get_streams() argument
1301 subdev = media_entity_to_v4l2_subdev(pad->entity); in __v4l2_link_validate_get_streams()
1317 if (pad->flags & MEDIA_PAD_FL_SOURCE) { in __v4l2_link_validate_get_streams()
1325 if (route_pad != pad->index) in __v4l2_link_validate_get_streams()
1337 static void v4l2_link_validate_get_streams(struct media_pad *pad, in v4l2_link_validate_get_streams() argument
1341 struct v4l2_subdev *subdev = media_entity_to_v4l2_subdev(pad->entity); in v4l2_link_validate_get_streams()
1350 __v4l2_link_validate_get_streams(pad, streams_mask, states_locked); in v4l2_link_validate_get_streams()
1421 ret = v4l2_subdev_call(sink_subdev, pad, link_validate, link, in v4l2_subdev_link_validate_locked()
1563 /* Drivers that support streams do not need the legacy pad config */ in __v4l2_subdev_state_alloc()
1624 has_enable_streams = v4l2_subdev_has_op(sd, pad, enable_streams); in __v4l2_subdev_init_finalize()
1625 has_disable_streams = v4l2_subdev_has_op(sd, pad, disable_streams); in __v4l2_subdev_init_finalize()
1676 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_format() argument
1688 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_format()
1691 return &state->pads[pad].format; in __v4l2_subdev_state_get_format()
1699 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_format()
1709 __v4l2_subdev_state_get_crop(struct v4l2_subdev_state *state, unsigned int pad, in __v4l2_subdev_state_get_crop() argument
1722 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_crop()
1725 return &state->pads[pad].crop; in __v4l2_subdev_state_get_crop()
1733 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_crop()
1744 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_compose() argument
1756 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_compose()
1759 return &state->pads[pad].compose; in __v4l2_subdev_state_get_compose()
1767 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_compose()
1778 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_interval() argument
1792 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_interval()
1795 return &state->pads[pad].interval; in __v4l2_subdev_state_get_interval()
1803 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_interval()
1840 * Fill in the 'pad' and stream' value for each item in the array from in v4l2_subdev_init_stream_configs()
1846 new_configs.configs[idx].pad = route->sink_pad; in v4l2_subdev_init_stream_configs()
1851 new_configs.configs[idx].pad = route->source_pad; in v4l2_subdev_init_stream_configs()
1868 fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream); in v4l2_subdev_get_fmt()
1884 interval = v4l2_subdev_state_get_interval(state, fi->pad, fi->stream); in v4l2_subdev_get_frame_interval()
1975 u32 pad, u32 stream, u32 *other_pad, in v4l2_subdev_routing_find_opposite_end() argument
1983 if (route->source_pad == pad && in v4l2_subdev_routing_find_opposite_end()
1992 if (route->sink_pad == pad && route->sink_stream == stream) { in v4l2_subdev_routing_find_opposite_end()
2007 u32 pad, u32 stream) in v4l2_subdev_state_get_opposite_stream_format() argument
2013 pad, stream, in v4l2_subdev_state_get_opposite_stream_format()
2070 /* Validate the sink and source pad numbers. */ in v4l2_subdev_routing_validate()
2073 dev_dbg(sd->dev, "route %u sink (%u) is not a sink pad\n", in v4l2_subdev_routing_validate()
2080 dev_dbg(sd->dev, "route %u source (%u) is not a source pad\n", in v4l2_subdev_routing_validate()
2087 * sink pad must be routed to a single source pad. in v4l2_subdev_routing_validate()
2101 * source pad must originate from a single sink pad. in v4l2_subdev_routing_validate()
2116 * a single stream in a sink pad. in v4l2_subdev_routing_validate()
2121 "route %u attempts to multiplex on %s pad %u\n", in v4l2_subdev_routing_validate()
2130 * be only a single stream in a source pad. in v4l2_subdev_routing_validate()
2135 "route %u attempts to multiplex on %s pad %u\n", in v4l2_subdev_routing_validate()
2189 u32 pad, u64 streams_mask, in v4l2_subdev_collect_streams() argument
2196 (sd->enabled_pads & BIT_ULL(pad)) ? BIT_ULL(0) : 0; in v4l2_subdev_collect_streams()
2207 if (cfg->pad != pad || !(streams_mask & BIT_ULL(cfg->stream))) in v4l2_subdev_collect_streams()
2218 u32 pad, u64 streams_mask, in v4l2_subdev_set_streams_enabled() argument
2223 sd->enabled_pads |= BIT_ULL(pad); in v4l2_subdev_set_streams_enabled()
2225 sd->enabled_pads &= ~BIT_ULL(pad); in v4l2_subdev_set_streams_enabled()
2233 if (cfg->pad == pad && (streams_mask & BIT_ULL(cfg->stream))) in v4l2_subdev_set_streams_enabled()
2238 int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad, in v4l2_subdev_enable_streams() argument
2250 if (pad >= sd->entity.num_pads) in v4l2_subdev_enable_streams()
2253 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in v4l2_subdev_enable_streams()
2260 if (pad >= sizeof(sd->enabled_pads) * BITS_PER_BYTE) in v4l2_subdev_enable_streams()
2267 use_s_stream = !v4l2_subdev_has_op(sd, pad, enable_streams); in v4l2_subdev_enable_streams()
2279 v4l2_subdev_collect_streams(sd, state, pad, streams_mask, in v4l2_subdev_enable_streams()
2284 streams_mask & ~found_streams, sd->entity.name, pad); in v4l2_subdev_enable_streams()
2291 enabled_streams, sd->entity.name, pad); in v4l2_subdev_enable_streams()
2296 dev_dbg(dev, "enable streams %u:%#llx\n", pad, streams_mask); in v4l2_subdev_enable_streams()
2302 ret = v4l2_subdev_call(sd, pad, enable_streams, state, pad, in v4l2_subdev_enable_streams()
2305 /* Start streaming when the first pad is enabled. */ in v4l2_subdev_enable_streams()
2313 dev_dbg(dev, "enable streams %u:%#llx failed: %d\n", pad, in v4l2_subdev_enable_streams()
2319 v4l2_subdev_set_streams_enabled(sd, state, pad, streams_mask, true); in v4l2_subdev_enable_streams()
2339 int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad, in v4l2_subdev_disable_streams() argument
2350 if (pad >= sd->entity.num_pads) in v4l2_subdev_disable_streams()
2353 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in v4l2_subdev_disable_streams()
2360 if (pad >= sizeof(sd->enabled_pads) * BITS_PER_BYTE) in v4l2_subdev_disable_streams()
2367 use_s_stream = !v4l2_subdev_has_op(sd, pad, disable_streams); in v4l2_subdev_disable_streams()
2379 v4l2_subdev_collect_streams(sd, state, pad, streams_mask, in v4l2_subdev_disable_streams()
2384 streams_mask & ~found_streams, sd->entity.name, pad); in v4l2_subdev_disable_streams()
2391 streams_mask & ~enabled_streams, sd->entity.name, pad); in v4l2_subdev_disable_streams()
2396 dev_dbg(dev, "disable streams %u:%#llx\n", pad, streams_mask); in v4l2_subdev_disable_streams()
2400 ret = v4l2_subdev_call(sd, pad, disable_streams, state, pad, in v4l2_subdev_disable_streams()
2405 if (!(sd->enabled_pads & ~BIT_ULL(pad))) in v4l2_subdev_disable_streams()
2412 dev_dbg(dev, "disable streams %u:%#llx failed: %d\n", pad, in v4l2_subdev_disable_streams()
2417 v4l2_subdev_set_streams_enabled(sd, state, pad, streams_mask, false); in v4l2_subdev_disable_streams()
2435 struct media_pad *pad; in v4l2_subdev_s_stream_helper() local
2440 * Find the source pad. This helper is meant for subdevs that have a in v4l2_subdev_s_stream_helper()
2441 * single source pad, so failures shouldn't happen, but catch them in v4l2_subdev_s_stream_helper()
2444 media_entity_for_each_pad(&sd->entity, pad) { in v4l2_subdev_s_stream_helper()
2445 if (pad->flags & MEDIA_PAD_FL_SOURCE) { in v4l2_subdev_s_stream_helper()
2446 pad_index = pad->index; in v4l2_subdev_s_stream_helper()
2456 * As there's a single source pad, just collect all the source in v4l2_subdev_s_stream_helper()
2468 * per pad. in v4l2_subdev_s_stream_helper()
2517 if (!v4l2_subdev_has_op(sd, pad, enable_streams)) in v4l2_subdev_is_streaming()