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

Commit 3acce1a1 authored by Shalaj Jain's avatar Shalaj Jain
Browse files

msm: vidc: Change tz version for dynamic buffer feature support



Use scm api to check if tz version is atleast 1.1.0. The tz changes
for assigning hint on map rather than the lock call are present
from that version onwards, which is needed for dynamic buffer
feature support.

Change-Id: I8a463c206f610d5d599d392e2502de307bfb95c0
Signed-off-by: default avatarShalaj Jain <shalajj@codeaurora.org>
parent e5421545
Loading
Loading
Loading
Loading
+10 −15
Original line number Diff line number Diff line
/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -23,13 +23,9 @@
#define MAX_NUM_OUTPUT_BUFFERS VIDEO_MAX_FRAME
#define DEFAULT_VIDEO_CONCEAL_COLOR_BLACK 0x8080

#define TZ_INFO_GET_FEATURE_VERSION_ID 0x3
#define TZ_DYNAMIC_BUFFER_FEATURE_ID 12
#define TZ_FEATURE_VERSION(major, minor, patch) \
	(((major & 0x3FF) << 22) | ((minor & 0x3FF) << 12) | (patch & 0xFFF))
struct tz_get_feature_version {
	u32 feature_id;
};

enum msm_vdec_ctrl_cluster {
	MSM_VDEC_CTRL_CLUSTER_MAX = 1 << 0,
@@ -1759,17 +1755,16 @@ static inline enum buffer_mode_type get_buf_type(int val)
static int check_tz_dynamic_buffer_support(void)
{
	int rc = 0;
	struct tz_get_feature_version tz_feature_id;
	unsigned int resp = 0;

	tz_feature_id.feature_id = TZ_DYNAMIC_BUFFER_FEATURE_ID;
	rc = scm_call(SCM_SVC_INFO,
		  TZ_INFO_GET_FEATURE_VERSION_ID, &tz_feature_id,
		  sizeof(tz_feature_id), &resp, sizeof(resp));
	if ((rc) || (resp != TZ_FEATURE_VERSION(1, 1, 0))) {
	int version = scm_get_feat_version(TZ_DYNAMIC_BUFFER_FEATURE_ID);

	/*
	 * if the version is < 1.1.0 then dynamic buffer allocation is
	 * not supported
	 */
	if (version < TZ_FEATURE_VERSION(1, 1, 0)) {
		dprintk(VIDC_DBG,
			"Dyamic buffer mode not supported, failed to get tz feature version id : %u, rc : %d, response : %u\n",
			tz_feature_id.feature_id, rc, resp);
			"Dynamic buffer mode not supported, tz version is : %u vs required : %u\n",
			version, TZ_FEATURE_VERSION(1, 1, 0));
		rc = -ENOTSUPP;
	}
	return rc;