Lines Matching full:pad
32 * @pad: pad number
43 u32 pad; member
67 * restricts the total number of streams in a pad, although the stream ID is
199 static inline int check_pad(struct v4l2_subdev *sd, u32 pad) in check_pad() argument
203 if (pad >= sd->entity.num_pads) in check_pad()
208 /* allow pad 0 on subdevices not registered as media entities */ in check_pad()
209 if (pad > 0) in check_pad()
215 u32 which, u32 pad, u32 stream) in check_state() argument
219 if (!v4l2_subdev_state_get_format(state, pad, stream)) in check_state()
243 return check_which(format->which) ? : check_pad(sd, format->pad) ? : in check_format()
244 check_state(sd, state, format->which, format->pad, format->stream); in check_format()
252 sd->ops->pad->get_fmt(sd, state, format); in call_get_fmt()
260 sd->ops->pad->set_fmt(sd, state, format); in call_set_fmt()
270 return check_which(code->which) ? : check_pad(sd, code->pad) ? : in call_enum_mbus_code()
271 check_state(sd, state, code->which, code->pad, code->stream) ? : in call_enum_mbus_code()
272 sd->ops->pad->enum_mbus_code(sd, state, code); in call_enum_mbus_code()
282 return check_which(fse->which) ? : check_pad(sd, fse->pad) ? : in call_enum_frame_size()
283 check_state(sd, state, fse->which, fse->pad, fse->stream) ? : in call_enum_frame_size()
284 sd->ops->pad->enum_frame_size(sd, state, fse); in call_enum_frame_size()
294 return check_which(fie->which) ? : check_pad(sd, fie->pad) ? : in call_enum_frame_interval()
295 check_state(sd, state, fie->which, fie->pad, fie->stream) ? : in call_enum_frame_interval()
296 sd->ops->pad->enum_frame_interval(sd, state, fie); in call_enum_frame_interval()
306 return check_which(sel->which) ? : check_pad(sd, sel->pad) ? : in check_selection()
307 check_state(sd, state, sel->which, sel->pad, sel->stream); in check_selection()
315 sd->ops->pad->get_selection(sd, state, sel); in call_get_selection()
323 sd->ops->pad->set_selection(sd, state, sel); in call_set_selection()
333 return check_which(fi->which) ? : check_pad(sd, fi->pad) ? : in check_frame_interval()
334 check_state(sd, state, fi->which, fi->pad, fi->stream); in check_frame_interval()
342 sd->ops->pad->get_frame_interval(sd, state, fi); in call_get_frame_interval()
350 sd->ops->pad->set_frame_interval(sd, state, fi); in call_set_frame_interval()
353 static int call_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, in call_get_frame_desc() argument
360 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in call_get_frame_desc()
366 ret = sd->ops->pad->get_frame_desc(sd, pad, fd); in call_get_frame_desc()
370 dev_dbg(sd->dev, "Frame descriptor on pad %u, type %s\n", pad, in call_get_frame_desc()
403 return check_pad(sd, edid->pad); in check_edid()
408 return check_edid(sd, edid) ? : sd->ops->pad->get_edid(sd, edid); in call_get_edid()
413 return check_edid(sd, edid) ? : sd->ops->pad->set_edid(sd, edid); in call_set_edid()
416 static int call_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_s_dv_timings() argument
422 return check_pad(sd, pad) ? : in call_s_dv_timings()
423 sd->ops->pad->s_dv_timings(sd, pad, timings); in call_s_dv_timings()
426 static int call_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_g_dv_timings() argument
432 return check_pad(sd, pad) ? : in call_g_dv_timings()
433 sd->ops->pad->g_dv_timings(sd, pad, timings); in call_g_dv_timings()
436 static int call_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_query_dv_timings() argument
442 return check_pad(sd, pad) ? : in call_query_dv_timings()
443 sd->ops->pad->query_dv_timings(sd, pad, timings); in call_query_dv_timings()
452 return check_pad(sd, cap->pad) ? : in call_dv_timings_cap()
453 sd->ops->pad->dv_timings_cap(sd, cap); in call_dv_timings_cap()
462 return check_pad(sd, dvt->pad) ? : in call_enum_dv_timings()
463 sd->ops->pad->enum_dv_timings(sd, dvt); in call_enum_dv_timings()
466 static int call_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad, in call_get_mbus_config() argument
471 return check_pad(sd, pad) ? : in call_get_mbus_config()
472 sd->ops->pad->get_mbus_config(sd, pad, config); in call_get_mbus_config()
508 * Create state-management wrapper for pad ops dealing with subdev state. The
573 .pad = &v4l2_subdev_call_pad_wrappers,
794 return v4l2_subdev_call(sd, pad, get_fmt, state, format); in subdev_do_ioctl()
808 return v4l2_subdev_call(sd, pad, set_fmt, state, format); in subdev_do_ioctl()
821 sel.pad = crop->pad; in subdev_do_ioctl()
826 sd, pad, get_selection, state, &sel); in subdev_do_ioctl()
846 sel.pad = crop->pad; in subdev_do_ioctl()
852 sd, pad, set_selection, state, &sel); in subdev_do_ioctl()
866 return v4l2_subdev_call(sd, pad, enum_mbus_code, state, in subdev_do_ioctl()
877 return v4l2_subdev_call(sd, pad, enum_frame_size, state, in subdev_do_ioctl()
888 return v4l2_subdev_call(sd, pad, get_frame_interval, state, fi); in subdev_do_ioctl()
901 return v4l2_subdev_call(sd, pad, set_frame_interval, state, fi); in subdev_do_ioctl()
911 return v4l2_subdev_call(sd, pad, enum_frame_interval, state, in subdev_do_ioctl()
923 sd, pad, get_selection, state, sel); in subdev_do_ioctl()
937 sd, pad, set_selection, state, sel); in subdev_do_ioctl()
943 return v4l2_subdev_call(sd, pad, get_edid, edid); in subdev_do_ioctl()
949 return v4l2_subdev_call(sd, pad, set_edid, edid); in subdev_do_ioctl()
955 return v4l2_subdev_call(sd, pad, dv_timings_cap, cap); in subdev_do_ioctl()
961 return v4l2_subdev_call(sd, pad, enum_dv_timings, dvt); in subdev_do_ioctl()
965 return v4l2_subdev_call(sd, pad, query_dv_timings, 0, arg); in subdev_do_ioctl()
968 return v4l2_subdev_call(sd, pad, g_dv_timings, 0, arg); in subdev_do_ioctl()
974 return v4l2_subdev_call(sd, pad, s_dv_timings, 0, arg); in subdev_do_ioctl()
1086 if (!v4l2_subdev_has_op(sd, pad, set_routing)) { in subdev_do_ioctl()
1100 rval = v4l2_subdev_call(sd, pad, set_routing, state, in subdev_do_ioctl()
1322 v4l2_subdev_link_validate_get_format(struct media_pad *pad, u32 stream, in v4l2_subdev_link_validate_get_format() argument
1330 sd = media_entity_to_v4l2_subdev(pad->entity); in v4l2_subdev_link_validate_get_format()
1333 fmt->pad = pad->index; in v4l2_subdev_link_validate_get_format()
1341 ret = v4l2_subdev_call(sd, pad, get_fmt, state, fmt); in v4l2_subdev_link_validate_get_format()
1351 static void __v4l2_link_validate_get_streams(struct media_pad *pad, in __v4l2_link_validate_get_streams() argument
1359 subdev = media_entity_to_v4l2_subdev(pad->entity); in __v4l2_link_validate_get_streams()
1375 if (pad->flags & MEDIA_PAD_FL_SOURCE) { in __v4l2_link_validate_get_streams()
1383 if (route_pad != pad->index) in __v4l2_link_validate_get_streams()
1395 static void v4l2_link_validate_get_streams(struct media_pad *pad, in v4l2_link_validate_get_streams() argument
1399 struct v4l2_subdev *subdev = media_entity_to_v4l2_subdev(pad->entity); in v4l2_link_validate_get_streams()
1408 __v4l2_link_validate_get_streams(pad, streams_mask, states_locked); in v4l2_link_validate_get_streams()
1479 ret = v4l2_subdev_call(sink_subdev, pad, link_validate, link, in v4l2_subdev_link_validate_locked()
1621 /* Drivers that support streams do not need the legacy pad config */ in __v4l2_subdev_state_alloc()
1682 has_enable_streams = v4l2_subdev_has_op(sd, pad, enable_streams); in __v4l2_subdev_init_finalize()
1683 has_disable_streams = v4l2_subdev_has_op(sd, pad, disable_streams); in __v4l2_subdev_init_finalize()
1737 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_format() argument
1749 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_format()
1752 return &state->pads[pad].format; in __v4l2_subdev_state_get_format()
1760 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_format()
1770 __v4l2_subdev_state_get_crop(struct v4l2_subdev_state *state, unsigned int pad, in __v4l2_subdev_state_get_crop() argument
1783 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_crop()
1786 return &state->pads[pad].crop; in __v4l2_subdev_state_get_crop()
1794 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_crop()
1805 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_compose() argument
1817 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_compose()
1820 return &state->pads[pad].compose; in __v4l2_subdev_state_get_compose()
1828 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_compose()
1839 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_interval() argument
1853 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_interval()
1856 return &state->pads[pad].interval; in __v4l2_subdev_state_get_interval()
1864 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_interval()
1901 * Fill in the 'pad' and stream' value for each item in the array from in v4l2_subdev_init_stream_configs()
1907 new_configs.configs[idx].pad = route->sink_pad; in v4l2_subdev_init_stream_configs()
1912 new_configs.configs[idx].pad = route->source_pad; in v4l2_subdev_init_stream_configs()
1929 fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream); in v4l2_subdev_get_fmt()
1945 interval = v4l2_subdev_state_get_interval(state, fi->pad, fi->stream); in v4l2_subdev_get_frame_interval()
2036 u32 pad, u32 stream, u32 *other_pad, in v4l2_subdev_routing_find_opposite_end() argument
2044 if (route->source_pad == pad && in v4l2_subdev_routing_find_opposite_end()
2053 if (route->sink_pad == pad && route->sink_stream == stream) { in v4l2_subdev_routing_find_opposite_end()
2068 u32 pad, u32 stream) in v4l2_subdev_state_get_opposite_stream_format() argument
2074 pad, stream, in v4l2_subdev_state_get_opposite_stream_format()
2131 /* Validate the sink and source pad numbers. */ in v4l2_subdev_routing_validate()
2134 dev_dbg(sd->dev, "route %u sink (%u) is not a sink pad\n", in v4l2_subdev_routing_validate()
2141 dev_dbg(sd->dev, "route %u source (%u) is not a source pad\n", in v4l2_subdev_routing_validate()
2148 * sink pad must be routed to a single source pad. in v4l2_subdev_routing_validate()
2162 * source pad must originate from a single sink pad. in v4l2_subdev_routing_validate()
2177 * a single stream in a sink pad. in v4l2_subdev_routing_validate()
2182 "route %u attempts to multiplex on %s pad %u\n", in v4l2_subdev_routing_validate()
2191 * be only a single stream in a source pad. in v4l2_subdev_routing_validate()
2196 "route %u attempts to multiplex on %s pad %u\n", in v4l2_subdev_routing_validate()
2250 u32 pad, u64 streams_mask, in v4l2_subdev_collect_streams() argument
2257 (sd->enabled_pads & BIT_ULL(pad)) ? BIT_ULL(0) : 0; in v4l2_subdev_collect_streams()
2271 if (cfg->pad != pad || !(streams_mask & BIT_ULL(cfg->stream))) in v4l2_subdev_collect_streams()
2281 sd->entity.name, pad, *found_streams, *enabled_streams); in v4l2_subdev_collect_streams()
2286 u32 pad, u64 streams_mask, in v4l2_subdev_set_streams_enabled() argument
2291 sd->enabled_pads |= BIT_ULL(pad); in v4l2_subdev_set_streams_enabled()
2293 sd->enabled_pads &= ~BIT_ULL(pad); in v4l2_subdev_set_streams_enabled()
2301 if (cfg->pad == pad && (streams_mask & BIT_ULL(cfg->stream))) in v4l2_subdev_set_streams_enabled()
2306 int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad, in v4l2_subdev_enable_streams() argument
2317 dev_dbg(dev, "enable streams \"%s\":%u/%#llx\n", sd->entity.name, pad, in v4l2_subdev_enable_streams()
2321 if (pad >= sd->entity.num_pads) in v4l2_subdev_enable_streams()
2324 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in v4l2_subdev_enable_streams()
2331 if (pad >= sizeof(sd->enabled_pads) * BITS_PER_BYTE) in v4l2_subdev_enable_streams()
2338 use_s_stream = !v4l2_subdev_has_op(sd, pad, enable_streams); in v4l2_subdev_enable_streams()
2350 v4l2_subdev_collect_streams(sd, state, pad, streams_mask, in v4l2_subdev_enable_streams()
2355 streams_mask & ~found_streams, sd->entity.name, pad); in v4l2_subdev_enable_streams()
2362 enabled_streams, sd->entity.name, pad); in v4l2_subdev_enable_streams()
2371 ret = v4l2_subdev_call(sd, pad, enable_streams, state, pad, in v4l2_subdev_enable_streams()
2374 /* Start streaming when the first pad is enabled. */ in v4l2_subdev_enable_streams()
2382 dev_dbg(dev, "enable streams %u:%#llx failed: %d\n", pad, in v4l2_subdev_enable_streams()
2388 v4l2_subdev_set_streams_enabled(sd, state, pad, streams_mask, true); in v4l2_subdev_enable_streams()
2408 int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad, in v4l2_subdev_disable_streams() argument
2418 dev_dbg(dev, "disable streams \"%s\":%u/%#llx\n", sd->entity.name, pad, in v4l2_subdev_disable_streams()
2422 if (pad >= sd->entity.num_pads) in v4l2_subdev_disable_streams()
2425 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in v4l2_subdev_disable_streams()
2432 if (pad >= sizeof(sd->enabled_pads) * BITS_PER_BYTE) in v4l2_subdev_disable_streams()
2439 use_s_stream = !v4l2_subdev_has_op(sd, pad, disable_streams); in v4l2_subdev_disable_streams()
2451 v4l2_subdev_collect_streams(sd, state, pad, streams_mask, in v4l2_subdev_disable_streams()
2456 streams_mask & ~found_streams, sd->entity.name, pad); in v4l2_subdev_disable_streams()
2463 streams_mask & ~enabled_streams, sd->entity.name, pad); in v4l2_subdev_disable_streams()
2470 ret = v4l2_subdev_call(sd, pad, disable_streams, state, pad, in v4l2_subdev_disable_streams()
2475 if (!(sd->enabled_pads & ~BIT_ULL(pad))) in v4l2_subdev_disable_streams()
2482 dev_dbg(dev, "disable streams %u:%#llx failed: %d\n", pad, in v4l2_subdev_disable_streams()
2487 v4l2_subdev_set_streams_enabled(sd, state, pad, streams_mask, false); in v4l2_subdev_disable_streams()
2505 struct media_pad *pad; in v4l2_subdev_s_stream_helper() local
2510 * Find the source pad. This helper is meant for subdevs that have a in v4l2_subdev_s_stream_helper()
2511 * single source pad, so failures shouldn't happen, but catch them in v4l2_subdev_s_stream_helper()
2514 media_entity_for_each_pad(&sd->entity, pad) { in v4l2_subdev_s_stream_helper()
2515 if (pad->flags & MEDIA_PAD_FL_SOURCE) { in v4l2_subdev_s_stream_helper()
2516 pad_index = pad->index; in v4l2_subdev_s_stream_helper()
2526 * As there's a single source pad, just collect all the source in v4l2_subdev_s_stream_helper()
2538 * per pad. in v4l2_subdev_s_stream_helper()
2587 if (!v4l2_subdev_has_op(sd, pad, enable_streams)) in v4l2_subdev_is_streaming()