Commit 311673ee authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vpif_display: move output_id to channel_obj

The output index does not belong to video_obj, it belongs to
channel_obj. Also rename to output_idx to be consistent with
the input_idx name used in vpif_capture.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarLad, Prabhakar <prabhakar.lad@ti.com>
Tested-by: default avatarLad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6f47c6c6
...@@ -1231,7 +1231,6 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) ...@@ -1231,7 +1231,6 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i)
{ {
struct vpif_fh *fh = priv; struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel; struct channel_obj *ch = fh->channel;
struct video_obj *vid_ch = &ch->video;
struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX];
int ret = 0; int ret = 0;
...@@ -1246,7 +1245,7 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i) ...@@ -1246,7 +1245,7 @@ static int vpif_s_output(struct file *file, void *priv, unsigned int i)
if (ret < 0) if (ret < 0)
vpif_err("Failed to set output standard\n"); vpif_err("Failed to set output standard\n");
vid_ch->output_id = i; ch->output_idx = i;
return ret; return ret;
} }
...@@ -1254,9 +1253,8 @@ static int vpif_g_output(struct file *file, void *priv, unsigned int *i) ...@@ -1254,9 +1253,8 @@ static int vpif_g_output(struct file *file, void *priv, unsigned int *i)
{ {
struct vpif_fh *fh = priv; struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel; struct channel_obj *ch = fh->channel;
struct video_obj *vid_ch = &ch->video;
*i = vid_ch->output_id; *i = ch->output_idx;
return 0; return 0;
} }
...@@ -1291,9 +1289,8 @@ vpif_enum_dv_timings(struct file *file, void *priv, ...@@ -1291,9 +1289,8 @@ vpif_enum_dv_timings(struct file *file, void *priv,
{ {
struct vpif_fh *fh = priv; struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel; struct channel_obj *ch = fh->channel;
struct video_obj *vid_ch = &ch->video;
return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], return v4l2_subdev_call(vpif_obj.sd[ch->output_idx],
video, enum_dv_timings, timings); video, enum_dv_timings, timings);
} }
...@@ -1320,7 +1317,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv, ...@@ -1320,7 +1317,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
} }
/* Configure subdevice timings, if any */ /* Configure subdevice timings, if any */
ret = v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], ret = v4l2_subdev_call(vpif_obj.sd[ch->output_idx],
video, s_dv_timings, timings); video, s_dv_timings, timings);
if (ret == -ENOIOCTLCMD) { if (ret == -ENOIOCTLCMD) {
vpif_dbg(2, debug, "Custom DV timings not supported by " vpif_dbg(2, debug, "Custom DV timings not supported by "
...@@ -1451,9 +1448,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv, ...@@ -1451,9 +1448,8 @@ static int vpif_dbg_g_register(struct file *file, void *priv,
struct v4l2_dbg_register *reg){ struct v4l2_dbg_register *reg){
struct vpif_fh *fh = priv; struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel; struct channel_obj *ch = fh->channel;
struct video_obj *vid_ch = &ch->video;
return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core,
g_register, reg); g_register, reg);
} }
...@@ -1470,9 +1466,8 @@ static int vpif_dbg_s_register(struct file *file, void *priv, ...@@ -1470,9 +1466,8 @@ static int vpif_dbg_s_register(struct file *file, void *priv,
struct v4l2_dbg_register *reg){ struct v4l2_dbg_register *reg){
struct vpif_fh *fh = priv; struct vpif_fh *fh = priv;
struct channel_obj *ch = fh->channel; struct channel_obj *ch = fh->channel;
struct video_obj *vid_ch = &ch->video;
return v4l2_subdev_call(vpif_obj.sd[vid_ch->output_id], core, return v4l2_subdev_call(vpif_obj.sd[ch->output_idx], core,
s_register, reg); s_register, reg);
} }
#endif #endif
......
...@@ -62,7 +62,6 @@ struct video_obj { ...@@ -62,7 +62,6 @@ struct video_obj {
v4l2_std_id stdid; /* Currently selected or default v4l2_std_id stdid; /* Currently selected or default
* standard */ * standard */
struct v4l2_dv_timings dv_timings; struct v4l2_dv_timings dv_timings;
u32 output_id; /* Current output id */
}; };
struct vpif_disp_buffer { struct vpif_disp_buffer {
...@@ -125,6 +124,7 @@ struct channel_obj { ...@@ -125,6 +124,7 @@ struct channel_obj {
* which is being displayed */ * which is being displayed */
u8 initialized; /* flag to indicate whether u8 initialized; /* flag to indicate whether
* encoder is initialized */ * encoder is initialized */
u32 output_idx; /* Current output index */
enum vpif_channel_id channel_id;/* Identifies channel */ enum vpif_channel_id channel_id;/* Identifies channel */
struct vpif_params vpifparams; struct vpif_params vpifparams;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment