Loading drivers/gpu/msm/adreno_a6xx.c +11 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include "kgsl.h" #include "kgsl_hfi.h" #include "kgsl_trace.h" #include "kgsl_gmu.h" #define MIN_HBB 13 Loading Loading @@ -1445,6 +1446,8 @@ static int64_t a6xx_read_throttling_counters(struct adreno_device *adreno_dev) int64_t adj = -1; uint32_t counts[ADRENO_GPMU_THROTTLE_COUNTERS]; struct adreno_busy_data *busy = &adreno_dev->busy_data; struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = KGSL_GMU_DEVICE(device); for (i = 0; i < ARRAY_SIZE(counts); i++) { if (!adreno_dev->gpmu_throttle_counters[i]) Loading @@ -1458,12 +1461,18 @@ static int64_t a6xx_read_throttling_counters(struct adreno_device *adreno_dev) /* * The adjustment is the number of cycles lost to throttling, which * is calculated as a weighted average of the cycles throttled * at 15%, 50%, and 90%. The adjustment is negative because in A6XX, * at 5% or 15% based on GMU FW version, 50%, and 90%. * The adjustment is negative because in A6XX, * the busy count includes the throttled cycles. Therefore, we want * to remove them to prevent appearing to be busier than * we actually are. */ adj *= ((counts[0] * 15) + (counts[1] * 50) + (counts[2] * 90)) / 100; if (GMU_VER_STEP(gmu->ver) > 0x104) adj *= ((counts[0] * 5) + (counts[1] * 50) + (counts[2] * 90)) / 100; else adj *= ((counts[0] * 15) + (counts[1] * 50) + (counts[2] * 90)) / 100; trace_kgsl_clock_throttling(0, counts[1], counts[2], counts[0], adj); Loading drivers/gpu/msm/adreno_a6xx_gmu.c +5 −1 Original line number Diff line number Diff line Loading @@ -1329,7 +1329,7 @@ static uint32_t lm_limit(struct adreno_device *adreno_dev) } static int a640_throttling_counters[ADRENO_GPMU_THROTTLE_COUNTERS] = { 0x11, 0x15, 0x19 0x11, 0x15, 0x19, }; static void _setup_throttling_counters(struct adreno_device *adreno_dev) Loading @@ -1338,6 +1338,10 @@ static void _setup_throttling_counters(struct adreno_device *adreno_dev) struct gmu_device *gmu = KGSL_GMU_DEVICE(device); int i, ret; /* Select counter for 5% throttling instead of 15% */ if (GMU_VER_STEP(gmu->ver) > 0x104) a640_throttling_counters[0] = 0x10; for (i = 0; i < ARRAY_SIZE(a640_throttling_counters); i++) { adreno_dev->busy_data.throttle_cycles[i] = 0; Loading drivers/gpu/msm/kgsl_gmu_core.h +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,12 @@ (((_devops) != NULL) && \ ((_devops)->_field != NULL)) #define GMU_VER_MAJOR(ver) (((ver) >> 28) & 0xF) #define GMU_VER_MINOR(ver) (((ver) >> 16) & 0xFFF) #define GMU_VER_STEP(ver) (((ver) >> 0) & 0xFFFF) #define GMU_VERSION(major, minor) \ ((((major) & 0xF) << 28) | (((minor) & 0xFFF) << 16)) #define NUM_BW_LEVELS 100 #define MAX_GX_LEVELS 16 #define MAX_CX_LEVELS 4 Loading drivers/gpu/msm/kgsl_hfi.c +1 −6 Original line number Diff line number Diff line /* Copyright (c) 2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2018-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 Loading Loading @@ -628,11 +628,6 @@ void hfi_receiver(unsigned long data) hfi_process_queue((struct gmu_device *) data, HFI_DBG_ID, NULL); } #define GMU_VER_MAJOR(ver) (((ver) >> 28) & 0xF) #define GMU_VER_MINOR(ver) (((ver) >> 16) & 0xFFF) #define GMU_VERSION(major, minor) \ ((((major) & 0xF) << 28) | (((minor) & 0xFFF) << 16)) static int hfi_verify_fw_version(struct kgsl_device *device, struct gmu_device *gmu) { Loading Loading
drivers/gpu/msm/adreno_a6xx.c +11 −2 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include "kgsl.h" #include "kgsl_hfi.h" #include "kgsl_trace.h" #include "kgsl_gmu.h" #define MIN_HBB 13 Loading Loading @@ -1445,6 +1446,8 @@ static int64_t a6xx_read_throttling_counters(struct adreno_device *adreno_dev) int64_t adj = -1; uint32_t counts[ADRENO_GPMU_THROTTLE_COUNTERS]; struct adreno_busy_data *busy = &adreno_dev->busy_data; struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct gmu_device *gmu = KGSL_GMU_DEVICE(device); for (i = 0; i < ARRAY_SIZE(counts); i++) { if (!adreno_dev->gpmu_throttle_counters[i]) Loading @@ -1458,12 +1461,18 @@ static int64_t a6xx_read_throttling_counters(struct adreno_device *adreno_dev) /* * The adjustment is the number of cycles lost to throttling, which * is calculated as a weighted average of the cycles throttled * at 15%, 50%, and 90%. The adjustment is negative because in A6XX, * at 5% or 15% based on GMU FW version, 50%, and 90%. * The adjustment is negative because in A6XX, * the busy count includes the throttled cycles. Therefore, we want * to remove them to prevent appearing to be busier than * we actually are. */ adj *= ((counts[0] * 15) + (counts[1] * 50) + (counts[2] * 90)) / 100; if (GMU_VER_STEP(gmu->ver) > 0x104) adj *= ((counts[0] * 5) + (counts[1] * 50) + (counts[2] * 90)) / 100; else adj *= ((counts[0] * 15) + (counts[1] * 50) + (counts[2] * 90)) / 100; trace_kgsl_clock_throttling(0, counts[1], counts[2], counts[0], adj); Loading
drivers/gpu/msm/adreno_a6xx_gmu.c +5 −1 Original line number Diff line number Diff line Loading @@ -1329,7 +1329,7 @@ static uint32_t lm_limit(struct adreno_device *adreno_dev) } static int a640_throttling_counters[ADRENO_GPMU_THROTTLE_COUNTERS] = { 0x11, 0x15, 0x19 0x11, 0x15, 0x19, }; static void _setup_throttling_counters(struct adreno_device *adreno_dev) Loading @@ -1338,6 +1338,10 @@ static void _setup_throttling_counters(struct adreno_device *adreno_dev) struct gmu_device *gmu = KGSL_GMU_DEVICE(device); int i, ret; /* Select counter for 5% throttling instead of 15% */ if (GMU_VER_STEP(gmu->ver) > 0x104) a640_throttling_counters[0] = 0x10; for (i = 0; i < ARRAY_SIZE(a640_throttling_counters); i++) { adreno_dev->busy_data.throttle_cycles[i] = 0; Loading
drivers/gpu/msm/kgsl_gmu_core.h +6 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,12 @@ (((_devops) != NULL) && \ ((_devops)->_field != NULL)) #define GMU_VER_MAJOR(ver) (((ver) >> 28) & 0xF) #define GMU_VER_MINOR(ver) (((ver) >> 16) & 0xFFF) #define GMU_VER_STEP(ver) (((ver) >> 0) & 0xFFFF) #define GMU_VERSION(major, minor) \ ((((major) & 0xF) << 28) | (((minor) & 0xFFF) << 16)) #define NUM_BW_LEVELS 100 #define MAX_GX_LEVELS 16 #define MAX_CX_LEVELS 4 Loading
drivers/gpu/msm/kgsl_hfi.c +1 −6 Original line number Diff line number Diff line /* Copyright (c) 2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2018-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 Loading Loading @@ -628,11 +628,6 @@ void hfi_receiver(unsigned long data) hfi_process_queue((struct gmu_device *) data, HFI_DBG_ID, NULL); } #define GMU_VER_MAJOR(ver) (((ver) >> 28) & 0xF) #define GMU_VER_MINOR(ver) (((ver) >> 16) & 0xFFF) #define GMU_VERSION(major, minor) \ ((((major) & 0xF) << 28) | (((minor) & 0xFFF) << 16)) static int hfi_verify_fw_version(struct kgsl_device *device, struct gmu_device *gmu) { Loading