From: Cho KyongHo Date: Mon, 13 Nov 2017 02:28:30 +0000 (+0900) Subject: [COMMON] g2d: disable sharabiltiy feature on g2d X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2aa3e2ccdecd96b705b8738171648582164aeb42;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] g2d: disable sharabiltiy feature on g2d Change-Id: I294f5974c57618cdae9aff5354f188db5334bfc5 Signed-off-by: Cho KyongHo --- diff --git a/drivers/gpu/exynos/g2d/g2d.h b/drivers/gpu/exynos/g2d/g2d.h index afb69d2820ae..9c9275af51dc 100644 --- a/drivers/gpu/exynos/g2d/g2d.h +++ b/drivers/gpu/exynos/g2d/g2d.h @@ -79,6 +79,7 @@ struct g2d_device { struct device *dev; struct clk *clock; void __iomem *reg; + void __iomem *sysreg; u64 fence_context; atomic_t fence_timeline; diff --git a/drivers/gpu/exynos/g2d/g2d_drv.c b/drivers/gpu/exynos/g2d/g2d_drv.c index 45afe0c19647..fd5c7f8d0639 100644 --- a/drivers/gpu/exynos/g2d/g2d_drv.c +++ b/drivers/gpu/exynos/g2d/g2d_drv.c @@ -768,6 +768,8 @@ static int g2d_probe(struct platform_device *pdev) if (IS_ERR(g2d_dev->reg)) return PTR_ERR(g2d_dev->reg); + g2d_dev->sysreg = ioremap(0x17610000, SZ_4K); + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(&pdev->dev, "Failed to get IRQ resource"); @@ -910,8 +912,13 @@ static int g2d_remove(struct platform_device *pdev) #ifdef CONFIG_PM static int g2d_runtime_resume(struct device *dev) { + struct g2d_device *g2d_dev = dev_get_drvdata(dev); + g2d_stamp_task(NULL, G2D_STAMP_STATE_RUNTIME_PM, 0); + /* clear [0:12] bit from SHARABILITY_CTRL */ + writel((readl(g2d_dev->sysreg + 0x408) & ~0x1FFF), g2d_dev->sysreg + 0x408); + return 0; }