Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/kernel-eas' into kernel-eas
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiviyan committed Oct 1, 2020
2 parents a03b8ca + 22ff130 commit ff6a13e
Show file tree
Hide file tree
Showing 45 changed files with 564 additions and 215 deletions.
30 changes: 23 additions & 7 deletions arch/arm/boot/dts/qcom/msm-audio.dtsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015-2017, 2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2015-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
Expand Down Expand Up @@ -357,6 +357,16 @@
qcom,msm-dai-q6-dev-id = <32770>;
};

proxy_rx: qcom,msm-dai-q6-proxy-rx {
compatible = "qcom,msm-dai-q6-dev";
qcom,msm-dai-q6-dev-id = <8194>;
};

proxy_tx: qcom,msm-dai-q6-proxy-tx {
compatible = "qcom,msm-dai-q6-dev";
qcom,msm-dai-q6-dev-id = <8195>;
};

usb_audio_rx: qcom,msm-dai-q6-usb-audio-rx {
compatible = "qcom,msm-dai-q6-dev";
qcom,msm-dai-q6-dev-id = <28672>;
Expand Down Expand Up @@ -679,7 +689,8 @@
<&dai_pri_tdm_rx_0>, <&dai_pri_tdm_tx_0>,
<&dai_sec_tdm_rx_0>, <&dai_sec_tdm_tx_0>,
<&dai_tert_tdm_rx_0>, <&dai_tert_tdm_tx_0>,
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>;
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>,
<&proxy_rx>, <&proxy_tx>;
asoc-cpu-names = "msm-dai-q6-dp.24608", "msm-dai-q6-mi2s.0",
"msm-dai-q6-mi2s.1",
"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
Expand All @@ -702,7 +713,8 @@
"msm-dai-q6-tdm.36865", "msm-dai-q6-tdm.36880",
"msm-dai-q6-tdm.36881", "msm-dai-q6-tdm.36896",
"msm-dai-q6-tdm.36897", "msm-dai-q6-tdm.36912",
"msm-dai-q6-tdm.36913";
"msm-dai-q6-tdm.36913",
"msm-dai-q6-dev.8194", "msm-dai-q6-dev.8195";
asoc-codec = <&stub_codec>, <&ext_disp_audio_codec>;
asoc-codec-names = "msm-stub-codec.1",
"msm-ext-disp-audio-codec-rx";
Expand Down Expand Up @@ -784,7 +796,8 @@
<&dai_pri_tdm_rx_0>, <&dai_pri_tdm_tx_0>,
<&dai_sec_tdm_rx_0>, <&dai_sec_tdm_tx_0>,
<&dai_tert_tdm_rx_0>, <&dai_tert_tdm_tx_0>,
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>;
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>,
<&proxy_rx>, <&proxy_tx>;
asoc-cpu-names = "msm-dai-q6-dp.24608", "msm-dai-q6-mi2s.0",
"msm-dai-q6-mi2s.1",
"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
Expand All @@ -807,7 +820,8 @@
"msm-dai-q6-tdm.36865", "msm-dai-q6-tdm.36880",
"msm-dai-q6-tdm.36881", "msm-dai-q6-tdm.36896",
"msm-dai-q6-tdm.36897", "msm-dai-q6-tdm.36912",
"msm-dai-q6-tdm.36913";
"msm-dai-q6-tdm.36913",
"msm-dai-q6-dev.8194", "msm-dai-q6-dev.8195";
asoc-codec = <&stub_codec>, <&ext_disp_audio_codec>;
asoc-codec-names = "msm-stub-codec.1",
"msm-ext-disp-audio-codec-rx";
Expand Down Expand Up @@ -900,7 +914,8 @@
<&dai_pri_tdm_rx_0>, <&dai_pri_tdm_tx_0>,
<&dai_sec_tdm_rx_0>, <&dai_sec_tdm_tx_0>,
<&dai_tert_tdm_rx_0>, <&dai_tert_tdm_tx_0>,
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>;
<&dai_quat_tdm_rx_0>, <&dai_quat_tdm_tx_0>,
<&proxy_rx>, <&proxy_tx>;
asoc-cpu-names = "msm-dai-q6-dp.24608", "msm-dai-q6-mi2s.0",
"msm-dai-q6-mi2s.1",
"msm-dai-q6-mi2s.2", "msm-dai-q6-mi2s.3",
Expand All @@ -919,7 +934,8 @@
"msm-dai-q6-tdm.36864", "msm-dai-q6-tdm.36865",
"msm-dai-q6-tdm.36880", "msm-dai-q6-tdm.36881",
"msm-dai-q6-tdm.36896", "msm-dai-q6-tdm.36897",
"msm-dai-q6-tdm.36912", "msm-dai-q6-tdm.36913";
"msm-dai-q6-tdm.36912", "msm-dai-q6-tdm.36913",
"msm-dai-q6-dev.8194", "msm-dai-q6-dev.8195";
asoc-codec = <&stub_codec>, <&msm_digital_codec>,
<&pmic_analog_codec>, <&msm_sdw_codec>,
<&ext_disp_audio_codec>;
Expand Down
15 changes: 14 additions & 1 deletion drivers/gpu/msm/adreno.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-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
Expand Down Expand Up @@ -2827,6 +2827,19 @@ static void adreno_resume_device(struct kgsl_device *device)
adreno_dispatcher_unhalt(device);
}

u32 adreno_get_ucode_version(const u32 *data)
{
u32 version;

version = data[1];

if ((version & 0xf) != 0xa)
return version;

version &= ~0xfff;
return version | ((data[3] & 0xfff000) >> 12);
}

static const struct kgsl_functable adreno_functable = {
/* Mandatory functions */
.regread = adreno_regread,
Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/msm/adreno.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2008-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-2018,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
Expand Down Expand Up @@ -940,6 +940,8 @@ int adreno_efuse_read_u32(struct adreno_device *adreno_dev, unsigned int offset,
unsigned int *val);
void adreno_efuse_unmap(struct adreno_device *adreno_dev);

u32 adreno_get_ucode_version(const u32 *data);

#define ADRENO_TARGET(_name, _id) \
static inline int adreno_is_##_name(struct adreno_device *adreno_dev) \
{ \
Expand Down
15 changes: 9 additions & 6 deletions drivers/gpu/msm/adreno_a5xx.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018,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
Expand Down Expand Up @@ -2177,12 +2177,15 @@ static int a5xx_post_start(struct adreno_device *adreno_dev)
*cmds++ = 0xF;
}

if (adreno_is_preemption_enabled(adreno_dev))
if (adreno_is_preemption_enabled(adreno_dev)) {
cmds += _preemption_init(adreno_dev, rb, cmds, NULL);
rb->_wptr = rb->_wptr - (42 - (cmds - start));
ret = adreno_ringbuffer_submit_spin_nosync(rb, NULL, 2000);
} else {
rb->_wptr = rb->_wptr - (42 - (cmds - start));
ret = adreno_ringbuffer_submit_spin(rb, NULL, 2000);
}

rb->_wptr = rb->_wptr - (42 - (cmds - start));

ret = adreno_ringbuffer_submit_spin(rb, NULL, 2000);
if (ret)
spin_idle_debug(KGSL_DEVICE(adreno_dev),
"hw initialization failed to idle\n");
Expand Down Expand Up @@ -2554,7 +2557,7 @@ static int _load_firmware(struct kgsl_device *device, const char *fwfile,

memcpy(ucode->hostptr, &fw->data[4], fw->size - 4);
*ucode_size = (fw->size - 4) / sizeof(uint32_t);
*ucode_version = *(unsigned int *)&fw->data[4];
*ucode_version = adreno_get_ucode_version((u32 *)fw->data);

done:
release_firmware(fw);
Expand Down
5 changes: 3 additions & 2 deletions drivers/gpu/msm/adreno_drawctxt.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-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
Expand Down Expand Up @@ -473,11 +473,12 @@ void adreno_drawctxt_detach(struct kgsl_context *context)
drawctxt = ADRENO_CONTEXT(context);
rb = drawctxt->rb;

spin_lock(&drawctxt->lock);

spin_lock(&adreno_dev->active_list_lock);
list_del_init(&drawctxt->active_node);
spin_unlock(&adreno_dev->active_list_lock);

spin_lock(&drawctxt->lock);
count = drawctxt_detach_drawobjs(drawctxt, list);
spin_unlock(&drawctxt->lock);

Expand Down
4 changes: 3 additions & 1 deletion drivers/gpu/msm/adreno_pm4types.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2016,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
Expand Down Expand Up @@ -97,6 +97,8 @@
/* A5XX Enable yield in RB only */
#define CP_YIELD_ENABLE 0x1C

#define CP_WHERE_AM_I 0x62

/* Enable/Disable/Defer A5x global preemption model */
#define CP_PREEMPT_ENABLE_GLOBAL 0x69

Expand Down
43 changes: 41 additions & 2 deletions drivers/gpu/msm/adreno_ringbuffer.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2017,2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2017,2019-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
Expand Down Expand Up @@ -138,7 +138,7 @@ void adreno_ringbuffer_submit(struct adreno_ringbuffer *rb,
adreno_ringbuffer_wptr(adreno_dev, rb);
}

int adreno_ringbuffer_submit_spin(struct adreno_ringbuffer *rb,
int adreno_ringbuffer_submit_spin_nosync(struct adreno_ringbuffer *rb,
struct adreno_submit_time *time, unsigned int timeout)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
Expand All @@ -147,6 +147,38 @@ int adreno_ringbuffer_submit_spin(struct adreno_ringbuffer *rb,
return adreno_spin_idle(adreno_dev, timeout);
}

/*
* adreno_ringbuffer_submit_spin() - Submit the cmds and wait until GPU is idle
* @rb: Pointer to ringbuffer
* @time: Pointer to adreno_submit_time
* @timeout: timeout value in ms
*
* Add commands to the ringbuffer and wait until GPU goes to idle. This routine
* inserts a WHERE_AM_I packet to trigger a shadow rptr update. So, use
* adreno_ringbuffer_submit_spin_nosync() if the previous cmd in the RB is a
* CSY packet because CSY followed by WHERE_AM_I is not legal..
*/
int adreno_ringbuffer_submit_spin(struct adreno_ringbuffer *rb,
struct adreno_submit_time *time, unsigned int timeout)
{
struct adreno_device *adreno_dev = ADRENO_RB_DEVICE(rb);
struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
unsigned int *cmds;

if (adreno_is_a3xx(adreno_dev))
return adreno_ringbuffer_submit_spin_nosync(rb, time, timeout);

cmds = adreno_ringbuffer_allocspace(rb, 3);
if (IS_ERR(cmds))
return PTR_ERR(cmds);

*cmds++ = cp_packet(adreno_dev, CP_WHERE_AM_I, 2);
cmds += cp_gpuaddr(adreno_dev, cmds,
SCRATCH_RPTR_GPU_ADDR(device, rb->id));

return adreno_ringbuffer_submit_spin_nosync(rb, time, timeout);
}

unsigned int *adreno_ringbuffer_allocspace(struct adreno_ringbuffer *rb,
unsigned int dwords)
{
Expand Down Expand Up @@ -480,6 +512,8 @@ adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb,
if (gpudev->preemption_post_ibsubmit &&
adreno_is_preemption_enabled(adreno_dev))
total_sizedwords += 5;
else if (!adreno_is_a3xx(adreno_dev))
total_sizedwords += 3;

/*
* a5xx uses 64 bit memory address. pm4 commands that involve read/write
Expand Down Expand Up @@ -670,6 +704,11 @@ adreno_ringbuffer_addcmds(struct adreno_ringbuffer *rb,
adreno_is_preemption_enabled(adreno_dev))
ringcmds += gpudev->preemption_post_ibsubmit(adreno_dev,
ringcmds);
else if (!adreno_is_a3xx(adreno_dev)) {
*ringcmds++ = cp_packet(adreno_dev, CP_WHERE_AM_I, 2);
ringcmds += cp_gpuaddr(adreno_dev, ringcmds,
SCRATCH_RPTR_GPU_ADDR(device, rb->id));
}

/*
* If we have more ringbuffer commands than space reserved
Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/msm/adreno_ringbuffer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2016,2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2016,2019-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
Expand Down Expand Up @@ -172,6 +172,9 @@ int adreno_ringbuffer_issuecmds(struct adreno_ringbuffer *rb,
void adreno_ringbuffer_submit(struct adreno_ringbuffer *rb,
struct adreno_submit_time *time);

int adreno_ringbuffer_submit_spin_nosync(struct adreno_ringbuffer *rb,
struct adreno_submit_time *time, unsigned int timeout);

int adreno_ringbuffer_submit_spin(struct adreno_ringbuffer *rb,
struct adreno_submit_time *time, unsigned int timeout);

Expand Down
8 changes: 5 additions & 3 deletions drivers/gpu/msm/kgsl.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2008-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2008-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
Expand Down Expand Up @@ -2486,7 +2486,7 @@ long kgsl_ioctl_gpuobj_import(struct kgsl_device_private *dev_priv,
return 0;

unmap:
if (param->type == KGSL_USER_MEM_TYPE_DMABUF) {
if (kgsl_memdesc_usermem_type(&entry->memdesc) == KGSL_MEM_ENTRY_ION) {
kgsl_destroy_ion(entry->priv_data);
entry->memdesc.sgt = NULL;
}
Expand Down Expand Up @@ -2795,7 +2795,7 @@ long kgsl_ioctl_map_user_mem(struct kgsl_device_private *dev_priv,
return result;

error_attach:
switch (memtype) {
switch (kgsl_memdesc_usermem_type(&entry->memdesc)) {
case KGSL_MEM_ENTRY_ION:
kgsl_destroy_ion(entry->priv_data);
entry->memdesc.sgt = NULL;
Expand Down Expand Up @@ -4202,6 +4202,8 @@ kgsl_mmap_memstore(struct kgsl_device *device, struct vm_area_struct *vma)
if (vma->vm_flags & VM_WRITE)
return -EPERM;

vma->vm_flags &= ~VM_MAYWRITE;

if (memdesc->size != vma_size) {
KGSL_MEM_ERR(device, "memstore bad size: %d should be %llu\n",
vma_size, memdesc->size);
Expand Down
23 changes: 19 additions & 4 deletions drivers/gpu/msm/kgsl_iommu.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-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
Expand Down Expand Up @@ -2389,16 +2389,31 @@ static uint64_t kgsl_iommu_find_svm_region(struct kgsl_pagetable *pagetable,
return addr;
}

static bool iommu_addr_in_svm_ranges(struct kgsl_iommu_pt *pt,
u64 gpuaddr, u64 size)
{
if ((gpuaddr >= pt->compat_va_start && gpuaddr < pt->compat_va_end) &&
((gpuaddr + size) > pt->compat_va_start &&
(gpuaddr + size) <= pt->compat_va_end))
return true;

if ((gpuaddr >= pt->svm_start && gpuaddr < pt->svm_end) &&
((gpuaddr + size) > pt->svm_start &&
(gpuaddr + size) <= pt->svm_end))
return true;

return false;
}

static int kgsl_iommu_set_svm_region(struct kgsl_pagetable *pagetable,
uint64_t gpuaddr, uint64_t size)
{
int ret = -ENOMEM;
struct kgsl_iommu_pt *pt = pagetable->priv;
struct rb_node *node;

/* Make sure the requested address doesn't fall in the global range */
if (ADDR_IN_GLOBAL(pagetable->mmu, gpuaddr) ||
ADDR_IN_GLOBAL(pagetable->mmu, gpuaddr + size))
/* Make sure the requested address doesn't fall out of SVM range */
if (!iommu_addr_in_svm_ranges(pt, gpuaddr, size))
return -ENOMEM;

spin_lock(&pagetable->lock);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/qcacld-3.0/core/hdd/inc/wlan_hdd_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -13449,7 +13449,7 @@ enum hw_filter_mode {
*/

#define CFG_IS_SAE_ENABLED_NAME "sae_enabled"
#define CFG_IS_SAE_ENABLED_DEFAULT (1)
#define CFG_IS_SAE_ENABLED_DEFAULT (0)
#define CFG_IS_SAE_ENABLED_MIN (0)
#define CFG_IS_SAE_ENABLED_MAX (1)

Expand Down
13 changes: 11 additions & 2 deletions include/sound/apr_audio-v2.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, 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
Expand Down Expand Up @@ -1429,7 +1429,7 @@ struct adm_cmd_connect_afe_port_v5 {
#define AFE_PORT_ID_SLIMBUS_RANGE_SIZE 0xA

/* Size of the range of port IDs for real-time proxy ports. */
#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x2
#define AFE_PORT_ID_RT_PROXY_PORT_RANGE_SIZE 0x4

/* Size of the range of port IDs for pseudoports. */
#define AFE_PORT_ID_PSEUDOPORT_RANGE_SIZE 0x5
Expand Down Expand Up @@ -1643,6 +1643,15 @@ struct adm_cmd_connect_afe_port_v5 {
*/
#define AFE_PORT_ID_VOICE2_PLAYBACK_TX 0x8002
#define AFE_PORT_ID_VOICE_PLAYBACK_TX 0x8005
/*
* Proxyport used for voice call data processing.
* In cases like call-screening feature, where user can communicate
* with caller with the help of "call screen" mode, and without
* connecting the call with any HW input/output devices in the phon,
* voice call can use Pseudo port to start voice data processing.
*/
#define RT_PROXY_PORT_002_TX 0x2003
#define RT_PROXY_PORT_002_RX 0x2002

#define AFE_PORT_ID_PRIMARY_TDM_RX \
(AFE_PORT_ID_TDM_PORT_RANGE_START + 0x00)
Expand Down
Loading

0 comments on commit ff6a13e

Please sign in to comment.