Loading drivers/gpu/msm/Kconfig +13 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ config MSM_KGSL depends on ARCH_MSM && !ARCH_MSM7X00A && !ARCH_MSM7X25 select GENERIC_ALLOCATOR select FW_LOADER select PM_DEVFREQ select DEVFREQ_GOV_SIMPLE_ONDEMAND select DEVFREQ_GOV_PERFORMANCE ---help--- 3D graphics driver. Required to use hardware accelerated OpenGL ES 2.0 and 1.1. Loading Loading @@ -60,6 +63,16 @@ config MSM_KGSL_2D default y depends on MSM_KGSL && !ARCH_MSM7X27 && !ARCH_MSM7X27A && !(ARCH_QSD8X50 && !MSM_SOC_REV_A) config MSM_ADRENO_DEFAULT_GOVERNOR string "devfreq governor for the adreno core" default "simple_ondemand" depends on MSM_KGSL config MSM_Z180_DEFAULT_GOVERNOR string "devfreq governor for the z180 core(s)" default "performance" depends on MSM_KGSL_2D config MSM_KGSL_DRM bool "Build a DRM interface for the MSM_KGSL driver" depends on MSM_KGSL && DRM Loading drivers/gpu/msm/Makefile +0 −2 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ msm_kgsl_core-y = \ msm_kgsl_core-$(CONFIG_DEBUG_FS) += kgsl_debugfs.o msm_kgsl_core-$(CONFIG_MSM_KGSL_CFF_DUMP) += kgsl_cffdump.o msm_kgsl_core-$(CONFIG_MSM_KGSL_DRM) += kgsl_drm.o msm_kgsl_core-$(CONFIG_MSM_SCM) += kgsl_pwrscale_trustzone.o msm_kgsl_core-$(CONFIG_MSM_SLEEP_STATS_DEVICE) += kgsl_pwrscale_idlestats.o msm_kgsl_core-$(CONFIG_SYNC) += kgsl_sync.o msm_adreno-y += \ Loading drivers/gpu/msm/adreno.c +20 −19 Original line number Diff line number Diff line Loading @@ -77,11 +77,27 @@ #define KGSL_LOG_LEVEL_DEFAULT 3 /* * The default values for the simpleondemand governor are 90 and 5, * we use different values here. * They have to be tuned and compare with the tz governor anyway. */ static struct devfreq_simple_ondemand_data adreno_ondemand_data = { .upthreshold = 80, .downdifferential = 20, }; static const struct devfreq_governor_data adreno_governors[] = { { .name = "simple_ondemand", .data = &adreno_ondemand_data }, }; static const struct kgsl_functable adreno_functable; static struct adreno_device device_3d0 = { .dev = { KGSL_DEVICE_COMMON_INIT(device_3d0.dev), .pwrscale = KGSL_PWRSCALE_INIT(adreno_governors, ARRAY_SIZE(adreno_governors)), .name = DEVICE_3D0_NAME, .id = KGSL_DEVICE_3D0, .mh = { Loading Loading @@ -1676,8 +1692,7 @@ adreno_probe(struct platform_device *pdev) adreno_ft_init_sysfs(device); kgsl_pwrscale_init(device); kgsl_pwrscale_attach_policy(device, ADRENO_DEFAULT_PWRSCALE_POLICY); kgsl_pwrscale_init(&pdev->dev, CONFIG_MSM_ADRENO_DEFAULT_GOVERNOR); device->flags &= ~KGSL_FLAGS_SOFT_RESET; pdata = kgsl_device_get_drvdata(device); Loading Loading @@ -1707,7 +1722,6 @@ static int adreno_remove(struct platform_device *pdev) adreno_coresight_remove(pdev); adreno_profile_close(device); kgsl_pwrscale_detach_policy(device); kgsl_pwrscale_close(device); adreno_dispatcher_close(adreno_dev); Loading Loading @@ -2922,6 +2936,7 @@ static void adreno_power_stats(struct kgsl_device *device, struct kgsl_pwrctrl *pwr = &device->pwrctrl; unsigned int cycles = 0; memset(stats, 0, sizeof(*stats)); /* * Get the busy cycles counted since the counter was last reset. * If we're not currently active, there shouldn't have been Loading @@ -2930,22 +2945,8 @@ static void adreno_power_stats(struct kgsl_device *device, if (device->state == KGSL_STATE_ACTIVE) cycles = adreno_dev->gpudev->busy_cycles(adreno_dev); /* * In order to calculate idle you have to have run the algorithm * at least once to get a start time. */ if (pwr->time != 0) { s64 tmp = ktime_to_us(ktime_get()); stats->total_time = tmp - pwr->time; pwr->time = tmp; stats->busy_time = adreno_ticks_to_us(cycles, device->pwrctrl. pwrlevels[device->pwrctrl.active_pwrlevel]. gpu_freq); } else { stats->total_time = 0; stats->busy_time = 0; pwr->time = ktime_to_us(ktime_get()); } stats->busy_time = adreno_ticks_to_us(cycles, kgsl_pwrctrl_active_freq(pwr)); } void adreno_irqctrl(struct kgsl_device *device, int state) Loading drivers/gpu/msm/adreno.h +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ #define ADRENO_DEFAULT_PWRSCALE_POLICY NULL #endif void adreno_debugfs_init(struct kgsl_device *device); #define ADRENO_ISTORE_START 0x5000 /* Istore offset */ Loading drivers/gpu/msm/adreno_dispatch.c +5 −9 Original line number Diff line number Diff line Loading @@ -1383,11 +1383,12 @@ static void adreno_dispatcher_work(struct work_struct *work) * into suspend even if there are queued command batches */ if (count && dispatcher->inflight == 0) { mutex_lock(&device->mutex); if (count && dispatcher->inflight == 0) kgsl_active_count_put(device); else kgsl_pwrscale_update(device); mutex_unlock(&device->mutex); } /* Dispatch new commands if we have the room */ if (dispatcher->inflight < _dispatcher_inflight) Loading @@ -1406,11 +1407,6 @@ done: del_timer_sync(&dispatcher->fault_timer); } /* Before leaving update the pwrscale information */ mutex_lock(&device->mutex); kgsl_pwrscale_idle(device); mutex_unlock(&device->mutex); mutex_unlock(&dispatcher->mutex); } Loading Loading
drivers/gpu/msm/Kconfig +13 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,9 @@ config MSM_KGSL depends on ARCH_MSM && !ARCH_MSM7X00A && !ARCH_MSM7X25 select GENERIC_ALLOCATOR select FW_LOADER select PM_DEVFREQ select DEVFREQ_GOV_SIMPLE_ONDEMAND select DEVFREQ_GOV_PERFORMANCE ---help--- 3D graphics driver. Required to use hardware accelerated OpenGL ES 2.0 and 1.1. Loading Loading @@ -60,6 +63,16 @@ config MSM_KGSL_2D default y depends on MSM_KGSL && !ARCH_MSM7X27 && !ARCH_MSM7X27A && !(ARCH_QSD8X50 && !MSM_SOC_REV_A) config MSM_ADRENO_DEFAULT_GOVERNOR string "devfreq governor for the adreno core" default "simple_ondemand" depends on MSM_KGSL config MSM_Z180_DEFAULT_GOVERNOR string "devfreq governor for the z180 core(s)" default "performance" depends on MSM_KGSL_2D config MSM_KGSL_DRM bool "Build a DRM interface for the MSM_KGSL driver" depends on MSM_KGSL && DRM Loading
drivers/gpu/msm/Makefile +0 −2 Original line number Diff line number Diff line Loading @@ -15,8 +15,6 @@ msm_kgsl_core-y = \ msm_kgsl_core-$(CONFIG_DEBUG_FS) += kgsl_debugfs.o msm_kgsl_core-$(CONFIG_MSM_KGSL_CFF_DUMP) += kgsl_cffdump.o msm_kgsl_core-$(CONFIG_MSM_KGSL_DRM) += kgsl_drm.o msm_kgsl_core-$(CONFIG_MSM_SCM) += kgsl_pwrscale_trustzone.o msm_kgsl_core-$(CONFIG_MSM_SLEEP_STATS_DEVICE) += kgsl_pwrscale_idlestats.o msm_kgsl_core-$(CONFIG_SYNC) += kgsl_sync.o msm_adreno-y += \ Loading
drivers/gpu/msm/adreno.c +20 −19 Original line number Diff line number Diff line Loading @@ -77,11 +77,27 @@ #define KGSL_LOG_LEVEL_DEFAULT 3 /* * The default values for the simpleondemand governor are 90 and 5, * we use different values here. * They have to be tuned and compare with the tz governor anyway. */ static struct devfreq_simple_ondemand_data adreno_ondemand_data = { .upthreshold = 80, .downdifferential = 20, }; static const struct devfreq_governor_data adreno_governors[] = { { .name = "simple_ondemand", .data = &adreno_ondemand_data }, }; static const struct kgsl_functable adreno_functable; static struct adreno_device device_3d0 = { .dev = { KGSL_DEVICE_COMMON_INIT(device_3d0.dev), .pwrscale = KGSL_PWRSCALE_INIT(adreno_governors, ARRAY_SIZE(adreno_governors)), .name = DEVICE_3D0_NAME, .id = KGSL_DEVICE_3D0, .mh = { Loading Loading @@ -1676,8 +1692,7 @@ adreno_probe(struct platform_device *pdev) adreno_ft_init_sysfs(device); kgsl_pwrscale_init(device); kgsl_pwrscale_attach_policy(device, ADRENO_DEFAULT_PWRSCALE_POLICY); kgsl_pwrscale_init(&pdev->dev, CONFIG_MSM_ADRENO_DEFAULT_GOVERNOR); device->flags &= ~KGSL_FLAGS_SOFT_RESET; pdata = kgsl_device_get_drvdata(device); Loading Loading @@ -1707,7 +1722,6 @@ static int adreno_remove(struct platform_device *pdev) adreno_coresight_remove(pdev); adreno_profile_close(device); kgsl_pwrscale_detach_policy(device); kgsl_pwrscale_close(device); adreno_dispatcher_close(adreno_dev); Loading Loading @@ -2922,6 +2936,7 @@ static void adreno_power_stats(struct kgsl_device *device, struct kgsl_pwrctrl *pwr = &device->pwrctrl; unsigned int cycles = 0; memset(stats, 0, sizeof(*stats)); /* * Get the busy cycles counted since the counter was last reset. * If we're not currently active, there shouldn't have been Loading @@ -2930,22 +2945,8 @@ static void adreno_power_stats(struct kgsl_device *device, if (device->state == KGSL_STATE_ACTIVE) cycles = adreno_dev->gpudev->busy_cycles(adreno_dev); /* * In order to calculate idle you have to have run the algorithm * at least once to get a start time. */ if (pwr->time != 0) { s64 tmp = ktime_to_us(ktime_get()); stats->total_time = tmp - pwr->time; pwr->time = tmp; stats->busy_time = adreno_ticks_to_us(cycles, device->pwrctrl. pwrlevels[device->pwrctrl.active_pwrlevel]. gpu_freq); } else { stats->total_time = 0; stats->busy_time = 0; pwr->time = ktime_to_us(ktime_get()); } stats->busy_time = adreno_ticks_to_us(cycles, kgsl_pwrctrl_active_freq(pwr)); } void adreno_irqctrl(struct kgsl_device *device, int state) Loading
drivers/gpu/msm/adreno.h +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ #define ADRENO_DEFAULT_PWRSCALE_POLICY NULL #endif void adreno_debugfs_init(struct kgsl_device *device); #define ADRENO_ISTORE_START 0x5000 /* Istore offset */ Loading
drivers/gpu/msm/adreno_dispatch.c +5 −9 Original line number Diff line number Diff line Loading @@ -1383,11 +1383,12 @@ static void adreno_dispatcher_work(struct work_struct *work) * into suspend even if there are queued command batches */ if (count && dispatcher->inflight == 0) { mutex_lock(&device->mutex); if (count && dispatcher->inflight == 0) kgsl_active_count_put(device); else kgsl_pwrscale_update(device); mutex_unlock(&device->mutex); } /* Dispatch new commands if we have the room */ if (dispatcher->inflight < _dispatcher_inflight) Loading @@ -1406,11 +1407,6 @@ done: del_timer_sync(&dispatcher->fault_timer); } /* Before leaving update the pwrscale information */ mutex_lock(&device->mutex); kgsl_pwrscale_idle(device); mutex_unlock(&device->mutex); mutex_unlock(&dispatcher->mutex); } Loading