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

Commit 06545143 authored by Rudra Venkatesh(Temp)'s avatar Rudra Venkatesh(Temp) Committed by Srinu Gorle
Browse files

msm: Changes to support 7.6k resolution feature



-Add HFI changes to firmware to set the 7.6k resolution

Change-Id: Ic7825d45648418c26744822a25096e38123fad58
Signed-off-by: default avatarSrinu Gorle <sgorle@codeaurora.org>
parent f8aaea46
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, 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
@@ -302,7 +302,26 @@ int create_pkt_cmd_sys_debug_config(
		hfi->debug_mode = msm_vidc_fw_debug_mode;
	return 0;
}
static int create_pkt_cmd_sys_feature_config_packet(
			struct hfi_cmd_sys_set_property_packet *pkt)
{
	struct hfi_feature_config *hfi;

	if (!pkt)
		return -EINVAL;

	pkt->size = sizeof(struct hfi_cmd_sys_set_property_packet) +
		sizeof(struct hfi_feature_config) + sizeof(u32);
	pkt->packet_type = HFI_CMD_SYS_SET_PROPERTY;
	pkt->num_properties = 1;
	pkt->rg_property_data[0] = HFI_PROPERTY_SYS_FEATURE_CONFIG;

	hfi = (struct hfi_feature_config *) &pkt->rg_property_data[1];
	hfi->enable_maxdec_resolution = 0;
	hfi->enable_maxenc_resolution = 1;
	hfi->reserved = 0;
	return 0;
}
int create_pkt_cmd_sys_coverage_config(
	struct hfi_cmd_sys_set_property_packet *pkt,
	u32 mode)
@@ -2085,6 +2104,7 @@ static struct hfi_packetization_ops hfi_default = {
	.sys_release_resource = create_pkt_cmd_sys_release_resource,
	.sys_ping = create_pkt_cmd_sys_ping,
	.sys_image_version = create_pkt_cmd_sys_image_version,
	.sys_feature_config = create_pkt_cmd_sys_feature_config_packet,
	.ssr_cmd = create_pkt_ssr_cmd,
	.session_init = create_pkt_cmd_sys_session_init,
	.session_cmd = create_pkt_cmd_session_cmd,
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, 2020 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
@@ -39,6 +39,7 @@ struct hfi_packetization_ops {
		void *resource_value);
	int (*sys_debug_config)(struct hfi_cmd_sys_set_property_packet *pkt,
			u32 mode);
	int (*sys_feature_config)(struct hfi_cmd_sys_set_property_packet *pkt);
	int (*sys_coverage_config)(struct hfi_cmd_sys_set_property_packet *pkt,
			u32 mode);
	int (*sys_release_resource)(
+17 −0
Original line number Diff line number Diff line
@@ -2093,6 +2093,7 @@ static int venus_hfi_session_init(void *device, void *session_id,
		void **new_session)
{
	struct hfi_cmd_sys_session_init_packet pkt;
	struct hfi_cmd_sys_set_property_packet feature_pkt;
	struct venus_hfi_device *dev;
	struct hal_session *s;

@@ -2122,6 +2123,22 @@ static int venus_hfi_session_init(void *device, void *session_id,
	list_add_tail(&s->list, &dev->sess_head);

	__set_default_sys_properties(device);
	if (dev->res) {
		if (dev->res->enable_max_resolution) {
			if (call_hfi_pkt_op(dev, sys_feature_config,
				&feature_pkt)) {
				dprintk(VIDC_ERR,
					"Failed to create feature config pkt\n");
				goto err_session_init_fail;
			}

			if (__iface_cmdq_write(dev, &feature_pkt)) {
				dprintk(VIDC_WARN,
					"Failed to set max resolutionfeature in f/w\n");
				goto err_session_init_fail;
			}
		}
	}

	if (call_hfi_pkt_op(dev, session_init, &pkt,
			s, session_type, codec_type)) {
+17 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2020, 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
@@ -199,6 +199,8 @@ struct hfi_buffer_info {
	(HFI_PROPERTY_SYS_COMMON_START + 0x006)
#define  HFI_PROPERTY_SYS_CONFIG_COVERAGE    \
	(HFI_PROPERTY_SYS_COMMON_START + 0x007)
#define HFI_PROPERTY_SYS_FEATURE_CONFIG		\
	(HFI_PROPERTY_SYS_COMMON_START + 0x009)

#define HFI_PROPERTY_PARAM_COMMON_START	\
	(HFI_DOMAIN_BASE_COMMON + HFI_ARCH_COMMON_OFFSET + 0x1000)
@@ -459,6 +461,20 @@ struct hfi_debug_config {
	u32 debug_config;
	u32 debug_mode;
};
struct hfi_feature_config {
	/* Set 1 to enable max resolution (hardcoded in FW)
	 * decoder support
	 */
	u32 enable_maxdec_resolution : 1;
	/* Set 1 to enable max resolution (hardcoded in FW)
	 * encoder support
	 */
	u32 enable_maxenc_resolution : 1;
	/* Must be set to 0, otherwise other fields will
	 * be ignored
	 */
	u32 reserved : 30;
};

struct hfi_enable {
	u32 enable;