Re: [PATCH 14/25] drm/exynos: introduce exynos_drm_plane_config structure

2015-11-19 Thread Marek Szyprowski

Hello,

On 2015-11-18 16:40, Tobias Jakobi wrote:

Marek Szyprowski wrote:

On 2015-11-17 19:00, Tobias Jakobi wrote:

Marek Szyprowski wrote:

This patch adds common structure for keeping plane configuration and
capabilities data. This patch is inspired by similar code developed by
Tobias Jakobi.

Signed-off-by: Marek Szyprowski 
---
   drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 +++---
   drivers/gpu/drm/exynos/exynos7_drm_decon.c| 23 +++-
   drivers/gpu/drm/exynos/exynos_drm_drv.h   | 22 
   drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 25 -
   drivers/gpu/drm/exynos/exynos_drm_plane.c | 34 --
   drivers/gpu/drm/exynos/exynos_drm_plane.h |  7 ++--
   drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 25 -
   drivers/gpu/drm/exynos/exynos_mixer.c | 51
---
   8 files changed, 131 insertions(+), 74 deletions(-)




diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c
b/drivers/gpu/drm/exynos/exynos_mixer.c
index 015e85cabcc9..cdec3c1827c6 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -43,7 +43,6 @@
 #define MIXER_WIN_NR3
   #define VP_DEFAULT_WIN2
-#define CURSOR_WIN1
 /* The pixelformats that are natively supported by the mixer. */
   #define MXR_FORMAT_RGB5654
@@ -112,6 +111,31 @@ struct mixer_drv_data {
   boolhas_sclk;
   };
   +static const struct exynos_drm_plane_config
plane_configs[MIXER_WIN_NR] = {
+{
+.zpos = 0,
+.type = DRM_PLANE_TYPE_PRIMARY,
+.pixel_formats = mixer_formats,
+.num_pixel_formats = ARRAY_SIZE(mixer_formats),
+.capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
+EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
+}, {
+.zpos = 1,
+.type = DRM_PLANE_TYPE_CURSOR,
+.pixel_formats = mixer_formats,
+.num_pixel_formats = ARRAY_SIZE(mixer_formats),
+.capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
+EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
+}, {
+.zpos = 2,
+.type = DRM_PLANE_TYPE_OVERLAY,
+.pixel_formats = vp_formats,
+.num_pixel_formats = ARRAY_SIZE(vp_formats),
+.capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
+EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,

As far as I know the video plane supports arbitrary scaling and provides
no dedicated 'pixel doubling' mode.

Right, I've forgotten that, I will update the code then. BTW, do you
plan to
submit your patches for Mixer, which fixes alpha blending setup?

I'll try to send a new version out this weekend. Any specific branch I
should base these on? (e.g. Inki's exynos-drm-next)


exynos-drm-next will be okay.

Best regards
--
Marek Szyprowski, PhD
Samsung R Institute Poland

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/25] drm/exynos: introduce exynos_drm_plane_config structure

2015-11-18 Thread Tobias Jakobi
Hey Marek,


Marek Szyprowski wrote:
> Hello,
> 
> On 2015-11-17 19:00, Tobias Jakobi wrote:
>> Marek Szyprowski wrote:
>>> This patch adds common structure for keeping plane configuration and
>>> capabilities data. This patch is inspired by similar code developed by
>>> Tobias Jakobi.
>>>
>>> Signed-off-by: Marek Szyprowski 
>>> ---
>>>   drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 +++---
>>>   drivers/gpu/drm/exynos/exynos7_drm_decon.c| 23 +++-
>>>   drivers/gpu/drm/exynos/exynos_drm_drv.h   | 22 
>>>   drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 25 -
>>>   drivers/gpu/drm/exynos/exynos_drm_plane.c | 34 --
>>>   drivers/gpu/drm/exynos/exynos_drm_plane.h |  7 ++--
>>>   drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 25 -
>>>   drivers/gpu/drm/exynos/exynos_mixer.c | 51
>>> ---
>>>   8 files changed, 131 insertions(+), 74 deletions(-)
>>>
>> 
>>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c
>>> b/drivers/gpu/drm/exynos/exynos_mixer.c
>>> index 015e85cabcc9..cdec3c1827c6 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
>>> @@ -43,7 +43,6 @@
>>> #define MIXER_WIN_NR3
>>>   #define VP_DEFAULT_WIN2
>>> -#define CURSOR_WIN1
>>> /* The pixelformats that are natively supported by the mixer. */
>>>   #define MXR_FORMAT_RGB5654
>>> @@ -112,6 +111,31 @@ struct mixer_drv_data {
>>>   boolhas_sclk;
>>>   };
>>>   +static const struct exynos_drm_plane_config
>>> plane_configs[MIXER_WIN_NR] = {
>>> +{
>>> +.zpos = 0,
>>> +.type = DRM_PLANE_TYPE_PRIMARY,
>>> +.pixel_formats = mixer_formats,
>>> +.num_pixel_formats = ARRAY_SIZE(mixer_formats),
>>> +.capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
>>> +EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
>>> +}, {
>>> +.zpos = 1,
>>> +.type = DRM_PLANE_TYPE_CURSOR,
>>> +.pixel_formats = mixer_formats,
>>> +.num_pixel_formats = ARRAY_SIZE(mixer_formats),
>>> +.capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
>>> +EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
>>> +}, {
>>> +.zpos = 2,
>>> +.type = DRM_PLANE_TYPE_OVERLAY,
>>> +.pixel_formats = vp_formats,
>>> +.num_pixel_formats = ARRAY_SIZE(vp_formats),
>>> +.capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
>>> +EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
>> As far as I know the video plane supports arbitrary scaling and provides
>> no dedicated 'pixel doubling' mode.
> 
> Right, I've forgotten that, I will update the code then. BTW, do you
> plan to
> submit your patches for Mixer, which fixes alpha blending setup?
I'll try to send a new version out this weekend. Any specific branch I
should base these on? (e.g. Inki's exynos-drm-next)

- Tobias


> 
> Best regards

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/25] drm/exynos: introduce exynos_drm_plane_config structure

2015-11-18 Thread Marek Szyprowski

Hello,

On 2015-11-17 19:00, Tobias Jakobi wrote:

Marek Szyprowski wrote:

This patch adds common structure for keeping plane configuration and
capabilities data. This patch is inspired by similar code developed by
Tobias Jakobi.

Signed-off-by: Marek Szyprowski 
---
  drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 +++---
  drivers/gpu/drm/exynos/exynos7_drm_decon.c| 23 +++-
  drivers/gpu/drm/exynos/exynos_drm_drv.h   | 22 
  drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 25 -
  drivers/gpu/drm/exynos/exynos_drm_plane.c | 34 --
  drivers/gpu/drm/exynos/exynos_drm_plane.h |  7 ++--
  drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 25 -
  drivers/gpu/drm/exynos/exynos_mixer.c | 51 ---
  8 files changed, 131 insertions(+), 74 deletions(-)




diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
b/drivers/gpu/drm/exynos/exynos_mixer.c
index 015e85cabcc9..cdec3c1827c6 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -43,7 +43,6 @@
  
  #define MIXER_WIN_NR		3

  #define VP_DEFAULT_WIN2
-#define CURSOR_WIN 1
  
  /* The pixelformats that are natively supported by the mixer. */

  #define MXR_FORMAT_RGB565 4
@@ -112,6 +111,31 @@ struct mixer_drv_data {
boolhas_sclk;
  };
  
+static const struct exynos_drm_plane_config plane_configs[MIXER_WIN_NR] = {

+   {
+   .zpos = 0,
+   .type = DRM_PLANE_TYPE_PRIMARY,
+   .pixel_formats = mixer_formats,
+   .num_pixel_formats = ARRAY_SIZE(mixer_formats),
+   .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
+   EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
+   }, {
+   .zpos = 1,
+   .type = DRM_PLANE_TYPE_CURSOR,
+   .pixel_formats = mixer_formats,
+   .num_pixel_formats = ARRAY_SIZE(mixer_formats),
+   .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
+   EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
+   }, {
+   .zpos = 2,
+   .type = DRM_PLANE_TYPE_OVERLAY,
+   .pixel_formats = vp_formats,
+   .num_pixel_formats = ARRAY_SIZE(vp_formats),
+   .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
+   EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,

As far as I know the video plane supports arbitrary scaling and provides
no dedicated 'pixel doubling' mode.


Right, I've forgotten that, I will update the code then. BTW, do you plan to
submit your patches for Mixer, which fixes alpha blending setup?

Best regards
--
Marek Szyprowski, PhD
Samsung R Institute Poland

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/25] drm/exynos: introduce exynos_drm_plane_config structure

2015-11-17 Thread Tobias Jakobi
Hello Marek,


Marek Szyprowski wrote:
> This patch adds common structure for keeping plane configuration and
> capabilities data. This patch is inspired by similar code developed by
> Tobias Jakobi.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 +++---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c| 23 +++-
>  drivers/gpu/drm/exynos/exynos_drm_drv.h   | 22 
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 25 -
>  drivers/gpu/drm/exynos/exynos_drm_plane.c | 34 --
>  drivers/gpu/drm/exynos/exynos_drm_plane.h |  7 ++--
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 25 -
>  drivers/gpu/drm/exynos/exynos_mixer.c | 51 
> ---
>  8 files changed, 131 insertions(+), 74 deletions(-)
> 

> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c 
> b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 015e85cabcc9..cdec3c1827c6 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> @@ -43,7 +43,6 @@
>  
>  #define MIXER_WIN_NR 3
>  #define VP_DEFAULT_WIN   2
> -#define CURSOR_WIN   1
>  
>  /* The pixelformats that are natively supported by the mixer. */
>  #define MXR_FORMAT_RGB5654
> @@ -112,6 +111,31 @@ struct mixer_drv_data {
>   boolhas_sclk;
>  };
>  
> +static const struct exynos_drm_plane_config plane_configs[MIXER_WIN_NR] = {
> + {
> + .zpos = 0,
> + .type = DRM_PLANE_TYPE_PRIMARY,
> + .pixel_formats = mixer_formats,
> + .num_pixel_formats = ARRAY_SIZE(mixer_formats),
> + .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
> + EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
> + }, {
> + .zpos = 1,
> + .type = DRM_PLANE_TYPE_CURSOR,
> + .pixel_formats = mixer_formats,
> + .num_pixel_formats = ARRAY_SIZE(mixer_formats),
> + .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
> + EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
> + }, {
> + .zpos = 2,
> + .type = DRM_PLANE_TYPE_OVERLAY,
> + .pixel_formats = vp_formats,
> + .num_pixel_formats = ARRAY_SIZE(vp_formats),
> + .capabilities = EXYNOS_DRM_PLANE_CAP_DOUBLE_X |
> + EXYNOS_DRM_PLANE_CAP_DOUBLE_Y,
As far as I know the video plane supports arbitrary scaling and provides
no dedicated 'pixel doubling' mode.


With best wishes,
Tobias


> + },
> +};
> +
>  static const u8 filter_y_horiz_tap8[] = {
>   0,  -1, -1, -1, -1, -1, -1, -1,
>   -1, -1, -1, -1, -1, 0,  0,  0,
> @@ -1188,38 +1212,25 @@ static struct of_device_id mixer_match_types[] = {
>  };
>  MODULE_DEVICE_TABLE(of, mixer_match_types);
>  
> +
>  static int mixer_bind(struct device *dev, struct device *manager, void *data)
>  {
>   struct mixer_context *ctx = dev_get_drvdata(dev);
>   struct drm_device *drm_dev = data;
>   struct exynos_drm_plane *exynos_plane;
> - unsigned int zpos;
> + unsigned int i;
>   int ret;
>  
>   ret = mixer_initialize(ctx, drm_dev);
>   if (ret)
>   return ret;
>  
> - for (zpos = 0; zpos < MIXER_WIN_NR; zpos++) {
> - enum drm_plane_type type;
> - const uint32_t *formats;
> - unsigned int fcount;
> -
> - if (zpos == VP_DEFAULT_WIN && !ctx->vp_enabled)
> + for (i = 0; i < MIXER_WIN_NR; i++) {
> + if (i == VP_DEFAULT_WIN && !ctx->vp_enabled)
>   continue;
>  
> - if (zpos < VP_DEFAULT_WIN) {
> - formats = mixer_formats;
> - fcount = ARRAY_SIZE(mixer_formats);
> - } else {
> - formats = vp_formats;
> - fcount = ARRAY_SIZE(vp_formats);
> - }
> -
> - type = exynos_plane_get_type(zpos, CURSOR_WIN);
> - ret = exynos_plane_init(drm_dev, >planes[zpos],
> - 1 << ctx->pipe, type, formats, fcount,
> - zpos);
> + ret = exynos_plane_init(drm_dev, >planes[i],
> + 1 << ctx->pipe, _configs[i]);
>   if (ret)
>   return ret;
>   }
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 14/25] drm/exynos: introduce exynos_drm_plane_config structure

2015-11-13 Thread Gustavo Padovan
Hi Marek,

2015-11-10 Marek Szyprowski :

> This patch adds common structure for keeping plane configuration and
> capabilities data. This patch is inspired by similar code developed by
> Tobias Jakobi.
> 
> Signed-off-by: Marek Szyprowski 
> ---
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 +++---
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c| 23 +++-
>  drivers/gpu/drm/exynos/exynos_drm_drv.h   | 22 
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 25 -
>  drivers/gpu/drm/exynos/exynos_drm_plane.c | 34 --
>  drivers/gpu/drm/exynos/exynos_drm_plane.h |  7 ++--
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 25 -
>  drivers/gpu/drm/exynos/exynos_mixer.c | 51 
> ---
>  8 files changed, 131 insertions(+), 74 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> index 27039468364b..3c8b8e0240fe 100644
> --- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
> @@ -26,7 +26,6 @@
>  #include "exynos_drm_iommu.h"
>  
>  #define WINDOWS_NR   3
> -#define CURSOR_WIN   2
>  #define MIN_FB_WIDTH_FOR_16WORD_BURST128
>  
>  static const char * const decon_clks_name[] = {
> @@ -57,6 +56,7 @@ struct decon_context {
>   struct drm_device   *drm_dev;
>   struct exynos_drm_crtc  *crtc;
>   struct exynos_drm_plane planes[WINDOWS_NR];
> + struct exynos_drm_plane_config  configs[WINDOWS_NR];
>   void __iomem*addr;
>   struct clk  *clks[ARRAY_SIZE(decon_clks_name)];
>   int pipe;
> @@ -72,6 +72,12 @@ static const uint32_t decon_formats[] = {
>   DRM_FORMAT_ARGB,
>  };
>  
> +static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
> + DRM_PLANE_TYPE_PRIMARY,
> + DRM_PLANE_TYPE_OVERLAY,
> + DRM_PLANE_TYPE_CURSOR,
> +};
> +
>  static inline void decon_set_bits(struct decon_context *ctx, u32 reg, u32 
> mask,
> u32 val)
>  {
> @@ -499,7 +505,6 @@ static int decon_bind(struct device *dev, struct device 
> *master, void *data)
>   struct exynos_drm_private *priv = drm_dev->dev_private;
>   struct exynos_drm_plane *exynos_plane;
>   enum exynos_drm_output_type out_type;
> - enum drm_plane_type type;
>   unsigned int win;
>   int ret;
>  
> @@ -509,10 +514,13 @@ static int decon_bind(struct device *dev, struct device 
> *master, void *data)
>   for (win = ctx->first_win; win < WINDOWS_NR; win++) {
>   int tmp = (win == ctx->first_win) ? 0 : win;
>  
> - type = exynos_plane_get_type(tmp, CURSOR_WIN);
> + ctx->configs[win].pixel_formats = decon_formats;
> + ctx->configs[win].num_pixel_formats = ARRAY_SIZE(decon_formats);
> + ctx->configs[win].zpos = win;
> + ctx->configs[win].type = decon_win_types[tmp];
> +
>   ret = exynos_plane_init(drm_dev, >planes[win],
> - 1 << ctx->pipe, type, decon_formats,
> - ARRAY_SIZE(decon_formats), win);
> + 1 << ctx->pipe, >configs[win]);
>   if (ret)
>   return ret;
>   }
> diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
> b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> index 7868d30d8eac..6b28e3f73e4e 100644
> --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
> @@ -41,13 +41,13 @@
>  #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
>  
>  #define WINDOWS_NR   2
> -#define CURSOR_WIN   1
>  
>  struct decon_context {
>   struct device   *dev;
>   struct drm_device   *drm_dev;
>   struct exynos_drm_crtc  *crtc;
>   struct exynos_drm_plane planes[WINDOWS_NR];
> + struct exynos_drm_plane_config  configs[WINDOWS_NR];
>   struct clk  *pclk;
>   struct clk  *aclk;
>   struct clk  *eclk;
> @@ -82,6 +82,11 @@ static const uint32_t decon_formats[] = {
>   DRM_FORMAT_BGRA,
>  };
>  
> +static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
> + DRM_PLANE_TYPE_PRIMARY,
> + DRM_PLANE_TYPE_CURSOR,
> +};
> +
>  static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
>  {
>   struct decon_context *ctx = crtc->ctx;
> @@ -672,8 +677,7 @@ static int decon_bind(struct device *dev, struct device 
> *master, void *data)
>   struct decon_context *ctx = dev_get_drvdata(dev);
>   struct drm_device *drm_dev = data;
>   struct exynos_drm_plane *exynos_plane;
> - enum drm_plane_type type;
> - unsigned int zpos;
> + unsigned int i;
>   int ret;
>  
>   ret = 

[PATCH 14/25] drm/exynos: introduce exynos_drm_plane_config structure

2015-11-10 Thread Marek Szyprowski
This patch adds common structure for keeping plane configuration and
capabilities data. This patch is inspired by similar code developed by
Tobias Jakobi.

Signed-off-by: Marek Szyprowski 
---
 drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 18 +++---
 drivers/gpu/drm/exynos/exynos7_drm_decon.c| 23 +++-
 drivers/gpu/drm/exynos/exynos_drm_drv.h   | 22 
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 25 -
 drivers/gpu/drm/exynos/exynos_drm_plane.c | 34 --
 drivers/gpu/drm/exynos/exynos_drm_plane.h |  7 ++--
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 25 -
 drivers/gpu/drm/exynos/exynos_mixer.c | 51 ---
 8 files changed, 131 insertions(+), 74 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c 
b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
index 27039468364b..3c8b8e0240fe 100644
--- a/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos5433_drm_decon.c
@@ -26,7 +26,6 @@
 #include "exynos_drm_iommu.h"
 
 #define WINDOWS_NR 3
-#define CURSOR_WIN 2
 #define MIN_FB_WIDTH_FOR_16WORD_BURST  128
 
 static const char * const decon_clks_name[] = {
@@ -57,6 +56,7 @@ struct decon_context {
struct drm_device   *drm_dev;
struct exynos_drm_crtc  *crtc;
struct exynos_drm_plane planes[WINDOWS_NR];
+   struct exynos_drm_plane_config  configs[WINDOWS_NR];
void __iomem*addr;
struct clk  *clks[ARRAY_SIZE(decon_clks_name)];
int pipe;
@@ -72,6 +72,12 @@ static const uint32_t decon_formats[] = {
DRM_FORMAT_ARGB,
 };
 
+static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
+   DRM_PLANE_TYPE_PRIMARY,
+   DRM_PLANE_TYPE_OVERLAY,
+   DRM_PLANE_TYPE_CURSOR,
+};
+
 static inline void decon_set_bits(struct decon_context *ctx, u32 reg, u32 mask,
  u32 val)
 {
@@ -499,7 +505,6 @@ static int decon_bind(struct device *dev, struct device 
*master, void *data)
struct exynos_drm_private *priv = drm_dev->dev_private;
struct exynos_drm_plane *exynos_plane;
enum exynos_drm_output_type out_type;
-   enum drm_plane_type type;
unsigned int win;
int ret;
 
@@ -509,10 +514,13 @@ static int decon_bind(struct device *dev, struct device 
*master, void *data)
for (win = ctx->first_win; win < WINDOWS_NR; win++) {
int tmp = (win == ctx->first_win) ? 0 : win;
 
-   type = exynos_plane_get_type(tmp, CURSOR_WIN);
+   ctx->configs[win].pixel_formats = decon_formats;
+   ctx->configs[win].num_pixel_formats = ARRAY_SIZE(decon_formats);
+   ctx->configs[win].zpos = win;
+   ctx->configs[win].type = decon_win_types[tmp];
+
ret = exynos_plane_init(drm_dev, >planes[win],
-   1 << ctx->pipe, type, decon_formats,
-   ARRAY_SIZE(decon_formats), win);
+   1 << ctx->pipe, >configs[win]);
if (ret)
return ret;
}
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c 
b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
index 7868d30d8eac..6b28e3f73e4e 100644
--- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c
+++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c
@@ -41,13 +41,13 @@
 #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
 
 #define WINDOWS_NR 2
-#define CURSOR_WIN 1
 
 struct decon_context {
struct device   *dev;
struct drm_device   *drm_dev;
struct exynos_drm_crtc  *crtc;
struct exynos_drm_plane planes[WINDOWS_NR];
+   struct exynos_drm_plane_config  configs[WINDOWS_NR];
struct clk  *pclk;
struct clk  *aclk;
struct clk  *eclk;
@@ -82,6 +82,11 @@ static const uint32_t decon_formats[] = {
DRM_FORMAT_BGRA,
 };
 
+static const enum drm_plane_type decon_win_types[WINDOWS_NR] = {
+   DRM_PLANE_TYPE_PRIMARY,
+   DRM_PLANE_TYPE_CURSOR,
+};
+
 static void decon_wait_for_vblank(struct exynos_drm_crtc *crtc)
 {
struct decon_context *ctx = crtc->ctx;
@@ -672,8 +677,7 @@ static int decon_bind(struct device *dev, struct device 
*master, void *data)
struct decon_context *ctx = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
struct exynos_drm_plane *exynos_plane;
-   enum drm_plane_type type;
-   unsigned int zpos;
+   unsigned int i;
int ret;
 
ret = decon_ctx_initialize(ctx, drm_dev);
@@ -682,11 +686,14 @@ static int decon_bind(struct device *dev, struct device 
*master, void *data)
return ret;
}
 
-   for (zpos = 0; zpos <