Re: [PATCH] davinci: vpbe: pass different platform names to handle different ip's

2012-11-20 Thread Sekhar Nori

On 11/19/2012 6:48 PM, Prabhakar Lad wrote:
 From: Lad, Prabhakar prabhakar@ti.com
 
 The vpbe driver can handle different platforms DM644X, DM36X and
 DM355. To differentiate between this platforms venc_type/vpbe_type
 was passed as part of platform data which was incorrect. The correct
 way to differentiate to handle this case is by passing different
 platform names.
 
 This patch creates platform_device_id[] array supporting different
 platforms and assigns id_table to the platform driver, and finally
 in the probe gets the actual device by using platform_get_device_id()
 and gets the appropriate driver data for that platform.
 
 Taking this approach will also make the DT transition easier.
 
 Signed-off-by: Lad, Prabhakar prabhakar@ti.com
 Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com

Looks good to me except some comments below. After addressing those,
please feel free to add my:

Acked-by: Sekhar Nori nsek...@ti.com

I assume you want to merge this from media tree to manage dependencies?

 ---
  arch/arm/mach-davinci/board-dm644x-evm.c  |8 ++--
  arch/arm/mach-davinci/dm644x.c|7 +--
  drivers/media/platform/davinci/vpbe.c |9 +++-
  drivers/media/platform/davinci/vpbe_display.c |4 +-
  drivers/media/platform/davinci/vpbe_osd.c |   27 +-
  drivers/media/platform/davinci/vpbe_venc.c|   67 
 +
  include/media/davinci/vpbe_osd.h  |5 +-
  include/media/davinci/vpbe_venc.h |5 +-
  8 files changed, 94 insertions(+), 38 deletions(-)
 
 diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
 b/arch/arm/mach-davinci/board-dm644x-evm.c
 index f22572ce..b00ade4 100644
 --- a/arch/arm/mach-davinci/board-dm644x-evm.c
 +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
 @@ -689,7 +689,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
   .std= VENC_STD_ALL,
   .capabilities   = V4L2_OUT_CAP_STD,
   },
 - .subdev_name= VPBE_VENC_SUBDEV_NAME,
 + .subdev_name= DM644X_VPBE_VENC_SUBDEV_NAME,
   .default_mode   = ntsc,
   .num_modes  = ARRAY_SIZE(dm644xevm_enc_std_timing),
   .modes  = dm644xevm_enc_std_timing,
 @@ -701,7 +701,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
   .type   = V4L2_OUTPUT_TYPE_ANALOG,
   .capabilities   = V4L2_OUT_CAP_DV_TIMINGS,
   },
 - .subdev_name= VPBE_VENC_SUBDEV_NAME,
 + .subdev_name= DM644X_VPBE_VENC_SUBDEV_NAME,
   .default_mode   = 480p59_94,
   .num_modes  = ARRAY_SIZE(dm644xevm_enc_preset_timing),
   .modes  = dm644xevm_enc_preset_timing,
 @@ -712,10 +712,10 @@ static struct vpbe_config dm644xevm_display_cfg = {
   .module_name= dm644x-vpbe-display,
   .i2c_adapter_id = 1,
   .osd= {
 - .module_name= VPBE_OSD_SUBDEV_NAME,
 + .module_name= DM644X_VPBE_OSD_SUBDEV_NAME,
   },
   .venc   = {
 - .module_name= VPBE_VENC_SUBDEV_NAME,
 + .module_name= DM644X_VPBE_VENC_SUBDEV_NAME,
   },
   .num_outputs= ARRAY_SIZE(dm644xevm_vpbe_outputs),
   .outputs= dm644xevm_vpbe_outputs,
 diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
 index cd0c8b1..7b785ec 100644
 --- a/arch/arm/mach-davinci/dm644x.c
 +++ b/arch/arm/mach-davinci/dm644x.c
 @@ -670,11 +670,11 @@ static struct resource dm644x_osd_resources[] = {
  };
  
  static struct osd_platform_data dm644x_osd_data = {
 - .vpbe_type = VPBE_VERSION_1,
 + .field_inv_wa_enable = 0,

Stray change in the patch? You anyway do not need to zero initialize.

  };
  
  static struct platform_device dm644x_osd_dev = {
 - .name   = VPBE_OSD_SUBDEV_NAME,
 + .name   = DM644X_VPBE_OSD_SUBDEV_NAME,
   .id = -1,
   .num_resources  = ARRAY_SIZE(dm644x_osd_resources),
   .resource   = dm644x_osd_resources,
 @@ -752,12 +752,11 @@ static struct platform_device dm644x_vpbe_display = {
  };
  
  static struct venc_platform_data dm644x_venc_pdata = {
 - .venc_type  = VPBE_VERSION_1,
   .setup_clock= dm644x_venc_setup_clock,
  };
  
  static struct platform_device dm644x_venc_dev = {
 - .name   = VPBE_VENC_SUBDEV_NAME,
 + .name   = DM644X_VPBE_VENC_SUBDEV_NAME,
   .id = -1,
   .num_resources  = ARRAY_SIZE(dm644x_venc_resources),
   .resource   = dm644x_venc_resources,
 diff --git a/drivers/media/platform/davinci/vpbe.c 
 b/drivers/media/platform/davinci/vpbe.c
 index 7f5cf9b..0dd3c62 100644
 --- a/drivers/media/platform/davinci/vpbe.c
 +++ b/drivers/media/platform/davinci/vpbe.c
 @@ -558,9 +558,14 @@ static int platform_device_get(struct device *dev, void 
 

Re: [PATCH] davinci: vpbe: pass different platform names to handle different ip's

2012-11-20 Thread Prabhakar Lad
Sekhar,

Thanks for the review.

On Tue, Nov 20, 2012 at 2:40 PM, Sekhar Nori nsek...@ti.com wrote:

 On 11/19/2012 6:48 PM, Prabhakar Lad wrote:
 From: Lad, Prabhakar prabhakar@ti.com

 The vpbe driver can handle different platforms DM644X, DM36X and
 DM355. To differentiate between this platforms venc_type/vpbe_type
 was passed as part of platform data which was incorrect. The correct
 way to differentiate to handle this case is by passing different
 platform names.

 This patch creates platform_device_id[] array supporting different
 platforms and assigns id_table to the platform driver, and finally
 in the probe gets the actual device by using platform_get_device_id()
 and gets the appropriate driver data for that platform.

 Taking this approach will also make the DT transition easier.

 Signed-off-by: Lad, Prabhakar prabhakar@ti.com
 Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com

 Looks good to me except some comments below. After addressing those,
 please feel free to add my:

 Acked-by: Sekhar Nori nsek...@ti.com

 I assume you want to merge this from media tree to manage dependencies?

Yes I plan to get this one through media tree.

 ---
  arch/arm/mach-davinci/board-dm644x-evm.c  |8 ++--
  arch/arm/mach-davinci/dm644x.c|7 +--
  drivers/media/platform/davinci/vpbe.c |9 +++-
  drivers/media/platform/davinci/vpbe_display.c |4 +-
  drivers/media/platform/davinci/vpbe_osd.c |   27 +-
  drivers/media/platform/davinci/vpbe_venc.c|   67 
 +
  include/media/davinci/vpbe_osd.h  |5 +-
  include/media/davinci/vpbe_venc.h |5 +-
  8 files changed, 94 insertions(+), 38 deletions(-)

 diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
 b/arch/arm/mach-davinci/board-dm644x-evm.c
 index f22572ce..b00ade4 100644
 --- a/arch/arm/mach-davinci/board-dm644x-evm.c
 +++ b/arch/arm/mach-davinci/board-dm644x-evm.c
 @@ -689,7 +689,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
   .std= VENC_STD_ALL,
   .capabilities   = V4L2_OUT_CAP_STD,
   },
 - .subdev_name= VPBE_VENC_SUBDEV_NAME,
 + .subdev_name= DM644X_VPBE_VENC_SUBDEV_NAME,
   .default_mode   = ntsc,
   .num_modes  = ARRAY_SIZE(dm644xevm_enc_std_timing),
   .modes  = dm644xevm_enc_std_timing,
 @@ -701,7 +701,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
   .type   = V4L2_OUTPUT_TYPE_ANALOG,
   .capabilities   = V4L2_OUT_CAP_DV_TIMINGS,
   },
 - .subdev_name= VPBE_VENC_SUBDEV_NAME,
 + .subdev_name= DM644X_VPBE_VENC_SUBDEV_NAME,
   .default_mode   = 480p59_94,
   .num_modes  = ARRAY_SIZE(dm644xevm_enc_preset_timing),
   .modes  = dm644xevm_enc_preset_timing,
 @@ -712,10 +712,10 @@ static struct vpbe_config dm644xevm_display_cfg = {
   .module_name= dm644x-vpbe-display,
   .i2c_adapter_id = 1,
   .osd= {
 - .module_name= VPBE_OSD_SUBDEV_NAME,
 + .module_name= DM644X_VPBE_OSD_SUBDEV_NAME,
   },
   .venc   = {
 - .module_name= VPBE_VENC_SUBDEV_NAME,
 + .module_name= DM644X_VPBE_VENC_SUBDEV_NAME,
   },
   .num_outputs= ARRAY_SIZE(dm644xevm_vpbe_outputs),
   .outputs= dm644xevm_vpbe_outputs,
 diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
 index cd0c8b1..7b785ec 100644
 --- a/arch/arm/mach-davinci/dm644x.c
 +++ b/arch/arm/mach-davinci/dm644x.c
 @@ -670,11 +670,11 @@ static struct resource dm644x_osd_resources[] = {
  };

  static struct osd_platform_data dm644x_osd_data = {
 - .vpbe_type = VPBE_VERSION_1,
 + .field_inv_wa_enable = 0,

 Stray change in the patch? You anyway do not need to zero initialize.

Yes I added it since the driver had check if the platform data was null.
I'll remove this and also the check from the driver.

  };

  static struct platform_device dm644x_osd_dev = {
 - .name   = VPBE_OSD_SUBDEV_NAME,
 + .name   = DM644X_VPBE_OSD_SUBDEV_NAME,
   .id = -1,
   .num_resources  = ARRAY_SIZE(dm644x_osd_resources),
   .resource   = dm644x_osd_resources,
 @@ -752,12 +752,11 @@ static struct platform_device dm644x_vpbe_display = {
  };

  static struct venc_platform_data dm644x_venc_pdata = {
 - .venc_type  = VPBE_VERSION_1,
   .setup_clock= dm644x_venc_setup_clock,
  };

  static struct platform_device dm644x_venc_dev = {
 - .name   = VPBE_VENC_SUBDEV_NAME,
 + .name   = DM644X_VPBE_VENC_SUBDEV_NAME,
   .id = -1,
   .num_resources  = ARRAY_SIZE(dm644x_venc_resources),
   .resource   = dm644x_venc_resources,
 diff --git 

Re: [PATCH v11 0/6] of: add display helper

2012-11-20 Thread Laurent Pinchart
Hi Steffen,

On Tuesday 20 November 2012 11:39:18 Steffen Trumtrar wrote:
 On Thu, Nov 15, 2012 at 02:15:06PM +0100, Steffen Trumtrar wrote:
  Hi!
  
  Changes since v10:
  - fix function name (drm_)display_mode_from_videomode
  - add acked-by, reviewed-by, tested-by
  
  Regards,
  Steffen
  
  Steffen Trumtrar (6):
video: add display_timing and videomode
video: add of helper for videomode
fbmon: add videomode helpers
fbmon: add of_videomode helpers
drm_modes: add videomode helpers
drm_modes: add of_videomode helpers
   
   .../devicetree/bindings/video/display-timings.txt  |  107 ++
   drivers/gpu/drm/drm_modes.c|   70 +++
   drivers/video/Kconfig  |   19 ++
   drivers/video/Makefile |4 +
   drivers/video/display_timing.c |   24 +++
   drivers/video/fbmon.c  |   86 
   drivers/video/of_display_timing.c  |  212 +++
   drivers/video/of_videomode.c   |   47 +
   drivers/video/videomode.c  |   45 +
   include/drm/drmP.h |   12 ++
   include/linux/display_timing.h |   69 +++
   include/linux/fb.h |   12 ++
   include/linux/of_display_timings.h |   20 ++
   include/linux/of_videomode.h   |   17 ++
   include/linux/videomode.h  |   40 
   15 files changed, 784 insertions(+)
   create mode 100644
   Documentation/devicetree/bindings/video/display-timings.txt create mode
   100644 drivers/video/display_timing.c
   create mode 100644 drivers/video/of_display_timing.c
   create mode 100644 drivers/video/of_videomode.c
   create mode 100644 drivers/video/videomode.c
   create mode 100644 include/linux/display_timing.h
   create mode 100644 include/linux/of_display_timings.h
   create mode 100644 include/linux/of_videomode.h
   create mode 100644 include/linux/videomode.h
 
 Ping!
 
 Any comments or taker for v11? Errors are fixed, driver is tested and
 working, DT binding got two ACKs. So, the series is finished as far as I
 can tell.

Just one last comment, sorry for not bringing this up earlier. Could you 
constify pointer arguments to functions where applicable ? For instance

int videomode_from_timing(struct display_timings *disp, struct videomode *vm,
  unsigned int index);

The function shouldn't modify disp, so you can make it const. Same for most of 
the API functions.

You can then add my

Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com

 As I'm not sure if I reached the right maintainers with the current CC, I
 did another get_maintainers and added Florian Schandinat and David Airlie
 to the list. If I need to resend the series, please tell.

-- 
Regards,

Laurent Pinchart

--
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 v11 0/6] of: add display helper

2012-11-20 Thread Steffen Trumtrar
On Tue, Nov 20, 2012 at 11:52:06AM +0100, Laurent Pinchart wrote:
 Hi Steffen,
 
 On Tuesday 20 November 2012 11:39:18 Steffen Trumtrar wrote:
  On Thu, Nov 15, 2012 at 02:15:06PM +0100, Steffen Trumtrar wrote:
   Hi!
   
   Changes since v10:
 - fix function name (drm_)display_mode_from_videomode
 - add acked-by, reviewed-by, tested-by
   
   Regards,
   Steffen
   
   Steffen Trumtrar (6):
 video: add display_timing and videomode
 video: add of helper for videomode
 fbmon: add videomode helpers
 fbmon: add of_videomode helpers
 drm_modes: add videomode helpers
 drm_modes: add of_videomode helpers

.../devicetree/bindings/video/display-timings.txt  |  107 ++
drivers/gpu/drm/drm_modes.c|   70 +++
drivers/video/Kconfig  |   19 ++
drivers/video/Makefile |4 +
drivers/video/display_timing.c |   24 +++
drivers/video/fbmon.c  |   86 
drivers/video/of_display_timing.c  |  212 +++
drivers/video/of_videomode.c   |   47 +
drivers/video/videomode.c  |   45 +
include/drm/drmP.h |   12 ++
include/linux/display_timing.h |   69 +++
include/linux/fb.h |   12 ++
include/linux/of_display_timings.h |   20 ++
include/linux/of_videomode.h   |   17 ++
include/linux/videomode.h  |   40 
15 files changed, 784 insertions(+)
create mode 100644
Documentation/devicetree/bindings/video/display-timings.txt create mode
100644 drivers/video/display_timing.c
create mode 100644 drivers/video/of_display_timing.c
create mode 100644 drivers/video/of_videomode.c
create mode 100644 drivers/video/videomode.c
create mode 100644 include/linux/display_timing.h
create mode 100644 include/linux/of_display_timings.h
create mode 100644 include/linux/of_videomode.h
create mode 100644 include/linux/videomode.h
  
  Ping!
  
  Any comments or taker for v11? Errors are fixed, driver is tested and
  working, DT binding got two ACKs. So, the series is finished as far as I
  can tell.
 
 Just one last comment, sorry for not bringing this up earlier. Could you 
 constify pointer arguments to functions where applicable ? For instance
 
 int videomode_from_timing(struct display_timings *disp, struct videomode *vm,
   unsigned int index);
 
 The function shouldn't modify disp, so you can make it const. Same for most 
 of 
 the API functions.
 

Okay. Will do.

 You can then add my
 
 Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 

Thanks.

Regards,
Steffen

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
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


Fwd: Re: Question Hauppauge Nova-S-Plus.

2012-11-20 Thread Marc Bolós

Dear again sirs,

After some investigation I've found 2 new clues.

1 - The problem begins always with a small signal drop. It usually lasts 
only a few seconds but that's enough to crash the adapter connected to 
the antenna.
2 - Now the news: if noticed that when this happens, the driver's kernel 
module belonging to that same adapter just dies, as you can see in the 
ps output below with my adapter /dev/dvb/adapter9:


root@*:/home/*# ps aux | grep cx88
root   903  0.0  0.0  0 0 ?SNov19   0:00 [cx88 
tvaudio]
root  2036  0.2  0.0  0 0 ?SNov19   3:36 
[cx88[8] dvb]
root  2037  0.2  0.0  0 0 ?SNov19   3:34 
[cx88[2] dvb]
root  2038  1.1  0.0  0 0 ?SNov19  17:11 
[cx88[1] dvb]
root  2039  1.0  0.0  0 0 ?SNov19  15:34 
[cx88[11] dvb]
root  2040  0.1  0.0  0 0 ?SNov19   2:49 
[cx88[3] dvb]
root  2041  1.0  0.0  0 0 ?SNov19  16:12 
[cx88[5] dvb]
root  2043  0.1  0.0  0 0 ?SNov19   2:56 
[cx88[7] dvb]
root 21951  0.0  0.0  0 0 ?S10:11   0:00 
[cx88[6] dvb]
root 21975  0.0  0.0  0 0 ?S10:11   0:00 
[cx88[4] dvb]

root 22741  0.0  0.0   7552   868 pts/4S+   10:30   0:00 grep cx88

The adapter's device files /dev/dvb/adapterX are kept in their place, 
but they are no longer readable nor writeable.
My question is: which module is the responsible for launching the kernel 
processes [cx88[XX] dvb]? Is there some way of manually launching one of 
them?
How can I restore the crashed device without needing to restart the 
machine or even remove the driver and affect the remaining working adapters?


Thank you very much for your help and time.

Kind regards.

El 13/08/12 11:44, Marc Bolós escribió:


Dear sirs,

I'm a systems engineer (from spain, so excuse my bad english) working
for some time with all kinds of TV receivers.

First I wanted to thank you all for your work.

I saw that sometimes your tips on this list are very helpfull, so I
wanted to make you a question that maybe you can help me with.

I've been working for some time with those devices, and recently I have
a problem which I've never seen before. The point is that I tune
properly frequency and I start watching all channels, but after some
time  one or 2 tuners stops, and you cannot tune again any frequency
until you reboot all server.

One thing very strange there is that always are the same tuners which
fails. Signal is OK.

I don't have any error on syslog nor dmesg. And once you reboot it works
again.

Have anyone seen this problem before and can help me please?

Thanks a lot for your time,
Kind regards

Marc.


--
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: Linux DVB Explained..

2012-11-20 Thread Richard
Hi Patrick,

Thanks for some clarifications, they are invaluable.

On 19 November 2012 10:52, Patrick Boettcher pboettc...@kernellabs.com wrote:
 Hi Richard,


 ---
 The hardware I am using has 6 TS data inputs, 4 tuners (linked to TS
 inputs)  and hardware PID filters and I am trying to establish the
 relationship of dmx and dmxdev.

 Before understanding the relationship you need to know where, in the end,
 you want your TS-packets. In user-space? Sent to a hardware-decoder?
 Somewhere else? All of that?

 HTH a litte bit,
 --
 Patrick


A brief description of the hardware platform :
The device is a Dual Core ARM A9 SoC with 8 TS inputs (each TS channel
has a dedicated PID filter) . There are 8 MPEG decoders and two live
video surfaces.  All TS channels can go to a mpeg decoder directly OR
can be placed in a ringbuffer so that it can be sent to userspace (DVR
perhaps)

My aim is to create a skeleton DVB device (that works with my
hardware) with documentation so that others dont have to learn the
lessons I have :D

It sounds easy, but I doubt it is..
Richard
--
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] davinci: vpbe: pass different platform names to handle different ip's

2012-11-20 Thread Prabhakar Lad
From: Lad, Prabhakar prabhakar@ti.com

The vpbe driver can handle different platforms DM644X, DM36X and
DM355. To differentiate between this platforms venc_type/vpbe_type
was passed as part of platform data which was incorrect. The correct
way to differentiate to handle this case is by passing different
platform names.

This patch creates platform_device_id[] array supporting different
platforms and assigns id_table to the platform driver, and finally
in the probe gets the actual device by using platform_get_device_id()
and gets the appropriate driver data for that platform.

Taking this approach will also make the DT transition easier.

Signed-off-by: Lad, Prabhakar prabhakar@ti.com
Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com
Acked-by: Sekhar Nori nsek...@ti.com
---
 Changes for v2:
 1: Fixed review comments pointed by Sekhar.

 arch/arm/mach-davinci/board-dm644x-evm.c  |8 ++--
 arch/arm/mach-davinci/dm644x.c|   10 +---
 drivers/media/platform/davinci/vpbe.c |4 +-
 drivers/media/platform/davinci/vpbe_display.c |2 +-
 drivers/media/platform/davinci/vpbe_osd.c |   35 ++
 drivers/media/platform/davinci/vpbe_venc.c|   65 +
 include/media/davinci/vpbe_osd.h  |5 +-
 include/media/davinci/vpbe_venc.h |5 +-
 8 files changed, 84 insertions(+), 50 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c 
b/arch/arm/mach-davinci/board-dm644x-evm.c
index f22572ce..b00ade4 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -689,7 +689,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
.std= VENC_STD_ALL,
.capabilities   = V4L2_OUT_CAP_STD,
},
-   .subdev_name= VPBE_VENC_SUBDEV_NAME,
+   .subdev_name= DM644X_VPBE_VENC_SUBDEV_NAME,
.default_mode   = ntsc,
.num_modes  = ARRAY_SIZE(dm644xevm_enc_std_timing),
.modes  = dm644xevm_enc_std_timing,
@@ -701,7 +701,7 @@ static struct vpbe_output dm644xevm_vpbe_outputs[] = {
.type   = V4L2_OUTPUT_TYPE_ANALOG,
.capabilities   = V4L2_OUT_CAP_DV_TIMINGS,
},
-   .subdev_name= VPBE_VENC_SUBDEV_NAME,
+   .subdev_name= DM644X_VPBE_VENC_SUBDEV_NAME,
.default_mode   = 480p59_94,
.num_modes  = ARRAY_SIZE(dm644xevm_enc_preset_timing),
.modes  = dm644xevm_enc_preset_timing,
@@ -712,10 +712,10 @@ static struct vpbe_config dm644xevm_display_cfg = {
.module_name= dm644x-vpbe-display,
.i2c_adapter_id = 1,
.osd= {
-   .module_name= VPBE_OSD_SUBDEV_NAME,
+   .module_name= DM644X_VPBE_OSD_SUBDEV_NAME,
},
.venc   = {
-   .module_name= VPBE_VENC_SUBDEV_NAME,
+   .module_name= DM644X_VPBE_VENC_SUBDEV_NAME,
},
.num_outputs= ARRAY_SIZE(dm644xevm_vpbe_outputs),
.outputs= dm644xevm_vpbe_outputs,
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index cd0c8b1..98d79f1 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -669,19 +669,14 @@ static struct resource dm644x_osd_resources[] = {
},
 };
 
-static struct osd_platform_data dm644x_osd_data = {
-   .vpbe_type = VPBE_VERSION_1,
-};
-
 static struct platform_device dm644x_osd_dev = {
-   .name   = VPBE_OSD_SUBDEV_NAME,
+   .name   = DM644X_VPBE_OSD_SUBDEV_NAME,
.id = -1,
.num_resources  = ARRAY_SIZE(dm644x_osd_resources),
.resource   = dm644x_osd_resources,
.dev= {
.dma_mask   = dm644x_video_dma_mask,
.coherent_dma_mask  = DMA_BIT_MASK(32),
-   .platform_data  = dm644x_osd_data,
},
 };
 
@@ -752,12 +747,11 @@ static struct platform_device dm644x_vpbe_display = {
 };
 
 static struct venc_platform_data dm644x_venc_pdata = {
-   .venc_type  = VPBE_VERSION_1,
.setup_clock= dm644x_venc_setup_clock,
 };
 
 static struct platform_device dm644x_venc_dev = {
-   .name   = VPBE_VENC_SUBDEV_NAME,
+   .name   = DM644X_VPBE_VENC_SUBDEV_NAME,
.id = -1,
.num_resources  = ARRAY_SIZE(dm644x_venc_resources),
.resource   = dm644x_venc_resources,
diff --git a/drivers/media/platform/davinci/vpbe.c 
b/drivers/media/platform/davinci/vpbe.c
index 7f5cf9b..dd670cd 100644
--- a/drivers/media/platform/davinci/vpbe.c
+++ b/drivers/media/platform/davinci/vpbe.c
@@ -558,9 +558,9 @@ static int platform_device_get(struct device *dev, void 
*data)
struct platform_device *pdev 

Re: [PATCH] [media] exynos-gsc: Adding tiled multi-planar format to G-Scaler

2012-11-20 Thread Shaik Ameer Basha
Hi Sylwester,

On Tue, Nov 20, 2012 at 3:05 AM, Sylwester Nawrocki
sylvester.nawro...@gmail.com wrote:
 Hi Shaik,


 On 11/07/2012 07:37 AM, Shaik Ameer Basha wrote:

 Adding V4L2_PIX_FMT_NV12MT_16X16 to G-Scaler supported formats.
 If the output or input format is V4L2_PIX_FMT_NV12MT_16X16, configure
 G-Scaler to use GSC_IN_TILE_MODE.

 Signed-off-by: Shaik Ameer Bashashaik.am...@samsung.com
 ---
   drivers/media/platform/exynos-gsc/gsc-core.c |9 +
   drivers/media/platform/exynos-gsc/gsc-core.h |5 +
   drivers/media/platform/exynos-gsc/gsc-regs.c |6 ++
   3 files changed, 20 insertions(+), 0 deletions(-)

 diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c
 b/drivers/media/platform/exynos-gsc/gsc-core.c
 index cc7b218..00f1013 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-core.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
 @@ -185,6 +185,15 @@ static const struct gsc_fmt gsc_formats[] = {
 .corder = GSC_CRCB,
 .num_planes = 3,
 .num_comp   = 3,
 +   }, {
 +   .name   = YUV 4:2:0 non-contig. 2p, Y/CbCr,
 tiled,


 I have applied this patch to my tree for v3.8, and I've shortened this
 description like this

 .name   = YUV 4:2:0 n.c. 2p, Y/CbCr tiled,

 so it fits in 32 char buffer.

Thanks and that should be fine.


 There are some too long format descriptions in the driver already.
 Please check output of VIDIOC_ENUM_FMT ioctl, for instance with
 'v4l2-ctl --list-fmt'.


 +   .pixelformat= V4L2_PIX_FMT_NV12MT_16X16,
 +   .depth  = { 8, 4 },
 +   .color  = GSC_YUV420,
 +   .yorder = GSC_LSB_Y,
 +   .corder = GSC_CBCR,
 +   .num_planes = 2,
 +   .num_comp   = 2,
 }
   };

 diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h
 b/drivers/media/platform/exynos-gsc/gsc-core.h
 index 5f157ef..cc19bba 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-core.h
 +++ b/drivers/media/platform/exynos-gsc/gsc-core.h
 @@ -427,6 +427,11 @@ static inline void gsc_ctx_state_lock_clear(u32
 state, struct gsc_ctx *ctx)
 spin_unlock_irqrestore(ctx-gsc_dev-slock, flags);
   }

 +static inline int is_tiled(const struct gsc_fmt *fmt)
 +{
 +   return fmt-pixelformat == V4L2_PIX_FMT_NV12MT_16X16;
 +}
 +
   static inline void gsc_hw_enable_control(struct gsc_dev *dev, bool on)
   {
 u32 cfg = readl(dev-regs + GSC_ENABLE);
 diff --git a/drivers/media/platform/exynos-gsc/gsc-regs.c
 b/drivers/media/platform/exynos-gsc/gsc-regs.c
 index 0146b35..6f5b5a4 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-regs.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-regs.c
 @@ -214,6 +214,9 @@ void gsc_hw_set_in_image_format(struct gsc_ctx *ctx)
 break;
 }

 +   if (is_tiled(frame-fmt))
 +   cfg |= GSC_IN_TILE_C_16x8 | GSC_IN_TILE_MODE;
 +
 writel(cfg, dev-regs + GSC_IN_CON);
   }

 @@ -334,6 +337,9 @@ void gsc_hw_set_out_image_format(struct gsc_ctx *ctx)
 break;
 }

 +   if (is_tiled(frame-fmt))
 +   cfg |= GSC_OUT_TILE_C_16x8 | GSC_OUT_TILE_MODE;
 +
   end_set:
 writel(cfg, dev-regs + GSC_OUT_CON);
   }


 Thanks,
 Sylwester
--
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 6/6] drm_modes: add of_videomode helpers

2012-11-20 Thread Steffen Trumtrar
Add helper to get drm_display_mode from devicetree.

Signed-off-by: Steffen Trumtrar s.trumt...@pengutronix.de
Reviewed-by: Thierry Reding thierry.red...@avionic-design.de
Acked-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Philipp Zabel p.za...@pengutronix.de
Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/gpu/drm/drm_modes.c |   35 ++-
 include/drm/drmP.h  |6 ++
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 0073b27..04feef8 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -35,7 +35,8 @@
 #include linux/export.h
 #include drm/drmP.h
 #include drm/drm_crtc.h
-#include linux/videomode.h
+#include linux/of.h
+#include linux/of_videomode.h
 
 /**
  * drm_mode_debug_printmodeline - debug print a mode
@@ -541,6 +542,38 @@ int drm_display_mode_from_videomode(const struct videomode 
*vm,
 EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode);
 #endif
 
+#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
+/**
+ * of_get_drm_display_mode - get a drm_display_mode from devicetree
+ * @np: device_node with the timing specification
+ * @dmode: will be set to the return value
+ * @index: index into the list of display timings in devicetree
+ *
+ * This function is expensive and should only be used, if only one mode is to 
be
+ * read from DT. To get multiple modes start with of_get_display_timings and
+ * work with that instead.
+ */
+int of_get_drm_display_mode(const struct device_node *np,
+   struct drm_display_mode *dmode, unsigned int index)
+{
+   struct videomode vm;
+   int ret;
+
+   ret = of_get_videomode(np, vm, index);
+   if (ret)
+   return ret;
+
+   drm_display_mode_from_videomode(vm, dmode);
+
+   pr_info(%s: got %dx%d display mode from %s\n, __func__, vm.hactive,
+   vm.vactive, np-name);
+   drm_mode_debug_printmodeline(dmode);
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
+#endif
+
 /**
  * drm_mode_set_name - set the name on a mode
  * @mode: name will be set in this mode
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index de2f6cf..377280f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -56,6 +56,7 @@
 #include linux/cdev.h
 #include linux/mutex.h
 #include linux/slab.h
+#include linux/of.h
 #include linux/videomode.h
 #if defined(__alpha__) || defined(__powerpc__)
 #include asm/pgtable.h   /* For pte_wrprotect */
@@ -1459,6 +1460,11 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev,
 extern int drm_display_mode_from_videomode(const struct videomode *vm,
   struct drm_display_mode *dmode);
 #endif
+#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
+extern int of_get_drm_display_mode(const struct device_node *np,
+  struct drm_display_mode *dmode,
+  unsigned int index);
+#endif
 
 /* Modesetting support */
 extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
-- 
1.7.10.4

--
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 3/6] fbmon: add videomode helpers

2012-11-20 Thread Steffen Trumtrar
Add a function to convert from the generic videomode to a fb_videomode.

Signed-off-by: Steffen Trumtrar s.trumt...@pengutronix.de
Reviewed-by: Thierry Reding thierry.red...@avionic-design.de
Acked-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Philipp Zabel p.za...@pengutronix.de
Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/video/fbmon.c |   46 ++
 include/linux/fb.h|6 ++
 2 files changed, 52 insertions(+)

diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index cef6557..c1939a6 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -31,6 +31,7 @@
 #include linux/pci.h
 #include linux/slab.h
 #include video/edid.h
+#include linux/videomode.h
 #ifdef CONFIG_PPC_OF
 #include asm/prom.h
 #include asm/pci-bridge.h
@@ -1373,6 +1374,51 @@ int fb_get_mode(int flags, u32 val, struct 
fb_var_screeninfo *var, struct fb_inf
kfree(timings);
return err;
 }
+
+#if IS_ENABLED(CONFIG_VIDEOMODE)
+int fb_videomode_from_videomode(const struct videomode *vm,
+   struct fb_videomode *fbmode)
+{
+   unsigned int htotal, vtotal;
+
+   fbmode-xres = vm-hactive;
+   fbmode-left_margin = vm-hback_porch;
+   fbmode-right_margin = vm-hfront_porch;
+   fbmode-hsync_len = vm-hsync_len;
+
+   fbmode-yres = vm-vactive;
+   fbmode-upper_margin = vm-vback_porch;
+   fbmode-lower_margin = vm-vfront_porch;
+   fbmode-vsync_len = vm-vsync_len;
+
+   fbmode-pixclock = KHZ2PICOS(vm-pixelclock / 1000);
+
+   fbmode-sync = 0;
+   fbmode-vmode = 0;
+   if (vm-hah)
+   fbmode-sync |= FB_SYNC_HOR_HIGH_ACT;
+   if (vm-vah)
+   fbmode-sync |= FB_SYNC_VERT_HIGH_ACT;
+   if (vm-interlaced)
+   fbmode-vmode |= FB_VMODE_INTERLACED;
+   if (vm-doublescan)
+   fbmode-vmode |= FB_VMODE_DOUBLE;
+   if (vm-de)
+   fbmode-sync |= FB_SYNC_DATA_ENABLE_HIGH_ACT;
+   fbmode-flag = 0;
+
+   htotal = vm-hactive + vm-hfront_porch + vm-hback_porch +
+vm-hsync_len;
+   vtotal = vm-vactive + vm-vfront_porch + vm-vback_porch +
+vm-vsync_len;
+   fbmode-refresh = (vm-pixelclock * 1000) / (htotal * vtotal);
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(fb_videomode_from_videomode);
+#endif
+
+
 #else
 int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
 {
diff --git a/include/linux/fb.h b/include/linux/fb.h
index c7a9571..920cbe3 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -14,6 +14,7 @@
 #include linux/backlight.h
 #include linux/slab.h
 #include asm/io.h
+#include linux/videomode.h
 
 struct vm_area_struct;
 struct fb_info;
@@ -714,6 +715,11 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb);
 extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
 extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
 
+#if IS_ENABLED(CONFIG_VIDEOMODE)
+extern int fb_videomode_from_videomode(const struct videomode *vm,
+  struct fb_videomode *fbmode);
+#endif
+
 /* drivers/video/modedb.c */
 #define VESA_MODEDB_SIZE 34
 extern void fb_var_to_videomode(struct fb_videomode *mode,
-- 
1.7.10.4

--
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/6] video: add of helper for videomode

2012-11-20 Thread Steffen Trumtrar
This adds support for reading display timings from DT or/and convert one of 
those
timings to a videomode.
The of_display_timing implementation supports multiple children where each
property can have up to 3 values. All children are read into an array, that
can be queried.
of_get_videomode converts exactly one of that timings to a struct videomode.

Signed-off-by: Steffen Trumtrar s.trumt...@pengutronix.de
Signed-off-by: Philipp Zabel p.za...@pengutronix.de
Acked-by: Stephen Warren swar...@nvidia.com
Reviewed-by: Thierry Reding thierry.red...@avionic-design.de
Acked-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Philipp Zabel p.za...@pengutronix.de
Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 .../devicetree/bindings/video/display-timings.txt  |  107 ++
 drivers/video/Kconfig  |   13 ++
 drivers/video/Makefile |2 +
 drivers/video/of_display_timing.c  |  216 
 drivers/video/of_videomode.c   |   48 +
 include/linux/of_display_timings.h |   20 ++
 include/linux/of_videomode.h   |   18 ++
 7 files changed, 424 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/display-timings.txt
 create mode 100644 drivers/video/of_display_timing.c
 create mode 100644 drivers/video/of_videomode.c
 create mode 100644 include/linux/of_display_timings.h
 create mode 100644 include/linux/of_videomode.h

diff --git a/Documentation/devicetree/bindings/video/display-timings.txt 
b/Documentation/devicetree/bindings/video/display-timings.txt
new file mode 100644
index 000..a05cade
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/display-timings.txt
@@ -0,0 +1,107 @@
+display-timings bindings
+
+
+display-timings node
+
+
+required properties:
+ - none
+
+optional properties:
+ - native-mode: The native mode for the display, in case multiple modes are
+   provided. When omitted, assume the first node is the native.
+
+timings subnode
+---
+
+required properties:
+ - hactive, vactive: Display resolution
+ - hfront-porch, hback-porch, hsync-len: Horizontal Display timing parameters
+   in pixels
+   vfront-porch, vback-porch, vsync-len: Vertical display timing parameters in
+   lines
+ - clock-frequency: display clock in Hz
+
+optional properties:
+ - hsync-active: Hsync pulse is active low/high/ignored
+ - vsync-active: Vsync pulse is active low/high/ignored
+ - de-active: Data-Enable pulse is active low/high/ignored
+ - pixelclk-inverted: pixelclock is inverted/non-inverted/ignored
+ - interlaced (bool)
+ - doublescan (bool)
+
+All the optional properties that are not bool follow the following logic:
+1: high active
+0: low active
+omitted: not used on hardware
+
+There are different ways of describing the capabilities of a display. The 
devicetree
+representation corresponds to the one commonly found in datasheets for 
displays.
+If a display supports multiple signal timings, the native-mode can be 
specified.
+
+The parameters are defined as
+
+struct display_timing
+=
+
+  +--+-+--+---+
+  |  |↑|  |   |
+  |  ||vback_porch |  |   |
+  |  |↓|  |   |
+  +--###--+---+
+  |  #↑#  |   |
+  |  #|#  |   |
+  |  hback   #|#  hfront  | hsync |
+  |   porch  #|   hactive  #  porch   |  len  |
+  |#---+---#|-|
+  |  #|#  |   |
+  |  #|vactive #  |   |
+  |  #|#  |   |
+  |  #↓#  |   |
+  +--###--+---+
+  |  |↑|  |   |
+  |  ||vfront_porch|  |   |
+  |  |↓|  |   |
+  +--+-+--+---+
+  |  |↑|  |   |
+  |  ||vsync_len   |  |   |
+  |  

[PATCH v12 1/6] video: add display_timing and videomode

2012-11-20 Thread Steffen Trumtrar
Add display_timing structure and the according helper functions. This allows
the description of a display via its supported timing parameters.

Every timing parameter can be specified as a single value or a range
min typ max.

Also, add helper functions to convert from display timings to a generic 
videomode
structure. This videomode can then be converted to the corresponding subsystem
mode representation (e.g. fb_videomode).

Signed-off-by: Steffen Trumtrar s.trumt...@pengutronix.de
Reviewed-by: Thierry Reding thierry.red...@avionic-design.de
Acked-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Philipp Zabel p.za...@pengutronix.de
Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/video/Kconfig  |6 
 drivers/video/Makefile |2 ++
 drivers/video/display_timing.c |   24 ++
 drivers/video/videomode.c  |   46 ++
 include/linux/display_timing.h |   70 
 include/linux/videomode.h  |   40 +++
 6 files changed, 188 insertions(+)
 create mode 100644 drivers/video/display_timing.c
 create mode 100644 drivers/video/videomode.c
 create mode 100644 include/linux/display_timing.h
 create mode 100644 include/linux/videomode.h

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index d08d799..2a23b18 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -33,6 +33,12 @@ config VIDEO_OUTPUT_CONTROL
  This framework adds support for low-level control of the video 
  output switch.
 
+config DISPLAY_TIMING
+   bool
+
+config VIDEOMODE
+   bool
+
 menuconfig FB
tristate Support for frame buffer devices
---help---
diff --git a/drivers/video/Makefile b/drivers/video/Makefile
index 23e948e..fc30439 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
@@ -167,3 +167,5 @@ obj-$(CONFIG_FB_VIRTUAL)  += vfb.o
 
 #video output switch sysfs driver
 obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o
+obj-$(CONFIG_DISPLAY_TIMING) += display_timing.o
+obj-$(CONFIG_VIDEOMODE) += videomode.o
diff --git a/drivers/video/display_timing.c b/drivers/video/display_timing.c
new file mode 100644
index 000..ac9bbbc
--- /dev/null
+++ b/drivers/video/display_timing.c
@@ -0,0 +1,24 @@
+/*
+ * generic display timing functions
+ *
+ * Copyright (c) 2012 Steffen Trumtrar s.trumt...@pengutronix.de, Pengutronix
+ *
+ * This file is released under the GPLv2
+ */
+
+#include linux/display_timing.h
+#include linux/export.h
+#include linux/slab.h
+
+void display_timings_release(struct display_timings *disp)
+{
+   if (disp-timings) {
+   unsigned int i;
+
+   for (i = 0; i  disp-num_timings; i++)
+   kfree(disp-timings[i]);
+   kfree(disp-timings);
+   }
+   kfree(disp);
+}
+EXPORT_SYMBOL_GPL(display_timings_release);
diff --git a/drivers/video/videomode.c b/drivers/video/videomode.c
new file mode 100644
index 000..e24f879
--- /dev/null
+++ b/drivers/video/videomode.c
@@ -0,0 +1,46 @@
+/*
+ * generic display timing functions
+ *
+ * Copyright (c) 2012 Steffen Trumtrar s.trumt...@pengutronix.de, Pengutronix
+ *
+ * This file is released under the GPLv2
+ */
+
+#include linux/export.h
+#include linux/errno.h
+#include linux/display_timing.h
+#include linux/kernel.h
+#include linux/videomode.h
+
+int videomode_from_timing(const struct display_timings *disp,
+ struct videomode *vm, unsigned int index)
+{
+   struct display_timing *dt;
+
+   dt = display_timings_get(disp, index);
+   if (!dt)
+   return -EINVAL;
+
+   vm-pixelclock = display_timing_get_value(dt-pixelclock, 0);
+   vm-hactive = display_timing_get_value(dt-hactive, 0);
+   vm-hfront_porch = display_timing_get_value(dt-hfront_porch, 0);
+   vm-hback_porch = display_timing_get_value(dt-hback_porch, 0);
+   vm-hsync_len = display_timing_get_value(dt-hsync_len, 0);
+
+   vm-vactive = display_timing_get_value(dt-vactive, 0);
+   vm-vfront_porch = display_timing_get_value(dt-vfront_porch, 0);
+   vm-vback_porch = display_timing_get_value(dt-vback_porch, 0);
+   vm-vsync_len = display_timing_get_value(dt-vsync_len, 0);
+
+   vm-vah = dt-vsync_pol_active;
+   vm-hah = dt-hsync_pol_active;
+   vm-de = dt-de_pol_active;
+   vm-pixelclk_pol = dt-pixelclk_pol;
+
+   vm-interlaced = dt-interlaced;
+   vm-doublescan = dt-doublescan;
+
+   return 0;
+}
+
+EXPORT_SYMBOL_GPL(videomode_from_timing);
diff --git a/include/linux/display_timing.h b/include/linux/display_timing.h
new file mode 100644
index 000..d5bf03f
--- /dev/null
+++ b/include/linux/display_timing.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2012 Steffen Trumtrar s.trumt...@pengutronix.de
+ *
+ * description of display timings
+ *
+ * This file is released under the 

[PATCH v12 5/6] drm_modes: add videomode helpers

2012-11-20 Thread Steffen Trumtrar
Add conversion from videomode to drm_display_mode

Signed-off-by: Steffen Trumtrar s.trumt...@pengutronix.de
Reviewed-by: Thierry Reding thierry.red...@avionic-design.de
Acked-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Philipp Zabel p.za...@pengutronix.de
Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/gpu/drm/drm_modes.c |   37 +
 include/drm/drmP.h  |6 ++
 2 files changed, 43 insertions(+)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 59450f3..0073b27 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -35,6 +35,7 @@
 #include linux/export.h
 #include drm/drmP.h
 #include drm/drm_crtc.h
+#include linux/videomode.h
 
 /**
  * drm_mode_debug_printmodeline - debug print a mode
@@ -504,6 +505,42 @@ drm_gtf_mode(struct drm_device *dev, int hdisplay, int 
vdisplay, int vrefresh,
 }
 EXPORT_SYMBOL(drm_gtf_mode);
 
+#if IS_ENABLED(CONFIG_VIDEOMODE)
+int drm_display_mode_from_videomode(const struct videomode *vm,
+   struct drm_display_mode *dmode)
+{
+   dmode-hdisplay = vm-hactive;
+   dmode-hsync_start = dmode-hdisplay + vm-hfront_porch;
+   dmode-hsync_end = dmode-hsync_start + vm-hsync_len;
+   dmode-htotal = dmode-hsync_end + vm-hback_porch;
+
+   dmode-vdisplay = vm-vactive;
+   dmode-vsync_start = dmode-vdisplay + vm-vfront_porch;
+   dmode-vsync_end = dmode-vsync_start + vm-vsync_len;
+   dmode-vtotal = dmode-vsync_end + vm-vback_porch;
+
+   dmode-clock = vm-pixelclock / 1000;
+
+   dmode-flags = 0;
+   if (vm-hah)
+   dmode-flags |= DRM_MODE_FLAG_PHSYNC;
+   else
+   dmode-flags |= DRM_MODE_FLAG_NHSYNC;
+   if (vm-vah)
+   dmode-flags |= DRM_MODE_FLAG_PVSYNC;
+   else
+   dmode-flags |= DRM_MODE_FLAG_NVSYNC;
+   if (vm-interlaced)
+   dmode-flags |= DRM_MODE_FLAG_INTERLACE;
+   if (vm-doublescan)
+   dmode-flags |= DRM_MODE_FLAG_DBLSCAN;
+   drm_mode_set_name(dmode);
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode);
+#endif
+
 /**
  * drm_mode_set_name - set the name on a mode
  * @mode: name will be set in this mode
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 3fd8280..de2f6cf 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -56,6 +56,7 @@
 #include linux/cdev.h
 #include linux/mutex.h
 #include linux/slab.h
+#include linux/videomode.h
 #if defined(__alpha__) || defined(__powerpc__)
 #include asm/pgtable.h   /* For pte_wrprotect */
 #endif
@@ -1454,6 +1455,11 @@ extern struct drm_display_mode *
 drm_mode_create_from_cmdline_mode(struct drm_device *dev,
  struct drm_cmdline_mode *cmd);
 
+#if IS_ENABLED(CONFIG_VIDEOMODE)
+extern int drm_display_mode_from_videomode(const struct videomode *vm,
+  struct drm_display_mode *dmode);
+#endif
+
 /* Modesetting support */
 extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
 extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
-- 
1.7.10.4

--
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 4/6] fbmon: add of_videomode helpers

2012-11-20 Thread Steffen Trumtrar
Add helper to get fb_videomode from devicetree.

Signed-off-by: Steffen Trumtrar s.trumt...@pengutronix.de
Reviewed-by: Thierry Reding thierry.red...@avionic-design.de
Acked-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Thierry Reding thierry.red...@avionic-design.de
Tested-by: Philipp Zabel p.za...@pengutronix.de
Reviewed-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/video/fbmon.c |   42 +-
 include/linux/fb.h|7 +++
 2 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbmon.c b/drivers/video/fbmon.c
index c1939a6..16c353c 100644
--- a/drivers/video/fbmon.c
+++ b/drivers/video/fbmon.c
@@ -31,7 +31,7 @@
 #include linux/pci.h
 #include linux/slab.h
 #include video/edid.h
-#include linux/videomode.h
+#include linux/of_videomode.h
 #ifdef CONFIG_PPC_OF
 #include asm/prom.h
 #include asm/pci-bridge.h
@@ -1418,6 +1418,46 @@ int fb_videomode_from_videomode(const struct videomode 
*vm,
 EXPORT_SYMBOL_GPL(fb_videomode_from_videomode);
 #endif
 
+#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
+static inline void dump_fb_videomode(const struct fb_videomode *m)
+{
+   pr_debug(fb_videomode = %ux%u@%uHz (%ukHz) %u %u %u %u %u %u %u %u 
%u\n,
+m-xres, m-yres, m-refresh, m-pixclock, m-left_margin,
+m-right_margin, m-upper_margin, m-lower_margin,
+m-hsync_len, m-vsync_len, m-sync, m-vmode, m-flag);
+}
+
+/**
+ * of_get_fb_videomode - get a fb_videomode from devicetree
+ * @np: device_node with the timing specification
+ * @fb: will be set to the return value
+ * @index: index into the list of display timings in devicetree
+ *
+ * DESCRIPTION:
+ * This function is expensive and should only be used, if only one mode is to 
be
+ * read from DT. To get multiple modes start with of_get_display_timings ond
+ * work with that instead.
+ */
+int of_get_fb_videomode(const struct device_node *np, struct fb_videomode *fb,
+   unsigned int index)
+{
+   struct videomode vm;
+   int ret;
+
+   ret = of_get_videomode(np, vm, index);
+   if (ret)
+   return ret;
+
+   fb_videomode_from_videomode(vm, fb);
+
+   pr_info(%s: got %dx%d display mode from %s\n, __func__, vm.hactive,
+   vm.vactive, np-name);
+   dump_fb_videomode(fb);
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(of_get_fb_videomode);
+#endif
 
 #else
 int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var)
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 920cbe3..41b5e49 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -15,6 +15,8 @@
 #include linux/slab.h
 #include asm/io.h
 #include linux/videomode.h
+#include linux/of.h
+#include linux/of_videomode.h
 
 struct vm_area_struct;
 struct fb_info;
@@ -715,6 +717,11 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb);
 extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
 extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
 
+#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
+extern int of_get_fb_videomode(const struct device_node *np,
+  struct fb_videomode *fb,
+  unsigned int index);
+#endif
 #if IS_ENABLED(CONFIG_VIDEOMODE)
 extern int fb_videomode_from_videomode(const struct videomode *vm,
   struct fb_videomode *fbmode);
-- 
1.7.10.4

--
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/6] of: add display helper

2012-11-20 Thread Steffen Trumtrar
Hi!

Changes since v11:
- make pointers const where applicable
- add reviewed-by Laurent Pinchart

Regards,
Steffen


Steffen Trumtrar (6):
  video: add display_timing and videomode
  video: add of helper for videomode
  fbmon: add videomode helpers
  fbmon: add of_videomode helpers
  drm_modes: add videomode helpers
  drm_modes: add of_videomode helpers

 .../devicetree/bindings/video/display-timings.txt  |  107 ++
 drivers/gpu/drm/drm_modes.c|   70 +++
 drivers/video/Kconfig  |   19 ++
 drivers/video/Makefile |4 +
 drivers/video/display_timing.c |   24 +++
 drivers/video/fbmon.c  |   86 
 drivers/video/of_display_timing.c  |  216 
 drivers/video/of_videomode.c   |   48 +
 drivers/video/videomode.c  |   46 +
 include/drm/drmP.h |   12 ++
 include/linux/display_timing.h |   70 +++
 include/linux/fb.h |   13 ++
 include/linux/of_display_timings.h |   20 ++
 include/linux/of_videomode.h   |   18 ++
 include/linux/videomode.h  |   40 
 15 files changed, 793 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/display-timings.txt
 create mode 100644 drivers/video/display_timing.c
 create mode 100644 drivers/video/of_display_timing.c
 create mode 100644 drivers/video/of_videomode.c
 create mode 100644 drivers/video/videomode.c
 create mode 100644 include/linux/display_timing.h
 create mode 100644 include/linux/of_display_timings.h
 create mode 100644 include/linux/of_videomode.h
 create mode 100644 include/linux/videomode.h

-- 
1.7.10.4

--
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 0/6] of: add display helper

2012-11-20 Thread Laurent Pinchart
On Tuesday 20 November 2012 16:54:50 Steffen Trumtrar wrote:
 Hi!
 
 Changes since v11:
   - make pointers const where applicable
   - add reviewed-by Laurent Pinchart

Looks good to me.

Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com

Through which tree do you plan to push this ?

 Regards,
 Steffen
 
 
 Steffen Trumtrar (6):
   video: add display_timing and videomode
   video: add of helper for videomode
   fbmon: add videomode helpers
   fbmon: add of_videomode helpers
   drm_modes: add videomode helpers
   drm_modes: add of_videomode helpers
 
  .../devicetree/bindings/video/display-timings.txt  |  107 ++
  drivers/gpu/drm/drm_modes.c|   70 +++
  drivers/video/Kconfig  |   19 ++
  drivers/video/Makefile |4 +
  drivers/video/display_timing.c |   24 +++
  drivers/video/fbmon.c  |   86 
  drivers/video/of_display_timing.c  |  216 +
  drivers/video/of_videomode.c   |   48 +
  drivers/video/videomode.c  |   46 +
  include/drm/drmP.h |   12 ++
  include/linux/display_timing.h |   70 +++
  include/linux/fb.h |   13 ++
  include/linux/of_display_timings.h |   20 ++
  include/linux/of_videomode.h   |   18 ++
  include/linux/videomode.h  |   40 
  15 files changed, 793 insertions(+)
  create mode 100644
 Documentation/devicetree/bindings/video/display-timings.txt create mode
 100644 drivers/video/display_timing.c
  create mode 100644 drivers/video/of_display_timing.c
  create mode 100644 drivers/video/of_videomode.c
  create mode 100644 drivers/video/videomode.c
  create mode 100644 include/linux/display_timing.h
  create mode 100644 include/linux/of_display_timings.h
  create mode 100644 include/linux/of_videomode.h
  create mode 100644 include/linux/videomode.h
-- 
Regards,

Laurent Pinchart

--
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] [media] s5p-mfc: Bug fix of timestamp/timecode copy mechanism

2012-11-20 Thread Kamil Debski
 From: Arun Kumar K [mailto:arun...@samsung.com]
 Sent: Monday, November 05, 2012 10:14 AM
 Subject: [PATCH] [media] s5p-mfc: Bug fix of timestamp/timecode copy
 mechanism
 
 Modified the function s5p_mfc_get_dec_y_adr_v6 to access the decode Y
 address register instead of display Y address.
 
 Signed-off-by: Sunil Mazhavanchery sun...@samsung.com
 Signed-off-by: Arun Kumar K arun...@samsung.com

Acked-by: Kamil Debski k.deb...@samsung.com

 ---
  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
 b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
 index 50b5bee..3a8cfd9 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c
 @@ -1762,7 +1762,7 @@ int s5p_mfc_get_dspl_y_adr_v6(struct s5p_mfc_dev
 *dev)
 
  int s5p_mfc_get_dec_y_adr_v6(struct s5p_mfc_dev *dev)  {
 - return mfc_read(dev, S5P_FIMV_D_DISPLAY_LUMA_ADDR_V6);
 + return mfc_read(dev, S5P_FIMV_D_DECODED_LUMA_ADDR_V6);
  }
 
  int s5p_mfc_get_dspl_status_v6(struct s5p_mfc_dev *dev)
 --
 1.7.0.4


--
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] s5p-mfc: Fix buffer allocation in s5p_mfc_alloc_instance_buffer_v5

2012-11-20 Thread Kamil Debski
The s5p-mfc: Change internal buffer allocation from vb2 ops to
dma_alloc_coherent patch has introduced a bug with allocation of instance
buffers buffers in MFC 5.1. This patch fixes this bug.

Reported-by: Arun Kumar K arun...@samsung.com
Signed-off-by: Kamil Debski k.deb...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
index 11faddd..15f40e4 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
@@ -217,7 +217,7 @@ int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx 
*ctx)
mfc_err(Failed to allocate instance buffer\n);
return ret;
}
-   ctx-ctx.ofs = ctx-ctx.dma - dev-bank1;
+   ctx-ctx.ofs = OFFSETA(ctx-ctx.dma);
 
/* Zero content of the allocated memory */
memset(ctx-ctx.virt, 0, ctx-ctx.size);
-- 
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 v1] s5p-mfc: Add device tree support

2012-11-20 Thread Kamil Debski
Hi Arun,

Thank you for your patch.

Best wishes,
-- 
Kamil Debski
Linux Platform Group
Samsung Poland RD Center

 From: Arun Kumar K [mailto:arun...@samsung.com]
 Sent: Saturday, November 03, 2012 1:02 PM
 Subject: [PATCH v1] s5p-mfc: Add device tree support
 
 This patch will add the device tree support for MFC driver.
 
 Signed-off-by: Arun Kumar K arun...@samsung.com

Acked-by: Kamil Debski k.deb...@samsung.com

 ---
  drivers/media/platform/s5p-mfc/s5p_mfc.c |  114
 +-
  1 files changed, 97 insertions(+), 17 deletions(-)
 
 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c
 b/drivers/media/platform/s5p-mfc/s5p_mfc.c
 index 130f4ac..0ca8dbb 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
 @@ -21,6 +21,7 @@
  #include linux/videodev2.h
  #include media/v4l2-event.h
  #include linux/workqueue.h
 +#include linux/of.h
  #include media/videobuf2-core.h
  #include s5p_mfc_common.h
  #include s5p_mfc_ctrl.h
 @@ -1030,6 +1031,48 @@ static int match_child(struct device *dev, void
 *data)
   return !strcmp(dev_name(dev), (char *)data);  }
 
 +static void *mfc_get_drv_data(struct platform_device *pdev);
 +
 +static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev) {
 + unsigned int mem_info[2];
 +
 + dev-mem_dev_l = devm_kzalloc(dev-plat_dev-dev,
 + sizeof(struct device), GFP_KERNEL);
 + if (!dev-mem_dev_l) {
 + mfc_err(Not enough memory\n);
 + return -ENOMEM;
 + }
 + device_initialize(dev-mem_dev_l);
 + of_property_read_u32_array(dev-plat_dev-dev.of_node,
 samsung,mfc-l,
 + mem_info, 2);
 + if (dma_declare_coherent_memory(dev-mem_dev_l, mem_info[0],
 + mem_info[0], mem_info[1],
 + DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) == 0) {
 + mfc_err(Failed to declare coherent memory for\n
 + MFC device\n);
 + return -ENOMEM;
 + }
 +
 + dev-mem_dev_r = devm_kzalloc(dev-plat_dev-dev,
 + sizeof(struct device), GFP_KERNEL);
 + if (!dev-mem_dev_r) {
 + mfc_err(Not enough memory\n);
 + return -ENOMEM;
 + }
 + device_initialize(dev-mem_dev_r);
 + of_property_read_u32_array(dev-plat_dev-dev.of_node,
 samsung,mfc-r,
 + mem_info, 2);
 + if (dma_declare_coherent_memory(dev-mem_dev_r, mem_info[0],
 + mem_info[0], mem_info[1],
 + DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE) == 0) {
 + pr_err(Failed to declare coherent memory for\n
 + MFC device\n);
 + return -ENOMEM;
 + }
 + return 0;
 +}
 +
  /* MFC probe function */
  static int s5p_mfc_probe(struct platform_device *pdev)  { @@ -1053,8
 +1096,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
   return -ENODEV;
   }
 
 - dev-variant = (struct s5p_mfc_variant *)
 - platform_get_device_id(pdev)-driver_data;
 + dev-variant = mfc_get_drv_data(pdev);
 
   ret = s5p_mfc_init_pm(dev);
   if (ret  0) {
 @@ -1084,20 +1126,24 @@ static int s5p_mfc_probe(struct platform_device
 *pdev)
   goto err_res;
   }
 
 - dev-mem_dev_l = device_find_child(dev-plat_dev-dev, s5p-mfc-
 l,
 -match_child);
 - if (!dev-mem_dev_l) {
 - mfc_err(Mem child (L) device get failed\n);
 - ret = -ENODEV;
 - goto err_res;
 - }
 -
 - dev-mem_dev_r = device_find_child(dev-plat_dev-dev, s5p-mfc-
 r,
 -match_child);
 - if (!dev-mem_dev_r) {
 - mfc_err(Mem child (R) device get failed\n);
 - ret = -ENODEV;
 - goto err_res;
 + if (pdev-dev.of_node) {
 + if (s5p_mfc_alloc_memdevs(dev)  0)
 + goto err_res;
 + } else {
 + dev-mem_dev_l = device_find_child(dev-plat_dev-dev,
 + s5p-mfc-l, match_child);
 + if (!dev-mem_dev_l) {
 + mfc_err(Mem child (L) device get failed\n);
 + ret = -ENODEV;
 + goto err_res;
 + }
 + dev-mem_dev_r = device_find_child(dev-plat_dev-dev,
 + s5p-mfc-r, match_child);
 + if (!dev-mem_dev_r) {
 + mfc_err(Mem child (R) device get failed\n);
 + ret = -ENODEV;
 + goto err_res;
 + }
   }
 
   dev-alloc_ctx[0] = vb2_dma_contig_init_ctx(dev-mem_dev_l);
 @@ -1221,6 +1267,10 @@ static int __devexit s5p_mfc_remove(struct
 platform_device *pdev)
   v4l2_device_unregister(dev-v4l2_dev);
   vb2_dma_contig_cleanup_ctx(dev-alloc_ctx[0]);
   vb2_dma_contig_cleanup_ctx(dev-alloc_ctx[1]);
 + if (pdev-dev.of_node) {
 + 

Re: [PATCH v12 0/6] of: add display helper

2012-11-20 Thread Robert Schwebel
On Tue, Nov 20, 2012 at 05:13:19PM +0100, Laurent Pinchart wrote:
 On Tuesday 20 November 2012 16:54:50 Steffen Trumtrar wrote:
  Hi!
  
  Changes since v11:
  - make pointers const where applicable
  - add reviewed-by Laurent Pinchart
 
 Looks good to me.
 
 Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 
 Through which tree do you plan to push this ?

We have no idea yet, and none of the people on Cc: have volunteered
so far... what do you think?

rsc
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |
--
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 0/6] of: add display helper

2012-11-20 Thread Thierry Reding
On Tue, Nov 20, 2012 at 07:11:29PM +0100, Robert Schwebel wrote:
 On Tue, Nov 20, 2012 at 05:13:19PM +0100, Laurent Pinchart wrote:
  On Tuesday 20 November 2012 16:54:50 Steffen Trumtrar wrote:
   Hi!
   
   Changes since v11:
 - make pointers const where applicable
 - add reviewed-by Laurent Pinchart
  
  Looks good to me.
  
  Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
  
  Through which tree do you plan to push this ?
 
 We have no idea yet, and none of the people on Cc: have volunteered
 so far... what do you think?

The customary approach would be to take the patches through separate
trees, but I think this particular series is sufficiently interwoven to
warrant taking them all through one tree. However the least that we
should do is collect Acked-by's from the other tree maintainers.

Given that most of the patches modify files in drivers/video, Florian's
fbdev tree would be the most obvious candidate, right? If Florian agrees
to take the patches, all we would need is David's Acked-by.

How does that sound?

Thierry


pgpKLIDOP7HB1.pgp
Description: PGP signature


Re: [PATCH 1/7] ir-rx51: Handle signals properly

2012-11-20 Thread Tony Lindgren
Hi,

* Timo Kokkonen timo.t.kokko...@iki.fi [121118 07:15]:
 --- a/drivers/media/rc/ir-rx51.c
 +++ b/drivers/media/rc/ir-rx51.c
 @@ -74,6 +74,19 @@ static void lirc_rx51_off(struct lirc_rx51 *lirc_rx51)
 OMAP_TIMER_TRIGGER_NONE);
  }
  
 +static void lirc_rx51_stop_tx(struct lirc_rx51 *lirc_rx51)
 +{
 + if (lirc_rx51-wbuf_index  0)
 + return;
 +
 + lirc_rx51_off(lirc_rx51);
 + lirc_rx51-wbuf_index = -1;
 + omap_dm_timer_stop(lirc_rx51-pwm_timer);
 + omap_dm_timer_stop(lirc_rx51-pulse_timer);
 + omap_dm_timer_set_int_enable(lirc_rx51-pulse_timer, 0);
 + wake_up(lirc_rx51-wqueue);
 +}
 +
  static int init_timing_params(struct lirc_rx51 *lirc_rx51)
  {
   u32 load, match;

Good fixes in general.. But you won't be able to access the
omap_dm_timer functions after we enable ARM multiplatform support
for omap2+. That's for v3.9 probably right after v3.8-rc1.

We need to find some Linux generic API to use hardware timers
like this, so I've added Thomas Gleixner and linux-arm-kernel
mailing list to cc.

If no such API is available, then maybe we can export some of
the omap_dm_timer functions if Thomas is OK with that.

The other alternative is to set them up as platform_data
function pointers, but that won't work after we make omap2+
device tree only. And that really just postpones the problem.

Cheers,

Tony


 @@ -163,13 +176,7 @@ static irqreturn_t lirc_rx51_interrupt_handler(int irq, 
 void *ptr)
  
   return IRQ_HANDLED;
  end:
 - /* Stop TX here */
 - lirc_rx51_off(lirc_rx51);
 - lirc_rx51-wbuf_index = -1;
 - omap_dm_timer_stop(lirc_rx51-pwm_timer);
 - omap_dm_timer_stop(lirc_rx51-pulse_timer);
 - omap_dm_timer_set_int_enable(lirc_rx51-pulse_timer, 0);
 - wake_up_interruptible(lirc_rx51-wqueue);
 + lirc_rx51_stop_tx(lirc_rx51);
  
   return IRQ_HANDLED;
  }
 @@ -249,8 +256,9 @@ static ssize_t lirc_rx51_write(struct file *file, const 
 char *buf,
   if ((count  WBUF_LEN) || (count % 2 == 0))
   return -EINVAL;
  
 - /* Wait any pending transfers to finish */
 - wait_event_interruptible(lirc_rx51-wqueue, lirc_rx51-wbuf_index  0);
 + /* We can have only one transmit at a time */
 + if (lirc_rx51-wbuf_index = 0)
 + return -EBUSY;
  
   if (copy_from_user(lirc_rx51-wbuf, buf, n))
   return -EFAULT;
 @@ -276,9 +284,18 @@ static ssize_t lirc_rx51_write(struct file *file, const 
 char *buf,
  
   /*
* Don't return back to the userspace until the transfer has
 -  * finished
 +  * finished. However, we wish to not spend any more than 500ms
 +  * in kernel. No IR code TX should ever take that long.
 +  */
 + i = wait_event_timeout(lirc_rx51-wqueue, lirc_rx51-wbuf_index  0,
 + HZ / 2);
 +
 + /*
 +  * Ensure transmitting has really stopped, even if the timers
 +  * went mad or something else happened that caused it still
 +  * sending out something.
*/
 - wait_event_interruptible(lirc_rx51-wqueue, lirc_rx51-wbuf_index  0);
 + lirc_rx51_stop_tx(lirc_rx51);
  
   /* We can sleep again */
   lirc_rx51-pdata-set_max_mpu_wakeup_lat(lirc_rx51-dev, -1);
 -- 
 1.8.0
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap 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


cron job: media_tree daily build: WARNINGS

2012-11-20 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:Tue Nov 20 19:00:19 CET 2012
git hash:2c4e11b7c15af70580625657a154ea7ea70b8c76
gcc version:  i686-linux-gcc (GCC) 4.7.1
host hardware:x86_64
host os:  3.4.07-marune

linux-git-arm-eabi-davinci: WARNINGS
linux-git-arm-eabi-exynos: WARNINGS
linux-git-arm-eabi-omap: WARNINGS
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: WARNINGS
linux-git-x86_64: OK
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: WARNINGS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.36-i686: WARNINGS
linux-2.6.37-i686: WARNINGS
linux-2.6.38.2-i686: WARNINGS
linux-2.6.39.1-i686: WARNINGS
linux-3.0-i686: WARNINGS
linux-3.1-i686: WARNINGS
linux-3.2.1-i686: WARNINGS
linux-3.3-i686: WARNINGS
linux-3.4-i686: WARNINGS
linux-3.5-i686: WARNINGS
linux-3.6-i686: WARNINGS
linux-3.7-rc1-i686: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: WARNINGS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
linux-2.6.36-x86_64: WARNINGS
linux-2.6.37-x86_64: WARNINGS
linux-2.6.38.2-x86_64: WARNINGS
linux-2.6.39.1-x86_64: WARNINGS
linux-3.0-x86_64: WARNINGS
linux-3.1-x86_64: WARNINGS
linux-3.2.1-x86_64: WARNINGS
linux-3.3-x86_64: WARNINGS
linux-3.4-x86_64: WARNINGS
linux-3.5-x86_64: WARNINGS
linux-3.6-x86_64: WARNINGS
linux-3.7-rc1-x86_64: WARNINGS
apps: WARNINGS
spec-git: WARNINGS
sparse: ERRORS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Tuesday.tar.bz2

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.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