[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-12-04 Thread Sean Paul
On Sun, Nov 10, 2013 at 8:32 PM, Tomasz Figa  wrote:
> On Tuesday 29 of October 2013 12:13:07 Sean Paul wrote:
>> This patch moves the code from video/ to drm/
>
> Again, rationale should be mentioned in patch description.
>
>> Signed-off-by: Sean Paul 
>> ---
>>
>> Changes in v2: None
>> Changes in v3: None
>>
>>  drivers/gpu/drm/exynos/Kconfig  |7 +
>>  drivers/gpu/drm/exynos/Makefile |1 +
>>  drivers/gpu/drm/exynos/exynos_dp_core.c | 1213 
>> ++
>>  drivers/gpu/drm/exynos/exynos_dp_core.h |  210 ++
>>  drivers/gpu/drm/exynos/exynos_dp_reg.c  | 1245 
>> +++
>>  drivers/gpu/drm/exynos/exynos_dp_reg.h  |  366 +
>>  drivers/video/exynos/Kconfig|7 -
>>  drivers/video/exynos/Makefile   |1 -
>>  drivers/video/exynos/exynos_dp_core.c   | 1213 
>> --
>>  drivers/video/exynos/exynos_dp_core.h   |  210 --
>>  drivers/video/exynos/exynos_dp_reg.c| 1245 
>> ---
>>  drivers/video/exynos/exynos_dp_reg.h|  366 -
>>  12 files changed, 3042 insertions(+), 3042 deletions(-)
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.c
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.h
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.c
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.h
>>  delete mode 100644 drivers/video/exynos/exynos_dp_core.c
>>  delete mode 100644 drivers/video/exynos/exynos_dp_core.h
>>  delete mode 100644 drivers/video/exynos/exynos_dp_reg.c
>>  delete mode 100644 drivers/video/exynos/exynos_dp_reg.h
>>
>> diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
>> index 45b6ef5..3ace74f 100644
>> --- a/drivers/gpu/drm/exynos/Kconfig
>> +++ b/drivers/gpu/drm/exynos/Kconfig
>> @@ -30,6 +30,13 @@ config DRM_EXYNOS_FIMD
>>   help
>> Choose this option if you want to use Exynos FIMD for DRM.
>>
>> +config DRM_EXYNOS_DP
>
> I would keep the symbol name as it was, so configs used by people remain
> valid.
>

I don't really want to do that. All of the other configs are named
DRM_EXYNOS_BLAH, DP should follow this convention. There are a few
ways around this:

1) Make DRM_EXYNOS_DP default to on if DRM_EXYNOS is selected
2) Make a shadow EXYNOS_DP config that selects DRM_EXYNOS_DP

Either of those work for you?

> Also, don't you need some kind of dependency on DRM_EXYNOS?
>

Yep, will do.

Sean


> Otherwise this patch is fine.
>
> Best regards,
> Tomasz
>


[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-11-01 Thread Jingoo Han
On Friday, November 01, 2013 8:27 AM, Tomasz Figa wrote:
> On Friday 01 of November 2013 08:23:59 Jingoo Han wrote:
> > On Friday, November 01, 2013 8:12 AM, Tomasz Figa wrote:
> > > On Friday 01 of November 2013 08:06:00 Jingoo Han wrote:
> > > > On Thursday, October 31, 2013 7:47 PM, Inki Dae wrote:
> > > > > CCing Jingoo,
> > > > >
> > > > > Is that ok to remove eDP driver from video/exynos? Isn't this
> > > > > driver
> > > > > really used by Linux framebuffer driver, s3c-fb.c?
> > > >
> > > > +cc Tomi Valkeinen, Jean-Christophe PLAGNIOL-VILLARD,
> > > >
> > > >  linux-fbdev list, linux-samsung-soc list
> > > >
> > > > Yes, it is used by s3c-fb.c.
> > > >
> > > > > Of course, now s3c-fb driver is dead code because this driver
> > > > > doesn't
> > > > > support device tree yet but we would need more reviews and
> > > > > discussions
> > > > > about moving this driver into drm side. Let's watch new rules for
> > > > > device tree bindings of DRM world. So I'd not like to merge this
> > > > > driver yet.
> > > >
> > > > 's3c-fb' driver is still used for other mass products projects.
> > > > Just, device tree support patch is not yet submitted.
> > >
> > > Current in-tree users of s3c-fb drivers are s3c2443, non-DT s3c64xx
> > > and
> > > all s5p* SoCs. It is not used on Exynos SoCs anymore.
> >
> > Hi Tomasz Figa,
> 
> Just Tomasz. ;)

Hi Tomasz, :-)

> 
> > Some mass product projects using Exynos5250 and etc, use s3c-fb driver
> > and dp driver. Also, these projects are still using Framebuffer, not
> > DRM.
> 
> Well, those are based on vendor trees anyway, so do not really affect
> mainline kernel.

OK, I see.

> 
> > > As for Exynos DP driver, what SoCs does it support? If only Exynos (as
> > > the name suggests) then there is no point in keeping it at
> > > video/exynos and making it a part of Exynos DRM driver seems
> > > reasonable to me.
> >
> > However, when considering only mainline kernel, I have no strong
> > objection. As you know, many Linux kernel based OS projects using
> > Exynos, are using DRM, not Framebuffer.
> 
> Generally, fbdev is strongly discouraged in any new systems and DRM is the
> way to go, so I don't think we should ever want to bring s3c-fb support
> back to Exynos platforms.

Yes, you're right.
Personally, I think that all Exynos platforms should go into DRM, not FB.

One more thing, then how about moving Exynos MIPI to DRM side?
Is there any plan on Exynos MIPI?

Best regards,
Jingoo Han

> 
> >
> > Also, if moving DP driver to DRM, MAINTAINERS entry for Exynos DP driver
> > should be updated, too.
> 
> That's correct.



[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-11-01 Thread Jingoo Han
On Friday, November 01, 2013 8:12 AM, Tomasz Figa wrote:
> On Friday 01 of November 2013 08:06:00 Jingoo Han wrote:
> > On Thursday, October 31, 2013 7:47 PM, Inki Dae wrote:
> > > CCing Jingoo,
> > >
> > > Is that ok to remove eDP driver from video/exynos? Isn't this driver
> > > really used by Linux framebuffer driver, s3c-fb.c?
> >
> > +cc Tomi Valkeinen, Jean-Christophe PLAGNIOL-VILLARD,
> >  linux-fbdev list, linux-samsung-soc list
> >
> > Yes, it is used by s3c-fb.c.
> >
> > > Of course, now s3c-fb driver is dead code because this driver doesn't
> > > support device tree yet but we would need more reviews and discussions
> > > about moving this driver into drm side. Let's watch new rules for
> > > device tree bindings of DRM world. So I'd not like to merge this
> > > driver yet.
> > 's3c-fb' driver is still used for other mass products projects.
> > Just, device tree support patch is not yet submitted.
> 
> Current in-tree users of s3c-fb drivers are s3c2443, non-DT s3c64xx and
> all s5p* SoCs. It is not used on Exynos SoCs anymore.

Hi Tomasz Figa,

Some mass product projects using Exynos5250 and etc, use s3c-fb driver
and dp driver. Also, these projects are still using Framebuffer, not DRM.

> 
> As for Exynos DP driver, what SoCs does it support? If only Exynos (as the
> name suggests) then there is no point in keeping it at video/exynos and
> making it a part of Exynos DRM driver seems reasonable to me.

However, when considering only mainline kernel, I have no strong objection.
As you know, many Linux kernel based OS projects using Exynos, are using
DRM, not Framebuffer.

Also, if moving DP driver to DRM, MAINTAINERS entry for Exynos DP driver
should be updated, too.

Best regards,
Jingoo Han



[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-11-01 Thread Jingoo Han
On Thursday, October 31, 2013 7:47 PM, Inki Dae wrote:
> 
> CCing Jingoo,
> 
> Is that ok to remove eDP driver from video/exynos? Isn't this driver really
> used by Linux framebuffer driver, s3c-fb.c?

+cc Tomi Valkeinen, Jean-Christophe PLAGNIOL-VILLARD,
 linux-fbdev list, linux-samsung-soc list

Yes, it is used by s3c-fb.c.

> 
> Of course, now s3c-fb driver is dead code because this driver doesn't
> support device tree yet but we would need more reviews and discussions about
> moving this driver into drm side. Let's watch new rules for device tree
> bindings of DRM world. So I'd not like to merge this driver yet.

's3c-fb' driver is still used for other mass products projects.
Just, device tree support patch is not yet submitted.


Sean Paul,
When moving the driver, notify related Maintainers of that driver.
Please use 'scripts/get_maintainer.pl' next time.

Best regards,
Jingoo Han



[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-11-01 Thread Tomasz Figa
On Friday 01 of November 2013 08:55:12 Jingoo Han wrote:
> On Friday, November 01, 2013 8:27 AM, Tomasz Figa wrote:
> > On Friday 01 of November 2013 08:23:59 Jingoo Han wrote:
> > > On Friday, November 01, 2013 8:12 AM, Tomasz Figa wrote:
> > > > On Friday 01 of November 2013 08:06:00 Jingoo Han wrote:
> > > > > On Thursday, October 31, 2013 7:47 PM, Inki Dae wrote:
> > > > > > CCing Jingoo,
> > > > > > 
> > > > > > Is that ok to remove eDP driver from video/exynos? Isn't this
> > > > > > driver
> > > > > > really used by Linux framebuffer driver, s3c-fb.c?
> > > > > 
> > > > > +cc Tomi Valkeinen, Jean-Christophe PLAGNIOL-VILLARD,
> > > > > 
> > > > >  linux-fbdev list, linux-samsung-soc list
> > > > > 
> > > > > Yes, it is used by s3c-fb.c.
> > > > > 
> > > > > > Of course, now s3c-fb driver is dead code because this driver
> > > > > > doesn't
> > > > > > support device tree yet but we would need more reviews and
> > > > > > discussions
> > > > > > about moving this driver into drm side. Let's watch new rules
> > > > > > for
> > > > > > device tree bindings of DRM world. So I'd not like to merge
> > > > > > this
> > > > > > driver yet.
> > > > > 
> > > > > 's3c-fb' driver is still used for other mass products projects.
> > > > > Just, device tree support patch is not yet submitted.
> > > > 
> > > > Current in-tree users of s3c-fb drivers are s3c2443, non-DT
> > > > s3c64xx
> > > > and
> > > > all s5p* SoCs. It is not used on Exynos SoCs anymore.
> > > 
> > > Hi Tomasz Figa,
> > 
> > Just Tomasz. ;)
> 
> Hi Tomasz, :-)
> 
> > > Some mass product projects using Exynos5250 and etc, use s3c-fb
> > > driver
> > > and dp driver. Also, these projects are still using Framebuffer, not
> > > DRM.
> > 
> > Well, those are based on vendor trees anyway, so do not really affect
> > mainline kernel.
> 
> OK, I see.
> 
> > > > As for Exynos DP driver, what SoCs does it support? If only Exynos
> > > > (as
> > > > the name suggests) then there is no point in keeping it at
> > > > video/exynos and making it a part of Exynos DRM driver seems
> > > > reasonable to me.
> > > 
> > > However, when considering only mainline kernel, I have no strong
> > > objection. As you know, many Linux kernel based OS projects using
> > > Exynos, are using DRM, not Framebuffer.
> > 
> > Generally, fbdev is strongly discouraged in any new systems and DRM is
> > the way to go, so I don't think we should ever want to bring s3c-fb
> > support back to Exynos platforms.
> 
> Yes, you're right.
> Personally, I think that all Exynos platforms should go into DRM, not
> FB.
> 
> One more thing, then how about moving Exynos MIPI to DRM side?
> Is there any plan on Exynos MIPI?

Well, it will eventually have to be moved somewhere else than it is, but I 
believe this will have to wait for Common Display Framework.

This is because the case of MIPI DSI is slightly different from 
DisplayPort, since it is not an enumerable/auto-configurable interface and 
requires dedicated panel drivers and static data provided by board 
designers (in DT for example). Handling of such things in a generic way 
will be done by CDF.

Best regards,
Tomasz



[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-11-01 Thread Tomasz Figa
On Friday 01 of November 2013 08:23:59 Jingoo Han wrote:
> On Friday, November 01, 2013 8:12 AM, Tomasz Figa wrote:
> > On Friday 01 of November 2013 08:06:00 Jingoo Han wrote:
> > > On Thursday, October 31, 2013 7:47 PM, Inki Dae wrote:
> > > > CCing Jingoo,
> > > > 
> > > > Is that ok to remove eDP driver from video/exynos? Isn't this
> > > > driver
> > > > really used by Linux framebuffer driver, s3c-fb.c?
> > > 
> > > +cc Tomi Valkeinen, Jean-Christophe PLAGNIOL-VILLARD,
> > > 
> > >  linux-fbdev list, linux-samsung-soc list
> > > 
> > > Yes, it is used by s3c-fb.c.
> > > 
> > > > Of course, now s3c-fb driver is dead code because this driver
> > > > doesn't
> > > > support device tree yet but we would need more reviews and
> > > > discussions
> > > > about moving this driver into drm side. Let's watch new rules for
> > > > device tree bindings of DRM world. So I'd not like to merge this
> > > > driver yet.
> > > 
> > > 's3c-fb' driver is still used for other mass products projects.
> > > Just, device tree support patch is not yet submitted.
> > 
> > Current in-tree users of s3c-fb drivers are s3c2443, non-DT s3c64xx
> > and
> > all s5p* SoCs. It is not used on Exynos SoCs anymore.
> 
> Hi Tomasz Figa,

Just Tomasz. ;)

> Some mass product projects using Exynos5250 and etc, use s3c-fb driver
> and dp driver. Also, these projects are still using Framebuffer, not
> DRM.

Well, those are based on vendor trees anyway, so do not really affect 
mainline kernel.

> > As for Exynos DP driver, what SoCs does it support? If only Exynos (as
> > the name suggests) then there is no point in keeping it at
> > video/exynos and making it a part of Exynos DRM driver seems
> > reasonable to me.
> 
> However, when considering only mainline kernel, I have no strong
> objection. As you know, many Linux kernel based OS projects using
> Exynos, are using DRM, not Framebuffer.

Generally, fbdev is strongly discouraged in any new systems and DRM is the 
way to go, so I don't think we should ever want to bring s3c-fb support 
back to Exynos platforms.

> 
> Also, if moving DP driver to DRM, MAINTAINERS entry for Exynos DP driver
> should be updated, too.

That's correct.

Best regards,
Tomasz



[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-11-01 Thread Tomasz Figa
On Friday 01 of November 2013 08:06:00 Jingoo Han wrote:
> On Thursday, October 31, 2013 7:47 PM, Inki Dae wrote:
> > CCing Jingoo,
> > 
> > Is that ok to remove eDP driver from video/exynos? Isn't this driver
> > really used by Linux framebuffer driver, s3c-fb.c?
> 
> +cc Tomi Valkeinen, Jean-Christophe PLAGNIOL-VILLARD,
>  linux-fbdev list, linux-samsung-soc list
> 
> Yes, it is used by s3c-fb.c.
> 
> > Of course, now s3c-fb driver is dead code because this driver doesn't
> > support device tree yet but we would need more reviews and discussions
> > about moving this driver into drm side. Let's watch new rules for
> > device tree bindings of DRM world. So I'd not like to merge this
> > driver yet.
> 's3c-fb' driver is still used for other mass products projects.
> Just, device tree support patch is not yet submitted.

Current in-tree users of s3c-fb drivers are s3c2443, non-DT s3c64xx and 
all s5p* SoCs. It is not used on Exynos SoCs anymore.

As for Exynos DP driver, what SoCs does it support? If only Exynos (as the 
name suggests) then there is no point in keeping it at video/exynos and 
making it a part of Exynos DRM driver seems reasonable to me.

Best regards,
Tomasz



[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-10-31 Thread Inki Dae
CCing Jingoo,

Is that ok to remove eDP driver from video/exynos? Isn't this driver really
used by Linux framebuffer driver, s3c-fb.c?

Of course, now s3c-fb driver is dead code because this driver doesn't
support device tree yet but we would need more reviews and discussions about
moving this driver into drm side. Let's watch new rules for device tree
bindings of DRM world. So I'd not like to merge this driver yet.

Thanks,
Inki Dae

> -Original Message-
> From: Sean Paul [mailto:seanpaul at chromium.org]
> Sent: Wednesday, October 30, 2013 1:13 AM
> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com
> Cc: airlied at linux.ie; tomasz.figa at gmail.com; marcheu at chromium.org; 
> Sean
> Paul
> Subject: [PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/
> 
> This patch moves the code from video/ to drm/
> 
> Signed-off-by: Sean Paul 
> ---
> 
> Changes in v2: None
> Changes in v3: None
> 
>  drivers/gpu/drm/exynos/Kconfig  |7 +
>  drivers/gpu/drm/exynos/Makefile |1 +
>  drivers/gpu/drm/exynos/exynos_dp_core.c | 1213
> ++
>  drivers/gpu/drm/exynos/exynos_dp_core.h |  210 ++
>  drivers/gpu/drm/exynos/exynos_dp_reg.c  | 1245
> +++
>  drivers/gpu/drm/exynos/exynos_dp_reg.h  |  366 +
>  drivers/video/exynos/Kconfig|7 -
>  drivers/video/exynos/Makefile   |1 -
>  drivers/video/exynos/exynos_dp_core.c   | 1213
---
> ---
>  drivers/video/exynos/exynos_dp_core.h   |  210 --
>  drivers/video/exynos/exynos_dp_reg.c| 1245
---
> 
>  drivers/video/exynos/exynos_dp_reg.h|  366 -
>  12 files changed, 3042 insertions(+), 3042 deletions(-)
>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.c
>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.h
>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.c
>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.h
>  delete mode 100644 drivers/video/exynos/exynos_dp_core.c
>  delete mode 100644 drivers/video/exynos/exynos_dp_core.h
>  delete mode 100644 drivers/video/exynos/exynos_dp_reg.c
>  delete mode 100644 drivers/video/exynos/exynos_dp_reg.h
> 
> diff --git a/drivers/gpu/drm/exynos/Kconfig
> b/drivers/gpu/drm/exynos/Kconfig
> index 45b6ef5..3ace74f 100644
> --- a/drivers/gpu/drm/exynos/Kconfig
> +++ b/drivers/gpu/drm/exynos/Kconfig
> @@ -30,6 +30,13 @@ config DRM_EXYNOS_FIMD
>   help
> Choose this option if you want to use Exynos FIMD for DRM.
> 
> +config DRM_EXYNOS_DP
> + bool "EXYNOS DRM DP driver support"
> + depends on ARCH_EXYNOS
> + default n
> + help
> +   This enables support for DP device.
> +
>  config DRM_EXYNOS_HDMI
>   bool "Exynos DRM HDMI"
>   depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
> diff --git a/drivers/gpu/drm/exynos/Makefile
> b/drivers/gpu/drm/exynos/Makefile
> index afbe499..fc8555c 100644
> --- a/drivers/gpu/drm/exynos/Makefile
> +++ b/drivers/gpu/drm/exynos/Makefile
> @@ -11,6 +11,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o
> exynos_drm_connector.o \
>  exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
>  exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
>  exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)  += exynos_drm_fimd.o
> +exynosdrm-$(CONFIG_DRM_EXYNOS_DP)+= exynos_dp_core.o
> exynos_dp_reg.o
>  exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)  += exynos_hdmi.o exynos_mixer.o
>  exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)  += exynos_drm_vidi.o
>  exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)   += exynos_drm_g2d.o
> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c
> b/drivers/gpu/drm/exynos/exynos_dp_core.c
> new file mode 100644
> index 000..089ae22
> --- /dev/null
> +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
> @@ -0,0 +1,1213 @@
> +/*
> + * Samsung SoC DP (Display Port) interface driver.
> + *
> + * Copyright (C) 2012 Samsung Electronics Co., Ltd.
> + * Author: Jingoo Han 
> + *
> + * This program is free software; you can redistribute it and/or modify
> it
> + * under the terms of the GNU General Public License as published by the
> + * Free Software Foundation; either version 2 of the License, or (at your
> + * option) any later version.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include "exynos_dp_core.h"
> +
> +static int exynos_dp_init_dp(struct exynos_dp_device *dp)
> +{
> + exynos_dp_reset(dp);
> +
> + exynos_dp_swreset(dp);
> +
> + exynos_dp_init_analo

[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-10-31 Thread Sean Paul
On Thu, Oct 31, 2013 at 6:46 AM, Inki Dae  wrote:
> CCing Jingoo,
>
> Is that ok to remove eDP driver from video/exynos? Isn't this driver really
> used by Linux framebuffer driver, s3c-fb.c?
>
> Of course, now s3c-fb driver is dead code because this driver doesn't
> support device tree yet but we would need more reviews and discussions about
> moving this driver into drm side. Let's watch new rules for device tree
> bindings of DRM world. So I'd not like to merge this driver yet.
>

Hi Inki,
I don't think that the dt bindings conversation has any bearing on
this patch. IMO, the justification for doing this is:

- Suspend/resume/dpms is currently broken for boards that use the edp driver
- HDMI driver is already in drm, so it makes sense to have DP in as well
- This allows us to do things like proper hpd, and EDID in DP driver
- Allows us to remove all encoder/connector oriented code from fimd

We've been talking about this for over 10 months now, is there really
anything left to discuss?

Sean



> Thanks,
> Inki Dae
>
>> -Original Message-
>> From: Sean Paul [mailto:seanpaul at chromium.org]
>> Sent: Wednesday, October 30, 2013 1:13 AM
>> To: dri-devel at lists.freedesktop.org; inki.dae at samsung.com
>> Cc: airlied at linux.ie; tomasz.figa at gmail.com; marcheu at chromium.org; 
>> Sean
>> Paul
>> Subject: [PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/
>>
>> This patch moves the code from video/ to drm/
>>
>> Signed-off-by: Sean Paul 
>> ---
>>
>> Changes in v2: None
>> Changes in v3: None
>>
>>  drivers/gpu/drm/exynos/Kconfig  |7 +
>>  drivers/gpu/drm/exynos/Makefile |1 +
>>  drivers/gpu/drm/exynos/exynos_dp_core.c | 1213
>> ++
>>  drivers/gpu/drm/exynos/exynos_dp_core.h |  210 ++
>>  drivers/gpu/drm/exynos/exynos_dp_reg.c  | 1245
>> +++
>>  drivers/gpu/drm/exynos/exynos_dp_reg.h  |  366 +
>>  drivers/video/exynos/Kconfig|7 -
>>  drivers/video/exynos/Makefile   |1 -
>>  drivers/video/exynos/exynos_dp_core.c   | 1213
> ---
>> ---
>>  drivers/video/exynos/exynos_dp_core.h   |  210 --
>>  drivers/video/exynos/exynos_dp_reg.c| 1245
> ---
>> 
>>  drivers/video/exynos/exynos_dp_reg.h|  366 -
>>  12 files changed, 3042 insertions(+), 3042 deletions(-)
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.c
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.h
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.c
>>  create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.h
>>  delete mode 100644 drivers/video/exynos/exynos_dp_core.c
>>  delete mode 100644 drivers/video/exynos/exynos_dp_core.h
>>  delete mode 100644 drivers/video/exynos/exynos_dp_reg.c
>>  delete mode 100644 drivers/video/exynos/exynos_dp_reg.h
>>
>> diff --git a/drivers/gpu/drm/exynos/Kconfig
>> b/drivers/gpu/drm/exynos/Kconfig
>> index 45b6ef5..3ace74f 100644
>> --- a/drivers/gpu/drm/exynos/Kconfig
>> +++ b/drivers/gpu/drm/exynos/Kconfig
>> @@ -30,6 +30,13 @@ config DRM_EXYNOS_FIMD
>>   help
>> Choose this option if you want to use Exynos FIMD for DRM.
>>
>> +config DRM_EXYNOS_DP
>> + bool "EXYNOS DRM DP driver support"
>> + depends on ARCH_EXYNOS
>> + default n
>> + help
>> +   This enables support for DP device.
>> +
>>  config DRM_EXYNOS_HDMI
>>   bool "Exynos DRM HDMI"
>>   depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
>> diff --git a/drivers/gpu/drm/exynos/Makefile
>> b/drivers/gpu/drm/exynos/Makefile
>> index afbe499..fc8555c 100644
>> --- a/drivers/gpu/drm/exynos/Makefile
>> +++ b/drivers/gpu/drm/exynos/Makefile
>> @@ -11,6 +11,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o
>> exynos_drm_connector.o \
>>  exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
>>  exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
>>  exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)  += exynos_drm_fimd.o
>> +exynosdrm-$(CONFIG_DRM_EXYNOS_DP)+= exynos_dp_core.o
>> exynos_dp_reg.o
>>  exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)  += exynos_hdmi.o exynos_mixer.o
>>  exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)  += exynos_drm_vidi.o
>>  exynosdrm-$(CONFIG_DRM_EXYNOS_G2D)   += exynos_drm_g2d.o
>> diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c
>> b/drivers/gpu/drm/exynos/exynos_dp_core.c
>> new file mode 100644
>> index 0

[PATCH v3 21/32] drm/exynos: Move dp driver from video/ to drm/

2013-10-29 Thread Sean Paul
This patch moves the code from video/ to drm/

Signed-off-by: Sean Paul 
---

Changes in v2: None
Changes in v3: None

 drivers/gpu/drm/exynos/Kconfig  |7 +
 drivers/gpu/drm/exynos/Makefile |1 +
 drivers/gpu/drm/exynos/exynos_dp_core.c | 1213 ++
 drivers/gpu/drm/exynos/exynos_dp_core.h |  210 ++
 drivers/gpu/drm/exynos/exynos_dp_reg.c  | 1245 +++
 drivers/gpu/drm/exynos/exynos_dp_reg.h  |  366 +
 drivers/video/exynos/Kconfig|7 -
 drivers/video/exynos/Makefile   |1 -
 drivers/video/exynos/exynos_dp_core.c   | 1213 --
 drivers/video/exynos/exynos_dp_core.h   |  210 --
 drivers/video/exynos/exynos_dp_reg.c| 1245 ---
 drivers/video/exynos/exynos_dp_reg.h|  366 -
 12 files changed, 3042 insertions(+), 3042 deletions(-)
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_core.h
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.c
 create mode 100644 drivers/gpu/drm/exynos/exynos_dp_reg.h
 delete mode 100644 drivers/video/exynos/exynos_dp_core.c
 delete mode 100644 drivers/video/exynos/exynos_dp_core.h
 delete mode 100644 drivers/video/exynos/exynos_dp_reg.c
 delete mode 100644 drivers/video/exynos/exynos_dp_reg.h

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 45b6ef5..3ace74f 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -30,6 +30,13 @@ config DRM_EXYNOS_FIMD
help
  Choose this option if you want to use Exynos FIMD for DRM.

+config DRM_EXYNOS_DP
+   bool "EXYNOS DRM DP driver support"
+   depends on ARCH_EXYNOS
+   default n
+   help
+ This enables support for DP device.
+
 config DRM_EXYNOS_HDMI
bool "Exynos DRM HDMI"
depends on DRM_EXYNOS && !VIDEO_SAMSUNG_S5P_TV
diff --git a/drivers/gpu/drm/exynos/Makefile b/drivers/gpu/drm/exynos/Makefile
index afbe499..fc8555c 100644
--- a/drivers/gpu/drm/exynos/Makefile
+++ b/drivers/gpu/drm/exynos/Makefile
@@ -11,6 +11,7 @@ exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o 
exynos_drm_connector.o \
 exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_DMABUF) += exynos_drm_dmabuf.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD)+= exynos_drm_fimd.o
+exynosdrm-$(CONFIG_DRM_EXYNOS_DP)  += exynos_dp_core.o exynos_dp_reg.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_HDMI)+= exynos_hdmi.o exynos_mixer.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_VIDI)+= exynos_drm_vidi.o
 exynosdrm-$(CONFIG_DRM_EXYNOS_G2D) += exynos_drm_g2d.o
diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c 
b/drivers/gpu/drm/exynos/exynos_dp_core.c
new file mode 100644
index 000..089ae22
--- /dev/null
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -0,0 +1,1213 @@
+/*
+ * Samsung SoC DP (Display Port) interface driver.
+ *
+ * Copyright (C) 2012 Samsung Electronics Co., Ltd.
+ * Author: Jingoo Han 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include "exynos_dp_core.h"
+
+static int exynos_dp_init_dp(struct exynos_dp_device *dp)
+{
+   exynos_dp_reset(dp);
+
+   exynos_dp_swreset(dp);
+
+   exynos_dp_init_analog_param(dp);
+   exynos_dp_init_interrupt(dp);
+
+   /* SW defined function Normal operation */
+   exynos_dp_enable_sw_function(dp);
+
+   exynos_dp_config_interrupt(dp);
+   exynos_dp_init_analog_func(dp);
+
+   exynos_dp_init_hpd(dp);
+   exynos_dp_init_aux(dp);
+
+   return 0;
+}
+
+static int exynos_dp_detect_hpd(struct exynos_dp_device *dp)
+{
+   int timeout_loop = 0;
+
+   while (exynos_dp_get_plug_in_status(dp) != 0) {
+   timeout_loop++;
+   if (DP_TIMEOUT_LOOP_COUNT < timeout_loop) {
+   dev_err(dp->dev, "failed to get hpd plug status\n");
+   return -ETIMEDOUT;
+   }
+   usleep_range(10, 11);
+   }
+
+   return 0;
+}
+
+static unsigned char exynos_dp_calc_edid_check_sum(unsigned char *edid_data)
+{
+   int i;
+   unsigned char sum = 0;
+
+   for (i = 0; i < EDID_BLOCK_LENGTH; i++)
+   sum = sum + edid_data[i];
+
+   return sum;
+}
+
+static int exynos_dp_read_edid(struct exynos_dp_device *dp)
+{
+   unsigned char edid[EDID_BLOCK_LENGTH * 2];
+   unsigned int extend_block = 0;
+   unsigned char sum;
+   unsigned char test_vector;
+   int retval;
+
+   /*
+* EDID device address is 0x50.
+* However, if necessary, you must have set upper