提交 14fae6fc 编写于 作者: M Mauro Carvalho Chehab

[media] davinci_vbpe: stop MEDIA_ENT_T_V4L2_SUBDEV abuse

This driver is abusing MEDIA_ENT_T_V4L2_SUBDEV:

- it uses a hack to check if the remote entity is a subdev;
- it still uses the legacy entity subtype check macro, that
  will be removed soon.
Signed-off-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
上级 26614b9b
...@@ -1712,8 +1712,11 @@ ipipe_link_setup(struct media_entity *entity, const struct media_pad *local, ...@@ -1712,8 +1712,11 @@ ipipe_link_setup(struct media_entity *entity, const struct media_pad *local,
struct vpfe_device *vpfe_dev = to_vpfe_device(ipipe); struct vpfe_device *vpfe_dev = to_vpfe_device(ipipe);
u16 ipipeif_sink = vpfe_dev->vpfe_ipipeif.input; u16 ipipeif_sink = vpfe_dev->vpfe_ipipeif.input;
switch (local->index | media_entity_type(remote->entity)) { if (!is_media_entity_v4l2_subdev(remote->entity))
case IPIPE_PAD_SINK | MEDIA_ENT_T_V4L2_SUBDEV: return -EINVAL;
switch (local->index) {
case IPIPE_PAD_SINK:
if (!(flags & MEDIA_LNK_FL_ENABLED)) { if (!(flags & MEDIA_LNK_FL_ENABLED)) {
ipipe->input = IPIPE_INPUT_NONE; ipipe->input = IPIPE_INPUT_NONE;
break; break;
...@@ -1726,7 +1729,7 @@ ipipe_link_setup(struct media_entity *entity, const struct media_pad *local, ...@@ -1726,7 +1729,7 @@ ipipe_link_setup(struct media_entity *entity, const struct media_pad *local,
ipipe->input = IPIPE_INPUT_CCDC; ipipe->input = IPIPE_INPUT_CCDC;
break; break;
case IPIPE_PAD_SOURCE | MEDIA_ENT_T_V4L2_SUBDEV: case IPIPE_PAD_SOURCE:
/* out to RESIZER */ /* out to RESIZER */
if (flags & MEDIA_LNK_FL_ENABLED) if (flags & MEDIA_LNK_FL_ENABLED)
ipipe->output = IPIPE_OUTPUT_RESIZER; ipipe->output = IPIPE_OUTPUT_RESIZER;
......
...@@ -88,7 +88,7 @@ vpfe_video_remote_subdev(struct vpfe_video_device *video, u32 *pad) ...@@ -88,7 +88,7 @@ vpfe_video_remote_subdev(struct vpfe_video_device *video, u32 *pad)
{ {
struct media_pad *remote = media_entity_remote_pad(&video->pad); struct media_pad *remote = media_entity_remote_pad(&video->pad);
if (remote == NULL || remote->entity->type != MEDIA_ENT_T_V4L2_SUBDEV) if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
return NULL; return NULL;
if (pad) if (pad)
*pad = remote->index; *pad = remote->index;
...@@ -243,8 +243,7 @@ static int vpfe_video_validate_pipeline(struct vpfe_pipeline *pipe) ...@@ -243,8 +243,7 @@ static int vpfe_video_validate_pipeline(struct vpfe_pipeline *pipe)
/* Retrieve the source format */ /* Retrieve the source format */
pad = media_entity_remote_pad(pad); pad = media_entity_remote_pad(pad);
if (pad == NULL || if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
pad->entity->type != MEDIA_ENT_T_V4L2_SUBDEV)
break; break;
subdev = media_entity_to_v4l2_subdev(pad->entity); subdev = media_entity_to_v4l2_subdev(pad->entity);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册