aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDikshita Agarwal <dikshita@codeaurora.org>2020-12-16 12:36:50 +0530
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2021-02-01 15:01:11 +0000
commit5a663a6bd5fbafb8fc3f8356346674f97edc3e08 (patch)
treed5ad4e156902957421f002d844be7c1c6ec4dca7
parentc5eb44687e6e14fd453873c67d17ef1acb6541c5 (diff)
venus: venc: set IDR period to FW only for H264 & HEVCtracking-qcomlt-sm8250-venus-in-linux-next
HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD is supported for only H264 & HEVC codec. There is no need to set it for VP8 since all key frames are treated as IDR frames for VP8. Signed-off-by: Dikshita Agarwal <dikshita@codeaurora.org> Reviewed-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
-rw-r--r--drivers/media/platform/qcom/venus/venc.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index c04474afd812..6976ed553647 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -598,16 +598,19 @@ static int venc_set_properties(struct venus_inst *inst)
return ret;
}
- /* IDR periodicity, n:
- * n = 0 - only the first I-frame is IDR frame
- * n = 1 - all I-frames will be IDR frames
- * n > 1 - every n-th I-frame will be IDR frame
- */
- ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;
- idrp.idr_period = 0;
- ret = hfi_session_set_property(inst, ptype, &idrp);
- if (ret)
- return ret;
+ if (inst->fmt_cap->pixfmt == V4L2_PIX_FMT_H264 ||
+ inst->fmt_cap->pixfmt == V4L2_PIX_FMT_HEVC) {
+ /* IDR periodicity, n:
+ * n = 0 - only the first I-frame is IDR frame
+ * n = 1 - all I-frames will be IDR frames
+ * n > 1 - every n-th I-frame will be IDR frame
+ */
+ ptype = HFI_PROPERTY_CONFIG_VENC_IDR_PERIOD;
+ idrp.idr_period = 0;
+ ret = hfi_session_set_property(inst, ptype, &idrp);
+ if (ret)
+ return ret;
+ }
if (ctr->num_b_frames) {
u32 max_num_b_frames = NUM_B_FRAMES_MAX;