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
338 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in call_get_frame_desc()
344 ret = sd->ops->pad->get_frame_desc(sd, pad, fd); in call_get_frame_desc()
348 dev_dbg(sd->dev, "Frame descriptor on pad %u, type %s\n", pad, in call_get_frame_desc()
381 return check_pad(sd, edid->pad); in check_edid()
386 return check_edid(sd, edid) ? : sd->ops->pad->get_edid(sd, edid); in call_get_edid()
391 return check_edid(sd, edid) ? : sd->ops->pad->set_edid(sd, edid); in call_set_edid()
394 static int call_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_s_dv_timings() argument
400 return check_pad(sd, pad) ? : in call_s_dv_timings()
401 sd->ops->pad->s_dv_timings(sd, pad, timings); in call_s_dv_timings()
404 static int call_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_g_dv_timings() argument
410 return check_pad(sd, pad) ? : in call_g_dv_timings()
411 sd->ops->pad->g_dv_timings(sd, pad, timings); in call_g_dv_timings()
414 static int call_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad, in call_query_dv_timings() argument
420 return check_pad(sd, pad) ? : in call_query_dv_timings()
421 sd->ops->pad->query_dv_timings(sd, pad, timings); in call_query_dv_timings()
430 return check_pad(sd, cap->pad) ? : in call_dv_timings_cap()
431 sd->ops->pad->dv_timings_cap(sd, cap); in call_dv_timings_cap()
440 return check_pad(sd, dvt->pad) ? : in call_enum_dv_timings()
441 sd->ops->pad->enum_dv_timings(sd, dvt); in call_enum_dv_timings()
444 static int call_get_mbus_config(struct v4l2_subdev *sd, unsigned int pad, in call_get_mbus_config() argument
449 return check_pad(sd, pad) ? : in call_get_mbus_config()
450 sd->ops->pad->get_mbus_config(sd, pad, config); in call_get_mbus_config()
486 * Create state-management wrapper for pad ops dealing with subdev state. The
551 .pad = &v4l2_subdev_call_pad_wrappers,
772 return v4l2_subdev_call(sd, pad, get_fmt, state, format); in subdev_do_ioctl()
786 return v4l2_subdev_call(sd, pad, set_fmt, state, format); in subdev_do_ioctl()
799 sel.pad = crop->pad; in subdev_do_ioctl()
804 sd, pad, get_selection, state, &sel); in subdev_do_ioctl()
824 sel.pad = crop->pad; in subdev_do_ioctl()
830 sd, pad, set_selection, state, &sel); in subdev_do_ioctl()
844 return v4l2_subdev_call(sd, pad, enum_mbus_code, state, in subdev_do_ioctl()
855 return v4l2_subdev_call(sd, pad, enum_frame_size, state, in subdev_do_ioctl()
866 return v4l2_subdev_call(sd, pad, get_frame_interval, state, fi); in subdev_do_ioctl()
879 return v4l2_subdev_call(sd, pad, set_frame_interval, state, fi); in subdev_do_ioctl()
889 return v4l2_subdev_call(sd, pad, enum_frame_interval, state, in subdev_do_ioctl()
901 sd, pad, get_selection, state, sel); in subdev_do_ioctl()
915 sd, pad, set_selection, state, sel); in subdev_do_ioctl()
921 return v4l2_subdev_call(sd, pad, get_edid, edid); in subdev_do_ioctl()
927 return v4l2_subdev_call(sd, pad, set_edid, edid); in subdev_do_ioctl()
933 return v4l2_subdev_call(sd, pad, dv_timings_cap, cap); in subdev_do_ioctl()
939 return v4l2_subdev_call(sd, pad, enum_dv_timings, dvt); in subdev_do_ioctl()
943 return v4l2_subdev_call(sd, pad, query_dv_timings, 0, arg); in subdev_do_ioctl()
946 return v4l2_subdev_call(sd, pad, g_dv_timings, 0, arg); in subdev_do_ioctl()
952 return v4l2_subdev_call(sd, pad, s_dv_timings, 0, arg); in subdev_do_ioctl()
1050 if (!v4l2_subdev_has_op(sd, pad, set_routing)) { in subdev_do_ioctl()
1064 rval = v4l2_subdev_call(sd, pad, set_routing, state, in subdev_do_ioctl()
1286 v4l2_subdev_link_validate_get_format(struct media_pad *pad, u32 stream, in v4l2_subdev_link_validate_get_format() argument
1294 sd = media_entity_to_v4l2_subdev(pad->entity); in v4l2_subdev_link_validate_get_format()
1297 fmt->pad = pad->index; in v4l2_subdev_link_validate_get_format()
1305 ret = v4l2_subdev_call(sd, pad, get_fmt, state, fmt); in v4l2_subdev_link_validate_get_format()
1315 static void __v4l2_link_validate_get_streams(struct media_pad *pad, in __v4l2_link_validate_get_streams() argument
1323 subdev = media_entity_to_v4l2_subdev(pad->entity); in __v4l2_link_validate_get_streams()
1339 if (pad->flags & MEDIA_PAD_FL_SOURCE) { in __v4l2_link_validate_get_streams()
1347 if (route_pad != pad->index) in __v4l2_link_validate_get_streams()
1359 static void v4l2_link_validate_get_streams(struct media_pad *pad, in v4l2_link_validate_get_streams() argument
1363 struct v4l2_subdev *subdev = media_entity_to_v4l2_subdev(pad->entity); in v4l2_link_validate_get_streams()
1372 __v4l2_link_validate_get_streams(pad, streams_mask, states_locked); in v4l2_link_validate_get_streams()
1443 ret = v4l2_subdev_call(sink_subdev, pad, link_validate, link, in v4l2_subdev_link_validate_locked()
1585 /* Drivers that support streams do not need the legacy pad config */ in __v4l2_subdev_state_alloc()
1646 has_enable_streams = v4l2_subdev_has_op(sd, pad, enable_streams); in __v4l2_subdev_init_finalize()
1647 has_disable_streams = v4l2_subdev_has_op(sd, pad, disable_streams); in __v4l2_subdev_init_finalize()
1701 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_format() argument
1713 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_format()
1716 return &state->pads[pad].format; in __v4l2_subdev_state_get_format()
1724 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_format()
1734 __v4l2_subdev_state_get_crop(struct v4l2_subdev_state *state, unsigned int pad, in __v4l2_subdev_state_get_crop() argument
1747 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_crop()
1750 return &state->pads[pad].crop; in __v4l2_subdev_state_get_crop()
1758 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_crop()
1769 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_compose() argument
1781 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_compose()
1784 return &state->pads[pad].compose; in __v4l2_subdev_state_get_compose()
1792 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_compose()
1803 unsigned int pad, u32 stream) in __v4l2_subdev_state_get_interval() argument
1817 if (pad >= state->sd->entity.num_pads) in __v4l2_subdev_state_get_interval()
1820 return &state->pads[pad].interval; in __v4l2_subdev_state_get_interval()
1828 if (stream_configs->configs[i].pad == pad && in __v4l2_subdev_state_get_interval()
1865 * Fill in the 'pad' and stream' value for each item in the array from in v4l2_subdev_init_stream_configs()
1871 new_configs.configs[idx].pad = route->sink_pad; in v4l2_subdev_init_stream_configs()
1876 new_configs.configs[idx].pad = route->source_pad; in v4l2_subdev_init_stream_configs()
1893 fmt = v4l2_subdev_state_get_format(state, format->pad, format->stream); in v4l2_subdev_get_fmt()
1909 interval = v4l2_subdev_state_get_interval(state, fi->pad, fi->stream); in v4l2_subdev_get_frame_interval()
2000 u32 pad, u32 stream, u32 *other_pad, in v4l2_subdev_routing_find_opposite_end() argument
2008 if (route->source_pad == pad && in v4l2_subdev_routing_find_opposite_end()
2017 if (route->sink_pad == pad && route->sink_stream == stream) { in v4l2_subdev_routing_find_opposite_end()
2032 u32 pad, u32 stream) in v4l2_subdev_state_get_opposite_stream_format() argument
2038 pad, stream, in v4l2_subdev_state_get_opposite_stream_format()
2095 /* Validate the sink and source pad numbers. */ in v4l2_subdev_routing_validate()
2098 dev_dbg(sd->dev, "route %u sink (%u) is not a sink pad\n", in v4l2_subdev_routing_validate()
2105 dev_dbg(sd->dev, "route %u source (%u) is not a source pad\n", in v4l2_subdev_routing_validate()
2112 * sink pad must be routed to a single source pad. in v4l2_subdev_routing_validate()
2126 * source pad must originate from a single sink pad. in v4l2_subdev_routing_validate()
2141 * a single stream in a sink pad. in v4l2_subdev_routing_validate()
2146 "route %u attempts to multiplex on %s pad %u\n", in v4l2_subdev_routing_validate()
2155 * be only a single stream in a source pad. in v4l2_subdev_routing_validate()
2160 "route %u attempts to multiplex on %s pad %u\n", in v4l2_subdev_routing_validate()
2214 u32 pad, u64 streams_mask, in v4l2_subdev_collect_streams() argument
2221 (sd->enabled_pads & BIT_ULL(pad)) ? BIT_ULL(0) : 0; in v4l2_subdev_collect_streams()
2232 if (cfg->pad != pad || !(streams_mask & BIT_ULL(cfg->stream))) in v4l2_subdev_collect_streams()
2243 u32 pad, u64 streams_mask, in v4l2_subdev_set_streams_enabled() argument
2248 sd->enabled_pads |= BIT_ULL(pad); in v4l2_subdev_set_streams_enabled()
2250 sd->enabled_pads &= ~BIT_ULL(pad); in v4l2_subdev_set_streams_enabled()
2258 if (cfg->pad == pad && (streams_mask & BIT_ULL(cfg->stream))) in v4l2_subdev_set_streams_enabled()
2263 int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad, in v4l2_subdev_enable_streams() argument
2275 if (pad >= sd->entity.num_pads) in v4l2_subdev_enable_streams()
2278 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in v4l2_subdev_enable_streams()
2285 if (pad >= sizeof(sd->enabled_pads) * BITS_PER_BYTE) in v4l2_subdev_enable_streams()
2292 use_s_stream = !v4l2_subdev_has_op(sd, pad, enable_streams); in v4l2_subdev_enable_streams()
2304 v4l2_subdev_collect_streams(sd, state, pad, streams_mask, in v4l2_subdev_enable_streams()
2309 streams_mask & ~found_streams, sd->entity.name, pad); in v4l2_subdev_enable_streams()
2316 enabled_streams, sd->entity.name, pad); in v4l2_subdev_enable_streams()
2321 dev_dbg(dev, "enable streams %u:%#llx\n", pad, streams_mask); in v4l2_subdev_enable_streams()
2327 ret = v4l2_subdev_call(sd, pad, enable_streams, state, pad, in v4l2_subdev_enable_streams()
2330 /* Start streaming when the first pad is enabled. */ in v4l2_subdev_enable_streams()
2338 dev_dbg(dev, "enable streams %u:%#llx failed: %d\n", pad, in v4l2_subdev_enable_streams()
2344 v4l2_subdev_set_streams_enabled(sd, state, pad, streams_mask, true); in v4l2_subdev_enable_streams()
2364 int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad, in v4l2_subdev_disable_streams() argument
2375 if (pad >= sd->entity.num_pads) in v4l2_subdev_disable_streams()
2378 if (!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE)) in v4l2_subdev_disable_streams()
2385 if (pad >= sizeof(sd->enabled_pads) * BITS_PER_BYTE) in v4l2_subdev_disable_streams()
2392 use_s_stream = !v4l2_subdev_has_op(sd, pad, disable_streams); in v4l2_subdev_disable_streams()
2404 v4l2_subdev_collect_streams(sd, state, pad, streams_mask, in v4l2_subdev_disable_streams()
2409 streams_mask & ~found_streams, sd->entity.name, pad); in v4l2_subdev_disable_streams()
2416 streams_mask & ~enabled_streams, sd->entity.name, pad); in v4l2_subdev_disable_streams()
2421 dev_dbg(dev, "disable streams %u:%#llx\n", pad, streams_mask); in v4l2_subdev_disable_streams()
2425 ret = v4l2_subdev_call(sd, pad, disable_streams, state, pad, in v4l2_subdev_disable_streams()
2430 if (!(sd->enabled_pads & ~BIT_ULL(pad))) in v4l2_subdev_disable_streams()
2437 dev_dbg(dev, "disable streams %u:%#llx failed: %d\n", pad, in v4l2_subdev_disable_streams()
2442 v4l2_subdev_set_streams_enabled(sd, state, pad, streams_mask, false); in v4l2_subdev_disable_streams()
2460 struct media_pad *pad; in v4l2_subdev_s_stream_helper() local
2465 * Find the source pad. This helper is meant for subdevs that have a in v4l2_subdev_s_stream_helper()
2466 * single source pad, so failures shouldn't happen, but catch them in v4l2_subdev_s_stream_helper()
2469 media_entity_for_each_pad(&sd->entity, pad) { in v4l2_subdev_s_stream_helper()
2470 if (pad->flags & MEDIA_PAD_FL_SOURCE) { in v4l2_subdev_s_stream_helper()
2471 pad_index = pad->index; in v4l2_subdev_s_stream_helper()
2481 * As there's a single source pad, just collect all the source in v4l2_subdev_s_stream_helper()
2493 * per pad. in v4l2_subdev_s_stream_helper()
2542 if (!v4l2_subdev_has_op(sd, pad, enable_streams)) in v4l2_subdev_is_streaming()