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

Commit f582fb49 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Enable decode batching in kona"

parents 2a96cfe0 83a2e875
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -882,10 +882,7 @@ static inline int start_streaming(struct msm_vidc_inst *inst)
		}
	}

	if (is_batching_allowed(inst))
		inst->batch.enable = true;
	else
		inst->batch.enable = false;
	inst->batch.enable = is_batching_allowed(inst);
	dprintk(VIDC_DBG, "%s: batching %s for inst %pK (%#x)\n",
		__func__, inst->batch.enable ? "enabled" : "disabled",
		inst, hash32_ptr(inst->session));
+15 −26
Original line number Diff line number Diff line
@@ -2780,37 +2780,26 @@ static bool is_thermal_permissible(struct msm_vidc_core *core)

bool is_batching_allowed(struct msm_vidc_inst *inst)
{
	bool allowed = false;
	struct v4l2_format *out_f;
	struct v4l2_format *inp_f;
	u32 op_pixelformat, fps, maxmbs, maxfps;

	if (!inst || !inst->core)
		return false;

	/*
	 * Enable decode batching based on below conditions
	 * - platform supports batching
	 * - decode session and H264/HEVC/VP9 format
	 * - session resolution <= 1080p
	 * - low latency not enabled
	 * - not a thumbnail session
	 * - UBWC color format
	 */
	inp_f = &inst->fmts[INPUT_PORT].v4l2_fmt;
	out_f = &inst->fmts[OUTPUT_PORT].v4l2_fmt;
	if (inst->core->resources.decode_batching && is_decode_session(inst) &&
		(inp_f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_H264 ||
		inp_f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_HEVC ||
		inp_f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_VP9) &&
		(msm_vidc_get_mbs_per_frame(inst) <=
		NUM_MBS_PER_FRAME(MAX_DEC_BATCH_HEIGHT, MAX_DEC_BATCH_WIDTH)) &&
		!inst->clk_data.low_latency_mode &&
		!is_thumbnail_session(inst) &&
		(out_f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12_UBWC ||
		out_f->fmt.pix_mp.pixelformat == V4L2_PIX_FMT_NV12_TP10_UBWC))
		allowed = true;
	/* Enable decode batching based on below conditions */
	op_pixelformat =
		inst->fmts[OUTPUT_PORT].v4l2_fmt.fmt.pix_mp.pixelformat;
	fps = inst->clk_data.frame_rate >> 16;
	maxmbs = inst->capability.cap[CAP_BATCH_MAX_MB_PER_FRAME].max;
	maxfps = inst->capability.cap[CAP_BATCH_MAX_FPS].max;

	return allowed;
	return (inst->core->resources.decode_batching &&
		is_decode_session(inst) &&
		!is_thumbnail_session(inst) &&
		!inst->clk_data.low_latency_mode &&
		(op_pixelformat == V4L2_PIX_FMT_NV12_UBWC ||
		 op_pixelformat	== V4L2_PIX_FMT_NV12_TP10_UBWC) &&
		fps <= maxfps &&
		msm_vidc_get_mbs_per_frame(inst) <= maxmbs);
}

static int msm_comm_session_abort(struct msm_vidc_inst *inst)
+0 −2
Original line number Diff line number Diff line
@@ -9,8 +9,6 @@
#include "msm_vidc_debug.h"

#define MAX_DEC_BATCH_SIZE                     6
#define MAX_DEC_BATCH_WIDTH                    1920
#define MAX_DEC_BATCH_HEIGHT                   1088
#define SKIP_BATCH_WINDOW                      100
#define MIN_FRAME_QUALITY 0
#define MAX_FRAME_QUALITY 100
+7 −3
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static struct msm_vidc_codec default_codecs[] = {
};

static struct msm_vidc_codec_capability kona_capabilities[] = {
	/* {cap_type, min, max, step_size, default_value, domains, codecs} */
	/* {cap_type, domains, codecs, min, max, step_size, default_value,} */
	{CAP_FRAME_WIDTH, DOMAINS_ALL, CODECS_ALL, 128, 8192, 1, 1920},
	{CAP_FRAME_HEIGHT, DOMAINS_ALL, CODECS_ALL, 128, 8192, 1, 1080},
	/* (8192 * 4320) / 256 */
@@ -213,6 +213,11 @@ static struct msm_vidc_codec_capability kona_capabilities[] = {
	/* (4096 * 2304) / 256 */
	{CAP_SECURE_MBS_PER_FRAME, DOMAINS_ALL, CODECS_ALL, 1, 36864, 1, 36864},
	{CAP_SECURE_BITRATE, DOMAINS_ALL, CODECS_ALL, 1, 40000000, 1, 20000000},

	/* Batch Mode Decode */
	{CAP_BATCH_MAX_MB_PER_FRAME, DEC, CODECS_ALL, 128, 34560, 1, 34560},
	/* (4096 * 2160) / 256 */
	{CAP_BATCH_MAX_FPS, DEC, CODECS_ALL, 1, 120, 1, 120},
};

/*
@@ -386,7 +391,6 @@ static struct msm_vidc_common_data lito_common_data_v1[] = {
	},
};

/* Update with kona */
static struct msm_vidc_common_data kona_common_data[] = {
	{
		.key = "qcom,never-unload-fw",
@@ -446,7 +450,7 @@ static struct msm_vidc_common_data kona_common_data[] = {
	},
	{
		.key = "qcom,decode-batching",
		.value = 0,
		.value = 1,
	},
	{
		.key = "qcom,dcvs",
+2 −0
Original line number Diff line number Diff line
@@ -278,6 +278,8 @@ enum hal_capability {
	CAP_SECURE_FRAME_HEIGHT,
	CAP_SECURE_MBS_PER_FRAME,
	CAP_SECURE_BITRATE,
	CAP_BATCH_MAX_MB_PER_FRAME,
	CAP_BATCH_MAX_FPS,
	CAP_MAX,
};