Skip to content

Commit b4cb178

Browse files
Dikshita Agarwalgregkh
authored andcommitted
media: iris: Update CAPTURE format info based on OUTPUT format
commit 8aadfd4 upstream. Update the width, height and buffer size of CAPTURE based on the resolution set to OUTPUT via VIDIOC_S_FMT. This is required to set the updated capture resolution to firmware when S_FMT is called only for OUTPUT. Cc: stable@vger.kernel.org Fixes: b530b95 ("media: iris: implement s_fmt, g_fmt and try_fmt ioctls") Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Acked-by: Vikash Garodia <quic_vgarodia@quicinc.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-HDK Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Tested-by: Vikash Garodia <quic_vgarodia@quicinc.com> # on sa8775p-ride Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7309f62 commit b4cb178

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/media/platform/qcom/iris/iris_vdec.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f)
171171
output_fmt->fmt.pix_mp.ycbcr_enc = f->fmt.pix_mp.ycbcr_enc;
172172
output_fmt->fmt.pix_mp.quantization = f->fmt.pix_mp.quantization;
173173

174+
/* Update capture format based on new ip w/h */
175+
output_fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
176+
output_fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
177+
inst->buffers[BUF_OUTPUT].size = iris_get_buffer_size(inst, BUF_OUTPUT);
178+
174179
inst->crop.left = 0;
175180
inst->crop.top = 0;
176181
inst->crop.width = f->fmt.pix_mp.width;

0 commit comments

Comments
 (0)