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: Srinu Gorle <sgorle@codeaurora.org>
This commit is contained in:
Rudra Venkatesh(Temp) 2020-09-10 13:41:34 +05:30 • committed by Srinu Gorle
commit 06545143b8
4 changed files with 57 additions and 3 deletions

View file

@ -1,4 +1,4 @@
/* 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,

View file

@ -1,4 +1,4 @@
/* 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)(

View file

@ -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)) {

View file

@ -1,4 +1,4 @@
/* 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;