diff options
author | ayaka <ayaka@soulik.info> | 2014-09-18 15:41:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-26 05:47:47 -0400 |
commit | 7e8fe13dc31d413c77ef1aaf7f7a2a60eab413da (patch) | |
tree | 156bbe796423fb277066032fe442e1aca459e7bf /drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | |
parent | e2c3be2aff3358e485ed307cc3ad11a9c58c086f (diff) |
[media] s5p-mfc: fix enum_fmt for s5p-mfc
As the s5p-mfc is a driver which use multiplanar api, so the
vidioc_enum_fmt_vid serial of ioctl should only for
multiplanar, non-multiplanar shouldn't be implemented at all.
Signed-off-by: ayaka <ayaka@soulik.info>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/s5p-mfc/s5p_mfc_enc.c')
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index 4ebfcd647b72..adffdb37746b 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | |||
@@ -951,17 +951,13 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
951 | } | 951 | } |
952 | 952 | ||
953 | static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f, | 953 | static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f, |
954 | bool mplane, bool out) | 954 | bool out) |
955 | { | 955 | { |
956 | struct s5p_mfc_dev *dev = video_drvdata(file); | 956 | struct s5p_mfc_dev *dev = video_drvdata(file); |
957 | struct s5p_mfc_fmt *fmt; | 957 | struct s5p_mfc_fmt *fmt; |
958 | int i, j = 0; | 958 | int i, j = 0; |
959 | 959 | ||
960 | for (i = 0; i < ARRAY_SIZE(formats); ++i) { | 960 | for (i = 0; i < ARRAY_SIZE(formats); ++i) { |
961 | if (mplane && formats[i].num_planes == 1) | ||
962 | continue; | ||
963 | else if (!mplane && formats[i].num_planes > 1) | ||
964 | continue; | ||
965 | if (out && formats[i].type != MFC_FMT_RAW) | 961 | if (out && formats[i].type != MFC_FMT_RAW) |
966 | continue; | 962 | continue; |
967 | else if (!out && formats[i].type != MFC_FMT_ENC) | 963 | else if (!out && formats[i].type != MFC_FMT_ENC) |
@@ -981,28 +977,16 @@ static int vidioc_enum_fmt(struct file *file, struct v4l2_fmtdesc *f, | |||
981 | return -EINVAL; | 977 | return -EINVAL; |
982 | } | 978 | } |
983 | 979 | ||
984 | static int vidioc_enum_fmt_vid_cap(struct file *file, void *pirv, | ||
985 | struct v4l2_fmtdesc *f) | ||
986 | { | ||
987 | return vidioc_enum_fmt(file, f, false, false); | ||
988 | } | ||
989 | |||
990 | static int vidioc_enum_fmt_vid_cap_mplane(struct file *file, void *pirv, | 980 | static int vidioc_enum_fmt_vid_cap_mplane(struct file *file, void *pirv, |
991 | struct v4l2_fmtdesc *f) | 981 | struct v4l2_fmtdesc *f) |
992 | { | 982 | { |
993 | return vidioc_enum_fmt(file, f, true, false); | 983 | return vidioc_enum_fmt(file, f, false); |
994 | } | ||
995 | |||
996 | static int vidioc_enum_fmt_vid_out(struct file *file, void *prov, | ||
997 | struct v4l2_fmtdesc *f) | ||
998 | { | ||
999 | return vidioc_enum_fmt(file, f, false, true); | ||
1000 | } | 984 | } |
1001 | 985 | ||
1002 | static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *prov, | 986 | static int vidioc_enum_fmt_vid_out_mplane(struct file *file, void *prov, |
1003 | struct v4l2_fmtdesc *f) | 987 | struct v4l2_fmtdesc *f) |
1004 | { | 988 | { |
1005 | return vidioc_enum_fmt(file, f, true, true); | 989 | return vidioc_enum_fmt(file, f, true); |
1006 | } | 990 | } |
1007 | 991 | ||
1008 | static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) | 992 | static int vidioc_g_fmt(struct file *file, void *priv, struct v4l2_format *f) |
@@ -1733,9 +1717,7 @@ static int vidioc_subscribe_event(struct v4l2_fh *fh, | |||
1733 | 1717 | ||
1734 | static const struct v4l2_ioctl_ops s5p_mfc_enc_ioctl_ops = { | 1718 | static const struct v4l2_ioctl_ops s5p_mfc_enc_ioctl_ops = { |
1735 | .vidioc_querycap = vidioc_querycap, | 1719 | .vidioc_querycap = vidioc_querycap, |
1736 | .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap, | ||
1737 | .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane, | 1720 | .vidioc_enum_fmt_vid_cap_mplane = vidioc_enum_fmt_vid_cap_mplane, |
1738 | .vidioc_enum_fmt_vid_out = vidioc_enum_fmt_vid_out, | ||
1739 | .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane, | 1721 | .vidioc_enum_fmt_vid_out_mplane = vidioc_enum_fmt_vid_out_mplane, |
1740 | .vidioc_g_fmt_vid_cap_mplane = vidioc_g_fmt, | 1722 | .vidioc_g_fmt_vid_cap_mplane = vidioc_g_fmt, |
1741 | .vidioc_g_fmt_vid_out_mplane = vidioc_g_fmt, | 1723 | .vidioc_g_fmt_vid_out_mplane = vidioc_g_fmt, |