Merge remote-tracking branch 'sm8350/lineage-20' into lineage-23.2

* sm8350/lineage-20: (306 commits)
  ANDROID: gki_defconfig: reduce KFENCE pool size
  ANDROID: GKI: enable KFENCE by setting the sample interval to 500ms
  ANDROID: GKI: Enable KFENCE
  UPSTREAM: random: split initialization into early step and later step
  UPSTREAM: kfence: avoid passing -g for test
  UPSTREAM: net: add and use skb_unclone_keeptruesize() helper
  UPSTREAM: kfence: fix memory leak when cat kfence objects
  UPSTREAM: kfence: unconditionally use unbound work queue
  UPSTREAM: kfence: use TASK_IDLE when awaiting allocation
  UPSTREAM: kfence: fix is_kfence_address() for addresses below KFENCE_POOL_SIZE
  FROMLIST: kfence: skip all GFP_ZONEMASK allocations
  FROMLIST: kfence: move the size check to the beginning of __kfence_alloc()
  ANDROID: kasan: fix interoperability with KFENCE
  UPSTREAM: arm64: mm: don't use CON and BLK mapping if KFENCE is enabled
  ANDROID: kfence: clean up unused variables
  FROMGIT: kfence: use power-efficient work queue to run delayed work
  FROMGIT: kfence: maximize allocation wait timeout duration
  FROMGIT: kfence: await for allocation using wait_event
  FROMGIT: kfence: zero guard page after out-of-bounds access
  UPSTREAM: kfence: make compatible with kmemleak
  ...

Change-Id: Id1436b77692839dc2394f500bba42487fac1b2b4
This commit is contained in:
Michael Bestas 2026-05-07 18:19:43 +03:00
commit 376925d57f
No known key found for this signature in database
209 changed files with 10117 additions and 1291 deletions

View file

@ -3381,35 +3381,35 @@ static const struct snd_soc_dapm_widget wcd938x_dapm_widgets[] = {
SND_SOC_DAPM_MIXER_E("ADC4_MIXER", SND_SOC_NOPM, ADC4, 0, adc4_switch,
ARRAY_SIZE(adc4_switch), wcd938x_tx_swr_ctrl,
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC1_MIXER", SND_SOC_NOPM, DMIC1,
SND_SOC_DAPM_MIXER_E("DMIC1_MIXER", SND_SOC_NOPM, DMIC0,
0, dmic1_switch, ARRAY_SIZE(dmic1_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC2_MIXER", SND_SOC_NOPM, DMIC2,
SND_SOC_DAPM_MIXER_E("DMIC2_MIXER", SND_SOC_NOPM, DMIC1,
0, dmic2_switch, ARRAY_SIZE(dmic2_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC3_MIXER", SND_SOC_NOPM, DMIC3,
SND_SOC_DAPM_MIXER_E("DMIC3_MIXER", SND_SOC_NOPM, DMIC2,
0, dmic3_switch, ARRAY_SIZE(dmic3_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC4_MIXER", SND_SOC_NOPM, DMIC4,
SND_SOC_DAPM_MIXER_E("DMIC4_MIXER", SND_SOC_NOPM, DMIC3,
0, dmic4_switch, ARRAY_SIZE(dmic4_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC5_MIXER", SND_SOC_NOPM, DMIC5,
SND_SOC_DAPM_MIXER_E("DMIC5_MIXER", SND_SOC_NOPM, DMIC4,
0, dmic5_switch, ARRAY_SIZE(dmic5_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC6_MIXER", SND_SOC_NOPM, DMIC6,
SND_SOC_DAPM_MIXER_E("DMIC6_MIXER", SND_SOC_NOPM, DMIC5,
0, dmic6_switch, ARRAY_SIZE(dmic6_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC7_MIXER", SND_SOC_NOPM, DMIC7,
SND_SOC_DAPM_MIXER_E("DMIC7_MIXER", SND_SOC_NOPM, DMIC6,
0, dmic7_switch, ARRAY_SIZE(dmic7_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_MIXER_E("DMIC8_MIXER", SND_SOC_NOPM, DMIC8,
SND_SOC_DAPM_MIXER_E("DMIC8_MIXER", SND_SOC_NOPM, DMIC7,
0, dmic8_switch, ARRAY_SIZE(dmic8_switch),
wcd938x_tx_swr_ctrl, SND_SOC_DAPM_PRE_PMU |
SND_SOC_DAPM_POST_PMD),

View file

@ -75,8 +75,8 @@ static struct port_params tx_frame_params_default[SWR_MSTR_PORT_LEN] = {
/* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */
static struct port_params tx_frame_params_shima[SWR_MSTR_PORT_LEN] = {
{3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX1 */
{7, 5, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
{7, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX3 */
{7, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0x00, 0x00}, /* TX2 */
{7, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0x00, 0x00}, /* TX3 */
};
/* 4.8 MHz clock */

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/slab.h>
@ -1091,7 +1092,7 @@ int msm_audio_effects_popless_eq_handler(struct audio_client *ac,
u32 packed_data_size = 0;
u8 *eq_config_data = NULL;
u32 *updt_config_data = NULL;
int config_param_length;
int config_param_length, prev_config_param_length = 0;
pr_debug("%s\n", __func__);
if (!ac || (devices == -EINVAL) || (num_commands == -EINVAL)) {
@ -1211,7 +1212,12 @@ int msm_audio_effects_popless_eq_handler(struct audio_client *ac,
if (!eq_config_data)
eq_config_data = kzalloc(config_param_length,
GFP_KERNEL);
else
else if (config_param_length != prev_config_param_length) {
if (eq_config_data)
kfree(eq_config_data);
eq_config_data = kzalloc(config_param_length,
GFP_KERNEL);
} else
memset(eq_config_data, 0, config_param_length);
if (!eq_config_data) {
pr_err("%s, EQ_CONFIG:memory alloc failed\n",
@ -1238,6 +1244,7 @@ int msm_audio_effects_popless_eq_handler(struct audio_client *ac,
*updt_config_data++ =
eq->per_band_cfg[idx].band_idx;
}
prev_config_param_length = config_param_length;
break;
case EQ_BAND_INDEX:
if (length != 1 || index_offset != 0) {
@ -1320,7 +1327,8 @@ int msm_audio_effects_popless_eq_handler(struct audio_client *ac,
pr_debug("%s: did not send pp params\n", __func__);
invalid_config:
kfree(params);
kfree(eq_config_data);
if (eq_config_data)
kfree(eq_config_data);
return rc;
}
EXPORT_SYMBOL(msm_audio_effects_popless_eq_handler);

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.​
*/
@ -4219,6 +4220,7 @@ static int msm_compr_adsp_stream_cmd_put(struct snd_kcontrol *kcontrol,
return -EINVAL;
}
mutex_lock(&pdata->lock);
cstream = pdata->cstream[fe_id];
if (cstream == NULL) {
pr_err("%s cstream is null\n", __func__);
@ -4231,7 +4233,6 @@ static int msm_compr_adsp_stream_cmd_put(struct snd_kcontrol *kcontrol,
return -EINVAL;
}
mutex_lock(&pdata->lock);
if (prtd->audio_client == NULL) {
pr_err("%s: audio_client is null\n", __func__);
ret = -EINVAL;

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/init.h>
#include <linux/err.h>
@ -42,6 +42,11 @@
#define LSM_IS_LAST_STAGE(client, stage_idx) \
(client->num_stages == (stage_idx + 1))
struct lsm_char_dev {
/* Protects access to LSM client sessions and shared resources */
struct mutex lock;
};
static struct snd_pcm_hardware msm_pcm_hardware_capture = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
@ -683,15 +688,47 @@ static int msm_lsm_set_conf(struct snd_pcm_substream *substream,
struct lsm_params_info_v2 *p_info)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct lsm_priv *prtd = runtime->private_data;
struct lsm_priv *prtd = NULL;
struct snd_soc_pcm_runtime *rtd = substream->private_data;
int rc = 0;
struct lsm_char_dev *lsm_dev;
struct snd_soc_component *component = NULL;
if (!rtd) {
pr_err("%s substream runtime or private_data not found\n",
__func__);
return -EINVAL;
}
component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
if (!component || !component->dev) {
pr_err("%s: invalid component\n", __func__);
return -EINVAL;
}
lsm_dev = (struct lsm_char_dev *) dev_get_drvdata(component->dev);
if (!lsm_dev) {
pr_err("%s: platform data is NULL\n", __func__);
return -EINVAL;
}
mutex_lock(&lsm_dev->lock);
if (!runtime) {
pr_err("%s: Invalid runtime", __func__);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
prtd = runtime->private_data;
if (!prtd || !prtd->lsm_client) {
pr_err("%s: No LSM session active\n", __func__);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
if (p_info->param_type == LSM_MULTI_SND_MODEL_CONFIDENCE_LEVELS) {
if (p_info->param_size > MAX_KEYWORDS_SUPPORTED) {
dev_err(rtd->dev,
"%s: invalid number of snd_model keywords %d, the max is %d\n",
__func__, p_info->param_size, MAX_KEYWORDS_SUPPORTED);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
@ -702,6 +739,7 @@ static int msm_lsm_set_conf(struct snd_pcm_substream *substream,
dev_err(rtd->dev,
"%s: get_conf_levels failed for snd_model %d, err = %d\n",
__func__, p_info->model_id, rc);
mutex_unlock(&lsm_dev->lock);
return rc;
}
@ -722,6 +760,7 @@ static int msm_lsm_set_conf(struct snd_pcm_substream *substream,
dev_err(rtd->dev,
"%s: invalid confidence levels %d\n",
__func__, p_info->param_size);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
@ -733,6 +772,7 @@ static int msm_lsm_set_conf(struct snd_pcm_substream *substream,
dev_err(rtd->dev,
"%s: get_conf_levels failed, err = %d\n",
__func__, rc);
mutex_unlock(&lsm_dev->lock);
return rc;
}
@ -749,6 +789,7 @@ static int msm_lsm_set_conf(struct snd_pcm_substream *substream,
prtd->lsm_client->confidence_levels = NULL;
}
}
mutex_unlock(&lsm_dev->lock);
return rc;
}
@ -989,23 +1030,63 @@ static int msm_lsm_check_and_set_lab_controls(struct snd_pcm_substream *substrea
u32 enable, struct lsm_params_info_v2 *p_info)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct lsm_priv *prtd = runtime->private_data;
struct lsm_priv *prtd = NULL;
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct lsm_hw_params *out_hw_params = &prtd->lsm_client->out_hw_params;
struct lsm_hw_params *out_hw_params = NULL;
struct snd_soc_component *component = NULL;
struct lsm_char_dev *lsm_dev = NULL;
u8 *chmap = NULL;
u32 ch_idx;
int rc = 0, stage_idx = p_info->stage_idx;
if (!rtd) {
pr_err("%s substream runtime or private_data not found\n",
__func__);
return -EINVAL;
}
component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
if (!component || !component->dev) {
pr_err("%s: invalid component\n", __func__);
return -EINVAL;
}
lsm_dev = (struct lsm_char_dev *) dev_get_drvdata(component->dev);
if (!lsm_dev) {
pr_err("%s: platform data is NULL\n", __func__);
return -EINVAL;
}
mutex_lock(&lsm_dev->lock);
if (!runtime) {
pr_err("%s: Invalid runtime", __func__);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
prtd = runtime->private_data;
if (!prtd || !prtd->lsm_client) {
pr_err("%s: No LSM session active\n", __func__);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
out_hw_params = &prtd->lsm_client->out_hw_params;
if (!out_hw_params) {
pr_err("%s: Invalid hw params\n", __func__);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
if (prtd->lsm_client->stage_cfg[stage_idx].lab_enable == enable) {
dev_dbg(rtd->dev, "%s: Lab for session %d, stage %d already %s\n",
__func__, prtd->lsm_client->session,
stage_idx, enable ? "enabled" : "disabled");
mutex_unlock(&lsm_dev->lock);
return rc;
}
chmap = kzalloc(out_hw_params->num_chs, GFP_KERNEL);
if (!chmap)
if (!chmap) {
mutex_unlock(&lsm_dev->lock);
return -ENOMEM;
}
rc = q6lsm_lab_control(prtd->lsm_client, enable, p_info);
if (rc) {
@ -1046,6 +1127,7 @@ static int msm_lsm_check_and_set_lab_controls(struct snd_pcm_substream *substrea
fail:
kfree(chmap);
mutex_unlock(&lsm_dev->lock);
return rc;
}
@ -3106,9 +3188,11 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
{
unsigned long flags;
struct snd_pcm_runtime *runtime = substream->runtime;
struct lsm_priv *prtd = runtime->private_data;
struct lsm_priv *prtd = NULL;
struct snd_soc_pcm_runtime *rtd;
struct msm_pcm_stream_app_type_cfg cfg_data = {0};
struct lsm_char_dev *lsm_dev;
struct snd_soc_component *component = NULL;
int ret = 0;
int be_id = 0;
int fe_id = 0;
@ -3117,12 +3201,29 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
pr_err("%s: Invalid private_data", __func__);
return -EINVAL;
}
if (!prtd || !prtd->lsm_client) {
pr_err("%s: No LSM session active\n", __func__);
if (!component || !component->dev) {
pr_err("%s: Invalid component\n", __func__);
return -EINVAL;
}
rtd = substream->private_data;
lsm_dev = (struct lsm_char_dev *) dev_get_drvdata(component->dev);
if (!lsm_dev) {
pr_err("%s: platform data is NULL\n", __func__);
return -EINVAL;
}
mutex_lock(&lsm_dev->lock);
if (!runtime) {
pr_err("%s: Invalid runtime", __func__);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
prtd = runtime->private_data;
if (!prtd || !prtd->lsm_client) {
pr_err("%s: No LSM session active\n", __func__);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
dev_dbg(rtd->dev, "%s\n", __func__);
if (prtd->lsm_client->started) {
if (prtd->lsm_client->lab_enable) {
@ -3232,6 +3333,7 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
mutex_destroy(&prtd->lsm_api_lock);
kfree(prtd);
runtime->private_data = NULL;
mutex_unlock(&lsm_dev->lock);
return 0;
}
@ -3240,21 +3342,36 @@ static int msm_lsm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct lsm_priv *prtd = runtime->private_data;
struct lsm_priv *prtd = NULL;
struct lsm_hw_params *out_hw_params = NULL;
struct lsm_hw_params *in_hw_params = NULL;
struct snd_soc_pcm_runtime *rtd;
struct lsm_char_dev *lsm_dev = NULL;
struct snd_soc_component *component = NULL;
if (!substream->private_data) {
pr_err("%s: Invalid private_data", __func__);
return -EINVAL;
}
rtd = substream->private_data;
component = snd_soc_rtdcom_lookup(rtd, DRV_NAME);
if (!component || !component->dev) {
pr_err("%s: Invalid component\n", __func__);
return -EINVAL;
}
lsm_dev = (struct lsm_char_dev *) dev_get_drvdata(component->dev);
if (!lsm_dev) {
pr_err("%s: platform data is NULL\n", __func__);
return -EINVAL;
}
mutex_lock(&lsm_dev->lock);
prtd = runtime->private_data;
if (!prtd || !params) {
dev_err(rtd->dev,
"%s: invalid params prtd %pK params %pK",
__func__, prtd, params);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
in_hw_params = &prtd->lsm_client->in_hw_params;
@ -3269,6 +3386,7 @@ static int msm_lsm_hw_params(struct snd_pcm_substream *substream,
"%s: Invalid Params sample rate %d period count %d\n",
__func__, out_hw_params->sample_rate,
out_hw_params->period_count);
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
@ -3279,6 +3397,7 @@ static int msm_lsm_hw_params(struct snd_pcm_substream *substream,
} else {
dev_err(rtd->dev, "%s: Invalid Format 0x%x\n",
__func__, params_format(params));
mutex_unlock(&lsm_dev->lock);
return -EINVAL;
}
@ -3299,6 +3418,7 @@ static int msm_lsm_hw_params(struct snd_pcm_substream *substream,
*/
memcpy(in_hw_params, out_hw_params,
sizeof(struct lsm_hw_params));
mutex_unlock(&lsm_dev->lock);
return 0;
}
@ -3629,6 +3749,14 @@ static struct snd_soc_component_driver msm_soc_component = {
static int msm_lsm_probe(struct platform_device *pdev)
{
struct lsm_char_dev *lsm_dev;
lsm_dev = devm_kzalloc(&pdev->dev, sizeof(*lsm_dev), GFP_KERNEL);
if (!lsm_dev)
return -ENOMEM;
mutex_init(&lsm_dev->lock);
dev_set_drvdata(&pdev->dev, lsm_dev);
return snd_soc_register_component(&pdev->dev, &msm_soc_component,
NULL, 0);
@ -3636,6 +3764,10 @@ static int msm_lsm_probe(struct platform_device *pdev)
static int msm_lsm_remove(struct platform_device *pdev)
{
struct lsm_char_dev *lsm_dev;
lsm_dev = dev_get_drvdata(&pdev->dev);
mutex_destroy(&lsm_dev->lock);
snd_soc_unregister_component(&pdev->dev);
return 0;

View file

@ -26945,6 +26945,10 @@ static const struct snd_kcontrol_new mmul17_mixer_controls[] = {
MSM_BACKEND_DAI_PRI_MI2S_TX,
MSM_FRONTEND_DAI_MULTIMEDIA17, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_DOUBLE_EXT("SEC_MI2S_TX", SND_SOC_NOPM,
MSM_BACKEND_DAI_SECONDARY_MI2S_TX,
MSM_FRONTEND_DAI_MULTIMEDIA17, 1, 0, msm_routing_get_audio_mixer,
msm_routing_put_audio_mixer),
SOC_DOUBLE_EXT("INT3_MI2S_TX", SND_SOC_NOPM,
MSM_BACKEND_DAI_INT3_MI2S_TX,
MSM_FRONTEND_DAI_MULTIMEDIA17, 1, 0, msm_routing_get_audio_mixer,
@ -41417,6 +41421,7 @@ static const struct snd_soc_dapm_route intercon_mi2s[] = {
{"MultiMedia29 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
{"MultiMedia30 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
{"MultiMedia8 Mixer", "PRI_MI2S_TX", "PRI_MI2S_TX"},
{"MultiMedia17 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
{"MultiMedia18 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
{"MultiMedia19 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},
{"MultiMedia28 Mixer", "SEC_MI2S_TX", "SEC_MI2S_TX"},

View file

@ -957,7 +957,8 @@ SND_SOC_DAILINK_DEFS(quat_mi2s_tx,
SND_SOC_DAILINK_DEFS(quin_mi2s_rx,
DAILINK_COMP_ARRAY(COMP_CPU("msm-dai-q6-mi2s.8")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx")),
DAILINK_COMP_ARRAY(COMP_CODEC("msm-stub-codec.1", "msm-stub-rx"),
COMP_CODEC("acm8625s_codec", "acm8625s-hifi")),
DAILINK_COMP_ARRAY(COMP_PLATFORM("msm-pcm-routing")));
SND_SOC_DAILINK_DEFS(quin_mi2s_tx,

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023, 2025 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/module.h>
#include <linux/slab.h>
@ -3911,10 +3911,14 @@ void adm_copp_mfc_cfg(int port_id, int copp_idx, int dst_sample_rate)
pr_err("%s: unable to get channal map\n", __func__);
goto fail_cmd;
}
for (i = 0; i < mfc_cfg.num_channels; i++)
mfc_cfg.channel_type[i] =
if (mfc_cfg.num_channels <= AUDPROC_MFC_OUT_CHANNELS_MAX) {
for (i = 0; i < mfc_cfg.num_channels; i++)
mfc_cfg.channel_type[i] =
(uint16_t) open.dev_channel_mapping[i];
} else {
pr_err("%s: size of num_channels is greater than channel type \n", __func__);
goto fail_cmd;
}
atomic_set(&this_adm.copp.stat[port_idx][copp_idx], -1);

View file

@ -710,7 +710,10 @@ static int __ipa3_del_hdr_proc_ctx(u32 proc_ctx_hdl,
return 0;
}
if (release_hdr)
if (entry->hdr && entry == entry->hdr->proc_ctx)
entry->hdr->proc_ctx = NULL;
if (entry->hdr && release_hdr)
__ipa3_del_hdr(entry->hdr->id, false);
/* move the offset entry to appropriate free list */
@ -774,17 +777,19 @@ int __ipa3_del_hdr(u32 hdr_hdl, bool by_user)
return 0;
}
if (entry->proc_ctx && entry == entry->proc_ctx->hdr)
entry->proc_ctx->hdr = NULL;
if (entry->is_hdr_proc_ctx || entry->proc_ctx) {
dma_unmap_single(ipa3_ctx->pdev,
entry->phys_base,
entry->hdr_len,
DMA_TO_DEVICE);
__ipa3_del_hdr_proc_ctx(entry->proc_ctx->id, false, false);
} else {
/* move the offset entry to appropriate free list */
list_move(&entry->offset_entry->link,
&htbl->head_free_offset_list[entry->offset_entry->bin]);
}
/* move the offset entry to appropriate free list */
list_move(&entry->offset_entry->link,
&htbl->head_free_offset_list[entry->offset_entry->bin]);
list_del(&entry->link);
htbl->hdr_cnt--;
entry->cookie = 0;

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/debugfs.h>
@ -770,9 +771,9 @@ int ipa_pm_register(struct ipa_pm_register_params *params, u32 *hdl)
client->skip_clk_vote = params->skip_clk_vote;
client->wlock = wakeup_source_register(NULL, client->name);
if (!client->wlock) {
ipa_pm_deregister(*hdl);
IPA_PM_ERR("IPA wakeup source register failed %s\n",
client->name);
ipa_pm_deregister(*hdl);
return -ENOMEM;
}

View file

@ -4,7 +4,7 @@ export CONFIG_DRM_MSM_DP=y
export CONFIG_DRM_MSM_DP_MST=y
export CONFIG_SYNC_FILE=y
export CONFIG_DRM_MSM_DSI=y
export CONFIG_DSI_PARSER=y
export CONFIG_DSI_PARSER=n
export CONFIG_DRM_SDE_WB=y
export CONFIG_DRM_MSM_REGISTER_LOGGING=y
export CONFIG_QCOM_MDSS_PLL=y

View file

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#define CONFIG_DRM_MSM 1
@ -9,7 +10,6 @@
#define CONFIG_DRM_MSM_SDE 1
#define CONFIG_SYNC_FILE 1
#define CONFIG_DRM_MSM_DSI 1
#define CONFIG_DSI_PARSER 1
#define CONFIG_DRM_SDE_WB 1
#define CONFIG_DRM_MSM_REGISTER_LOGGING 1
#define CONFIG_DRM_SDE_EVTLOG_DEBUG 1

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
@ -1184,6 +1184,7 @@ error_ctrl:
static int dp_display_panel_ready(struct dp_display_private *dp)
{
int rc = 0;
bool skip_op = is_skip_required(&dp->dp_display);
if (dp->dp_display.is_edp) {
rc = dp->power->edp_panel_set_gpio(dp->power, DP_GPIO_EDP_VCC_EN, true);
@ -1201,9 +1202,9 @@ static int dp_display_panel_ready(struct dp_display_private *dp)
}
return -ETIMEDOUT;
}
dp->panel->init(dp->panel, skip_op);
}
if (!dp->dp_display.cont_splash_enabled)
dp->panel->init(dp->panel);
return 0;
}
@ -1247,6 +1248,8 @@ static int dp_display_host_ready(struct dp_display_private *dp)
dp->ctrl->abort(dp->ctrl, false);
dp->aux->init(dp->aux, dp->parser->aux_cfg, skip_op);
dp->panel->init(dp->panel, skip_op);
dp_display_state_add(DP_STATE_READY);
/* log this as it results from user action of cable connection */
DP_INFO("[OK]\n");
@ -3918,6 +3921,7 @@ static int dp_display_get_display_type(struct dp_display *dp_display,
const char **display_type)
{
struct dp_display_private *dp;
struct device_node *of_node;
if (!dp_display || !display_type) {
pr_err("invalid input\n");
@ -3927,7 +3931,11 @@ static int dp_display_get_display_type(struct dp_display *dp_display,
dp = container_of(dp_display, struct dp_display_private, dp_display);
if (dp->parser)
*display_type = dp->parser->display_type;
else {
of_node = dp->pdev->dev.of_node;
*display_type = of_get_property(of_node, "qcom,display-type",
NULL);
}
return 0;
}

View file

@ -471,6 +471,7 @@ int dp_connector_get_info(struct drm_connector *connector,
{
struct dp_display *display = data;
const char *display_type = NULL;
u32 conn_disp_type = SDE_CONNECTOR_PRIMARY;
if (!info || !display || !display->drm_dev) {
DP_ERR("invalid params\n");
@ -480,11 +481,11 @@ int dp_connector_get_info(struct drm_connector *connector,
info->intf_type = DRM_MODE_CONNECTOR_DisplayPort;
display->get_display_type(display, &display_type);
if (display_type){
if (display_type) {
if (!strcmp(display_type, "primary"))
info->display_type = SDE_CONNECTOR_PRIMARY;
conn_disp_type = SDE_CONNECTOR_PRIMARY;
else if (!strcmp(display_type, "secondary"))
info->display_type = SDE_CONNECTOR_SECONDARY;
conn_disp_type = SDE_CONNECTOR_SECONDARY;
}
info->num_of_h_tiles = 1;
@ -495,7 +496,8 @@ int dp_connector_get_info(struct drm_connector *connector,
if (display && display->is_edp) {
info->intf_type = DRM_MODE_CONNECTOR_eDP;
if(display->ext_hpd_en)
info->display_type = conn_disp_type;
if (display->ext_hpd_en)
info->capabilities |= MSM_DISPLAY_CAP_HOT_PLUG;
else
info->is_connected = true;

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023, 2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*/
@ -2381,7 +2381,7 @@ error:
return rc;
}
static int dp_panel_init_panel_info(struct dp_panel *dp_panel)
static int dp_panel_init_panel_info(struct dp_panel *dp_panel, bool skip_op)
{
int rc = 0;
struct dp_panel_private *panel;
@ -2393,6 +2393,9 @@ static int dp_panel_init_panel_info(struct dp_panel *dp_panel)
goto end;
}
if (skip_op)
goto end;
panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
pinfo = &dp_panel->pinfo;

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023, 2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
*/
@ -162,7 +162,7 @@ struct dp_panel {
s64 fec_overhead_fp;
int (*init)(struct dp_panel *dp_panel);
int (*init)(struct dp_panel *dp_panel, bool skip_op);
int (*deinit)(struct dp_panel *dp_panel, u32 flags);
int (*hw_cfg)(struct dp_panel *dp_panel, bool enable);
int (*read_sink_caps)(struct dp_panel *dp_panel,

View file

@ -178,13 +178,10 @@ static int dp_parser_misc(struct dp_parser *parser)
&parser->pixel_base_off[i]);
}
parser->display_type = of_get_property(of_node, "qcom,display-type", NULL);
if (!parser->display_type) {
if (parser->is_edp)
parser->display_type = "primary";
else
parser->display_type = "secondary";
}
parser->display_type = of_get_property(of_node, "qcom,display-type",
NULL);
if (!parser->display_type)
parser->display_type = "unknown";
parser->panel_notifier_support = of_property_read_bool(of_node,
"qcom,panel-notifier-support");

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <linux/of_device.h>
@ -229,10 +229,10 @@ static ssize_t debugfs_line_count_read(struct file *file,
dsi_ctrl->cmd_trigger_frame);
len += scnprintf((buf + len), max_len - len,
"Command successful at line: %04x\n",
dsi_ctrl->cmd_success_line);
atomic_read(&dsi_ctrl->cmd_success_line));
len += scnprintf((buf + len), max_len - len,
"Command successful at frame: %04x\n",
dsi_ctrl->cmd_success_frame);
atomic_read(&dsi_ctrl->cmd_success_frame));
mutex_unlock(&dsi_ctrl->ctrl_lock);
@ -2891,12 +2891,13 @@ static irqreturn_t dsi_ctrl_isr(int irq, void *ptr)
if (dsi_ctrl->enable_cmd_dma_stats) {
u32 reg = dsi_ctrl->hw.ops.log_line_count(&dsi_ctrl->hw,
dsi_ctrl->cmd_mode);
dsi_ctrl->cmd_success_line = (reg & 0xFFFF);
dsi_ctrl->cmd_success_frame = ((reg >> 16) & 0xFFFF);
atomic_set(&dsi_ctrl->cmd_success_line, (reg & 0xFFFF));
atomic_set(&dsi_ctrl->cmd_success_frame, ((reg >> 16) & 0xFFFF));
SDE_EVT32(dsi_ctrl->cell_index, SDE_EVTLOG_FUNC_CASE1,
dsi_ctrl->cmd_success_line,
dsi_ctrl->cmd_success_frame);
}
atomic_set(&dsi_ctrl->dma_irq_trig, 1);
dsi_ctrl_disable_status_interrupt(dsi_ctrl,
DSI_SINT_CMD_MODE_DMA_DONE);

View file

@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
*/
@ -309,8 +310,8 @@ struct dsi_ctrl {
bool cmd_mode;
u32 cmd_trigger_line;
u32 cmd_trigger_frame;
u32 cmd_success_line;
u32 cmd_success_frame;
atomic_t cmd_success_line;
atomic_t cmd_success_frame;
};
/**

View file

@ -6488,15 +6488,25 @@ static int dsi_display_init(struct dsi_display *display)
if (rc) {
DSI_ERR("[%s] failed to enable vregs, rc=%d\n",
display->panel->name, rc);
return rc;
goto vreg_fail;
}
}
rc = component_add(&pdev->dev, &dsi_display_comp_ops);
if (rc)
if (rc) {
DSI_ERR("component add failed, rc=%d\n", rc);
goto comp_add_fail;
}
DSI_DEBUG("component add success: %s\n", display->name);
return rc;
comp_add_fail:
if (display->panel)
dsi_pwr_enable_regulator(&display->panel->power_info, false);
vreg_fail:
_dsi_display_dev_deinit(display);
end:
return rc;
}

View file

@ -1,4 +1,5 @@
/*
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
@ -211,6 +212,10 @@ static void msm_smmu_destroy(struct msm_mmu *mmu)
{
struct msm_smmu *smmu = to_msm_smmu(mmu);
struct platform_device *pdev = to_platform_device(smmu->client_dev);
struct iommu_domain *domain = iommu_get_domain_for_dev(smmu->client_dev);
if (domain)
iommu_set_fault_handler(domain, NULL, NULL);
if (smmu->client_dev)
platform_device_unregister(pdev);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
* Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
@ -1264,16 +1264,6 @@ static void _sde_kms_release_splash_resource(struct sde_kms *sde_kms,
SDE_EVT32(DRMID(crtc), crtc->state->active,
sde_kms->splash_data.num_splash_displays);
/*remove all votes if eDP displays are done with splash*/
if (dp_display_get_num_of_boot_displays()) {
for (i = 0; i < SDE_POWER_HANDLE_DBUS_ID_MAX; i++)
sde_power_data_bus_set_quota(phandle, i,
SDE_POWER_HANDLE_ENABLE_BUS_AB_QUOTA,
phandle->ib_quota[i]);
pm_runtime_put_sync(sde_kms->dev->dev);
sde_kms->splash_data.num_splash_displays--;
}
for (i = 0; i < MAX_DSI_DISPLAYS; i++) {
splash_display = &sde_kms->splash_data.splash_display[i];
if (splash_display->encoder &&
@ -3405,7 +3395,7 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms,
struct msm_display_info info;
struct drm_encoder *encoder = NULL;
struct drm_crtc *crtc = NULL;
int i, rc = 0;
int i, rc = 0, splash_index = 0;
struct drm_display_mode *drm_mode = NULL;
struct drm_device *dev;
struct msm_drm_private *priv;
@ -3443,7 +3433,7 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms,
DRM_INFO("cont_splash enabled in %d of %d display(s)\n",
sde_kms->splash_data.num_splash_displays,
sde_kms->dsi_display_count);
sde_kms->dsi_display_count + sde_kms->dp_display_count);
/* dsi */
for (i = 0; i < sde_kms->dsi_display_count; ++i) {
@ -3509,11 +3499,20 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms,
mutex_unlock(&dev->mode_config.mutex);
return -EINVAL;
}
mutex_unlock(&dev->mode_config.mutex);
crtc->state->encoder_mask = (1 << drm_encoder_index(encoder));
/* get supported modes in case of external bridge panels*/
if (!dsi_display->panel->num_timing_nodes) {
connector->funcs->fill_modes(connector,
dev->mode_config.max_width,
dev->mode_config.max_height);
drm_mode = list_first_entry(&connector->modes,
struct drm_display_mode, head);
}
else
drm_mode = _sde_kms_get_splash_mode(sde_kms, connector, state);
drm_mode = _sde_kms_get_splash_mode(sde_kms, connector, state);
mutex_unlock(&dev->mode_config.mutex);
if (!drm_mode) {
SDE_ERROR("drm_mode not found; handoff_type:%d\n",
sde_kms->splash_data.type);
@ -3570,6 +3569,19 @@ static int sde_kms_cont_splash_config(struct msm_kms *kms,
break;
}
splash_display = &sde_kms->splash_data.splash_display[splash_index];
if (splash_display->cont_splash_enabled) {
priv = sde_kms->dev->dev_private;
encoder->crtc = priv->crtcs[splash_index];
splash_display->encoder = encoder;
SDE_DEBUG("dp-display:%d splash_index:%d crtc id[%d]:%d enc id[%d]:%d\n",
i, splash_index, encoder->crtc->index, encoder->crtc->base.id,
encoder->index, encoder->base.id);
splash_index++;
}
mutex_lock(&dev->mode_config.mutex);
drm_connector_list_iter_begin(dev, &conn_iter);
drm_for_each_connector_iter(connector, &conn_iter) {

View file

@ -204,6 +204,8 @@ int sde_wb_connector_set_modes(struct sde_wb_device *wb_dev,
memset(&dispmode, 0, sizeof(dispmode));
ret = drm_mode_convert_umode(wb_dev->drm_dev,
&dispmode, &modeinfo[i]);
/* null terminate the string */
modeinfo[i].name[DRM_DISPLAY_MODE_LEN - 1] = '\0';
if (ret) {
SDE_ERROR(
"failed to convert mode %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x status:%d rc:%d\n",

View file

@ -3710,6 +3710,9 @@ int msm_venc_enable_hybrid_hp(struct msm_vidc_inst *inst)
if (ctrl->val)
return 0;
if (msm_vidc_get_fps(inst) <= 60)
return 0;
ctrl = get_ctrl(inst,
V4L2_CID_MPEG_VIDC_VIDEO_HEVC_MAX_HIER_CODING_LAYER);
layer = get_ctrl(inst, V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_LAYER);

View file

@ -1482,7 +1482,6 @@ static void close_helper(struct kref *kref)
{
struct msm_vidc_inst *inst = container_of(kref,
struct msm_vidc_inst, kref);
msm_vidc_destroy(inst);
}
@ -1497,19 +1496,19 @@ void *msm_vidc_open(int core_id, int session_type)
session_type >= MSM_VIDC_MAX_DEVICES) {
d_vpr_e("Invalid input, core_id = %d, session = %d\n",
core_id, session_type);
goto err_invalid_core;
return NULL;
}
core = get_vidc_core(core_id);
if (!core) {
d_vpr_e("Failed to find core for core_id = %d\n", core_id);
goto err_invalid_core;
return NULL;
}
inst = kzalloc(sizeof(*inst), GFP_KERNEL);
if (!inst) {
d_vpr_e("Failed to allocate memory\n");
rc = -ENOMEM;
goto err_invalid_core;
return NULL;
}
mutex_lock(&core->lock);
rc = get_sid(&inst->sid, session_type);
@ -1609,14 +1608,15 @@ void *msm_vidc_open(int core_id, int session_type)
s_vpr_e(inst->sid,
"Failed to move video instance to init state\n");
kref_put(&inst->kref, close_helper);
inst = NULL;
goto err_invalid_core;
return NULL;
}
if (msm_comm_check_for_inst_overload(core)) {
s_vpr_e(inst->sid,
"Instance count reached Max limit, rejecting session");
goto fail_init;
msm_comm_kill_session(inst);
kref_put(&inst->kref, close_helper);
return NULL;
}
msm_comm_scale_clocks_and_bus(inst, 1);
@ -1625,14 +1625,6 @@ void *msm_vidc_open(int core_id, int session_type)
msm_vidc_debugfs_init_inst(inst, core->debugfs_root);
return inst;
fail_init:
mutex_lock(&core->lock);
list_del(&inst->list);
mutex_unlock(&core->lock);
v4l2_fh_del(&inst->event_handler);
v4l2_fh_exit(&inst->event_handler);
vb2_queue_release(&inst->bufq[INPUT_PORT].vb2_bufq);
fail_bufq_output:
vb2_queue_release(&inst->bufq[OUTPUT_PORT].vb2_bufq);
fail_bufq_capture:
@ -1660,7 +1652,6 @@ err_invalid_sid:
put_sid(inst->sid);
kfree(inst);
inst = NULL;
err_invalid_core:
return inst;
}
EXPORT_SYMBOL(msm_vidc_open);