Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa1c4131 authored by Qiwei Liu's avatar Qiwei Liu Committed by Sanjay Singh
Browse files

msm: vidc: enable hdr10 sei only when client set it



For HLG HDR recording, client won't set HDR10 SEI,
and driver shouldn't set this info to firmware either.
Otherwise some applications may have wrong behavior
when HDR10 SEI is present in HLG clips.

Change-Id: I7a054ded39e3b9309d823e97da039f0de1bcde9d
Signed-off-by: default avatarQiwei Liu <qiweil@codeaurora.org>
Signed-off-by: default avatarSanjay Singh <sisanj@codeaurora.org>
parent f31d17c6
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 */
 */
#include <linux/slab.h>
#include <linux/slab.h>
#include "msm_venc.h"
#include "msm_venc.h"
@@ -1205,6 +1205,7 @@ int msm_venc_inst_init(struct msm_vidc_inst *inst)
	inst->buff_req.buffer[13].buffer_type = HAL_BUFFER_INTERNAL_RECON;
	inst->buff_req.buffer[13].buffer_type = HAL_BUFFER_INTERNAL_RECON;
	msm_vidc_init_buffer_size_calculators(inst);
	msm_vidc_init_buffer_size_calculators(inst);
	inst->static_rotation_flip_enabled = false;
	inst->static_rotation_flip_enabled = false;
	inst->hdr10_sei_enabled = false;
	return rc;
	return rc;
}
}


@@ -1699,6 +1700,7 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
		u32 info_type = ((u32)ctrl->val >> 28) & 0xF;
		u32 info_type = ((u32)ctrl->val >> 28) & 0xF;
		u32 val = (ctrl->val & 0xFFFFFFF);
		u32 val = (ctrl->val & 0xFFFFFFF);


		inst->hdr10_sei_enabled = true;
		s_vpr_h(sid, "Ctrl:%d, HDR Info with value %u (%#X)",
		s_vpr_h(sid, "Ctrl:%d, HDR Info with value %u (%#X)",
				info_type, val, ctrl->val);
				info_type, val, ctrl->val);
		switch (info_type) {
		switch (info_type) {
@@ -4383,7 +4385,8 @@ int msm_venc_set_hdr_info(struct msm_vidc_inst *inst)
	}
	}
	hdev = inst->core->device;
	hdev = inst->core->device;


	if (get_v4l2_codec(inst) != V4L2_PIX_FMT_HEVC)
	if (get_v4l2_codec(inst) != V4L2_PIX_FMT_HEVC ||
		!inst->hdr10_sei_enabled)
		return 0;
		return 0;


	profile = get_ctrl(inst, V4L2_CID_MPEG_VIDEO_HEVC_PROFILE);
	profile = get_ctrl(inst, V4L2_CID_MPEG_VIDEO_HEVC_PROFILE);
+1 −0
Original line number Original line Diff line number Diff line
@@ -551,6 +551,7 @@ struct msm_vidc_inst {
	bool static_rotation_flip_enabled;
	bool static_rotation_flip_enabled;
	struct internal_buf *dpb_extra_binfo;
	struct internal_buf *dpb_extra_binfo;
	struct msm_vidc_codec_data *codec_data;
	struct msm_vidc_codec_data *codec_data;
	bool hdr10_sei_enabled;
	struct hal_hdr10_pq_sei hdr10_sei_params;
	struct hal_hdr10_pq_sei hdr10_sei_params;
	struct batch_mode batch;
	struct batch_mode batch;
	struct delayed_work batch_work;
	struct delayed_work batch_work;