Loading drivers/gpu/msm/Kconfig +1 −0 Original line number Original line Diff line number Diff line Loading @@ -6,6 +6,7 @@ config QCOM_KGSL select FW_LOADER select FW_LOADER select PM_DEVFREQ select PM_DEVFREQ select QCOM_SCM select QCOM_SCM select NVMEM select DEVFREQ_GOV_SIMPLE_ONDEMAND select DEVFREQ_GOV_SIMPLE_ONDEMAND select DEVFREQ_GOV_PERFORMANCE select DEVFREQ_GOV_PERFORMANCE select DEVFREQ_GOV_QCOM_ADRENO_TZ select DEVFREQ_GOV_QCOM_ADRENO_TZ Loading drivers/gpu/msm/adreno.c +29 −0 Original line number Original line Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include <linux/module.h> #include <linux/module.h> #include <linux/msm_kgsl.h> #include <linux/msm_kgsl.h> #include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h> #include <linux/nvmem-consumer.h> #include <soc/qcom/scm.h> #include <soc/qcom/scm.h> #include "adreno.h" #include "adreno.h" Loading Loading @@ -1283,6 +1284,30 @@ static bool adreno_is_gpu_disabled(struct adreno_device *adreno_dev) pte_row0_msb[1] ? true : false; pte_row0_msb[1] ? true : false; } } static int adreno_read_speed_bin(struct platform_device *pdev, struct adreno_device *adreno_dev) { struct nvmem_cell *cell = nvmem_cell_get(&pdev->dev, "speed_bin"); int ret = PTR_ERR_OR_ZERO(cell); if (ret) { /* * If the cell isn't defined enabled, then revert to * using the default bin */ if (ret == -ENOENT) return 0; return ret; } adreno_dev->speed_bin = *((unsigned int *) nvmem_cell_read(cell, NULL)); nvmem_cell_put(cell); return 0; } static int adreno_probe(struct platform_device *pdev) static int adreno_probe(struct platform_device *pdev) { { const struct of_device_id *of_id = const struct of_device_id *of_id = Loading @@ -1303,6 +1328,10 @@ static int adreno_probe(struct platform_device *pdev) adreno_update_soc_hw_revision_quirks(adreno_dev, pdev); adreno_update_soc_hw_revision_quirks(adreno_dev, pdev); status = adreno_read_speed_bin(pdev, adreno_dev); if (status) return status; /* Get the chip ID from the DT and set up target specific parameters */ /* Get the chip ID from the DT and set up target specific parameters */ if (adreno_identify_gpu(adreno_dev)) if (adreno_identify_gpu(adreno_dev)) return -ENODEV; return -ENODEV; Loading Loading
drivers/gpu/msm/Kconfig +1 −0 Original line number Original line Diff line number Diff line Loading @@ -6,6 +6,7 @@ config QCOM_KGSL select FW_LOADER select FW_LOADER select PM_DEVFREQ select PM_DEVFREQ select QCOM_SCM select QCOM_SCM select NVMEM select DEVFREQ_GOV_SIMPLE_ONDEMAND select DEVFREQ_GOV_SIMPLE_ONDEMAND select DEVFREQ_GOV_PERFORMANCE select DEVFREQ_GOV_PERFORMANCE select DEVFREQ_GOV_QCOM_ADRENO_TZ select DEVFREQ_GOV_QCOM_ADRENO_TZ Loading
drivers/gpu/msm/adreno.c +29 −0 Original line number Original line Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include <linux/module.h> #include <linux/module.h> #include <linux/msm_kgsl.h> #include <linux/msm_kgsl.h> #include <linux/regulator/consumer.h> #include <linux/regulator/consumer.h> #include <linux/nvmem-consumer.h> #include <soc/qcom/scm.h> #include <soc/qcom/scm.h> #include "adreno.h" #include "adreno.h" Loading Loading @@ -1283,6 +1284,30 @@ static bool adreno_is_gpu_disabled(struct adreno_device *adreno_dev) pte_row0_msb[1] ? true : false; pte_row0_msb[1] ? true : false; } } static int adreno_read_speed_bin(struct platform_device *pdev, struct adreno_device *adreno_dev) { struct nvmem_cell *cell = nvmem_cell_get(&pdev->dev, "speed_bin"); int ret = PTR_ERR_OR_ZERO(cell); if (ret) { /* * If the cell isn't defined enabled, then revert to * using the default bin */ if (ret == -ENOENT) return 0; return ret; } adreno_dev->speed_bin = *((unsigned int *) nvmem_cell_read(cell, NULL)); nvmem_cell_put(cell); return 0; } static int adreno_probe(struct platform_device *pdev) static int adreno_probe(struct platform_device *pdev) { { const struct of_device_id *of_id = const struct of_device_id *of_id = Loading @@ -1303,6 +1328,10 @@ static int adreno_probe(struct platform_device *pdev) adreno_update_soc_hw_revision_quirks(adreno_dev, pdev); adreno_update_soc_hw_revision_quirks(adreno_dev, pdev); status = adreno_read_speed_bin(pdev, adreno_dev); if (status) return status; /* Get the chip ID from the DT and set up target specific parameters */ /* Get the chip ID from the DT and set up target specific parameters */ if (adreno_identify_gpu(adreno_dev)) if (adreno_identify_gpu(adreno_dev)) return -ENODEV; return -ENODEV; Loading