Re: [PATCH] drm/exynos: Add check for IOMMU while passing physically continous memory flag

2013-08-05 Thread Vikas Sajjan
Hi Sylwester,

On 2 August 2013 16:28, Sylwester Nawrocki s.nawro...@samsung.com wrote:
 Hi Vikas,

 On 08/02/2013 12:10 PM, Vikas Sajjan wrote:
 yeah, we could not allocate CMA region for FIMD, because the function
 dma_declare_contiguous() needs dev as the first argument and we have
 access to dev node only if it is NON-DT way of probing like the way
 it is done in arch/arm/mach-davinci/devices-da8xx.c
 But now, since the probing is through DT way, there is NO way ( Let me
 know if something is newly added ) to call dma_declare_contiguous()
 and reserve CMA region .

 See this patch series [1]. We have have been using this kind of bindings
 for assigning physically contiguous memory regions to the Exynos
 multimedia devices, instead of what's currently in mainline where same
 physical addresses are repeated in dts for various boards without much
 thought. And where custom device specific parsing code is required at
 arch side.

 $ git grep mfc\-[lr] arch/arm/boot/dts

 arch/arm/boot/dts/exynos4210-origen.dts: samsung,mfc-r = 0x4300 
 0x80;
 arch/arm/boot/dts/exynos4210-origen.dts: samsung,mfc-l = 0x5100 
 0x80;
 arch/arm/boot/dts/exynos4210-smdkv310.dts:   samsung,mfc-r = 0x4300 
 0x80;
 arch/arm/boot/dts/exynos4210-smdkv310.dts:   samsung,mfc-l = 0x5100 
 0x80;
 arch/arm/boot/dts/exynos4412-origen.dts: samsung,mfc-r = 0x4300 
 0x80;
 arch/arm/boot/dts/exynos4412-origen.dts: samsung,mfc-l = 0x5100 
 0x80;
 arch/arm/boot/dts/exynos4412-smdk4412.dts:   samsung,mfc-r = 0x4300 
 0x80;
 arch/arm/boot/dts/exynos4412-smdk4412.dts:   samsung,mfc-l = 0x5100 
 0x80;
 arch/arm/boot/dts/exynos5250-arndale.dts:samsung,mfc-r = 0x4300 
 0x80;
 arch/arm/boot/dts/exynos5250-arndale.dts:samsung,mfc-l = 0x5100 
 0x80;
 arch/arm/boot/dts/exynos5250-smdk5250.dts:   samsung,mfc-r = 0x4300 
 0x80;
 arch/arm/boot/dts/exynos5250-smdk5250.dts:   samsung,mfc-l = 0x5100 
 0x80;


 [1] http://www.spinics.net/lists/arm-kernel/msg263130.html



Thanks, its good that now we have a new way to reserve CMA region.


 Regards,
 Sylwester



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH V2] drm/exynos: Add fallback option to get non physically continous memory for fb

2013-08-05 Thread Vikas Sajjan
While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
connected with resolution 2560x1600, following error occured even with
IOMMU enabled:
[0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate buffer.
[0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0

To address the case where physically continous memory MAY NOT be a
mandatory requirement for fb, the patch adds a feature to get non physically
continous memory for fb if IOMMU is supported and if CONTIG memory allocation
fails.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Signed-off-by: Arun Kumar arun...@samsung.com
---
changes since v1:
 - Modified to add the fallback patch if CONTIG alloc fails as suggested
 by Rob Clark robdcl...@gmail.com and Tomasz Figa 
tomasz.f...@gmail.com.

 - changed the commit message.
---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   19 +++
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 8e60bd6..9a4b886 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -16,6 +16,7 @@
 #include drm/drm_crtc.h
 #include drm/drm_fb_helper.h
 #include drm/drm_crtc_helper.h
+#include drm/exynos_drm.h
 
 #include exynos_drm_drv.h
 #include exynos_drm_fb.h
@@ -165,11 +166,21 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper 
*helper,
 
size = mode_cmd.pitches[0] * mode_cmd.height;
 
-   /* 0 means to allocate physically continuous memory */
-   exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
+   exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG, size);
if (IS_ERR(exynos_gem_obj)) {
-   ret = PTR_ERR(exynos_gem_obj);
-   goto err_release_framebuffer;
+   /*
+* If IOMMU is supported then try to get buffer from
+* non-continous memory area
+*/
+   if (is_drm_iommu_supported(dev))
+   exynos_gem_obj = exynos_drm_gem_create(dev,
+   EXYNOS_BO_NONCONTIG, size);
+   if (IS_ERR(exynos_gem_obj)) {
+   ret = PTR_ERR(exynos_gem_obj);
+   goto err_release_framebuffer;
+   }
+   dev_warn(pdev-dev, exynos_gem_obj for FB is allocated with\n
+   non physically continuous memory\n);
}
 
exynos_fbdev-exynos_gem_obj = exynos_gem_obj;
-- 
1.7.9.5

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


[PATCH v3] drm/exynos: Add fallback option to get non physically continous memory for fb

2013-08-05 Thread Vikas Sajjan
While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
connected with resolution 2560x1600, following error occured even with
IOMMU enabled:
[0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate buffer.
[0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0

To address the cases where physically continous memory MAY NOT be a
mandatory requirement for fb, the patch adds a feature to get non physically
continous memory for fb if IOMMU is supported and if CONTIG memory allocation
fails.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Signed-off-by: Arun Kumar arun...@samsung.com
Reviewed-by: Rob Clark robdcl...@gmail.com
---
changes since v2:
- addressed comments given by Tomasz Figa tomasz.f...@gmail.com.

changes since v1:
 - Modified to add the fallback patch if CONTIG alloc fails as suggested
 by Rob Clark robdcl...@gmail.com and Tomasz Figa 
tomasz.f...@gmail.com.

 - changed the commit message.
---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 8e60bd6..faec77e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -16,6 +16,7 @@
 #include drm/drm_crtc.h
 #include drm/drm_fb_helper.h
 #include drm/drm_crtc_helper.h
+#include drm/exynos_drm.h
 
 #include exynos_drm_drv.h
 #include exynos_drm_fb.h
@@ -165,8 +166,17 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper 
*helper,
 
size = mode_cmd.pitches[0] * mode_cmd.height;
 
-   /* 0 means to allocate physically continuous memory */
-   exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
+   exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG, size);
+   /*
+* If IOMMU is supported then try to get buffer from non physically
+* continous memory area.
+*/
+   if (IS_ERR(exynos_gem_obj)  is_drm_iommu_supported(dev)) {
+   dev_warn(pdev-dev, contiguous FB allocation failed, falling 
back to non-contiguous\n);
+   exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_NONCONTIG,
+   size);
+   }
+
if (IS_ERR(exynos_gem_obj)) {
ret = PTR_ERR(exynos_gem_obj);
goto err_release_framebuffer;
-- 
1.7.9.5

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


Re: [PATCH] drm/exynos: Add check for IOMMU while passing physically continous memory flag

2013-08-02 Thread Vikas Sajjan
Hi Rob,

On 2 August 2013 06:03, Rob Clark robdcl...@gmail.com wrote:
 On Thu, Aug 1, 2013 at 7:20 PM, Tomasz Figa tomasz.f...@gmail.com wrote:
 Hi Vikas,

 On Thursday 01 of August 2013 16:49:32 Vikas Sajjan wrote:
 While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
 connected with resolution 2560x1600, following error occured even with
 IOMMU enabled:
 [0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate
 buffer. [0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0

 This patch fixes the issue by adding a check for IOMMU.

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 Signed-off-by: Arun Kumar arun...@samsung.com
 ---
  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |9 -
  1 file changed, 8 insertions(+), 1 deletion(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 8e60bd6..2a8
 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 @@ -16,6 +16,7 @@
  #include drm/drm_crtc.h
  #include drm/drm_fb_helper.h
  #include drm/drm_crtc_helper.h
 +#include drm/exynos_drm.h

  #include exynos_drm_drv.h
  #include exynos_drm_fb.h
 @@ -143,6 +144,7 @@ static int exynos_drm_fbdev_create(struct
 drm_fb_helper *helper, struct platform_device *pdev = dev-platformdev;
   unsigned long size;
   int ret;
 + unsigned int flag;

   DRM_DEBUG_KMS(surface width(%d), height(%d) and bpp(%d\n,
   sizes-surface_width, sizes-surface_height,
 @@ -166,7 +168,12 @@ static int exynos_drm_fbdev_create(struct
 drm_fb_helper *helper, size = mode_cmd.pitches[0] * mode_cmd.height;

   /* 0 means to allocate physically continuous memory */
 - exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
 + if (!is_drm_iommu_supported(dev))
 + flag = 0;
 + else
 + flag = EXYNOS_BO_NONCONTIG;

 While noncontig memory might be used for devices that support IOMMU, there
 should be no problem with using contig memory for them, so this seems more
 like masking the original problem rather than tracking it down.

 it is probably a good idea to not require contig memory when it is not
 needed for performance or functionality (and if it is only
 performance, then fallback gracefully to non-contig).. but yeah, would
 be good to know if this is masking another issue all the same


Whats happening with CONTIG flag and with IOMMU,  is

 __iommu_alloc_buffer() --- dma_alloc_from_contiguous() and in this
function it fails at
this condition check  if (pageno = cma-count)

So I tried increasing the CONFIG_CMA_SIZE_MBYTES to 24,  this check
succeeds and it works well without my patch.

But what about the case where CONFIG_CMA is disabled , yet i want
bigger memory for a device.
 I think using IOMMU we can achieve this.

 correct me, if i am wrong.


 BR,
 -R

 Could you check why the allocation fails when requesting contiguous
 memory?

 Best regards,
 Tomasz

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



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drm/exynos: Add check for IOMMU while passing physically continous memory flag

2013-08-02 Thread Vikas Sajjan
Hi Inki Dae,

On 2 August 2013 12:58, Inki Dae inki@samsung.com wrote:


 2013/8/2 Vikas Sajjan vikas.saj...@linaro.org

 Hi Rob,

 On 2 August 2013 06:03, Rob Clark robdcl...@gmail.com wrote:
  On Thu, Aug 1, 2013 at 7:20 PM, Tomasz Figa tomasz.f...@gmail.com
  wrote:
  Hi Vikas,
 
  On Thursday 01 of August 2013 16:49:32 Vikas Sajjan wrote:
  While trying to get boot-logo up on exynos5420 SMDK which has eDP
  panel
  connected with resolution 2560x1600, following error occured even with
  IOMMU enabled:
  [0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate
  buffer. [0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0
 
  This patch fixes the issue by adding a check for IOMMU.
 
  Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
  Signed-off-by: Arun Kumar arun...@samsung.com
  ---
   drivers/gpu/drm/exynos/exynos_drm_fbdev.c |9 -
   1 file changed, 8 insertions(+), 1 deletion(-)
 
  diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 8e60bd6..2a8
  100644
  --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  @@ -16,6 +16,7 @@
   #include drm/drm_crtc.h
   #include drm/drm_fb_helper.h
   #include drm/drm_crtc_helper.h
  +#include drm/exynos_drm.h
 
   #include exynos_drm_drv.h
   #include exynos_drm_fb.h
  @@ -143,6 +144,7 @@ static int exynos_drm_fbdev_create(struct
  drm_fb_helper *helper, struct platform_device *pdev =
  dev-platformdev;
unsigned long size;
int ret;
  + unsigned int flag;
 
DRM_DEBUG_KMS(surface width(%d), height(%d) and bpp(%d\n,
sizes-surface_width, sizes-surface_height,
  @@ -166,7 +168,12 @@ static int exynos_drm_fbdev_create(struct
  drm_fb_helper *helper, size = mode_cmd.pitches[0] * mode_cmd.height;
 
/* 0 means to allocate physically continuous memory */
  - exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
  + if (!is_drm_iommu_supported(dev))
  + flag = 0;
  + else
  + flag = EXYNOS_BO_NONCONTIG;
 
  While noncontig memory might be used for devices that support IOMMU,
  there
  should be no problem with using contig memory for them, so this seems
  more
  like masking the original problem rather than tracking it down.
 
  it is probably a good idea to not require contig memory when it is not
  needed for performance or functionality (and if it is only
  performance, then fallback gracefully to non-contig).. but yeah, would
  be good to know if this is masking another issue all the same
 

 Whats happening with CONTIG flag and with IOMMU,  is

  __iommu_alloc_buffer() --- dma_alloc_from_contiguous() and in this
 function it fails at
 this condition check  if (pageno = cma-count)

 So I tried increasing the CONFIG_CMA_SIZE_MBYTES to 24,  this check
 succeeds and it works well without my patch.

 But what about the case where CONFIG_CMA is disabled , yet i want
 bigger memory for a device.
  I think using IOMMU we can achieve this.

  correct me, if i am wrong.


 I'm on summer vacation so I'm afraid that I cannot test and look into it but
 I guess you guy didn't declare CMA region for Exynos drm. And in this case,
 the size of CMA declared region is 16MB as default. That is why works well
 after increasing default size, CONFIG_CMA_SIZE_MBYTES, to 24MB. And I
 mentioned long time ago, we are required to use physically contiguous memory
 in case that bootloader uses physically contiguous memory for its own
 framebuffer, and kernel wants to share the bootloader's framebuffer region
 to resolve flickering issue while booted; that is required for product. And
 one question, is there any reason that you guy should use non-contiguous
 memory for framebuffer with iommu?


yeah, we could not allocate CMA region for FIMD, because the function
dma_declare_contiguous() needs dev as the first argument and we have
access to dev node only if it is NON-DT way of probing like the way
it is done in arch/arm/mach-davinci/devices-da8xx.c
But now, since the probing is through DT way, there is NO way ( Let me
know if something is newly added ) to call dma_declare_contiguous()
and reserve CMA region .

we don't have any specific requirement for NON_CONTIG or CONTIG
memory, but only requirement was to allocate a bigger memory like (
2560 * 1600 * 4 ) for FB.

But as Rob suggested, we should have fall-back case if CONTIG memory
allocation fails, as below

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index df43fa9..15de626 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -144,7 +144,6 @@ static int exynos_drm_fbdev_create(struct
drm_fb_helper *helper,
struct platform_device *pdev = dev-platformdev;
unsigned long size;
int ret;

DRM_DEBUG_KMS(surface width(%d), height(%d) and bpp(%d\n,
sizes

[PATCH] drm/exynos: Add check for IOMMU while passing physically continous memory flag

2013-08-01 Thread Vikas Sajjan
While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
connected with resolution 2560x1600, following error occured even with
IOMMU enabled:
[0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate buffer.
[0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0

This patch fixes the issue by adding a check for IOMMU.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Signed-off-by: Arun Kumar arun...@samsung.com
---
 drivers/gpu/drm/exynos/exynos_drm_fbdev.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 8e60bd6..2a8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -16,6 +16,7 @@
 #include drm/drm_crtc.h
 #include drm/drm_fb_helper.h
 #include drm/drm_crtc_helper.h
+#include drm/exynos_drm.h
 
 #include exynos_drm_drv.h
 #include exynos_drm_fb.h
@@ -143,6 +144,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper 
*helper,
struct platform_device *pdev = dev-platformdev;
unsigned long size;
int ret;
+   unsigned int flag;
 
DRM_DEBUG_KMS(surface width(%d), height(%d) and bpp(%d\n,
sizes-surface_width, sizes-surface_height,
@@ -166,7 +168,12 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper 
*helper,
size = mode_cmd.pitches[0] * mode_cmd.height;
 
/* 0 means to allocate physically continuous memory */
-   exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
+   if (!is_drm_iommu_supported(dev))
+   flag = 0;
+   else
+   flag = EXYNOS_BO_NONCONTIG;
+
+   exynos_gem_obj = exynos_drm_gem_create(dev, flag, size);
if (IS_ERR(exynos_gem_obj)) {
ret = PTR_ERR(exynos_gem_obj);
goto err_release_framebuffer;
-- 
1.7.9.5

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


Re: [PATCH] drm/exynos: Add check for IOMMU while passing physically continous memory flag

2013-08-01 Thread Vikas Sajjan
Hi Tomasz,


On 2 August 2013 04:50, Tomasz Figa tomasz.f...@gmail.com wrote:

 Hi Vikas,

 On Thursday 01 of August 2013 16:49:32 Vikas Sajjan wrote:
  While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
  connected with resolution 2560x1600, following error occured even with
  IOMMU enabled:
  [0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate
  buffer. [0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0
 
  This patch fixes the issue by adding a check for IOMMU.
 
  Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
  Signed-off-by: Arun Kumar arun...@samsung.com
  ---
   drivers/gpu/drm/exynos/exynos_drm_fbdev.c |9 -
   1 file changed, 8 insertions(+), 1 deletion(-)
 
  diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 8e60bd6..2a8
  100644
  --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  @@ -16,6 +16,7 @@
   #include drm/drm_crtc.h
   #include drm/drm_fb_helper.h
   #include drm/drm_crtc_helper.h
  +#include drm/exynos_drm.h
 
   #include exynos_drm_drv.h
   #include exynos_drm_fb.h
  @@ -143,6 +144,7 @@ static int exynos_drm_fbdev_create(struct
  drm_fb_helper *helper, struct platform_device *pdev = dev-platformdev;
unsigned long size;
int ret;
  + unsigned int flag;
 
DRM_DEBUG_KMS(surface width(%d), height(%d) and bpp(%d\n,
sizes-surface_width, sizes-surface_height,
  @@ -166,7 +168,12 @@ static int exynos_drm_fbdev_create(struct
  drm_fb_helper *helper, size = mode_cmd.pitches[0] * mode_cmd.height;
 
/* 0 means to allocate physically continuous memory */
  - exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
  + if (!is_drm_iommu_supported(dev))
  + flag = 0;
  + else
  + flag = EXYNOS_BO_NONCONTIG;

 While noncontig memory might be used for devices that support IOMMU, there
 should be no problem with using contig memory for them, so this seems more
 like masking the original problem rather than tracking it down.

 Could you check why the allocation fails when requesting contiguous
 memory?


It is failing if i am giving bigger resolution like 2560x1600, but if
i try for 1280x780 resolution, it   works fine.
Looks like arm_dma_alloc() is NOT able to allocate bigger buffer of
size 2560 * 1600 * 4.
Hence i used flag = EXYNOS_BO_NONCONTIG;



 Best regards,
 Tomasz




-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4] drm/exynos: prepare FIMD clocks

2013-04-08 Thread Vikas Sajjan
While migrating to common clock framework (CCF), I found that the FIMD clocks
were pulled down by the CCF.
If CCF finds any clock(s) which has NOT been claimed by any of the
drivers, then such clock(s) are PULLed low by CCF.

Calling clk_prepare() for FIMD clocks fixes the issue.

This patch also replaces clk_disable() with clk_unprepare() during exit, since
clk_prepare() is called in fimd_probe().

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
Changes since v3:
- added clk_prepare() in fimd_probe() and clk_unprepare() in 
fimd_remove()
 as suggested by Viresh Kumar viresh.ku...@linaro.org
Changes since v2:
- moved clk_prepare_enable() and clk_disable_unprepare() from 
fimd_probe() to fimd_clock() as suggested by Inki Dae 
inki@samsung.com
Changes since v1:
- added error checking for clk_prepare_enable() and also replaced 
clk_disable() with clk_disable_unprepare() during exit.
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..aa22370 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -934,6 +934,16 @@ static int fimd_probe(struct platform_device *pdev)
return ret;
}
 
+   ret = clk_prepare(ctx-bus_clk);
+   if (ret  0)
+   return ret;
+
+   ret = clk_prepare(ctx-lcd_clk);
+   if  (ret  0) {
+   clk_unprepare(ctx-bus_clk);
+   return ret;
+   }
+
ctx-vidcon0 = pdata-vidcon0;
ctx-vidcon1 = pdata-vidcon1;
ctx-default_win = pdata-default_win;
@@ -981,8 +991,8 @@ static int fimd_remove(struct platform_device *pdev)
if (ctx-suspended)
goto out;
 
-   clk_disable(ctx-lcd_clk);
-   clk_disable(ctx-bus_clk);
+   clk_unprepare(ctx-lcd_clk);
+   clk_unprepare(ctx-bus_clk);
 
pm_runtime_set_suspended(dev);
pm_runtime_put_sync(dev);
-- 
1.7.9.5

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


[PATCH v3] drm/exynos: enable FIMD clocks

2013-04-01 Thread Vikas Sajjan
While migrating to common clock framework (CCF), found that the FIMD clocks
were pulled down by the CCF.
If CCF finds any clock(s) which has NOT been claimed by any of the
drivers, then such clock(s) are PULLed low by CCF.

By calling clk_prepare_enable() for FIMD clocks fixes the issue.

this patch also replaces clk_disable() with clk_disable_unprepare()
during exit.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
Changes since v2:
- moved clk_prepare_enable() and clk_disable_unprepare() from 
fimd_probe() to fimd_clock() as suggested by Inki Dae 
inki@samsung.com
Changes since v1:
- added error checking for clk_prepare_enable() and also replaced 
clk_disable() with clk_disable_unprepare() during exit.
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..f2400c8 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -799,18 +799,18 @@ static int fimd_clock(struct fimd_context *ctx, bool 
enable)
if (enable) {
int ret;
 
-   ret = clk_enable(ctx-bus_clk);
+   ret = clk_prepare_enable(ctx-bus_clk);
if (ret  0)
return ret;
 
-   ret = clk_enable(ctx-lcd_clk);
+   ret = clk_prepare_enable(ctx-lcd_clk);
if  (ret  0) {
-   clk_disable(ctx-bus_clk);
+   clk_disable_unprepare(ctx-bus_clk);
return ret;
}
} else {
-   clk_disable(ctx-lcd_clk);
-   clk_disable(ctx-bus_clk);
+   clk_disable_unprepare(ctx-lcd_clk);
+   clk_disable_unprepare(ctx-bus_clk);
}
 
return 0;
@@ -981,8 +981,8 @@ static int fimd_remove(struct platform_device *pdev)
if (ctx-suspended)
goto out;
 
-   clk_disable(ctx-lcd_clk);
-   clk_disable(ctx-bus_clk);
+   clk_disable_unprepare(ctx-lcd_clk);
+   clk_disable_unprepare(ctx-bus_clk);
 
pm_runtime_set_suspended(dev);
pm_runtime_put_sync(dev);
-- 
1.7.9.5

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


Re: [PATCH] drm/exynos: change the method for getting the interrupt resource of FIMD

2013-04-01 Thread Vikas Sajjan
Hi Mr. Inki Dae,

Can you please review this patch.?

On Wed, Mar 13, 2013 at 4:22 PM, Vikas Sajjan vikas.saj...@linaro.org wrote:
 Replaces the platform_get_resource() for IORESOURCE_IRQ with
 platform_get_resource_byname().
 Both in exynos4 and exynos5, FIMD IP has 3 interrupts in the order: fifo,
 vsync, and lcd_sys.
 But The FIMD driver expects the vsync interrupt to be mentioned as the
 1st parameter in the FIMD DT node. So to meet this expectation of the
 driver, the FIMD DT node was forced to be made by keeping vsync as the
 1st paramter.
 For example in exynos4, the FIMD DT node has interrupt numbers
 mentioned as 11, 1 11, 0 11, 2 keeping vsync as the 1st paramter.

 This patch fixes the above mentioned hack of re-ordering of the
 FIMD interrupt numbers by getting interrupt resource of FIMD by using
 platform_get_resource_byname().

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 1ea173a..cd79d38 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -945,7 +945,7 @@ static int fimd_probe(struct platform_device *pdev)
 return -ENXIO;
 }

 -   res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 +   res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, vsync);
 if (!res) {
 dev_err(dev, irq request failed.\n);
 return -ENXIO;
 --
 1.7.9.5

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


Re: [PATCH v2] drm/exynos: enable FIMD clocks

2013-03-27 Thread Vikas Sajjan
Hi,

On 27 March 2013 15:53, Inki Dae inki@samsung.com wrote:
 2013/3/20 Vikas Sajjan vikas.saj...@linaro.org:
 While migrating to common clock framework (CCF), found that the FIMD clocks
 were pulled down by the CCF.
 If CCF finds any clock(s) which has NOT been claimed by any of the
 drivers, then such clock(s) are PULLed low by CCF.

 By calling clk_prepare_enable() for FIMD clocks fixes the issue.

 this patch also replaces clk_disable() with clk_disable_unprepare()
 during exit.

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
 Changes since v1:
 - added error checking for clk_prepare_enable() and also replaced
 clk_disable() with clk_disable_unprepare() during exit.
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 +++--
  1 file changed, 15 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..014d750 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -934,6 +934,19 @@ static int fimd_probe(struct platform_device *pdev)
 return ret;
 }

 +   ret = clk_prepare_enable(ctx-lcd_clk);
 +   if (ret) {
 +   dev_err(dev, failed to enable 'sclk_fimd' clock\n);
 +   return ret;
 +   }
 +
 +   ret = clk_prepare_enable(ctx-bus_clk);
 +   if (ret) {
 +   clk_disable_unprepare(ctx-lcd_clk);
 +   dev_err(dev, failed to enable 'fimd' clock\n);
 +   return ret;
 +   }
 +

 Please remove the above two clk_prepare_enable function calls and use
 them in fimd_clock() instead of clk_enable/disable(). When probed,
 fimd clock will be enabled by runtime pm.


Sure, will modify and resend.

 Thanks,
 Inki Dae

 ctx-vidcon0 = pdata-vidcon0;
 ctx-vidcon1 = pdata-vidcon1;
 ctx-default_win = pdata-default_win;
 @@ -981,8 +994,8 @@ static int fimd_remove(struct platform_device *pdev)
 if (ctx-suspended)
 goto out;

 -   clk_disable(ctx-lcd_clk);
 -   clk_disable(ctx-bus_clk);
 +   clk_disable_unprepare(ctx-lcd_clk);
 +   clk_disable_unprepare(ctx-bus_clk);

 pm_runtime_set_suspended(dev);
 pm_runtime_put_sync(dev);
 --
 1.7.9.5

 ___
 dri-devel mailing list
 dri-de...@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] drm/exynos: enable FIMD clocks

2013-03-20 Thread Vikas Sajjan
While migrating to common clock framework (CCF), found that the FIMD clocks
were pulled down by the CCF.
If CCF finds any clock(s) which has NOT been claimed by any of the
drivers, then such clock(s) are PULLed low by CCF.

By calling clk_prepare_enable() for FIMD clocks fixes the issue.

this patch also replaces clk_disable() with clk_disable_unprepare()
during exit.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
Changes since v1:
- added error checking for clk_prepare_enable() and also replaced 
clk_disable() with clk_disable_unprepare() during exit.
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   17 +++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..014d750 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -934,6 +934,19 @@ static int fimd_probe(struct platform_device *pdev)
return ret;
}
 
+   ret = clk_prepare_enable(ctx-lcd_clk);
+   if (ret) {
+   dev_err(dev, failed to enable 'sclk_fimd' clock\n);
+   return ret;
+   }
+
+   ret = clk_prepare_enable(ctx-bus_clk);
+   if (ret) {
+   clk_disable_unprepare(ctx-lcd_clk);
+   dev_err(dev, failed to enable 'fimd' clock\n);
+   return ret;
+   }
+
ctx-vidcon0 = pdata-vidcon0;
ctx-vidcon1 = pdata-vidcon1;
ctx-default_win = pdata-default_win;
@@ -981,8 +994,8 @@ static int fimd_remove(struct platform_device *pdev)
if (ctx-suspended)
goto out;
 
-   clk_disable(ctx-lcd_clk);
-   clk_disable(ctx-bus_clk);
+   clk_disable_unprepare(ctx-lcd_clk);
+   clk_disable_unprepare(ctx-bus_clk);
 
pm_runtime_set_suspended(dev);
pm_runtime_put_sync(dev);
-- 
1.7.9.5

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


[PATCH] drm/exynos: enable FIMD clocks

2013-03-19 Thread Vikas Sajjan
While migrating to common clock framework (CCF), found that the FIMD clocks
were pulled down by the CCF.
If CCF finds any clock(s) which has NOT been claimed by any of the
drivers, then such clock(s) are PULLed low by CCF.

By calling clk_prepare_enable() for FIMD clocks fixes the issue.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..d93dd8a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -934,6 +934,9 @@ static int fimd_probe(struct platform_device *pdev)
return ret;
}
 
+   clk_prepare_enable(ctx-lcd_clk);
+   clk_prepare_enable(ctx-bus_clk);
+
ctx-vidcon0 = pdata-vidcon0;
ctx-vidcon1 = pdata-vidcon1;
ctx-default_win = pdata-default_win;
-- 
1.7.9.5

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


[PATCH] drm/exynos: change the method for getting the interrupt resource of FIMD

2013-03-13 Thread Vikas Sajjan
Replaces the platform_get_resource() for IORESOURCE_IRQ with
platform_get_resource_byname().
Both in exynos4 and exynos5, FIMD IP has 3 interrupts in the order: fifo,
vsync, and lcd_sys.
But The FIMD driver expects the vsync interrupt to be mentioned as the
1st parameter in the FIMD DT node. So to meet this expectation of the
driver, the FIMD DT node was forced to be made by keeping vsync as the
1st paramter.
For example in exynos4, the FIMD DT node has interrupt numbers
mentioned as 11, 1 11, 0 11, 2 keeping vsync as the 1st paramter.

This patch fixes the above mentioned hack of re-ordering of the
FIMD interrupt numbers by getting interrupt resource of FIMD by using
platform_get_resource_byname().

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 1ea173a..cd79d38 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -945,7 +945,7 @@ static int fimd_probe(struct platform_device *pdev)
return -ENXIO;
}
 
-   res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+   res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, vsync);
if (!res) {
dev_err(dev, irq request failed.\n);
return -ENXIO;
-- 
1.7.9.5

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


[PATCH v13 0/2] Add display-timing node parsing to exynos drm fimd

2013-03-08 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

changes since v12:
- Added dependency of OF for exynos drm fimd as suggested
by Inki Dae inki@samsung.com

changes since v11:
- Oops, there was a build error, fixed that.

changes since v10:
- abandoned the pinctrl patch, as commented by Linus Walleij
linus.wall...@linaro.org
- added new patch to enable the OF_VIDEOMODE and FB_MODE_HELPERS for
EXYNOS DRM FIMD.

changes since v9:
- replaced IS_ERR_OR_NULL() with IS_ERR(), since IS_ERR_OR_NULL()
will be depreciated, as discussed at

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140543.html
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg78030.html

changes since v8:
- replaced IS_ERR() with IS_ERR_OR_NULL(),
because devm_pinctrl_get_select_default can return NULL,
If CONFIG_PINCTRL is disabled.
- modified the error log, such that it shall NOT cross 80 column.
- added Acked-by.

changes since v7:
- addressed comments from Joonyoung Shim jy0922.s...@samsung.com
to remove a unnecessary variable.

changes since v6:
addressed comments from Inki Dae inki@samsung.com to
separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org


Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
helper function
  drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm
fimd

 drivers/gpu/drm/exynos/Kconfig   |4 +++-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 
 2 files changed, 23 insertions(+), 5 deletions(-)

-- 
1.7.9.5

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


[PATCH v13 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-03-08 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Acked-by: Joonyoung Shim jy0922.s...@samsung.com
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..e323cf9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include linux/of_device.h
 #include linux/pm_runtime.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -883,10 +884,25 @@ static int fimd_probe(struct platform_device *pdev)
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, pdata-panel.timing,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode() : %d\n, ret);
+   return ret;
+   }
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v13 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

2013-03-08 Thread Vikas Sajjan
patch adds select OF_VIDEOMODE and select FB_MODE_HELPERS when
EXYNOS_DRM_FIMD config is selected. Also adds the OF dependency.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/Kconfig |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 046bcda..406f32a 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -24,7 +24,9 @@ config DRM_EXYNOS_DMABUF
 
 config DRM_EXYNOS_FIMD
bool Exynos DRM FIMD
-   depends on DRM_EXYNOS  !FB_S3C  !ARCH_MULTIPLATFORM
+   depends on OF  DRM_EXYNOS  !FB_S3C  !ARCH_MULTIPLATFORM
+   select OF_VIDEOMODE
+   select FB_MODE_HELPERS
help
  Choose this option if you want to use Exynos FIMD for DRM.
 
-- 
1.7.9.5

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


Re: [PATCH v12 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

2013-03-07 Thread Vikas Sajjan
Hi Mr. Dae,

On 7 March 2013 13:34, Inki Dae inki@samsung.com wrote:


 -Original Message-
 From: linux-media-ow...@vger.kernel.org [mailto:linux-media-
 ow...@vger.kernel.org] On Behalf Of Vikas Sajjan
 Sent: Thursday, March 07, 2013 4:40 PM
 To: dri-de...@lists.freedesktop.org
 Cc: linux-media@vger.kernel.org; kgene@samsung.com;
 inki@samsung.com; l.kris...@samsung.com; jo...@samsung.com; linaro-
 ker...@lists.linaro.org
 Subject: [PATCH v12 2/2] drm/exynos: enable OF_VIDEOMODE and
 FB_MODE_HELPERS for exynos drm fimd

 patch adds select OF_VIDEOMODE and select FB_MODE_HELPERS when
 EXYNOS_DRM_FIMD config is selected.

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/gpu/drm/exynos/Kconfig |2 ++
  1 file changed, 2 insertions(+)

 diff --git a/drivers/gpu/drm/exynos/Kconfig
 b/drivers/gpu/drm/exynos/Kconfig
 index 046bcda..bb25130 100644
 --- a/drivers/gpu/drm/exynos/Kconfig
 +++ b/drivers/gpu/drm/exynos/Kconfig
 @@ -25,6 +25,8 @@ config DRM_EXYNOS_DMABUF
  config DRM_EXYNOS_FIMD
   bool Exynos DRM FIMD
   depends on DRM_EXYNOS  !FB_S3C  !ARCH_MULTIPLATFORM

 Again, you missed 'OF' dependency. At least, let's have build testing surely
 before posting :)

 Surely will add  depends on OF  DRM_EXYNOS  !FB_S3C 
!ARCH_MULTIPLATFORM 
and repost.

 Thanks,
 Inki Dae

 + select OF_VIDEOMODE
 + select FB_MODE_HELPERS
   help
 Choose this option if you want to use Exynos FIMD for DRM.

 --
 1.7.9.5

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




-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v10 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-03-06 Thread Vikas Sajjan
Hi,

On 6 March 2013 14:12, Inki Dae inki@samsung.com wrote:
 2013/3/1 Vikas Sajjan vikas.saj...@linaro.org:
 Add support for parsing the display-timing node using video helper
 function.

 The DT node parsing is done only if 'dev.of_node'
 exists and the NON-DT logic is still maintained under the 'else' part.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 Acked-by: Joonyoung Shim jy0922.s...@samsung.com
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 
  1 file changed, 20 insertions(+), 4 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..e323cf9 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -20,6 +20,7 @@
  #include linux/of_device.h
  #include linux/pm_runtime.h

 +#include video/of_display_timing.h
  #include video/samsung_fimd.h
  #include drm/exynos_drm.h

 @@ -883,10 +884,25 @@ static int fimd_probe(struct platform_device *pdev)

 DRM_DEBUG_KMS(%s\n, __FILE__);

 -   pdata = pdev-dev.platform_data;
 -   if (!pdata) {
 -   dev_err(dev, no platform data specified\n);
 -   return -EINVAL;
 +   if (pdev-dev.of_node) {
 +   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 +   if (!pdata) {
 +   DRM_ERROR(memory allocation for pdata failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   ret = of_get_fb_videomode(dev-of_node, pdata-panel.timing,
 +   OF_USE_NATIVE_MODE);

 Add select OF_VIDEOMODE and select FB_MODE_HELPERS to
 drivers/gpu/drm/exynos/Kconfig. When EXYNOS_DRM_FIMD config is
 selected, these two configs should also be selected.

Sure. Will add and resend.
 Thanks,
 Inki Dae

 +   if (ret) {
 +   DRM_ERROR(failed: of_get_fb_videomode() : %d\n, 
 ret);
 +   return ret;
 +   }
 +   } else {
 +   pdata = pdev-dev.platform_data;
 +   if (!pdata) {
 +   DRM_ERROR(no platform data specified\n);
 +   return -EINVAL;
 +   }
 }

 panel = pdata-panel;
 --
 1.7.9.5

 ___
 dri-devel mailing list
 dri-de...@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v11 0/2] Add display-timing node parsing to exynos drm fimd

2013-03-06 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

changes since v10:
- abandoned the pinctrl patch, as commented by Linus Walleij
linus.wall...@linaro.org
- added new patch to enable the OF_VIDEOMODE and FB_MODE_HELPERS for
EXYNOS DRM FIMD.

changes since v9:
- replaced IS_ERR_OR_NULL() with IS_ERR(), since IS_ERR_OR_NULL()
will be depreciated, as discussed at

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140543.html
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg78030.html

changes since v8:
- replaced IS_ERR() with IS_ERR_OR_NULL(),
because devm_pinctrl_get_select_default can return NULL,
If CONFIG_PINCTRL is disabled.
- modified the error log, such that it shall NOT cross 80 column.
- added Acked-by.

changes since v7:
- addressed comments from Joonyoung Shim jy0922.s...@samsung.com
to remove a unnecessary variable.

changes since v6:
addressed comments from Inki Dae inki@samsung.com to
separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org

Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
helper function
  drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm
fimd

 drivers/gpu/drm/exynos/Kconfig   |2 ++
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   27 +++
 2 files changed, 25 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v11 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-03-06 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Acked-by: Joonyoung Shim jy0922.s...@samsung.com
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..f322ec3 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include linux/of_device.h
 #include linux/pm_runtime.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -883,10 +884,25 @@ static int fimd_probe(struct platform_device *pdev)
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, pdata-panel.timing,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode() : %d\n, ret);
+   return ret;
+   }
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v11 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

2013-03-06 Thread Vikas Sajjan
patch adds select OF_VIDEOMODE and select FB_MODE_HELPERS when
EXYNOS_DRM_FIMD config is selected.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/Kconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 046bcda..bb25130 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -25,6 +25,8 @@ config DRM_EXYNOS_DMABUF
 config DRM_EXYNOS_FIMD
bool Exynos DRM FIMD
depends on DRM_EXYNOS  !FB_S3C  !ARCH_MULTIPLATFORM
+   select OF_VIDEOMODE
+   select FB_MODE_HELPERS
help
  Choose this option if you want to use Exynos FIMD for DRM.
 
-- 
1.7.9.5

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


Re: [PATCH] drm/exynos: modify the compatible string for exynos fimd

2013-03-06 Thread Vikas Sajjan
Hi Mr Inki Dae,

On 28 February 2013 08:12, Joonyoung Shim jy0922.s...@samsung.com wrote:
 On 02/27/2013 07:32 PM, Vikas Sajjan wrote:

 modified compatible string for exynos4 fimd as exynos4210-fimd and
 exynos5 fimd as exynos5250-fimd to stick to the rule that compatible
 value should be named after first specific SoC model in which this
 particular IP version was included as discussed at
 https://patchwork.kernel.org/patch/2144861/

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
   drivers/gpu/drm/exynos/exynos_drm_fimd.c |4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..433ed35 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -109,9 +109,9 @@ struct fimd_context {
 #ifdef CONFIG_OF
   static const struct of_device_id fimd_driver_dt_match[] = {
 -   { .compatible = samsung,exynos4-fimd,
 +   { .compatible = samsung,exynos4210-fimd,
   .data = exynos4_fimd_driver_data },
 -   { .compatible = samsung,exynos5-fimd,
 +   { .compatible = samsung,exynos5250-fimd,
   .data = exynos5_fimd_driver_data },
 {},
   };


 Acked-by: Joonyoung Shim jy0922.s...@samsung.com

Can you please apply this patch.


 Thanks.



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] drm/exynos: modify the compatible string for exynos fimd

2013-03-06 Thread Vikas Sajjan
Thanks.

On 7 March 2013 12:47, Inki Dae inki@samsung.com wrote:
 Already merged. :)

 -Original Message-
 From: Vikas Sajjan [mailto:vikas.saj...@linaro.org]
 Sent: Thursday, March 07, 2013 4:09 PM
 To: InKi Dae
 Cc: dri-de...@lists.freedesktop.org; linux-media@vger.kernel.org;
 kgene@samsung.com; Joonyoung Shim; sunil joshi
 Subject: Re: [PATCH] drm/exynos: modify the compatible string for exynos
 fimd

 Hi Mr Inki Dae,

 On 28 February 2013 08:12, Joonyoung Shim jy0922.s...@samsung.com wrote:
  On 02/27/2013 07:32 PM, Vikas Sajjan wrote:
 
  modified compatible string for exynos4 fimd as exynos4210-fimd and
  exynos5 fimd as exynos5250-fimd to stick to the rule that compatible
  value should be named after first specific SoC model in which this
  particular IP version was included as discussed at
  https://patchwork.kernel.org/patch/2144861/
 
  Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
  ---
drivers/gpu/drm/exynos/exynos_drm_fimd.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
 
  diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
  b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
  index 9537761..433ed35 100644
  --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
  +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
  @@ -109,9 +109,9 @@ struct fimd_context {
  #ifdef CONFIG_OF
static const struct of_device_id fimd_driver_dt_match[] = {
  -   { .compatible = samsung,exynos4-fimd,
  +   { .compatible = samsung,exynos4210-fimd,
.data = exynos4_fimd_driver_data },
  -   { .compatible = samsung,exynos5-fimd,
  +   { .compatible = samsung,exynos5250-fimd,
.data = exynos5_fimd_driver_data },
  {},
};
 
 
  Acked-by: Joonyoung Shim jy0922.s...@samsung.com

 Can you please apply this patch.

 
  Thanks.



 --
 Thanks and Regards
  Vikas Sajjan




-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v12 0/2] Add display-timing node parsing to exynos drm fimd

2013-03-06 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

changes since v11:
- Oops, there was a build error, fixed that.

changes since v10:
- abandoned the pinctrl patch, as commented by Linus Walleij
linus.wall...@linaro.org
- added new patch to enable the OF_VIDEOMODE and FB_MODE_HELPERS for
EXYNOS DRM FIMD.

changes since v9:
- replaced IS_ERR_OR_NULL() with IS_ERR(), since IS_ERR_OR_NULL()
will be depreciated, as discussed at

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140543.html
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg78030.html

changes since v8:
- replaced IS_ERR() with IS_ERR_OR_NULL(),
because devm_pinctrl_get_select_default can return NULL,
If CONFIG_PINCTRL is disabled.
- modified the error log, such that it shall NOT cross 80 column.
- added Acked-by.

changes since v7:
- addressed comments from Joonyoung Shim jy0922.s...@samsung.com
to remove a unnecessary variable.

changes since v6:
addressed comments from Inki Dae inki@samsung.com to
separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org

Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
helper function
  drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm
fimd

 drivers/gpu/drm/exynos/Kconfig   |2 ++
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   27 +++
 2 files changed, 25 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v12 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-03-06 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Acked-by: Joonyoung Shim jy0922.s...@samsung.com
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..e323cf9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include linux/of_device.h
 #include linux/pm_runtime.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -883,10 +884,25 @@ static int fimd_probe(struct platform_device *pdev)
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, pdata-panel.timing,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode() : %d\n, ret);
+   return ret;
+   }
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v12 2/2] drm/exynos: enable OF_VIDEOMODE and FB_MODE_HELPERS for exynos drm fimd

2013-03-06 Thread Vikas Sajjan
patch adds select OF_VIDEOMODE and select FB_MODE_HELPERS when
EXYNOS_DRM_FIMD config is selected.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/Kconfig |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig
index 046bcda..bb25130 100644
--- a/drivers/gpu/drm/exynos/Kconfig
+++ b/drivers/gpu/drm/exynos/Kconfig
@@ -25,6 +25,8 @@ config DRM_EXYNOS_DMABUF
 config DRM_EXYNOS_FIMD
bool Exynos DRM FIMD
depends on DRM_EXYNOS  !FB_S3C  !ARCH_MULTIPLATFORM
+   select OF_VIDEOMODE
+   select FB_MODE_HELPERS
help
  Choose this option if you want to use Exynos FIMD for DRM.
 
-- 
1.7.9.5

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


Re: [PATCH v9 2/2] video: drm: exynos: Add pinctrl support to fimd

2013-03-01 Thread Vikas Sajjan
Hi Linus,

On Fri, Mar 1, 2013 at 2:49 PM, Linus Walleij linus.wall...@linaro.org wrote:
 On Thu, Feb 28, 2013 at 5:12 AM, Vikas Sajjan vikas.saj...@linaro.org wrote:

 Adds support for pinctrl to drm fimd

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 (...)
 +   pctrl = devm_pinctrl_get_select_default(dev);

 NAK.

 The device core will do this for you as of commit
 ab78029ecc347debbd737f06688d788bd9d60c1d
 drivers/pinctrl: grab default handles from device core

OK. Will abandon the patch.

 Yours,
 Linus Walleij
 ___
 dri-devel mailing list
 dri-de...@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v10 2/2] video: drm: exynos: Add pinctrl support to fimd

2013-03-01 Thread Vikas Sajjan
Hi All,

On Fri, Mar 1, 2013 at 11:04 AM, Vikas Sajjan vikas.saj...@linaro.org wrote:
 Adds support for pinctrl to drm fimd

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |9 +
  1 file changed, 9 insertions(+)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index e323cf9..c00aa4a 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -19,6 +19,7 @@
  #include linux/clk.h
  #include linux/of_device.h
  #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h

  #include video/of_display_timing.h
  #include video/samsung_fimd.h
 @@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
 struct exynos_drm_fimd_pdata *pdata;
 struct exynos_drm_panel_info *panel;
 struct resource *res;
 +   struct pinctrl *pctrl;
 int win;
 int ret = -EINVAL;

 @@ -897,6 +899,13 @@ static int fimd_probe(struct platform_device *pdev)
 DRM_ERROR(failed: of_get_fb_videomode() : %d\n, 
 ret);
 return ret;
 }
 +   pctrl = devm_pinctrl_get_select_default(dev);

This patch is abandoned, as the device core will do this for you as of commit
ab78029ecc347debbd737f06688d788bd9d60c1d
drivers/pinctrl: grab default handles from device core

 +   if (IS_ERR(pctrl)) {
 +   DRM_ERROR(failed: 
 devm_pinctrl_get_select_default():\n
 +   %d\n, PTR_RET(pctrl));
 +   return PTR_ERR(pctrl);
 +   }
 +
 } else {
 pdata = pdev-dev.platform_data;
 if (!pdata) {
 --
 1.7.9.5

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


[PATCH v10 0/2] Add display-timing node parsing to exynos drm fimd

2013-02-28 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v9:
- replaced IS_ERR_OR_NULL() with IS_ERR(), since IS_ERR_OR_NULL()
will be depreciated, as discussed at

http://lists.infradead.org/pipermail/linux-arm-kernel/2013-January/140543.html
http://www.mail-archive.com/linux-omap@vger.kernel.org/msg78030.html

changes since v8:
- replaced IS_ERR() with IS_ERR_OR_NULL(),
because devm_pinctrl_get_select_default can return NULL,
If CONFIG_PINCTRL is disabled.
- modified the error log, such that it shall NOT cross 80 column.
- added Acked-by.

changes since v7:
- addressed comments from Joonyoung Shim jy0922.s...@samsung.com 
to remove a unnecessary variable.

changes since v6:
addressed comments from Inki Dae inki@samsung.com to
separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel 
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org


Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
helper function
  video: drm: exynos: Add pinctrl support to fimd

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   33 ++
 1 file changed, 29 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v10 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-28 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Acked-by: Joonyoung Shim jy0922.s...@samsung.com
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..e323cf9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include linux/of_device.h
 #include linux/pm_runtime.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -883,10 +884,25 @@ static int fimd_probe(struct platform_device *pdev)
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, pdata-panel.timing,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode() : %d\n, ret);
+   return ret;
+   }
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v10 2/2] video: drm: exynos: Add pinctrl support to fimd

2013-02-28 Thread Vikas Sajjan
Adds support for pinctrl to drm fimd

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index e323cf9..c00aa4a 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/of_display_timing.h
 #include video/samsung_fimd.h
@@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
struct resource *res;
+   struct pinctrl *pctrl;
int win;
int ret = -EINVAL;
 
@@ -897,6 +899,13 @@ static int fimd_probe(struct platform_device *pdev)
DRM_ERROR(failed: of_get_fb_videomode() : %d\n, ret);
return ret;
}
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR(pctrl)) {
+   DRM_ERROR(failed: devm_pinctrl_get_select_default():\n
+   %d\n, PTR_RET(pctrl));
+   return PTR_ERR(pctrl);
+   }
+
} else {
pdata = pdev-dev.platform_data;
if (!pdata) {
-- 
1.7.9.5

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


Re: [PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd

2013-02-27 Thread Vikas Sajjan
Hi Mr.Shim,

On 21 February 2013 12:35, Joonyoung Shim jy0922.s...@samsung.com wrote:
 Hi,


 On 02/21/2013 02:11 PM, Vikas Sajjan wrote:

 Adds support for pinctrl to drm fimd.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
   drivers/gpu/drm/exynos/exynos_drm_fimd.c |9 +
   1 file changed, 9 insertions(+)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index f80cf68..878b134 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -19,6 +19,7 @@
   #include linux/clk.h
   #include linux/of_device.h
   #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h
 #include video/of_display_timing.h
   #include video/samsung_fimd.h
 @@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
 struct exynos_drm_fimd_pdata *pdata;
 struct exynos_drm_panel_info *panel;
 struct fb_videomode *fbmode;
 +   struct pinctrl *pctrl;
 struct resource *res;
 int win;
 int ret = -EINVAL;
 @@ -900,6 +902,13 @@ static int fimd_probe(struct platform_device *pdev)
 with return value: %d\n, ret);
 return ret;
 }
 +   pctrl = devm_pinctrl_get_select_default(dev);
 +   if (IS_ERR_OR_NULL(pctrl)) {
 +   DRM_ERROR(failed:
 devm_pinctrl_get_select_default()\n
 +   with return value: %d\n,
 PTR_RET(pctrl));
 +   return PTR_RET(pctrl);
 +   }


 I think pinctrl isn't related with dt then it doesn't need to be in if
 (pdev-dev.of_node).

actuall in V1 patchset it was outside if (pdev-dev.of_node).
lated in V2, I moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', to keep NON-DT code unchanged.




 Blank.


 } else {
 pdata = pdev-dev.platform_data;
 if (!pdata) {





-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] drm/exynos: modify the compatible string for exynos fimd

2013-02-27 Thread Vikas Sajjan
modified compatible string for exynos4 fimd as exynos4210-fimd and
exynos5 fimd as exynos5250-fimd to stick to the rule that compatible
value should be named after first specific SoC model in which this
particular IP version was included as discussed at
https://patchwork.kernel.org/patch/2144861/

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..433ed35 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -109,9 +109,9 @@ struct fimd_context {
 
 #ifdef CONFIG_OF
 static const struct of_device_id fimd_driver_dt_match[] = {
-   { .compatible = samsung,exynos4-fimd,
+   { .compatible = samsung,exynos4210-fimd,
  .data = exynos4_fimd_driver_data },
-   { .compatible = samsung,exynos5-fimd,
+   { .compatible = samsung,exynos5250-fimd,
  .data = exynos5_fimd_driver_data },
{},
 };
-- 
1.7.9.5

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


[PATCH v8 0/2] Add display-timing node parsing to exynos drm fimd

2013-02-27 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v7:
- addressed comments from Joonyoung Shim jy0922.s...@samsung.com to 
remove a unnecessary variable.

changes since v6:
addressed comments from Inki Dae inki@samsung.com to
separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel 
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org


Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
helper function
  video: drm: exynos: Add pinctrl support to fimd

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   34 ++
 1 file changed, 30 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v8 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-27 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing and pinctrl selection is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   25 +
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..7932dc2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include linux/of_device.h
 #include linux/pm_runtime.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device *pdev)
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, pdata-panel.timing,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode()\n
+   with return value: %d\n, ret);
+   return ret;
+   }
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v8 2/2] video: drm: exynos: Add pinctrl support to fimd

2013-02-27 Thread Vikas Sajjan
Adds support for pinctrl to drm fimd

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 7932dc2..7d93475 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/of_display_timing.h
 #include video/samsung_fimd.h
@@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
struct resource *res;
+   struct pinctrl *pctrl;
int win;
int ret = -EINVAL;
 
@@ -898,6 +900,13 @@ static int fimd_probe(struct platform_device *pdev)
with return value: %d\n, ret);
return ret;
}
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR(pctrl)) {
+   DRM_ERROR(failed: devm_pinctrl_get_select_default()\n
+   with return value: %d\n, PTR_RET(pctrl));
+   return PTR_ERR(pctrl);
+   }
+
} else {
pdata = pdev-dev.platform_data;
if (!pdata) {
-- 
1.7.9.5

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


Re: [PATCH] drm/exynos: modify the compatible string for exynos fimd

2013-02-27 Thread Vikas Sajjan
Thanks Mr. Shim.

On 28 February 2013 08:12, Joonyoung Shim jy0922.s...@samsung.com wrote:
 On 02/27/2013 07:32 PM, Vikas Sajjan wrote:

 modified compatible string for exynos4 fimd as exynos4210-fimd and
 exynos5 fimd as exynos5250-fimd to stick to the rule that compatible
 value should be named after first specific SoC model in which this
 particular IP version was included as discussed at
 https://patchwork.kernel.org/patch/2144861/

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
   drivers/gpu/drm/exynos/exynos_drm_fimd.c |4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..433ed35 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -109,9 +109,9 @@ struct fimd_context {
 #ifdef CONFIG_OF
   static const struct of_device_id fimd_driver_dt_match[] = {
 -   { .compatible = samsung,exynos4-fimd,
 +   { .compatible = samsung,exynos4210-fimd,
   .data = exynos4_fimd_driver_data },
 -   { .compatible = samsung,exynos5-fimd,
 +   { .compatible = samsung,exynos5250-fimd,
   .data = exynos5_fimd_driver_data },
 {},
   };


 Acked-by: Joonyoung Shim jy0922.s...@samsung.com

 Thanks.



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-27 Thread Vikas Sajjan
Hi,

On 28 February 2013 08:07, Joonyoung Shim jy0922.s...@samsung.com wrote:
 On 02/27/2013 08:49 PM, Vikas Sajjan wrote:

 Add support for parsing the display-timing node using video helper
 function.

 The DT node parsing and pinctrl selection is done only if 'dev.of_node'
 exists and the NON-DT logic is still maintained under the 'else' part.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
   drivers/gpu/drm/exynos/exynos_drm_fimd.c |   25
 +
   1 file changed, 21 insertions(+), 4 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..7932dc2 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -20,6 +20,7 @@
   #include linux/of_device.h
   #include linux/pm_runtime.h
   +#include video/of_display_timing.h
   #include video/samsung_fimd.h
   #include drm/exynos_drm.h
   @@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device
 *pdev)
 DRM_DEBUG_KMS(%s\n, __FILE__);
   - pdata = pdev-dev.platform_data;
 -   if (!pdata) {
 -   dev_err(dev, no platform data specified\n);
 -   return -EINVAL;
 +   if (pdev-dev.of_node) {
 +   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 +   if (!pdata) {
 +   DRM_ERROR(memory allocation for pdata failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   ret = of_get_fb_videomode(dev-of_node,
 pdata-panel.timing,
 +   OF_USE_NATIVE_MODE);
 +   if (ret) {
 +   DRM_ERROR(failed: of_get_fb_videomode()\n
 +   with return value: %d\n, ret);


 Could you make this error log to one line?

The Line was going beyond 80 line marks, hence I had to split it.

 except this,
 Acked-by: Joonyoung Shim jy0922.s...@samsung.com


 +   return ret;
 +   }
 +   } else {
 +   pdata = pdev-dev.platform_data;
 +   if (!pdata) {
 +   DRM_ERROR(no platform data specified\n);
 +   return -EINVAL;
 +   }
 }
 panel = pdata-panel;





-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v8 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-27 Thread Vikas Sajjan
On Thu, Feb 28, 2013 at 8:21 AM, Joonyoung Shim jy0922.s...@samsung.com wrote:
 On 02/28/2013 11:45 AM, Vikas Sajjan wrote:

 Hi,

 On 28 February 2013 08:07, Joonyoung Shim jy0922.s...@samsung.com wrote:

 On 02/27/2013 08:49 PM, Vikas Sajjan wrote:

 Add support for parsing the display-timing node using video helper
 function.

 The DT node parsing and pinctrl selection is done only if 'dev.of_node'
 exists and the NON-DT logic is still maintained under the 'else' part.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
drivers/gpu/drm/exynos/exynos_drm_fimd.c |   25
 +
1 file changed, 21 insertions(+), 4 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..7932dc2 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -20,6 +20,7 @@
#include linux/of_device.h
#include linux/pm_runtime.h
+#include video/of_display_timing.h
#include video/samsung_fimd.h
#include drm/exynos_drm.h
@@ -883,10 +884,26 @@ static int fimd_probe(struct platform_device
 *pdev)
  DRM_DEBUG_KMS(%s\n, __FILE__);
- pdata = pdev-dev.platform_data;
 -   if (!pdata) {
 -   dev_err(dev, no platform data specified\n);
 -   return -EINVAL;
 +   if (pdev-dev.of_node) {
 +   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 +   if (!pdata) {
 +   DRM_ERROR(memory allocation for pdata
 failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   ret = of_get_fb_videomode(dev-of_node,
 pdata-panel.timing,
 +   OF_USE_NATIVE_MODE);
 +   if (ret) {
 +   DRM_ERROR(failed: of_get_fb_videomode()\n
 +   with return value: %d\n, ret);


 Could you make this error log to one line?

 The Line was going beyond 80 line marks, hence I had to split it.


 So remove or contract some log messages, e.g. with return value
 I think that is unnecessary.

Will do and resend.

 except this,
 Acked-by: Joonyoung Shim jy0922.s...@samsung.com


 +   return ret;
 +   }
 +   } else {
 +   pdata = pdev-dev.platform_data;
 +   if (!pdata) {
 +   DRM_ERROR(no platform data specified\n);
 +   return -EINVAL;
 +   }
  }
  panel = pdata-panel;





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


[PATCH v9 0/2] Add display-timing node parsing to exynos drm fimd

2013-02-27 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v8:
- replaced IS_ERR() with IS_ERR_OR_NULL(),
because devm_pinctrl_get_select_default can return NULL,
If CONFIG_PINCTRL is disabled.
- modified the error log, such that it shall NOT cross 80 column.
- added Acked-by.
changes since v7:
- addressed comments from Joonyoung Shim jy0922.s...@samsung.com 
to remove a unnecessary variable.

changes since v6:
addressed comments from Inki Dae inki@samsung.com to
separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel 
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org


Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
helper function
  video: drm: exynos: Add pinctrl support to fimd

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   33 ++
 1 file changed, 29 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v9 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-27 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
Acked-by: Joonyoung Shim jy0922.s...@samsung.com
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   24 
 1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..e323cf9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include linux/of_device.h
 #include linux/pm_runtime.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -883,10 +884,25 @@ static int fimd_probe(struct platform_device *pdev)
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, pdata-panel.timing,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode() : %d\n, ret);
+   return ret;
+   }
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v9 2/2] video: drm: exynos: Add pinctrl support to fimd

2013-02-27 Thread Vikas Sajjan
Adds support for pinctrl to drm fimd

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index e323cf9..21ada8d 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/of_display_timing.h
 #include video/samsung_fimd.h
@@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
struct resource *res;
+   struct pinctrl *pctrl;
int win;
int ret = -EINVAL;
 
@@ -897,6 +899,13 @@ static int fimd_probe(struct platform_device *pdev)
DRM_ERROR(failed: of_get_fb_videomode() : %d\n, ret);
return ret;
}
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR_OR_NULL(pctrl)) {
+   DRM_ERROR(failed: devm_pinctrl_get_select_default():
+   %d\n, PTR_RET(pctrl));
+   return PTR_ERR(pctrl);
+   }
+
} else {
pdata = pdev-dev.platform_data;
if (!pdata) {
-- 
1.7.9.5

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


Re: [PATCH v6 1/1] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-20 Thread Vikas Sajjan
Hi Mr. Inki Dae,

On 20 February 2013 16:45, Inki Dae inki@samsung.com wrote:


 -Original Message-
 From: Vikas Sajjan [mailto:vikas.saj...@linaro.org]
 Sent: Friday, February 15, 2013 3:43 PM
 To: dri-de...@lists.freedesktop.org
 Cc: linux-media@vger.kernel.org; kgene@samsung.com;
 inki@samsung.com; l.kris...@samsung.com; patc...@linaro.org
 Subject: [PATCH v6 1/1] video: drm: exynos: Add display-timing node
 parsing using video helper function

 Add support for parsing the display-timing node using video helper
 function.

 The DT node parsing and pinctrl selection is done only if 'dev.of_node'
 exists and the NON-DT logic is still maintained under the 'else' part.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   37
 ++
  1 file changed, 33 insertions(+), 4 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..8b2c0ff 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -19,7 +19,9 @@
  #include linux/clk.h
  #include linux/of_device.h
  #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h

 +#include video/of_display_timing.h
  #include video/samsung_fimd.h
  #include drm/exynos_drm.h

 @@ -877,16 +879,43 @@ static int fimd_probe(struct platform_device *pdev)
   struct exynos_drm_subdrv *subdrv;
   struct exynos_drm_fimd_pdata *pdata;
   struct exynos_drm_panel_info *panel;
 + struct fb_videomode *fbmode;
 + struct pinctrl *pctrl;
   struct resource *res;
   int win;
   int ret = -EINVAL;

   DRM_DEBUG_KMS(%s\n, __FILE__);

 - pdata = pdev-dev.platform_data;
 - if (!pdata) {
 - dev_err(dev, no platform data specified\n);
 - return -EINVAL;
 + if (pdev-dev.of_node) {
 + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 + if (!pdata) {
 + DRM_ERROR(memory allocation for pdata failed\n);
 + return -ENOMEM;
 + }
 +
 + fbmode = pdata-panel.timing;
 + ret = of_get_fb_videomode(dev-of_node, fbmode,
 + OF_USE_NATIVE_MODE);
 + if (ret) {
 + DRM_ERROR(failed: of_get_fb_videomode()\n
 + with return value: %d\n, ret);
 + return ret;
 + }
 +
 + pctrl = devm_pinctrl_get_select_default(dev);

 Why does it need pinctrl? and even though needed, I think this should be
 separated into another one.

Will separate it out and send it in a separate patch.

 Thanks,
 Inki Dae

 + if (IS_ERR_OR_NULL(pctrl)) {
 + DRM_ERROR(failed:
 devm_pinctrl_get_select_default()\n
 + with return value: %d\n, PTR_RET(pctrl));
 + return PTR_RET(pctrl);
 + }
 +
 + } else {
 + pdata = pdev-dev.platform_data;
 + if (!pdata) {
 + DRM_ERROR(no platform data specified\n);
 + return -EINVAL;
 + }
   }

   panel = pdata-panel;
 --
 1.7.9.5




-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v7 0/2] Add display-timing node parsing to exynos drm fimd

2013-02-20 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v6:
addressed comments from Inki Dae inki@samsung.com to
separated out the pinctrl functionality and made a separate patch.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel 
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org


Vikas Sajjan (2):
  video: drm: exynos: Add display-timing node parsing using video
helper function
  video: drm: exynos: Add pinctrl support to fimd

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   36 ++
 1 file changed, 32 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v7 1/2] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-20 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing and pinctrl selection is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..f80cf68 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -20,6 +20,7 @@
 #include linux/of_device.h
 #include linux/pm_runtime.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -877,16 +878,34 @@ static int fimd_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv;
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
+   struct fb_videomode *fbmode;
struct resource *res;
int win;
int ret = -EINVAL;
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   fbmode = pdata-panel.timing;
+   ret = of_get_fb_videomode(dev-of_node, fbmode,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode()\n
+   with return value: %d\n, ret);
+   return ret;
+   }
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v7 2/2] video: drm: exynos: Add pinctrl support to fimd

2013-02-20 Thread Vikas Sajjan
Adds support for pinctrl to drm fimd.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index f80cf68..878b134 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/of_display_timing.h
 #include video/samsung_fimd.h
@@ -879,6 +880,7 @@ static int fimd_probe(struct platform_device *pdev)
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
struct fb_videomode *fbmode;
+   struct pinctrl *pctrl;
struct resource *res;
int win;
int ret = -EINVAL;
@@ -900,6 +902,13 @@ static int fimd_probe(struct platform_device *pdev)
with return value: %d\n, ret);
return ret;
}
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR_OR_NULL(pctrl)) {
+   DRM_ERROR(failed: devm_pinctrl_get_select_default()\n
+   with return value: %d\n, PTR_RET(pctrl));
+   return PTR_RET(pctrl);
+   }
+
} else {
pdata = pdev-dev.platform_data;
if (!pdata) {
-- 
1.7.9.5

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


Re: [PATCH v6 1/1] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-20 Thread Vikas Sajjan
Hi,

On 21 February 2013 12:25, Joonyoung Shim jy0922.s...@samsung.com wrote:
 Hi,


 On 02/15/2013 03:43 PM, Vikas Sajjan wrote:

 Add support for parsing the display-timing node using video helper
 function.

 The DT node parsing and pinctrl selection is done only if 'dev.of_node'
 exists and the NON-DT logic is still maintained under the 'else' part.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
   drivers/gpu/drm/exynos/exynos_drm_fimd.c |   37
 ++
   1 file changed, 33 insertions(+), 4 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index 9537761..8b2c0ff 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -19,7 +19,9 @@
   #include linux/clk.h
   #include linux/of_device.h
   #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h
   +#include video/of_display_timing.h
   #include video/samsung_fimd.h
   #include drm/exynos_drm.h
   @@ -877,16 +879,43 @@ static int fimd_probe(struct platform_device
 *pdev)
 struct exynos_drm_subdrv *subdrv;
 struct exynos_drm_fimd_pdata *pdata;
 struct exynos_drm_panel_info *panel;
 +   struct fb_videomode *fbmode;
 +   struct pinctrl *pctrl;
 struct resource *res;
 int win;
 int ret = -EINVAL;
 DRM_DEBUG_KMS(%s\n, __FILE__);
   - pdata = pdev-dev.platform_data;
 -   if (!pdata) {
 -   dev_err(dev, no platform data specified\n);
 -   return -EINVAL;
 +   if (pdev-dev.of_node) {
 +   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 +   if (!pdata) {
 +   DRM_ERROR(memory allocation for pdata failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   fbmode = pdata-panel.timing;
 +   ret = of_get_fb_videomode(dev-of_node, fbmode,
 +   OF_USE_NATIVE_MODE);


 fbmode variable can be substituted to pdata-panel.timing directly then can
 remove fbmode variable.

this is can be done.

 +   if (ret) {
 +   DRM_ERROR(failed: of_get_fb_videomode()\n
 +   with return value: %d\n, ret);
 +   return ret;
 +   }
 +
 +   pctrl = devm_pinctrl_get_select_default(dev);
 +   if (IS_ERR_OR_NULL(pctrl)) {


 It's enough to if (IS_ERR(pctrl)) {.

what if it returns NULL?

 +   DRM_ERROR(failed:
 devm_pinctrl_get_select_default()\n
 +   with return value: %d\n,
 PTR_RET(pctrl));
 +   return PTR_RET(pctrl);


 It's enough to return PTR_ERR(pctrl);

ok.

 +   }


 If this needs, parts for pinctrl should go to another patch.

I have it as a separate patch already. [PATCH v7 2/2] video: drm:
exynos: Add pinctrl support to fimd

 +
 +   } else {
 +   pdata = pdev-dev.platform_data;
 +   if (!pdata) {
 +   DRM_ERROR(no platform data specified\n);
 +   return -EINVAL;
 +   }
 }
 panel = pdata-panel;


 Thanks.



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC v2 3/3] video: exynos: Making s6e8ax0 panel driver compliant with CDF

2013-02-14 Thread Vikas Sajjan
Hi Mr. Lee,

thanks for the review.

On 14 February 2013 07:30, Donghwa Lee dh09@samsung.com wrote:
 On Wed, Feb 13, 2013 at 19:01, Vikas Sajjan wrote:

 Made necessary changes in s6e8ax0 panel driver as per the  CDF-T.
 It also removes the dependency on backlight and lcd framework

 Signed-off-by: Vikas Sajjanvikas.saj...@linaro.org
 ---
   drivers/video/exynos/s6e8ax0.c |  848
 +---
   1 file changed, 444 insertions(+), 404 deletions(-)

 diff --git a/drivers/video/exynos/s6e8ax0.c
 b/drivers/video/exynos/s6e8ax0.c
 index 7f7b25f..5a17e3c 100644
 --- a/drivers/video/exynos/s6e8ax0.c
 +++ b/drivers/video/exynos/s6e8ax0.c
 @@ -25,6 +25,7 @@
   #include linux/backlight.h
   #include linux/regulator/consumer.h
   +#include video/display.h
   #include video/mipi_display.h
   #include video/exynos_mipi_dsim.h
   @@ -38,8 +39,7 @@
   #define POWER_IS_OFF(pwr) ((pwr) == FB_BLANK_POWERDOWN)
   #define POWER_IS_NRM(pwr) ((pwr) == FB_BLANK_NORMAL)
   -#define lcd_to_master(a) (a-dsim_dev-master)
 -#define lcd_to_master_ops(a)   ((lcd_to_master(a))-master_ops)
 +#define to_panel(p) container_of(p, struct s6e8ax0, entity)
 enum {
 DSIM_NONE_STATE = 0,
 @@ -47,20 +47,34 @@ enum {
 DSIM_FRAME_DONE = 2,
   };
   +/* This structure defines all the properties of a backlight */
 +struct backlight_prop {
 +   /* Current User requested brightness (0 - max_brightness) */
 +   int brightness;
 +   /* Maximal value for brightness (read-only) */
 +   int max_brightness;
 +};
 +
 +struct panel_platform_data {
 +   unsigned intreset_delay;
 +   unsigned intpower_on_delay;
 +   unsigned intpower_off_delay;
 +   const char  *video_source_name;
 +};
 +
   struct s6e8ax0 {
 -   struct device   *dev;
 -   unsigned intpower;
 -   unsigned intid;
 -   unsigned intgamma;
 -   unsigned intacl_enable;
 -   unsigned intcur_acl;
 -
 -   struct lcd_device   *ld;
 -   struct backlight_device *bd;
 -
 -   struct mipi_dsim_lcd_device *dsim_dev;
 -   struct lcd_platform_data*ddi_pd;
 +   struct platform_device  *pdev;
 +   struct video_source *src;
 +   struct display_entity   entity;
 +   unsigned intpower;
 +   unsigned intid;
 +   unsigned intgamma;
 +   unsigned intacl_enable;
 +   unsigned intcur_acl;
 +   boolpanel_reverse;
 +   struct lcd_platform_data*plat_data;
 struct mutexlock;
 +   struct backlight_prop   bl_prop;
 bool  enabled;
   };


 Could this panel driver use only CDF?
 Does not consider the compatibility with backlight and lcd framework?

as of now CDF does not support backlight and lcd framework functionalities.
Once CDF has the support, we modify the driver to support both CDF and
non CDF way, there by maintaining the backward compatibility with
backlight and lcd framework.

 -static const unsigned char s6e8ax0_22_gamma_30[] = {
 +static unsigned char s6e8ax0_22_gamma_30[] = {
 0xfa, 0x01, 0x60, 0x10, 0x60, 0xf5, 0x00, 0xff, 0xad, 0xaf,
 0xbA, 0xc3, 0xd8, 0xc5, 0x9f, 0xc6, 0x9e, 0xc1, 0xdc, 0xc0,
 0x00, 0x61, 0x00, 0x5a, 0x00, 0x74,
   };

 In all case, you had changed data type to 'static unsigned char'.
 Is it need to change all case? Otherwise, for the unity of the code?

in the CDF-T proposed by Mr. Tomi Valkeinen, the prototype for
dcs_write looks as below

int (*dcs_write)(struct video_source *src, int channel, u8 *data, size_t len);

It does not have const for the 3rd parameter (u8 *data ), and in our
driver we have all the arrays as const.
Just to silence the compiler warnings, i had removed the const keyword.


 Thank you,
 Donghwa Lee





-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 1/1] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-14 Thread Vikas Sajjan
Hi Mr. Inki Dae,

Thanks for review.

On 15 February 2013 08:50, Inki Dae inki@samsung.com wrote:
 2013/2/6 Vikas Sajjan vikas.saj...@linaro.org:
 Add support for parsing the display-timing node using video helper
 function.

 The DT node parsing and pinctrl selection is done only if 'dev.of_node'
 exists and the NON-DT logic is still maintained under the 'else' part.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   41 
 +++---
  1 file changed, 37 insertions(+), 4 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index bf0d9ba..978e866 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -19,6 +19,7 @@
  #include linux/clk.h
  #include linux/of_device.h
  #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h

  #include video/samsung_fimd.h
  #include drm/exynos_drm.h
 @@ -905,16 +906,48 @@ static int __devinit fimd_probe(struct platform_device 
 *pdev)
 struct exynos_drm_subdrv *subdrv;
 struct exynos_drm_fimd_pdata *pdata;
 struct exynos_drm_panel_info *panel;
 +   struct fb_videomode *fbmode;
 +   struct pinctrl *pctrl;
 struct resource *res;
 int win;
 int ret = -EINVAL;

 DRM_DEBUG_KMS(%s\n, __FILE__);

 -   pdata = pdev-dev.platform_data;
 -   if (!pdata) {
 -   dev_err(dev, no platform data specified\n);
 -   return -EINVAL;
 +   if (pdev-dev.of_node) {
 +   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 +   if (!pdata) {
 +   DRM_ERROR(memory allocation for pdata failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
 +   if (!fbmode) {
 +   DRM_ERROR(memory allocation for fbmode failed\n);
 +   return -ENOMEM;
 +   }

 It doesn't need to allocate fbmode.

 +
 +   ret = of_get_fb_videomode(dev-of_node, fbmode, -1);

 What is -1? use OF_USE_NATIVE_MODE instead including
 of_display_timing.h and just change the above code like below,

fbmode = pdata-panel.timing;
ret = of_get_fb_videomode(dev-of_node, fbmode,
 OF_USE_NATIVE_MODE);

 +   if (ret) {
 +   DRM_ERROR(failed: of_get_fb_videomode()\n
 +   with return value: %d\n, ret);
 +   return ret;
 +   }
 +   pdata-panel.timing = (struct fb_videomode) *fbmode;

 remove the above line.

 +
 +   pctrl = devm_pinctrl_get_select_default(dev);
 +   if (IS_ERR_OR_NULL(pctrl)) {
 +   DRM_ERROR(failed: 
 devm_pinctrl_get_select_default()\n
 +   with return value: %d\n, PTR_RET(pctrl));
 +   return PTR_RET(pctrl);
 +   }
 +
 +   } else {
 +   pdata = pdev-dev.platform_data;
 +   if (!pdata) {
 +   DRM_ERROR(no platform data specified\n);
 +   return -EINVAL;
 +   }
 }

 panel = pdata-panel;
 --
 1.7.9.5

Will modify, test and resend V6.


 ___
 dri-devel mailing list
 dri-de...@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel


-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 0/1] Add display-timing node parsing to exynos drm fimd

2013-02-14 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v5:
- addressed comments from Inki Dae inki@samsung.com,
to remove the allocation of 'fbmode' and replaced
'-1'in of_get_fb_videomode(dev-of_node, fbmode, -1) with
OF_USE_NATIVE_MODE.

changes since v4:
- addressed comments from Paul Menzel 
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org

Vikas Sajjan (1):
  video: drm: exynos: Add display-timing node parsing using video
helper function

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   37 ++
 1 file changed, 33 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v6 1/1] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-14 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing and pinctrl selection is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   37 ++
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 9537761..8b2c0ff 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,7 +19,9 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
+#include video/of_display_timing.h
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
 
@@ -877,16 +879,43 @@ static int fimd_probe(struct platform_device *pdev)
struct exynos_drm_subdrv *subdrv;
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
+   struct fb_videomode *fbmode;
+   struct pinctrl *pctrl;
struct resource *res;
int win;
int ret = -EINVAL;
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   fbmode = pdata-panel.timing;
+   ret = of_get_fb_videomode(dev-of_node, fbmode,
+   OF_USE_NATIVE_MODE);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode()\n
+   with return value: %d\n, ret);
+   return ret;
+   }
+
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR_OR_NULL(pctrl)) {
+   DRM_ERROR(failed: devm_pinctrl_get_select_default()\n
+   with return value: %d\n, PTR_RET(pctrl));
+   return PTR_RET(pctrl);
+   }
+
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[RFC v2 0/3] Support Common Display Framework on Exynos5 SoC

2013-02-13 Thread Vikas Sajjan
changes since v1:
Since v1 was not tested when I posted it, now that I have the s6e8aa0 panel, I 
tested the same on Exynos5 SoC. Needed to make below mentioned changes to make 
it work.

In exynos mipi driver:
1 added enable_hs as part of dsi_video_source_ops, as this function
needs to be called from the s6e8aa0 panel probe after LCD power_on.

2 moved the call exynos_mipi_dsi_set_hs_enable()
out of the exynos_mipi_update_cfg() function as it needs to be called 
only
after the LCD power_on. hence in s6e8aa0 probe added call enable_hs 
after power_on. otherwise DSI COMMAND TIME OUT error occurs, after
sending WRITE COMMAND.
Prior to CDF changes, things used to work fine, as the panel 
used to register with MIPI DSIM driver and in the MIPI DSI probe used 
to 
call LCD power_on first and then exynos_mipi_dsi_set_hs_enable.
Since the CDF support is introduced, the both panel and mipi dsi probe
happens independently and DSI COMMAND TIME OUT error used to occurs, 
after
sending WRITE COMMAND. by making above mentioned changes it started 
working.

In s6e8ax0 driver:
1 added call enable_hs in probe after power_on, to over come above 
mentioned error.
2 addd init_lcd(), the missing sequence to initialise the lcd.

This patch series contains 3 patches with the following changes

is based on CDF-T proposed by Tomi Valkeinen tomi.valkei...@ti.com
http://lwn.net/Articles/529489/

[PATCH 1/3] video: display: Adding frame related ops to MIPI DSI video source 
struct
Adds the frame related ops to the MIPI DSI video source struct

[PATCH 2/3] video: exynos: mipi dsi: Making Exynos MIPI Compliant with CDF
Makes the Exynos MIPI DSI driver compliant with CDF.

[PATCH 3/3] video: exynos: Making s6e8ax0 panel driver compliant with CDF

Makes the Exynos s6e8ax0 panel driver compliant with CDF.
Have made necessary changes in s6e8ax0 panel driver, made an effort to 
remove dependency on backlight and lcd framework, but its NOT fully 
done.
s6e8ax0_get_brightness() and s6e8ax0_set_brightness() functionalities
have NOT been modified. as backlight support in CDF are _NOT_
implemented yet.
Thought of adding these get and set as part of 
display_entity_control_ops(), but didn't modify as of now.
Any thoughts on the same will be helpful.
removed the lcd_ops set_power and get_power and added as part of 
panel_set_state.

Testing: 
Tested on Exynos5 SoC with s6e8aa0 panel connected, by applying some of
the dependent patches
Could see the linux logo and ran modetest application and saw the 
test pattern on display panel.

Vikas Sajjan (3):
  video: display: Adding frame related ops to MIPI DSI video source
struct
  video: exynos: mipi dsi: Making Exynos MIPI Compliant with CDF
  video: exynos: Making s6e8ax0 panel driver compliant with CDF

 drivers/video/exynos/exynos_mipi_dsi.c|  197 ++
 drivers/video/exynos/exynos_mipi_dsi_common.c |   22 +-
 drivers/video/exynos/exynos_mipi_dsi_common.h |   12 +-
 drivers/video/exynos/s6e8ax0.c|  848 +
 include/video/display.h   |6 +
 include/video/exynos_mipi_dsim.h  |5 +-
 6 files changed, 519 insertions(+), 571 deletions(-)

-- 
1.7.9.5

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


[RFC v2 1/3] video: display: Adding frame related ops to MIPI DSI video source struct

2013-02-13 Thread Vikas Sajjan
Adds the frame related ops to MIPI DSI video source struct

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 include/video/display.h |6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/video/display.h b/include/video/display.h
index b639fd0..fb2f437 100644
--- a/include/video/display.h
+++ b/include/video/display.h
@@ -117,6 +117,12 @@ struct dsi_video_source_ops {
 
void (*enable_hs)(struct video_source *src, bool enable);
 
+   /* frame related */
+   int (*get_frame_done)(struct video_source *src);
+   int (*clear_frame_done)(struct video_source *src);
+   int (*set_early_blank_mode)(struct video_source *src, int power);
+   int (*set_blank_mode)(struct video_source *src, int power);
+
/* data transfer */
int (*dcs_write)(struct video_source *src, int channel,
u8 *data, size_t len);
-- 
1.7.9.5

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


[RFC v2 2/3] video: exynos: mipi dsi: Making Exynos MIPI Compliant with CDF

2013-02-13 Thread Vikas Sajjan
Modifies the exynos mipi dsi driver as per the CDF-T.

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/video/exynos/exynos_mipi_dsi.c|  197 ++---
 drivers/video/exynos/exynos_mipi_dsi_common.c |   22 ++-
 drivers/video/exynos/exynos_mipi_dsi_common.h |   12 +-
 include/video/exynos_mipi_dsim.h  |5 +-
 4 files changed, 69 insertions(+), 167 deletions(-)

diff --git a/drivers/video/exynos/exynos_mipi_dsi.c 
b/drivers/video/exynos/exynos_mipi_dsi.c
index 32dde44..c4eca0a 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -32,14 +32,13 @@
 #include linux/notifier.h
 #include linux/regulator/consumer.h
 #include linux/pm_runtime.h
-
+#include video/display.h
 #include video/exynos_mipi_dsim.h
 
 #include plat/fb.h
 
 #include exynos_mipi_dsi_common.h
 #include exynos_mipi_dsi_lowlevel.h
-
 struct mipi_dsim_ddi {
int bus_id;
struct list_headlist;
@@ -97,8 +96,6 @@ static void exynos_mipi_update_cfg(struct mipi_dsim_device 
*dsim)
exynos_mipi_dsi_init_dsim(dsim);
exynos_mipi_dsi_init_link(dsim);
 
-   exynos_mipi_dsi_set_hs_enable(dsim);
-
/* set display timing. */
exynos_mipi_dsi_set_display_mode(dsim, dsim-dsim_config);
 
@@ -111,12 +108,13 @@ static void exynos_mipi_update_cfg(struct 
mipi_dsim_device *dsim)
exynos_mipi_dsi_stand_by(dsim, 1);
 }
 
-static int exynos_mipi_dsi_early_blank_mode(struct mipi_dsim_device *dsim,
+static int exynos_mipi_dsi_early_blank_mode(struct video_source *video_source,
int power)
 {
+   struct mipi_dsim_device *dsim = container_of(video_source,
+   struct mipi_dsim_device, video_source);
struct mipi_dsim_lcd_driver *client_drv = dsim-dsim_lcd_drv;
struct mipi_dsim_lcd_device *client_dev = dsim-dsim_lcd_dev;
-
switch (power) {
case FB_BLANK_POWERDOWN:
if (dsim-suspended)
@@ -139,12 +137,13 @@ static int exynos_mipi_dsi_early_blank_mode(struct 
mipi_dsim_device *dsim,
return 0;
 }
 
-static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int power)
+static int exynos_mipi_dsi_blank_mode(struct video_source *video_source, int 
power)
 {
+   struct mipi_dsim_device *dsim = container_of(video_source,
+   struct mipi_dsim_device, video_source);
struct platform_device *pdev = to_platform_device(dsim-dev);
struct mipi_dsim_lcd_driver *client_drv = dsim-dsim_lcd_drv;
struct mipi_dsim_lcd_device *client_dev = dsim-dsim_lcd_dev;
-
switch (power) {
case FB_BLANK_UNBLANK:
if (!dsim-suspended)
@@ -164,6 +163,8 @@ static int exynos_mipi_dsi_blank_mode(struct 
mipi_dsim_device *dsim, int power)
 
exynos_mipi_update_cfg(dsim);
 
+   exynos_mipi_dsi_set_hs_enable(dsim);
+
/* set lcd panel sequence commands. */
if (client_drv  client_drv-set_sequence)
client_drv-set_sequence(client_dev);
@@ -205,134 +206,31 @@ int exynos_mipi_dsi_register_lcd_device(struct 
mipi_dsim_lcd_device *lcd_dev)
return 0;
 }
 
-static struct mipi_dsim_ddi *exynos_mipi_dsi_find_lcd_device(
-   struct mipi_dsim_lcd_driver *lcd_drv)
+static void exynos_mipi_dsi_panel_release(struct video_source *src)
 {
-   struct mipi_dsim_ddi *dsim_ddi, *next;
-   struct mipi_dsim_lcd_device *lcd_dev;
-
-   mutex_lock(mipi_dsim_lock);
-
-   list_for_each_entry_safe(dsim_ddi, next, dsim_ddi_list, list) {
-   if (!dsim_ddi)
-   goto out;
-
-   lcd_dev = dsim_ddi-dsim_lcd_dev;
-   if (!lcd_dev)
-   continue;
-
-   if ((strcmp(lcd_drv-name, lcd_dev-name)) == 0) {
-   /**
-* bus_id would be used to identify
-* connected bus.
-*/
-   dsim_ddi-bus_id = lcd_dev-bus_id;
-   mutex_unlock(mipi_dsim_lock);
-
-   return dsim_ddi;
-   }
-
-   list_del(dsim_ddi-list);
-   kfree(dsim_ddi);
-   }
-
-out:
-   mutex_unlock(mipi_dsim_lock);
-
-   return NULL;
+   pr_info(dsi entity release\n);
 }
 
-int exynos_mipi_dsi_register_lcd_driver(struct mipi_dsim_lcd_driver *lcd_drv)
+void  exynos_mipi_set_hs_enable(struct video_source *video_source, bool enable)
 {
-   struct mipi_dsim_ddi *dsim_ddi;
-
-   if (!lcd_drv-name) {
-   pr_err(dsim_lcd_driver name is NULL.\n);
-   return -EFAULT;
-   }
-
-   dsim_ddi = exynos_mipi_dsi_find_lcd_device(lcd_drv);
-   if (!dsim_ddi) {
-   pr_err(v mipi_dsim_ddi object not found.\n);
-   return -EFAULT

[RFC v2 3/3] video: exynos: Making s6e8ax0 panel driver compliant with CDF

2013-02-13 Thread Vikas Sajjan
Made necessary changes in s6e8ax0 panel driver as per the  CDF-T.
It also removes the dependency on backlight and lcd framework

Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/video/exynos/s6e8ax0.c |  848 +---
 1 file changed, 444 insertions(+), 404 deletions(-)

diff --git a/drivers/video/exynos/s6e8ax0.c b/drivers/video/exynos/s6e8ax0.c
index 7f7b25f..5a17e3c 100644
--- a/drivers/video/exynos/s6e8ax0.c
+++ b/drivers/video/exynos/s6e8ax0.c
@@ -25,6 +25,7 @@
 #include linux/backlight.h
 #include linux/regulator/consumer.h
 
+#include video/display.h
 #include video/mipi_display.h
 #include video/exynos_mipi_dsim.h
 
@@ -38,8 +39,7 @@
 #define POWER_IS_OFF(pwr)  ((pwr) == FB_BLANK_POWERDOWN)
 #define POWER_IS_NRM(pwr)  ((pwr) == FB_BLANK_NORMAL)
 
-#define lcd_to_master(a)   (a-dsim_dev-master)
-#define lcd_to_master_ops(a)   ((lcd_to_master(a))-master_ops)
+#define to_panel(p) container_of(p, struct s6e8ax0, entity)
 
 enum {
DSIM_NONE_STATE = 0,
@@ -47,20 +47,34 @@ enum {
DSIM_FRAME_DONE = 2,
 };
 
+/* This structure defines all the properties of a backlight */
+struct backlight_prop {
+   /* Current User requested brightness (0 - max_brightness) */
+   int brightness;
+   /* Maximal value for brightness (read-only) */
+   int max_brightness;
+};
+
+struct panel_platform_data {
+   unsigned intreset_delay;
+   unsigned intpower_on_delay;
+   unsigned intpower_off_delay;
+   const char  *video_source_name;
+};
+
 struct s6e8ax0 {
-   struct device   *dev;
-   unsigned intpower;
-   unsigned intid;
-   unsigned intgamma;
-   unsigned intacl_enable;
-   unsigned intcur_acl;
-
-   struct lcd_device   *ld;
-   struct backlight_device *bd;
-
-   struct mipi_dsim_lcd_device *dsim_dev;
-   struct lcd_platform_data*ddi_pd;
+   struct platform_device  *pdev;
+   struct video_source *src;
+   struct display_entity   entity;
+   unsigned intpower;
+   unsigned intid;
+   unsigned intgamma;
+   unsigned intacl_enable;
+   unsigned intcur_acl;
+   boolpanel_reverse;
+   struct lcd_platform_data*plat_data;
struct mutexlock;
+   struct backlight_prop   bl_prop;
bool  enabled;
 };
 
@@ -70,192 +84,194 @@ static struct regulator_bulk_data supplies[] = {
{ .supply = vci, },
 };
 
-static void s6e8ax0_regulator_enable(struct s6e8ax0 *lcd)
+static void s6e8ax0_regulator_enable(struct s6e8ax0 *panel)
 {
int ret = 0;
-   struct lcd_platform_data *pd = NULL;
+   struct lcd_platform_data *plat_data = NULL;
 
-   pd = lcd-ddi_pd;
-   mutex_lock(lcd-lock);
-   if (!lcd-enabled) {
+   plat_data = panel-plat_data;
+
+   mutex_lock(panel-lock);
+
+   if (!panel-enabled) {
ret = regulator_bulk_enable(ARRAY_SIZE(supplies), supplies);
if (ret)
goto out;
-
-   lcd-enabled = true;
+   panel-enabled = true;
}
-   msleep(pd-power_on_delay);
+   msleep(plat_data-power_on_delay);
 out:
-   mutex_unlock(lcd-lock);
+   mutex_unlock(panel-lock);
 }
 
-static void s6e8ax0_regulator_disable(struct s6e8ax0 *lcd)
+static void s6e8ax0_regulator_disable(struct s6e8ax0 *panel)
 {
int ret = 0;
 
-   mutex_lock(lcd-lock);
-   if (lcd-enabled) {
+   mutex_lock(panel-lock);
+
+   if (panel-enabled) {
ret = regulator_bulk_disable(ARRAY_SIZE(supplies), supplies);
if (ret)
goto out;
 
-   lcd-enabled = false;
+   panel-enabled = false;
}
 out:
-   mutex_unlock(lcd-lock);
+   mutex_unlock(panel-lock);
 }
 
-static const unsigned char s6e8ax0_22_gamma_30[] = {
+static unsigned char s6e8ax0_22_gamma_30[] = {
0xfa, 0x01, 0x60, 0x10, 0x60, 0xf5, 0x00, 0xff, 0xad, 0xaf,
0xbA, 0xc3, 0xd8, 0xc5, 0x9f, 0xc6, 0x9e, 0xc1, 0xdc, 0xc0,
0x00, 0x61, 0x00, 0x5a, 0x00, 0x74,
 };
 
-static const unsigned char s6e8ax0_22_gamma_50[] = {
+static unsigned char s6e8ax0_22_gamma_50[] = {
0xfa, 0x01, 0x60, 0x10, 0x60, 0xe8, 0x1f, 0xf7, 0xad, 0xc0,
0xb5, 0xc4, 0xdc, 0xc4, 0x9e, 0xc6, 0x9c, 0xbb, 0xd8, 0xbb,
0x00, 0x70, 0x00, 0x68, 0x00, 0x86,
 };
 
-static const unsigned char s6e8ax0_22_gamma_60[] = {
+static unsigned char s6e8ax0_22_gamma_60[] = {
0xfa, 0x01, 0x60, 0x10, 0x60, 0xde, 0x1f, 0xef, 0xad, 0xc4,
0xb3, 0xc3, 0xdd, 0xc4, 0x9e, 0xc6, 0x9c, 0xbc, 0xd6, 0xba,
0x00, 0x75, 0x00, 0x6e, 0x00, 0x8d,
 };
 
-static const unsigned char s6e8ax0_22_gamma_70[] = {
+static unsigned char

[PATCH v5 0/1] Add display-timing node parsing to exynos drm fimd

2013-02-05 Thread Vikas Sajjan
Add display-timing node parsing to drm fimd and depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v4:
- addressed comments from Paul Menzel 
paulepan...@users.sourceforge.net, to modify the commit message

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org

Vikas Sajjan (1):
  video: drm: exynos: Add display-timing node parsing using video
helper function

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   41 +++---
 1 file changed, 37 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v5 1/1] video: drm: exynos: Add display-timing node parsing using video helper function

2013-02-05 Thread Vikas Sajjan
Add support for parsing the display-timing node using video helper
function.

The DT node parsing and pinctrl selection is done only if 'dev.of_node'
exists and the NON-DT logic is still maintained under the 'else' part.

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   41 +++---
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bf0d9ba..978e866 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
@@ -905,16 +906,48 @@ static int __devinit fimd_probe(struct platform_device 
*pdev)
struct exynos_drm_subdrv *subdrv;
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
+   struct fb_videomode *fbmode;
+   struct pinctrl *pctrl;
struct resource *res;
int win;
int ret = -EINVAL;
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
+   if (!fbmode) {
+   DRM_ERROR(memory allocation for fbmode failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, fbmode, -1);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode()\n
+   with return value: %d\n, ret);
+   return ret;
+   }
+   pdata-panel.timing = (struct fb_videomode) *fbmode;
+
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR_OR_NULL(pctrl)) {
+   DRM_ERROR(failed: devm_pinctrl_get_select_default()\n
+   with return value: %d\n, PTR_RET(pctrl));
+   return PTR_RET(pctrl);
+   }
+
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v4 0/1] Adds display-timing node parsing to exynos drm fimd

2013-02-04 Thread Vikas Sajjan
This patch adds display-timing node parsing to drm fimd, this depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v3:
- addressed comments from Sean Paul seanp...@chromium.org, to modify
the return values and print messages.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org

Vikas Sajjan (1):
  video: drm: exynos: Adds display-timing node parsing using video
helper function

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   41 +++---
 1 file changed, 37 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v4 1/1] video: drm: exynos: Adds display-timing node parsing using video helper function

2013-02-04 Thread Vikas Sajjan
This patch adds display-timing node parsing using video helper function

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   41 +++---
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bf0d9ba..978e866 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
@@ -905,16 +906,48 @@ static int __devinit fimd_probe(struct platform_device 
*pdev)
struct exynos_drm_subdrv *subdrv;
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
+   struct fb_videomode *fbmode;
+   struct pinctrl *pctrl;
struct resource *res;
int win;
int ret = -EINVAL;
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
+   if (!fbmode) {
+   DRM_ERROR(memory allocation for fbmode failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, fbmode, -1);
+   if (ret) {
+   DRM_ERROR(failed: of_get_fb_videomode() :
+   return value: %d\n, ret);
+   return ret;
+   }
+   pdata-panel.timing = (struct fb_videomode) *fbmode;
+
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR_OR_NULL(pctrl)) {
+   DRM_ERROR(failed: devm_pinctrl_get_select_default()
+   return value: %d\n, PTR_RET(pctrl));
+   return PTR_RET(pctrl);
+   }
+
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


[PATCH v3 0/1] Adds display-timing node parsing to exynos drm fimd

2013-02-01 Thread Vikas Sajjan
This patch adds display-timing node parsing to drm fimd, this depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

changes since v2:
- moved 'devm_pinctrl_get_select_default' function call under
'if (pdev-dev.of_node)', this makes NON-DT code unchanged.
(reported by: Rahul Sharma r.sh.o...@gmail.com)

changes since v1:
- addressed comments from Sean Paul seanp...@chromium.org

patch is based on branch exynos-drm-next at
http://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git

Is tested on Exynos5250 and Exynos4412 by applying dependent patches available
at http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

Vikas Sajjan (1):
  video: drm: exynos: Adds display-timing node parsing using video
helper function

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   39 +++---
 1 file changed, 35 insertions(+), 4 deletions(-)

-- 
1.7.9.5

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


[PATCH v3 1/1] video: drm: exynos: Adds display-timing node parsing using video helper function

2013-02-01 Thread Vikas Sajjan
This patch adds display-timing node parsing using video helper function

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   39 +++---
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bf0d9ba..8eee13f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
@@ -905,16 +906,46 @@ static int __devinit fimd_probe(struct platform_device 
*pdev)
struct exynos_drm_subdrv *subdrv;
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
+   struct fb_videomode *fbmode;
+   struct pinctrl *pctrl;
struct resource *res;
int win;
int ret = -EINVAL;
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
-   return -EINVAL;
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
+   if (!fbmode) {
+   DRM_ERROR(memory allocation for fbmode failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(dev-of_node, fbmode, -1);
+   if (ret) {
+   DRM_ERROR(failed to get fb_videomode\n);
+   return -EINVAL;
+   }
+   pdata-panel.timing = (struct fb_videomode) *fbmode;
+
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR(pctrl)) {
+   DRM_ERROR(no pinctrl data provided.\n);
+   return -EINVAL;
+   }
+
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
}
 
panel = pdata-panel;
-- 
1.7.9.5

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


Re: [PATCH v2 1/1] video: drm: exynos: Adds display-timing node parsing using video helper function

2013-01-30 Thread Vikas Sajjan
Hi Sean,

On 30 January 2013 21:28, Sean Paul seanp...@chromium.org wrote:
 On Wed, Jan 30, 2013 at 1:30 AM, Vikas Sajjan vikas.saj...@linaro.org wrote:
 This patch adds display-timing node parsing using video helper function

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   38 
 +++---
  1 file changed, 35 insertions(+), 3 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index bf0d9ba..94729ed 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -19,6 +19,7 @@
  #include linux/clk.h
  #include linux/of_device.h
  #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h

  #include video/samsung_fimd.h
  #include drm/exynos_drm.h
 @@ -905,15 +906,46 @@ static int __devinit fimd_probe(struct platform_device 
 *pdev)
 struct exynos_drm_subdrv *subdrv;
 struct exynos_drm_fimd_pdata *pdata;
 struct exynos_drm_panel_info *panel;
 +   struct fb_videomode *fbmode;
 +   struct device *disp_dev = pdev-dev;

 Isn't this the same as dev (maybe I'm missing some dependent patch)?

yeah, its same. Will remove the duplicate variable.

 +   struct pinctrl *pctrl;
 struct resource *res;
 int win;
 int ret = -EINVAL;

 DRM_DEBUG_KMS(%s\n, __FILE__);

 -   pdata = pdev-dev.platform_data;
 -   if (!pdata) {
 -   dev_err(dev, no platform data specified\n);
 +   if (pdev-dev.of_node) {
 +   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 +   if (!pdata) {
 +   DRM_ERROR(memory allocation for pdata failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
 +   if (!fbmode) {
 +   DRM_ERROR(memory allocation for fbmode failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   ret = of_get_fb_videomode(disp_dev-of_node, fbmode, -1);
 +   if (ret) {
 +   DRM_ERROR(failed to get fb_videomode\n);
 +   return -EINVAL;
 +   }
 +   pdata-panel.timing = (struct fb_videomode) *fbmode;
 +
 +   } else {
 +   pdata = pdev-dev.platform_data;
 +   if (!pdata) {
 +   DRM_ERROR(no platform data specified\n);
 +   return -EINVAL;
 +   }
 +   }
 +
 +   pctrl = devm_pinctrl_get_select_default(dev);
 +   if (IS_ERR(pctrl)) {

 Will this work for exynos5? AFAICT, there's no pinctrl setup for it.

Was tested with

 Sean

 +   DRM_ERROR(no pinctrl data provided.\n);
 return -EINVAL;
 }

 --
 1.7.9.5

 ___
 dri-devel mailing list
 dri-de...@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/1] video: drm: exynos: Adds display-timing node parsing using video helper function

2013-01-30 Thread Vikas Sajjan
Hi Sean,

Sorry, wrongly sent incomplete mail.

On 31 January 2013 10:41, Vikas Sajjan vikas.saj...@linaro.org wrote:
 Hi Sean,

 On 30 January 2013 21:28, Sean Paul seanp...@chromium.org wrote:
 On Wed, Jan 30, 2013 at 1:30 AM, Vikas Sajjan vikas.saj...@linaro.org 
 wrote:
 This patch adds display-timing node parsing using video helper function

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/gpu/drm/exynos/exynos_drm_fimd.c |   38 
 +++---
  1 file changed, 35 insertions(+), 3 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 index bf0d9ba..94729ed 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
 @@ -19,6 +19,7 @@
  #include linux/clk.h
  #include linux/of_device.h
  #include linux/pm_runtime.h
 +#include linux/pinctrl/consumer.h

  #include video/samsung_fimd.h
  #include drm/exynos_drm.h
 @@ -905,15 +906,46 @@ static int __devinit fimd_probe(struct 
 platform_device *pdev)
 struct exynos_drm_subdrv *subdrv;
 struct exynos_drm_fimd_pdata *pdata;
 struct exynos_drm_panel_info *panel;
 +   struct fb_videomode *fbmode;
 +   struct device *disp_dev = pdev-dev;

 Isn't this the same as dev (maybe I'm missing some dependent patch)?

 yeah, its same. Will remove the duplicate variable.

 +   struct pinctrl *pctrl;
 struct resource *res;
 int win;
 int ret = -EINVAL;

 DRM_DEBUG_KMS(%s\n, __FILE__);

 -   pdata = pdev-dev.platform_data;
 -   if (!pdata) {
 -   dev_err(dev, no platform data specified\n);
 +   if (pdev-dev.of_node) {
 +   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 +   if (!pdata) {
 +   DRM_ERROR(memory allocation for pdata failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
 +   if (!fbmode) {
 +   DRM_ERROR(memory allocation for fbmode failed\n);
 +   return -ENOMEM;
 +   }
 +
 +   ret = of_get_fb_videomode(disp_dev-of_node, fbmode, -1);
 +   if (ret) {
 +   DRM_ERROR(failed to get fb_videomode\n);
 +   return -EINVAL;
 +   }
 +   pdata-panel.timing = (struct fb_videomode) *fbmode;
 +
 +   } else {
 +   pdata = pdev-dev.platform_data;
 +   if (!pdata) {
 +   DRM_ERROR(no platform data specified\n);
 +   return -EINVAL;
 +   }
 +   }
 +
 +   pctrl = devm_pinctrl_get_select_default(dev);
 +   if (IS_ERR(pctrl)) {

 Will this work for exynos5? AFAICT, there's no pinctrl setup for it.

 Was tested with test on Exynos 4412 SoC, with the arch side changes (refer 
 below link )
http://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg15336.html

as you said there's no pinctrl setup for it, by making similar changes
for exynos5, it should work for exynos5 also.

 Sean

 +   DRM_ERROR(no pinctrl data provided.\n);
 return -EINVAL;
 }

 --
 1.7.9.5

 ___
 dri-devel mailing list
 dri-de...@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/dri-devel



 --
 Thanks and Regards
  Vikas Sajjan



-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/1] Adds display-timing node parsing to exynos drm fimd

2013-01-29 Thread Vikas Sajjan
This patch adds display-timing node parsing to drm fimd, this depends on
the display helper patchset at
http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

It also adds pinctrl support for drm fimd.

patch is based on branch exynos-drm-next at
http://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos.git

Is tested on Exynos5250 and Exynos4412 by applying dependent patches available
at http://lists.freedesktop.org/archives/dri-devel/2013-January/033998.html

Vikas Sajjan (1):
  video: drm: exynos: Adds display-timing node parsing using video
helper function

 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   38 +++---
 1 file changed, 35 insertions(+), 3 deletions(-)

-- 
1.7.9.5

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


[PATCH v2 1/1] video: drm: exynos: Adds display-timing node parsing using video helper function

2013-01-29 Thread Vikas Sajjan
This patch adds display-timing node parsing using video helper function

Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
---
 drivers/gpu/drm/exynos/exynos_drm_fimd.c |   38 +++---
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c 
b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index bf0d9ba..94729ed 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -19,6 +19,7 @@
 #include linux/clk.h
 #include linux/of_device.h
 #include linux/pm_runtime.h
+#include linux/pinctrl/consumer.h
 
 #include video/samsung_fimd.h
 #include drm/exynos_drm.h
@@ -905,15 +906,46 @@ static int __devinit fimd_probe(struct platform_device 
*pdev)
struct exynos_drm_subdrv *subdrv;
struct exynos_drm_fimd_pdata *pdata;
struct exynos_drm_panel_info *panel;
+   struct fb_videomode *fbmode;
+   struct device *disp_dev = pdev-dev;
+   struct pinctrl *pctrl;
struct resource *res;
int win;
int ret = -EINVAL;
 
DRM_DEBUG_KMS(%s\n, __FILE__);
 
-   pdata = pdev-dev.platform_data;
-   if (!pdata) {
-   dev_err(dev, no platform data specified\n);
+   if (pdev-dev.of_node) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata) {
+   DRM_ERROR(memory allocation for pdata failed\n);
+   return -ENOMEM;
+   }
+
+   fbmode = devm_kzalloc(dev, sizeof(*fbmode), GFP_KERNEL);
+   if (!fbmode) {
+   DRM_ERROR(memory allocation for fbmode failed\n);
+   return -ENOMEM;
+   }
+
+   ret = of_get_fb_videomode(disp_dev-of_node, fbmode, -1);
+   if (ret) {
+   DRM_ERROR(failed to get fb_videomode\n);
+   return -EINVAL;
+   }
+   pdata-panel.timing = (struct fb_videomode) *fbmode;
+
+   } else {
+   pdata = pdev-dev.platform_data;
+   if (!pdata) {
+   DRM_ERROR(no platform data specified\n);
+   return -EINVAL;
+   }
+   }
+
+   pctrl = devm_pinctrl_get_select_default(dev);
+   if (IS_ERR(pctrl)) {
+   DRM_ERROR(no pinctrl data provided.\n);
return -EINVAL;
}
 
-- 
1.7.9.5

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


Re: [PATCH 2/2] [RFC] video: display: Adding frame related ops to MIPI DSI video source struct

2013-01-09 Thread Vikas Sajjan
Hi Laurent,

On 10 January 2013 05:05, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 Hi Vikas,

 Thank you for the patch.

 On Friday 04 January 2013 10:24:04 Vikas Sajjan wrote:
 On 3 January 2013 16:29, Tomasz Figa t.f...@samsung.com wrote:
  On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
  From: Vikas Sajjan vikas.saj...@linaro.org
 
  Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
  ---
 
   include/video/display.h |6 ++
   1 file changed, 6 insertions(+)
 
  diff --git a/include/video/display.h b/include/video/display.h
  index b639fd0..fb2f437 100644
  --- a/include/video/display.h
  +++ b/include/video/display.h
  @@ -117,6 +117,12 @@ struct dsi_video_source_ops {
 
void (*enable_hs)(struct video_source *src, bool enable);
 
  + /* frame related */
  + int (*get_frame_done)(struct video_source *src);
  + int (*clear_frame_done)(struct video_source *src);
  + int (*set_early_blank_mode)(struct video_source *src, int power);
  + int (*set_blank_mode)(struct video_source *src, int power);
  +
 
  I'm not sure if all those extra ops are needed in any way.
 
  Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only
  FB_BLANK_UNBLANK status, which basically equals to the already existing
  enable operation, while set_early_blank mode handles only
  FB_BLANK_POWERDOWN, being equal to disable callback.

 Right, exynos_mipi_dsi_blank_mode() only supports FB_BLANK_UNBLANK as
 of now, but FB_BLANK_NORMAL will be supported in future.
 If not for Exynos, i think it will be need for other SoCs which
 support FB_BLANK_UNBLANK and FB_BLANK_NORMAL.

 Could you please explain in a bit more details what the set_early_blank_mode
 and set_blank_mode operations do ?


with reference to Mr. Inki Dae's patch and discussion
http://lkml.indiana.edu/hypermail/linux/kernel/1109.1/00413.html
http://lkml.indiana.edu/hypermail/linux/kernel/1109.1/02247.html

set_early_blank_mode:
  - sets the framebuffer blank mode.
  - this callback should be called prior to fb_blank() by a client
driver only if needed
set_blank_mode:
  - sets framebuffer blank mode
  -  this callback should be called after fb_blank() by a client
driver only if needed.

In case of MIPI-DSI based video mode LCD Panel, for lcd power off, the
power off commands should be transferred to lcd panel with display and
mipi-dsi controller enabled, because the commands is set to lcd panel
at vsync porch period, hence set_early_blank_mode() was introduced and
should be called prior to fb_blank() as mentioned in the above 2
links.

I think Mr. Inki Dae can throw more light on this.

  Both get_frame_done and clear_frame_done do not look at anything used at
  the moment and if frame done status monitoring will be ever needed, I
  think a better way should be implemented.

 You are right, as of now Exynos MIPI DSI Panels are NOT using these
 callbacks, but as you mentioned we will need frame done status monitoring
 anyways, so i included these callbacks here. Will check, if we can implement
 any better method.

 Do you expect the entity drivers (and in particular the panel drivers) to
 require frame done notification ? If so, could you explain your use case(s) ?

In our Exynos MIPI DSIM H/W, once MIPI DSIM transfers whole image
frame, interrupt will raised to indicate the same.
as part of the mipi_dsim_master_ops() we have get_dsim_frame_done()
and clear_dsim_frame_done() ops. But as of now we are also _NOT_ using
these ops in any particular use case. So i guess as of now we can park
it, later if we find any need for the same we can add it.

 --
 Regards,

 Laurent Pinchart


--
Thanks and Regards
 Vikas Sajjan
 SAMSUNG Research India - Banglore.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [RFC] video: exynos mipi dsi: Making Exynos MIPI Complaint with CDF

2013-01-03 Thread Vikas Sajjan
Hi Sachin,

Thanks for the comments.

On Thu, Jan 3, 2013 at 11:14 AM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Vikas,

 Some nitpicks inline

 Subject: s/Complaint/Compliant

Oops, nice catch.

 On 2 January 2013 18:47, Vikas C Sajjan vikas.saj...@linaro.org wrote:
 From: Vikas Sajjan vikas.saj...@linaro.org


 Please add some description about this patch here.

sure.

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  drivers/video/exynos/exynos_mipi_dsi.c|   46 
 ++---
  drivers/video/exynos/exynos_mipi_dsi_common.c |   22 
  drivers/video/exynos/exynos_mipi_dsi_common.h |   12 +++
  include/video/exynos_mipi_dsim.h  |5 ++-
  4 files changed, 56 insertions(+), 29 deletions(-)

 diff --git a/drivers/video/exynos/exynos_mipi_dsi.c 
 b/drivers/video/exynos/exynos_mipi_dsi.c
 index 07d70a3..88b2aa9 100644
 --- a/drivers/video/exynos/exynos_mipi_dsi.c
 +++ b/drivers/video/exynos/exynos_mipi_dsi.c
 @@ -32,14 +32,13 @@
  #include linux/notifier.h
  #include linux/regulator/consumer.h
  #include linux/pm_runtime.h
 -
 +#include video/display.h
  #include video/exynos_mipi_dsim.h

  #include plat/fb.h

  #include exynos_mipi_dsi_common.h
  #include exynos_mipi_dsi_lowlevel.h
 -
  struct mipi_dsim_ddi {
 int bus_id;
 struct list_headlist;
 @@ -111,12 +110,13 @@ static void exynos_mipi_update_cfg(struct 
 mipi_dsim_device *dsim)
 exynos_mipi_dsi_stand_by(dsim, 1);
  }

 -static int exynos_mipi_dsi_early_blank_mode(struct mipi_dsim_device *dsim,
 +static int exynos_mipi_dsi_early_blank_mode(struct video_source 
 *video_source,
 int power)
  {
 +   struct mipi_dsim_device *dsim = container_of(video_source,
 +   struct mipi_dsim_device, 
 video_source);
 struct mipi_dsim_lcd_driver *client_drv = dsim-dsim_lcd_drv;
 struct mipi_dsim_lcd_device *client_dev = dsim-dsim_lcd_dev;
 -
 switch (power) {
 case FB_BLANK_POWERDOWN:
 if (dsim-suspended)
 @@ -139,12 +139,13 @@ static int exynos_mipi_dsi_early_blank_mode(struct 
 mipi_dsim_device *dsim,
 return 0;
  }

 -static int exynos_mipi_dsi_blank_mode(struct mipi_dsim_device *dsim, int 
 power)
 +static int exynos_mipi_dsi_blank_mode(struct video_source *video_source, 
 int power)
  {
 +   struct mipi_dsim_device *dsim = container_of(video_source,
 +   struct mipi_dsim_device, 
 video_source);
 struct platform_device *pdev = to_platform_device(dsim-dev);
 struct mipi_dsim_lcd_driver *client_drv = dsim-dsim_lcd_drv;
 struct mipi_dsim_lcd_device *client_dev = dsim-dsim_lcd_dev;
 -
 switch (power) {
 case FB_BLANK_UNBLANK:
 if (!dsim-suspended)
 @@ -319,12 +320,19 @@ static struct mipi_dsim_ddi 
 *exynos_mipi_dsi_bind_lcd_ddi(
 return NULL;
  }

 -/* define MIPI-DSI Master operations. */
 -static struct mipi_dsim_master_ops master_ops = {
 -   .cmd_read   = exynos_mipi_dsi_rd_data,
 -   .cmd_write  = exynos_mipi_dsi_wr_data,
 -   .get_dsim_frame_done= 
 exynos_mipi_dsi_get_frame_done_status,
 -   .clear_dsim_frame_done  = exynos_mipi_dsi_clear_frame_done,


 +static void panel_dsi_release(struct video_source *src)

 How about exynos_dsi_panel_release in line with other function names?

will modify.
 +{
 +   printk(dsi entity release\n);

 Please use pr_* function here (instead of printk).

Sure.

 +}
 +
 +static const struct common_video_source_ops dsi_common_ops = {

 Some comments for this place holder would be good.

 +};
 +
 +static const struct dsi_video_source_ops exynos_dsi_ops = {
 +   .dcs_read   = exynos_mipi_dsi_rd_data,
 +   .dcs_write  = exynos_mipi_dsi_wr_data,
 +   .get_frame_done = 
 exynos_mipi_dsi_get_frame_done_status,
 +   .clear_frame_done   = exynos_mipi_dsi_clear_frame_done,
 .set_early_blank_mode   = exynos_mipi_dsi_early_blank_mode,
 .set_blank_mode = exynos_mipi_dsi_blank_mode,
  };
 @@ -362,7 +370,6 @@ static int exynos_mipi_dsi_probe(struct platform_device 
 *pdev)
 }

 dsim-dsim_config = dsim_config;
 -   dsim-master_ops = master_ops;

 mutex_init(dsim-lock);

 @@ -463,6 +470,19 @@ static int exynos_mipi_dsi_probe(struct platform_device 
 *pdev)

 dsim-suspended = false;

 +   dsim-video_source.dev = pdev-dev;
 +   dsim-video_source.release = panel_dsi_release;
 +   dsim-video_source.common_ops = dsi_common_ops;
 +   dsim-video_source.ops.dsi = exynos_dsi_ops;
 +   dsim-video_source.name = exynos;

 Can't we get this from pdev?

right, will change accordingly.
 +
 +   ret = video_source_register(dsim-video_source);
 +   if (ret  0

Re: [PATCH 2/2] [RFC] video: display: Adding frame related ops to MIPI DSI video source struct

2013-01-03 Thread Vikas Sajjan
Hi Mr. Figa,

Thanks for reviewing.

On 3 January 2013 16:29, Tomasz Figa t.f...@samsung.com wrote:
 Hi Vikas,

 On Wednesday 02 of January 2013 18:47:22 Vikas C Sajjan wrote:
 From: Vikas Sajjan vikas.saj...@linaro.org

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 ---
  include/video/display.h |6 ++
  1 file changed, 6 insertions(+)

 diff --git a/include/video/display.h b/include/video/display.h
 index b639fd0..fb2f437 100644
 --- a/include/video/display.h
 +++ b/include/video/display.h
 @@ -117,6 +117,12 @@ struct dsi_video_source_ops {

   void (*enable_hs)(struct video_source *src, bool enable);

 + /* frame related */
 + int (*get_frame_done)(struct video_source *src);
 + int (*clear_frame_done)(struct video_source *src);
 + int (*set_early_blank_mode)(struct video_source *src, int power);
 + int (*set_blank_mode)(struct video_source *src, int power);
 +

 I'm not sure if all those extra ops are needed in any way.

 Looking and Exynos MIPI DSIM driver, set_blank_mode is handling only
 FB_BLANK_UNBLANK status, which basically equals to the already existing
 enable operation, while set_early_blank mode handles only
 FB_BLANK_POWERDOWN, being equal to disable callback.


Right, exynos_mipi_dsi_blank_mode() only supports FB_BLANK_UNBLANK as
of now, but FB_BLANK_NORMAL will be supported in future.
If not for Exynos, i think it will be need for other SoCs which
support  FB_BLANK_UNBLANK and FB_BLANK_NORMAL.

 Both get_frame_done and clear_frame_done do not look at anything used at
 the moment and if frame done status monitoring will be ever needed, I
 think a better way should be implemented.

You are right, as of now Exynos MIPI DSI Panels are NOT using these
callbacks, but as you mentioned we will need frame done status
monitoring anyways, so i included these callbacks here. Will check, if
we can implement any better method.

 Best regards,
 --
 Tomasz Figa
 Samsung Poland RD Center
 SW Solution Development, Linux Platform




-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC v2 0/5] Common Display Framework

2012-12-27 Thread Vikas Sajjan
On 27 December 2012 20:13, Tomasz Figa t.f...@samsung.com wrote:
 Hi Laurent,

 On Monday 24 of December 2012 15:12:28 Laurent Pinchart wrote:
 Hi Tomasz,

 On Friday 21 December 2012 11:00:52 Tomasz Figa wrote:
  On Tuesday 18 of December 2012 08:31:30 Vikas Sajjan wrote:
   On 17 December 2012 20:55, Laurent Pinchart wrote:
Hi Vikas,
   
Sorry for the late reply. I now have more time to work on CDF, so
delays should be much shorter.
   
On Thursday 06 December 2012 10:51:15 Vikas Sajjan wrote:
 Hi Laurent,

 I was thinking of porting CDF to samsung EXYNOS 5250 platform,
 what
 I found is that, the exynos display controller is MIPI DSI based
 controller.

 But if I look at CDF patches, it has only support for MIPI DBI
 based
 Display controller.

 So my question is, do we have any generic framework for MIPI DSI
 based display controller? basically I wanted to know, how to go
 about
 porting CDF for such kind of display controller.
   
MIPI DSI support is not available yet. The only reason for that is
that I don't have any MIPI DSI hardware to write and test the code
with :-)
   
The common display framework should definitely support MIPI DSI. I
think the existing MIPI DBI code could be used as a base, so the
implementation shouldn't be too high.
   
Yeah, i was also thinking in similar lines, below is my though for
MIPI DSI support in CDF.
  
   o   MIPI DSI support as part of CDF framework will expose
   §  mipi_dsi_register_device(mpi_device) (will be called
   mach-xxx-dt.c
   file )
   §  mipi_dsi_register_driver(mipi_driver, bus ops) (will be called
   from
   platform specific init driver call )
   ·bus ops will be
   o   read data
   o   write data
   o   write command
   §  MIPI DSI will be registered as bus_register()
  
   When MIPI DSI probe is called, it (e.g., Exynos or OMAP MIPI DSI)
   will
   initialize the MIPI DSI HW IP.
  
   This probe will also parse the DT file for MIPI DSI based panel, add
   the panel device (device_add() ) to kernel and register the display
   entity with its control and  video ops with CDF.
  
   I can give this a try.
 
  I am currently in progress of reworking Exynos MIPI DSIM code and
  s6e8ax0 LCD driver to use the v2 RFC of Common Display Framework. I
  have most of the work done, I have just to solve several remaining
  problems.
 Do you already have code that you can publish ? I'm particularly
 interested (and I think Tomi Valkeinen would be as well) in looking at
 the DSI operations you expose to DSI sinks (panels, transceivers, ...).

 Well, I'm afraid this might be little below your expectations, but here's
 an initial RFC of the part defining just the DSI bus. I need a bit more
 time for patches for Exynos MIPI DSI master and s6e8ax0 LCD.

 The implementation is very simple and heavily based on your MIPI DBI
 support and existing Exynos MIPI DSIM framework. Provided operation set is
 based on operation set used by Exynos s6e8ax0 LCD driver. Unfortunately
 this is my only source of information about MIPI DSI.

 Best regards,
 --
 Tomasz Figa
 Samsung Poland RD Center
 SW Solution Development, Linux Platform

 From bad07d8bdce0ff76cbc81a9da597c0d01e5244f7 Mon Sep 17 00:00:00 2001
 From: Tomasz Figa t.f...@samsung.com
 Date: Thu, 27 Dec 2012 12:36:15 +0100
 Subject: [RFC] video: display: Add generic MIPI DSI bus

 Signed-off-by: Tomasz Figa t.f...@samsung.com
 ---
  drivers/video/display/Kconfig|   4 +
  drivers/video/display/Makefile   |   1 +
  drivers/video/display/mipi-dsi-bus.c | 214
 +++
  include/video/display.h  |   1 +
  include/video/mipi-dsi-bus.h |  98 
  5 files changed, 318 insertions(+)
  create mode 100644 drivers/video/display/mipi-dsi-bus.c
  create mode 100644 include/video/mipi-dsi-bus.h

 diff --git a/drivers/video/display/Kconfig b/drivers/video/display/Kconfig
 index 13b6aaf..dbaff9d 100644
 --- a/drivers/video/display/Kconfig
 +++ b/drivers/video/display/Kconfig
 @@ -9,6 +9,10 @@ config DISPLAY_MIPI_DBI
 tristate
 default n

 +config DISPLAY_MIPI_DSI
 +   tristate
 +   default n
 +
  config DISPLAY_PANEL_DPI
 tristate DPI (Parallel) Display Panels
 ---help---
 diff --git a/drivers/video/display/Makefile
 b/drivers/video/display/Makefile
 index 482bec7..429b3ac8 100644
 --- a/drivers/video/display/Makefile
 +++ b/drivers/video/display/Makefile
 @@ -1,5 +1,6 @@
  obj-$(CONFIG_DISPLAY_CORE) += display-core.o
  obj-$(CONFIG_DISPLAY_MIPI_DBI) += mipi-dbi-bus.o
 +obj-$(CONFIG_DISPLAY_MIPI_DSI) += mipi-dsi-bus.o
  obj-$(CONFIG_DISPLAY_PANEL_DPI) += panel-dpi.o
  obj-$(CONFIG_DISPLAY_PANEL_R61505) += panel-r61505.o
  obj-$(CONFIG_DISPLAY_PANEL_R61517) += panel-r61517.o
 diff --git a/drivers/video/display/mipi-dsi-bus.c
 b/drivers/video/display/mipi-dsi-bus.c
 new file mode 100644
 index 000..2998522

Re: [RFC v2 0/5] Common Display Framework

2012-12-17 Thread Vikas Sajjan
Hi All,

On 17 December 2012 20:55, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:

 Hi Vikas,

 Sorry for the late reply. I now have more time to work on CDF, so delays
 should be much shorter.

 On Thursday 06 December 2012 10:51:15 Vikas Sajjan wrote:
  Hi Laurent,
 
  I was thinking of porting CDF to samsung EXYNOS 5250 platform, what I found
  is that, the exynos display controller is MIPI DSI based controller.
 
  But if I look at CDF patches, it has only support for MIPI DBI based Display
  controller.
 
  So my question is, do we have any generic framework for MIPI DSI based
  display controller? basically I wanted to know, how to go about porting CDF
  for such kind of display controller.

 MIPI DSI support is not available yet. The only reason for that is that I
 don't have any MIPI DSI hardware to write and test the code with :-)

 The common display framework should definitely support MIPI DSI. I think the
 existing MIPI DBI code could be used as a base, so the implementation
 shouldn't be too high.

Yeah, i was also thinking in similar lines, below is my though for
MIPI DSI support in CDF.

o   MIPI DSI support as part of CDF framework will expose

 mipi_dsi_register_device(mpi_device) (will be called mach-xxx-dt.c file )

mipi_dsi_register_driver(mipi_driver, bus ops) (will be called
from platform specific init driver call )

·   bus ops will be
 o   read data
 o   write data
 o   write command

  MIPI DSI will be registered as bus_register()

When MIPI DSI probe is called, it (e.g., Exynos or OMAP MIPI DSI) will
initialize the MIPI DSI HW IP.

 This probe will also parse the DT file for MIPI DSI based panel, add
the panel device (device_add() ) to kernel and register the display
entity with its control and  video ops with CDF.

 I can give this a try. Does the existing Exynos 5250 driver support MIPI DSI ?
 Is the device documentation publicly available ? Can you point me to a MIPI
 DSI panel with public documentation (preferably with an existing mainline
 driver if possible) ?

 yeah, existing Exynos 5250 driver support MIPI DSI ass well as eDP.
 i think device documentation is NOT available publicly.

 --
 Regards,

 Laurent Pinchart


-- 
Thanks and Regards
 Vikas Sajjan
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html