Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge tag 'upstream/6.4.11.p2.10' #43

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,10 @@ static inline int get_power_imx8_subsystem(struct device *pdev)
if (core_node)
of_node_put(core_node);

#ifdef CONFIG_PM
pm_runtime_enable(pdev);
#endif

return 0;
}

Expand Down Expand Up @@ -1336,10 +1340,10 @@ free_priv(void)
}

static int set_clock(int gpu, int enable);
static int set_power(int gpu, int enable);
static int set_power(struct device *pdev, int gpu, int enable);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
static void imx6sx_optimize_qosc_for_GPU(void)
static void imx6sx_optimize_qosc_for_GPU(struct device *pdev)
{
struct device_node *np;
void __iomem *src_base;
Expand All @@ -1351,7 +1355,7 @@ static void imx6sx_optimize_qosc_for_GPU(void)
src_base = of_iomap(np, 0);
WARN_ON(!src_base);

set_power(gcvCORE_MAJOR, 1);
set_power(pdev, gcvCORE_MAJOR, 1);
set_clock(gcvCORE_MAJOR, 1);

writel_relaxed(0, src_base); /* Disable clkgate & soft_rst */
Expand All @@ -1361,7 +1365,7 @@ static void imx6sx_optimize_qosc_for_GPU(void)
writel_relaxed(0x0f000822, src_base+0x1400+0xe0); /* Set Read QoS 8 for gpu */

set_clock(gcvCORE_MAJOR, 0);
set_power(gcvCORE_MAJOR, 0);
set_power(pdev, gcvCORE_MAJOR, 0);

return;
}
Expand Down Expand Up @@ -1530,7 +1534,7 @@ static inline int get_power(struct device *pdev)
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
imx6sx_optimize_qosc_for_GPU();
imx6sx_optimize_qosc_for_GPU(pdev);
#endif

return 0;
Expand Down Expand Up @@ -1569,7 +1573,7 @@ static inline int get_power_ls(struct device *pdev)
return 0;
}

static inline void put_power(void)
static inline void put_power(struct device *pdev)
{
int core = 0;
struct gpu_clk *imx_clk = NULL;
Expand Down Expand Up @@ -1609,6 +1613,11 @@ static inline void put_power(void)
#endif
}

#if defined(IMX_GPU_SUBSYSTEM) && defined(CONFIG_PM)
if (pdev->of_node && use_imx_gpu_subsystem)
pm_runtime_disable(pdev);
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 5, 0)
if (priv->gpu_regulator) {
regulator_put(priv->gpu_regulator);
Expand Down Expand Up @@ -1649,7 +1658,7 @@ static inline void put_power_ls(void)
#endif
}

static inline int set_power(int gpu, int enable)
static inline int set_power(struct device *pdev, int gpu, int enable)
{
#ifdef CONFIG_PM
struct imx_priv* priv = &imxPriv;
Expand All @@ -1676,6 +1685,10 @@ static inline int set_power(int gpu, int enable)

#ifdef CONFIG_PM
pm_runtime_get_sync(priv->pmdev[gpu]);
#ifdef IMX_GPU_SUBSYSTEM
if (pdev->of_node && use_imx_gpu_subsystem)
pm_runtime_get_sync(pdev);
#endif
if(priv->pm_qos_core == gpu) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
cpu_latency_qos_add_request(&priv->pm_qos, 0);
Expand Down Expand Up @@ -1748,6 +1761,10 @@ static inline int set_power(int gpu, int enable)
clk_unprepare(clk_ahb);
#ifdef CONFIG_PM
pm_runtime_put_sync(priv->pmdev[gpu]);
#ifdef IMX_GPU_SUBSYSTEM
if (pdev->of_node && use_imx_gpu_subsystem)
pm_runtime_put_sync(pdev);
#endif
if (priv->pm_qos_core == gpu) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
cpu_latency_qos_remove_request(&priv->pm_qos);
Expand Down Expand Up @@ -1941,7 +1958,7 @@ _PutPower(
if (is_layerscape)
put_power_ls();
else
put_power();
put_power(&Platform->device->dev);

return gcvSTATUS_OK;
}
Expand All @@ -1955,8 +1972,8 @@ _SetPower(
gctBOOL Enable
)
{
return set_power((int)GPU, Enable) ? gcvSTATUS_GENERIC_IO
: gcvSTATUS_OK;
return set_power(&Platform->device->dev, (int)GPU, Enable) ?
gcvSTATUS_GENERIC_IO : gcvSTATUS_OK;
}

static gceSTATUS
Expand Down