[COMMON] g2d: disable sharabiltiy feature on g2d
authorCho KyongHo <pullip.cho@samsung.com>
Mon, 13 Nov 2017 02:28:30 +0000 (11:28 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:15 +0000 (20:22 +0300)
Change-Id: I294f5974c57618cdae9aff5354f188db5334bfc5
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/gpu/exynos/g2d/g2d.h
drivers/gpu/exynos/g2d/g2d_drv.c

index afb69d2820ae70481efca082cab45eb72e38c9ca..9c9275af51dcbf75d3ed31f2cd4f2e96e949b3d5 100644 (file)
@@ -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;
index 45afe0c1964789750b49f237280e19ee25ec222f..fd5c7f8d0639f7e5dc4f599d1b77fabac14b9eea 100644 (file)
@@ -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;
 }