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

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

Merge "msm: vidc: Add support for dynamic UBWC configuration"

parents 12f893da 0f8d18c1
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, 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
@@ -2102,6 +2102,32 @@ int create_pkt_cmd_sys_image_version(
	return 0;
}

int create_pkt_cmd_sys_ubwc_config(struct hfi_cmd_sys_set_property_packet *pkt,
		struct msm_vidc_ubwc_config *config)
{
	struct msm_vidc_ubwc_config *hfi;

	if (!pkt) {
		dprintk(VIDC_ERR, "%s invalid param :%pK\n", __func__, pkt);
		return -EINVAL;
	}

	pkt->size = sizeof(struct hfi_cmd_sys_set_property_packet) +
		sizeof(struct msm_vidc_ubwc_config) + sizeof(u32);
	pkt->packet_type = HFI_CMD_SYS_SET_PROPERTY;
	pkt->num_properties = 1;
	pkt->rg_property_data[0] = HFI_PROPERTY_SYS_UBWC_CONFIG;
	hfi = (struct msm_vidc_ubwc_config *) &pkt->rg_property_data[1];
	hfi->sOverrideBitInfo.bMalLengthOverride =
			config->sOverrideBitInfo.bMalLengthOverride;
	hfi->nMalLength = config->nMalLength;
	dprintk(VIDC_DBG,
			"UBWC settings Mal Length Override : %u MalLength: %u",
			hfi->sOverrideBitInfo.bMalLengthOverride,
			hfi->nMalLength);
	return 0;
}

int create_pkt_cmd_session_sync_process(
		struct hfi_cmd_session_sync_process_packet *pkt,
		struct hal_session *session)
@@ -2129,6 +2155,7 @@ static struct hfi_packetization_ops hfi_default = {
	.sys_ping = create_pkt_cmd_sys_ping,
	.sys_image_version = create_pkt_cmd_sys_image_version,
	.ssr_cmd = create_pkt_ssr_cmd,
	.sys_ubwc_config = create_pkt_cmd_sys_ubwc_config,
	.session_init = create_pkt_cmd_sys_session_init,
	.session_cmd = create_pkt_cmd_session_cmd,
	.session_set_buffers = create_pkt_cmd_session_set_buffers,
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, 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
@@ -46,6 +46,8 @@ struct hfi_packetization_ops {
	int (*sys_image_version)(struct hfi_cmd_sys_get_property_packet *pkt);
	int (*ssr_cmd)(enum hal_ssr_trigger_type type,
		struct hfi_cmd_sys_test_ssr_packet *pkt);
	int (*sys_ubwc_config)(struct hfi_cmd_sys_set_property_packet *pkt,
			struct msm_vidc_ubwc_config *config);
	int (*session_init)(
		struct hfi_cmd_sys_session_init_packet *pkt,
		struct hal_session *session,
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, 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
@@ -241,6 +241,8 @@ struct msm_vidc_platform_data {
	struct msm_vidc_csc_coeff csc_data;
	struct msm_vidc_efuse_data *efuse_data;
	unsigned int efuse_data_length;
	struct msm_vidc_ubwc_config *ubwc_config;
	unsigned int ubwc_config_length;
	unsigned int sku_version;
	phys_addr_t gcc_register_base;
	uint32_t gcc_register_size;
+31 −0
Original line number Diff line number Diff line
@@ -36,6 +36,19 @@
	.low_power_cycles = lp	\
}

#define UBWC_CONFIG(mco, mlo, hbbo, rs1, mc, ml, hbb, rs2) \
{	\
	.sOverrideBitInfo.bMaxChannelsOverride = mc,	\
	.sOverrideBitInfo.bMalLengthOverride = mlo,	\
	.sOverrideBitInfo.bHBBOverride = hbbo,	\
	.sOverrideBitInfo.reserved1 = rs1,	\
	.nMaxChannels = mc,	\
	.nMalLength = ml,	\
	.nHighestBankBit = hbb,	\
	.reserved2 = {rs2}	\
}


#define EFUSE_ENTRY(sa, s, m, sh, p) \
{	\
	.start_address = sa,		\
@@ -660,11 +673,17 @@ static struct msm_vidc_efuse_data sdmmagpie_efuse_data[] = {
	EFUSE_ENTRY(0x00786018, 4, 0x00000400, 0x0a, SKU_VERSION),
};

static struct msm_vidc_ubwc_config trinket_ubwc_data[] = {
	UBWC_CONFIG(0, 1, 0, 0, 0, 64, 0, 0),
};

static struct msm_vidc_platform_data default_data = {
	.codec_data = default_codec_data,
	.codec_data_length =  ARRAY_SIZE(default_codec_data),
	.common_data = default_common_data,
	.common_data_length =  ARRAY_SIZE(default_common_data),
	.ubwc_config = 0,
	.ubwc_config_length = 0,
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
@@ -681,6 +700,8 @@ static struct msm_vidc_platform_data sm6150_data = {
	.codec_data_length =  ARRAY_SIZE(sm6150_codec_data),
	.common_data = sm6150_common_data,
	.common_data_length =  ARRAY_SIZE(sm6150_common_data),
	.ubwc_config = 0,
	.ubwc_config_length = 0,
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
@@ -697,6 +718,8 @@ static struct msm_vidc_platform_data trinket_data = {
	.codec_data_length =  ARRAY_SIZE(trinket_codec_data),
	.common_data = trinket_common_data,
	.common_data_length =  ARRAY_SIZE(trinket_common_data),
	.ubwc_config = trinket_ubwc_data,
	.ubwc_config_length = ARRAY_SIZE(trinket_ubwc_data),
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
@@ -713,6 +736,8 @@ static struct msm_vidc_platform_data sm8150_data = {
	.codec_data_length =  ARRAY_SIZE(sm8150_codec_data),
	.common_data = sm8150_common_data,
	.common_data_length =  ARRAY_SIZE(sm8150_common_data),
	.ubwc_config = 0,
	.ubwc_config_length = 0,
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
@@ -729,6 +754,8 @@ static struct msm_vidc_platform_data sdmmagpie_data = {
	.codec_data_length =  ARRAY_SIZE(sdmmagpie_codec_data),
	.common_data = sdmmagpie_common_data_v0,
	.common_data_length =  ARRAY_SIZE(sdmmagpie_common_data_v0),
	.ubwc_config = 0,
	.ubwc_config_length = 0,
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
@@ -745,6 +772,8 @@ static struct msm_vidc_platform_data sdm845_data = {
	.codec_data_length =  ARRAY_SIZE(sdm845_codec_data),
	.common_data = sdm845_common_data,
	.common_data_length =  ARRAY_SIZE(sdm845_common_data),
	.ubwc_config = 0,
	.ubwc_config_length = 0,
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
@@ -761,6 +790,8 @@ static struct msm_vidc_platform_data sdm670_data = {
	.codec_data_length =  ARRAY_SIZE(sdm670_codec_data),
	.common_data = sdm670_common_data_v0,
	.common_data_length =  ARRAY_SIZE(sdm670_common_data_v0),
	.ubwc_config = 0,
	.ubwc_config_length = 0,
	.csc_data.vpe_csc_custom_bias_coeff = vpe_csc_custom_bias_coeff,
	.csc_data.vpe_csc_custom_matrix_coeff = vpe_csc_custom_matrix_coeff,
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, 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
@@ -810,6 +810,10 @@ int read_platform_resources_from_drv_data(
	res->gcc_register_size = platform_data->gcc_register_size;

	res->vpu_ver = platform_data->vpu_ver;

	res->ubwc_config = platform_data->ubwc_config;
	res->ubwc_config_length = platform_data->ubwc_config_length;

	return rc;

}
Loading