[9610] g2d: add support for Exynos9610
authorCho KyongHo <pullip.cho@samsung.com>
Fri, 18 May 2018 03:12:18 +0000 (12:12 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:28:12 +0000 (14:28 +0900)
The features of G2D of Exynos9610 is the same as Exynos9810 except
supporting source layers.

Change-Id: Ia5b69fd25b5ab02c742a8ec71eafc4fe601ead3a
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/gpu/exynos/g2d/g2d.h
drivers/gpu/exynos/g2d/g2d_drv.c
drivers/gpu/exynos/g2d/g2d_task.h
drivers/gpu/exynos/g2d/g2d_uapi_process.c

index b7f6f19c0322f559c02ddab9a0e74265016fed7f..81aae54c984d66ca3020b030ce9ef482a6e809c7 100644 (file)
@@ -116,6 +116,7 @@ struct g2d_device {
        struct mutex                    lock_qos;
        struct list_head                qos_contexts;
        u32 hw_ppc[PPC_END];
+       u32                             max_layers;
 
        struct g2d_dvfs_table *dvfs_table;
        u32 dvfs_table_cnt;
index 0bd47ab9b4634777c3cc50a1303206fdfd446771..434817dd80b58f281873439999656fa75b4e77eb 100644 (file)
@@ -774,15 +774,29 @@ static int g2d_parse_dt(struct g2d_device *g2d_dev)
 
 struct g2d_device_data {
        unsigned long caps;
+       unsigned int max_layers;
+};
+
+const struct g2d_device_data g2d_9610_data __initconst = {
+       .max_layers = G2D_MAX_IMAGES_HALF,
+};
+
+const struct g2d_device_data g2d_9810_data __initconst = {
+       .max_layers = G2D_MAX_IMAGES,
 };
 
 const struct g2d_device_data g2d_9820_data __initconst = {
        .caps = G2D_DEVICE_CAPS_SELF_PROTECTION | G2D_DEVICE_CAPS_YUV_BITDEPTH,
+       .max_layers = G2D_MAX_IMAGES,
 };
 
 static const struct of_device_id of_g2d_match[] __refconst = {
        {
                .compatible = "samsung,exynos9810-g2d",
+               .data = &g2d_9810_data,
+       }, {
+               .compatible = "samsung,exynos9610-g2d",
+               .data = &g2d_9610_data,
        }, {
                .compatible = "samsung,exynos9820-g2d",
                .data = &g2d_9820_data,
@@ -843,6 +857,7 @@ static int g2d_probe(struct platform_device *pdev)
                const struct g2d_device_data *devdata = of_id->data;
 
                g2d_dev->caps = devdata->caps;
+               g2d_dev->max_layers = devdata->max_layers;
        }
 
        ret = iovmm_activate(&pdev->dev);
index 43e925b626cc1787f1742340ea825eb37d781773..a3898d4202aa60d369d24d0e11f2866559aa9cc7 100644 (file)
@@ -27,6 +27,7 @@
 #include "g2d_format.h"
 
 #define G2D_MAX_IMAGES         16
+#define G2D_MAX_IMAGES_HALF    8
 #define G2D_MAX_JOBS           16
 #define G2D_CMD_LIST_SIZE      8192
 
index 6c9957ce09f461445266c3187bf372e50652acfd..fde5b2f933e46a29da855469440087d8a15e6ca2 100644 (file)
@@ -763,7 +763,7 @@ int g2d_get_userdata(struct g2d_device *g2d_dev, struct g2d_context *ctx,
        int ret;
 
        /* invalid range check */
-       if ((data->num_source < 1) || (data->num_source > G2D_MAX_IMAGES)) {
+       if ((data->num_source < 1) || (data->num_source > g2d_dev->max_layers)) {
                dev_err(dev, "%s: Invalid number of source images %u\n",
                        __func__, data->num_source);
                return -EINVAL;