summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom/venus/venc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-04-10 20:10:30 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-10 20:10:30 +0300
commitd36260050e1881dce09625a9352d8729c911a6e3 (patch)
tree4f574d65f6c12bd633daf93e23235312c49fa2ef /drivers/media/platform/qcom/venus/venc.c
parent71219b3494a32b5e1f22c4b1a5be2eb0d5524057 (diff)
parenta95845ba184b854106972f5d8f50354c2d272c06 (diff)
downloadlinux-d36260050e1881dce09625a9352d8729c911a6e3.tar.xz
Merge tag 'media/v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media fixes from Mauro Carvalho Chehab: "A series of media updates/fixes for 4.17. There are two important core fix patches in this series: - A regression fix on Kernel 4.16 with causes it to not work with some input devices that depend on media core - A fix at compat32 bits with causes it to OOPS on overlay, and affects the Kernels where the CVE-2017-13166 was backported The remaining ones are other random fixes at the documentation and on drivers. The biggest part of this series is a set of 18 patches for the Intel atomisp driver. Currently, it produces hundreds of warnings/errors on sparse/smatch, causing me to sometimes ignore new warnings on other drivers that are not so broken. This driver is on really poor state, even for staging standards: it has several layers of abstraction on it, and it supports two different hardware. Selecting between them require to add a define (there isn't even a Kconfig option for such purpose). Just on this smatch cleanup, I could easily get rid of 8 "do-nothing" files. So, I'm seriously considering its removal from upstream, if I don't see any real work on addressing the problems there along this year" * tag 'media/v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (48 commits) media: v4l2-core: fix size of devnode_nums[] bitarray media: v4l2-compat-ioctl32: don't oops on overlay media: i2c: adv748x: afe: fix sparse warning media: extended-controls.rst: transmitter -> receiver media: staging: atomisp: stop duplicating input format types media: staging: atomisp: get rid of an unused var media: staging: atomisp: stop mixing enum types media: staging: atomisp: get rid of some static warnings media: staging: atomisp: use %p to print pointers media: staging: atomisp: remove an useless check media: staging: atomisp: avoid a warning if 32 bits build media: staging: atomisp: don't access a NULL var media: staging: atomisp: Get rid of *default.host.[ch] media: staging: atomisp: get rid of an unused function media: staging: atomisp: remove unused set_pd_base() media: staging: atomisp: fix endianess issues media: staging: atomisp: add a missing include media: staging: atomisp: get rid of stupid statements media: staging: atomisp: declare static vars as such media: staging: atomisp: ia_css_output.host: don't use var before check ...
Diffstat (limited to 'drivers/media/platform/qcom/venus/venc.c')
-rw-r--r--drivers/media/platform/qcom/venus/venc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index e3a10a852cad..6b2ce479584e 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -120,20 +120,21 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type)
return NULL;
for (i = 0; i < size; i++) {
+ bool valid;
+
if (fmt[i].type != type)
continue;
- if (k == index)
+ valid = type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
+ venus_helper_check_codec(inst, fmt[i].pixfmt);
+ if (k == index && valid)
break;
- k++;
+ if (valid)
+ k++;
}
if (i == size)
return NULL;
- if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE &&
- !venus_helper_check_codec(inst, fmt[i].pixfmt))
- return NULL;
-
return &fmt[i];
}