media: venus: keep resolution when adjusting format
authorAlexandre Courbot <acourbot@chromium.org>
Tue, 5 Jun 2018 04:50:46 +0000 (00:50 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 28 Jun 2018 11:55:10 +0000 (07:55 -0400)
When checking a format for validity, the resolution is reset to 1280x720
whenever the pixel format is not supported. This behavior can mislead
user-space into believing that this is the only resolution supported,
and looks strange considering that if we try/set the same format with
just the pixel format changed to a valid one, the call will this time
succeed without altering the resolution.

Resolution is managed independently of the pixel format, so remove this
reset.

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/qcom/venus/vdec.c
drivers/media/platform/qcom/venus/venc.c

index 49bbd1861d3a3f5d289825ff4e76921d7eaf0ce1..f89a91d43cc9938c6b1cf800ed50581825a4cfc4 100644 (file)
@@ -173,8 +173,6 @@ vdec_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f)
                else
                        return NULL;
                fmt = find_format(inst, pixmp->pixelformat, f->type);
-               pixmp->width = 1280;
-               pixmp->height = 720;
        }
 
        pixmp->width = clamp(pixmp->width, inst->cap_width.min,
index 6b2ce479584e9123af085aed83a2b5aa052050c8..11dafc7848c5c4edddc12873bfee2a14a551bb9e 100644 (file)
@@ -297,8 +297,6 @@ venc_try_fmt_common(struct venus_inst *inst, struct v4l2_format *f)
                else
                        return NULL;
                fmt = find_format(inst, pixmp->pixelformat, f->type);
-               pixmp->width = 1280;
-               pixmp->height = 720;
        }
 
        pixmp->width = clamp(pixmp->width, inst->cap_width.min,