Loading drivers/gpu/msm/adreno.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2008-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2008-2019, The Linux Foundation. All rights reserved. */ #ifndef __ADRENO_H #define __ADRENO_H Loading Loading @@ -122,6 +122,8 @@ * for droop mitigation */ #define ADRENO_ACD BIT(17) /* ECP enabled GMU */ #define ADRENO_ECP BIT(18) /* * Adreno GPU quirks - control bits for various workarounds Loading drivers/gpu/msm/kgsl_gmu.c +15 −7 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #include <linux/module.h> #include <linux/device.h> Loading Loading @@ -63,13 +63,11 @@ struct gmu_iommu_context gmu_ctx[] = { * * We define an array and a simple allocator to keep track of the currently * active SMMU entries of GMU kernel mode context. Each entry is assigned * a unique address inside GMU kernel mode address range. The addresses * are assigned sequentially and aligned to 1MB each. * * a unique address inside GMU kernel mode address range. */ static struct gmu_memdesc gmu_kmem_entries[GMU_KERNEL_ENTRIES]; static unsigned long gmu_kmem_bitmap; static unsigned int num_uncached_entries; static unsigned int uncached_alloc_offset; static void gmu_snapshot(struct kgsl_device *device); static void gmu_remove(struct kgsl_device *device); Loading Loading @@ -199,7 +197,7 @@ static struct gmu_memdesc *allocate_gmu_kmem(struct gmu_device *gmu, md = &gmu_kmem_entries[entry_idx]; md->gmuaddr = gmu_vma[mem_type].start + (num_uncached_entries * SZ_1M); uncached_alloc_offset; set_bit(entry_idx, &gmu_kmem_bitmap); md->size = size; md->mem_type = mem_type; Loading Loading @@ -252,7 +250,7 @@ static struct gmu_memdesc *allocate_gmu_kmem(struct gmu_device *gmu, } if (mem_type == GMU_NONCACHED_KERNEL) num_uncached_entries++; uncached_alloc_offset += md->size; return md; } Loading Loading @@ -468,6 +466,16 @@ static int gmu_memory_probe(struct kgsl_device *device, goto err_ret; } if (ADRENO_FEATURE(adreno_dev, ADRENO_ECP)) { /* Allocation to account for future MEM_ALLOC buffers */ md = allocate_gmu_kmem(gmu, GMU_NONCACHED_KERNEL, SZ_32K, (IOMMU_READ | IOMMU_WRITE | IOMMU_PRIV)); if (IS_ERR(md)) { ret = PTR_ERR(md); goto err_ret; } } return 0; err_ret: gmu_memory_close(gmu); Loading drivers/gpu/msm/kgsl_hfi.c +7 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. */ #include "kgsl_device.h" Loading Loading @@ -734,9 +734,12 @@ int hfi_start(struct kgsl_device *device, * send H2F_MSG_CORE_FW_START and features for A640 devices */ if (HFI_VER_MAJOR(&gmu->hfi) >= 2) { result = hfi_send_feature_ctrl(gmu, HFI_FEATURE_ECP, 0, 0); if (ADRENO_FEATURE(adreno_dev, ADRENO_ECP)) { result = hfi_send_feature_ctrl(gmu, HFI_FEATURE_ECP, 1, 0); if (result) return result; } result = hfi_send_acd_feature_ctrl(gmu, adreno_dev); if (result) Loading Loading
drivers/gpu/msm/adreno.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2008-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2008-2019, The Linux Foundation. All rights reserved. */ #ifndef __ADRENO_H #define __ADRENO_H Loading Loading @@ -122,6 +122,8 @@ * for droop mitigation */ #define ADRENO_ACD BIT(17) /* ECP enabled GMU */ #define ADRENO_ECP BIT(18) /* * Adreno GPU quirks - control bits for various workarounds Loading
drivers/gpu/msm/kgsl_gmu.c +15 −7 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. */ #include <linux/module.h> #include <linux/device.h> Loading Loading @@ -63,13 +63,11 @@ struct gmu_iommu_context gmu_ctx[] = { * * We define an array and a simple allocator to keep track of the currently * active SMMU entries of GMU kernel mode context. Each entry is assigned * a unique address inside GMU kernel mode address range. The addresses * are assigned sequentially and aligned to 1MB each. * * a unique address inside GMU kernel mode address range. */ static struct gmu_memdesc gmu_kmem_entries[GMU_KERNEL_ENTRIES]; static unsigned long gmu_kmem_bitmap; static unsigned int num_uncached_entries; static unsigned int uncached_alloc_offset; static void gmu_snapshot(struct kgsl_device *device); static void gmu_remove(struct kgsl_device *device); Loading Loading @@ -199,7 +197,7 @@ static struct gmu_memdesc *allocate_gmu_kmem(struct gmu_device *gmu, md = &gmu_kmem_entries[entry_idx]; md->gmuaddr = gmu_vma[mem_type].start + (num_uncached_entries * SZ_1M); uncached_alloc_offset; set_bit(entry_idx, &gmu_kmem_bitmap); md->size = size; md->mem_type = mem_type; Loading Loading @@ -252,7 +250,7 @@ static struct gmu_memdesc *allocate_gmu_kmem(struct gmu_device *gmu, } if (mem_type == GMU_NONCACHED_KERNEL) num_uncached_entries++; uncached_alloc_offset += md->size; return md; } Loading Loading @@ -468,6 +466,16 @@ static int gmu_memory_probe(struct kgsl_device *device, goto err_ret; } if (ADRENO_FEATURE(adreno_dev, ADRENO_ECP)) { /* Allocation to account for future MEM_ALLOC buffers */ md = allocate_gmu_kmem(gmu, GMU_NONCACHED_KERNEL, SZ_32K, (IOMMU_READ | IOMMU_WRITE | IOMMU_PRIV)); if (IS_ERR(md)) { ret = PTR_ERR(md); goto err_ret; } } return 0; err_ret: gmu_memory_close(gmu); Loading
drivers/gpu/msm/kgsl_hfi.c +7 −4 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2018, The Linux Foundation. All rights reserved. * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. */ #include "kgsl_device.h" Loading Loading @@ -734,9 +734,12 @@ int hfi_start(struct kgsl_device *device, * send H2F_MSG_CORE_FW_START and features for A640 devices */ if (HFI_VER_MAJOR(&gmu->hfi) >= 2) { result = hfi_send_feature_ctrl(gmu, HFI_FEATURE_ECP, 0, 0); if (ADRENO_FEATURE(adreno_dev, ADRENO_ECP)) { result = hfi_send_feature_ctrl(gmu, HFI_FEATURE_ECP, 1, 0); if (result) return result; } result = hfi_send_acd_feature_ctrl(gmu, adreno_dev); if (result) Loading