Re: [PATCH RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-10 Thread Hans Verkuil
Hi Federico!

A few small remarks:

On Wed July 11 2012 04:34:46 Federico Vaga wrote:
> Signed-off-by: Federico Vaga 
> ---
>  drivers/media/video/adv7180.c |  221 
> +
>  1 file changed, 90 insertions(+), 131 deletions(-)
> 
> diff --git a/drivers/media/video/adv7180.c b/drivers/media/video/adv7180.c
> index 174bffa..7705456 100644
> --- a/drivers/media/video/adv7180.c
> +++ b/drivers/media/video/adv7180.c
> @@ -26,11 +26,10 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  
> -#define DRIVER_NAME "adv7180"
> -
>  #define ADV7180_INPUT_CONTROL_REG0x00
>  #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM 0x00
>  #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM_PED 0x10
> @@ -55,21 +54,21 @@
>  
>  #define ADV7180_AUTODETECT_ENABLE_REG0x07
>  #define ADV7180_AUTODETECT_DEFAULT   0x7f
> -
> +/* Contrast */
>  #define ADV7180_CON_REG  0x08/*Unsigned */
> -#define CON_REG_MIN  0
> -#define CON_REG_DEF  128
> -#define CON_REG_MAX  255
> -
> +#define ADV7180_CON_MIN  0
> +#define ADV7180_CON_DEF  128
> +#define ADV7180_CON_MAX  255
> +/* Brightness*/
>  #define ADV7180_BRI_REG  0x0a/*Signed */
> -#define BRI_REG_MIN  -128
> -#define BRI_REG_DEF  0
> -#define BRI_REG_MAX  127
> -
> +#define ADV7180_BRI_MIN  -128
> +#define ADV7180_BRI_DEF  0
> +#define ADV7180_BRI_MAX  127
> +/* Hue */
>  #define ADV7180_HUE_REG  0x0b/*Signed, inverted */
> -#define HUE_REG_MIN  -127
> -#define HUE_REG_DEF  0
> -#define HUE_REG_MAX  128
> +#define ADV7180_HUE_MIN  -127
> +#define ADV7180_HUE_DEF  0
> +#define ADV7180_HUE_MAX  128
>  
>  #define ADV7180_ADI_CTRL_REG 0x0e
>  #define ADV7180_ADI_CTRL_IRQ_SPACE   0x20
> @@ -98,12 +97,12 @@
>  #define ADV7180_ICONF1_ACTIVE_LOW0x01
>  #define ADV7180_ICONF1_PSYNC_ONLY0x10
>  #define ADV7180_ICONF1_ACTIVE_TO_CLR 0xC0
> -
> +/* Saturation */
>  #define ADV7180_SD_SAT_CB_REG0xe3/*Unsigned */
>  #define ADV7180_SD_SAT_CR_REG0xe4/*Unsigned */
> -#define SAT_REG_MIN  0
> -#define SAT_REG_DEF  128
> -#define SAT_REG_MAX  255
> +#define ADV7180_SAT_MIN  0
> +#define ADV7180_SAT_DEF  128
> +#define ADV7180_SAT_MAX  255
>  
>  #define ADV7180_IRQ1_LOCK0x01
>  #define ADV7180_IRQ1_UNLOCK  0x02
> @@ -121,18 +120,18 @@
>  #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND  0x4F
>  
>  struct adv7180_state {
> + struct v4l2_ctrl_handler ctrl_hdl;
>   struct v4l2_subdev  sd;
>   struct work_struct  work;
>   struct mutexmutex; /* mutual excl. when accessing chip */
>   int irq;
>   v4l2_std_id curr_norm;
>   boolautodetect;
> - s8  brightness;
> - s16 hue;
> - u8  contrast;
> - u8  saturation;
>   u8  input;
>  };
> +#define to_adv7180_sd(_ctrl) &container_of(_ctrl->handler,   \
> +struct adv7180_state,\
> +ctrl_hdl)->sd
>  
>  static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
>  {
> @@ -237,7 +236,7 @@ static int adv7180_s_routing(struct v4l2_subdev *sd, u32 
> input,
>   if (ret)
>   return ret;
>  
> - /*We cannot discriminate between LQFP and 40-pin LFCSP, so accept
> + /* We cannot discriminate between LQFP and 40-pin LFCSP, so accept
>* all inputs and let the card driver take care of validation
>*/
>   if ((input & ADV7180_INPUT_CONTROL_INSEL_MASK) != input)
> @@ -316,117 +315,39 @@ out:
>   return ret;
>  }
>  
> -static int adv7180_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl 
> *qc)
> -{
> - switch (qc->id) {
> - case V4L2_CID_BRIGHTNESS:
> - return v4l2_ctrl_query_fill(qc, BRI_REG_MIN, BRI_REG_MAX,
> - 1, BRI_REG_DEF);
> - case V4L2_CID_HUE:
> - return v4l2_ctrl_query_fill(qc, HUE_REG_MIN, HUE_REG_MAX,
> - 1, HUE_REG_DEF);
> - case V4L2_CID_CONTRAST:
> - return v4l2_ctrl_query_fill(qc, CON_REG_MIN, CON_REG_MAX,
> - 1, CON_REG_DEF);
> - case V4L2_CID_SATURATION:
> - return v4l2_ctrl_query_fill(qc, SAT_REG_MIN, SAT_REG_MAX,
> - 1, SAT_REG_DEF);
> - default:
> - break;
> - }
> -
> - return -EINVAL;
> -}
> -
> -static int adv7180_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
> -

RE: [GIT PULL FOR v3.5] davicni: vpfe:media controller based capture driver for dm365

2012-07-10 Thread Hadli, Manjunath
Hi Mauro,

On Thu, Jul 05, 2012 at 22:17:10, Mauro Carvalho Chehab wrote:
> Em 04-07-2012 02:01, Hadli, Manjunath escreveu:
> > Mauro,
> > Can you please pull the patches? Let me know if anything needs to be done
> > from my side.
> > 
> > -Manju
> > 
> > 
> > On Thu, May 31, 2012 at 17:42:24, Hadli, Manjunath wrote:
> >> Mauro,
> >>   The following patch set adds the media controller based driver TI dm365 
> >> SoC.
> >> Patches have gone through RFC and reviews and are pending for some time.
> >>
> >> The main support added here:
> >> -CCDC capture
> >> -Previewer
> >> -Resizer
> >> -AEW/AF
> >> -Some media formats supported on dm365
> >> -PIX_FORMATs supported on dm365
> >>
> >>
> >> ---
> >> The following changes since commit 
> >> a01ee165a132fadb57659d26246e340d6ac53265:
> >>
> >>Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd 
> >> (2012-05-28 13:10:41 -0700)
> >>
> >> are available in the git repository at:
> >>
> >>git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git 
> >> pull_dm365_mc_for_mauro
> >>
> >> Manjunath Hadli (19):
> >>media: add new mediabus format enums for dm365
> >>v4l2: add new pixel formats supported on dm365
> >>davinci: vpfe: add dm3xx IPIPEIF hardware support module
> >>davinci: vpfe: add IPIPE hardware layer support
> >>davinci: vpfe: add IPIPE support for media controller driver
> 
> $ grep copy_ `quilt next`|wc -l
> 53
> 
> Wow! There's a lot of undocumented userspace API stuff there! Am I missing 
> something?
> 
  As discussed on IRC, I'll send a documentation patch to the mailing list
  and on acceptance of this patch I'll issue a new pull request along with
  the documentation patch and current patch set.

Thx,
--Manju

> Regards,
> Mauro
> 

--
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 RFC] [media] adv7180.c: convert to v4l2 control framework

2012-07-10 Thread Federico Vaga
Signed-off-by: Federico Vaga 
---
 drivers/media/video/adv7180.c |  221 +
 1 file changed, 90 insertions(+), 131 deletions(-)

diff --git a/drivers/media/video/adv7180.c b/drivers/media/video/adv7180.c
index 174bffa..7705456 100644
--- a/drivers/media/video/adv7180.c
+++ b/drivers/media/video/adv7180.c
@@ -26,11 +26,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-#define DRIVER_NAME "adv7180"
-
 #define ADV7180_INPUT_CONTROL_REG  0x00
 #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM   0x00
 #define ADV7180_INPUT_CONTROL_AD_PAL_BG_NTSC_J_SECAM_PED 0x10
@@ -55,21 +54,21 @@
 
 #define ADV7180_AUTODETECT_ENABLE_REG  0x07
 #define ADV7180_AUTODETECT_DEFAULT 0x7f
-
+/* Contrast */
 #define ADV7180_CON_REG0x08/*Unsigned */
-#define CON_REG_MIN0
-#define CON_REG_DEF128
-#define CON_REG_MAX255
-
+#define ADV7180_CON_MIN0
+#define ADV7180_CON_DEF128
+#define ADV7180_CON_MAX255
+/* Brightness*/
 #define ADV7180_BRI_REG0x0a/*Signed */
-#define BRI_REG_MIN-128
-#define BRI_REG_DEF0
-#define BRI_REG_MAX127
-
+#define ADV7180_BRI_MIN-128
+#define ADV7180_BRI_DEF0
+#define ADV7180_BRI_MAX127
+/* Hue */
 #define ADV7180_HUE_REG0x0b/*Signed, inverted */
-#define HUE_REG_MIN-127
-#define HUE_REG_DEF0
-#define HUE_REG_MAX128
+#define ADV7180_HUE_MIN-127
+#define ADV7180_HUE_DEF0
+#define ADV7180_HUE_MAX128
 
 #define ADV7180_ADI_CTRL_REG   0x0e
 #define ADV7180_ADI_CTRL_IRQ_SPACE 0x20
@@ -98,12 +97,12 @@
 #define ADV7180_ICONF1_ACTIVE_LOW  0x01
 #define ADV7180_ICONF1_PSYNC_ONLY  0x10
 #define ADV7180_ICONF1_ACTIVE_TO_CLR   0xC0
-
+/* Saturation */
 #define ADV7180_SD_SAT_CB_REG  0xe3/*Unsigned */
 #define ADV7180_SD_SAT_CR_REG  0xe4/*Unsigned */
-#define SAT_REG_MIN0
-#define SAT_REG_DEF128
-#define SAT_REG_MAX255
+#define ADV7180_SAT_MIN0
+#define ADV7180_SAT_DEF128
+#define ADV7180_SAT_MAX255
 
 #define ADV7180_IRQ1_LOCK  0x01
 #define ADV7180_IRQ1_UNLOCK0x02
@@ -121,18 +120,18 @@
 #define ADV7180_NTSC_V_BIT_END_MANUAL_NVEND0x4F
 
 struct adv7180_state {
+   struct v4l2_ctrl_handler ctrl_hdl;
struct v4l2_subdev  sd;
struct work_struct  work;
struct mutexmutex; /* mutual excl. when accessing chip */
int irq;
v4l2_std_id curr_norm;
boolautodetect;
-   s8  brightness;
-   s16 hue;
-   u8  contrast;
-   u8  saturation;
u8  input;
 };
+#define to_adv7180_sd(_ctrl) &container_of(_ctrl->handler, \
+  struct adv7180_state,\
+  ctrl_hdl)->sd
 
 static v4l2_std_id adv7180_std_to_v4l2(u8 status1)
 {
@@ -237,7 +236,7 @@ static int adv7180_s_routing(struct v4l2_subdev *sd, u32 
input,
if (ret)
return ret;
 
-   /*We cannot discriminate between LQFP and 40-pin LFCSP, so accept
+   /* We cannot discriminate between LQFP and 40-pin LFCSP, so accept
 * all inputs and let the card driver take care of validation
 */
if ((input & ADV7180_INPUT_CONTROL_INSEL_MASK) != input)
@@ -316,117 +315,39 @@ out:
return ret;
 }
 
-static int adv7180_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
-{
-   switch (qc->id) {
-   case V4L2_CID_BRIGHTNESS:
-   return v4l2_ctrl_query_fill(qc, BRI_REG_MIN, BRI_REG_MAX,
-   1, BRI_REG_DEF);
-   case V4L2_CID_HUE:
-   return v4l2_ctrl_query_fill(qc, HUE_REG_MIN, HUE_REG_MAX,
-   1, HUE_REG_DEF);
-   case V4L2_CID_CONTRAST:
-   return v4l2_ctrl_query_fill(qc, CON_REG_MIN, CON_REG_MAX,
-   1, CON_REG_DEF);
-   case V4L2_CID_SATURATION:
-   return v4l2_ctrl_query_fill(qc, SAT_REG_MIN, SAT_REG_MAX,
-   1, SAT_REG_DEF);
-   default:
-   break;
-   }
-
-   return -EINVAL;
-}
-
-static int adv7180_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
-{
-   struct adv7180_state *state = to_state(sd);
-   int ret = mutex_lock_interruptible(&state->mutex);
-   if (ret)
-   return ret;
-
-   switch (ctrl->id) {
-   case V4L2_CID_BRIGHTNESS:

Re: pctv452e

2012-07-10 Thread Antti Palosaari

On 07/11/2012 12:08 AM, Marx wrote:

W dniu 2012-07-10 11:33, Antti Palosaari pisze:


Seems like stream is broken. It should look like that:

Input #0, mpegts, from '/dev/dvb/adapter0/dvr0':
   Duration: N/A, start: 19013.637311, bitrate: 15224 kb/s
 Stream #0:0[0x231]: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
 Stream #0:1[0x131]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
64:45 DAR 16:9], 15000 kb/s, 26.89 fps, 25 tbr, 90k tbn, 50 tbc


You have said it works some times. Could you try to using tzap + ffmpeg
cases when it works and when it does not. Use FTA channels to analyze as
I think ffmpeg could not say much about encrypted streams.


It's hard to say it works because I have no GUI on this PC and I don't
know a method to share directly device/stream into PC.
Hovewer I've tried to tune and analyze several FTA channels.
I have now better results because:
1) i've disconnected pctv device (USB & power)
2) poweroff
3) poweron
4) connect device
If I simply reboot or reconnect device - it doesn't help.

[   67.544510] Linux media interface: v0.10
[   67.565420] Linux video capture interface: v2.00
[   67.834186] saa7146: register extension 'av7110'
[ 1536.841356] usb 1-4: new high-speed USB device number 2 using ehci_hcd
[ 1537.437957] usb 1-4: New USB device found, idVendor=2304, idProduct=021f
[ 1537.437971] usb 1-4: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 1537.437980] usb 1-4: Product: PCTV452e
[ 1537.437989] usb 1-4: Manufacturer: Pinnacle
[ 1537.556548] usb 1-4: dvb_usbv2: found a 'PCTV HDTV USB' in warm state
[ 1537.556560] pctv452e_power_ctrl: 1
[ 1537.556565] pctv452e_power_ctrl: step 1
[ 1537.556570] pctv452e_power_ctrl: step 2
[ 1537.557057] pctv452e_power_ctrl: step 3
[ 1537.557197] usbcore: registered new interface driver dvb_usb_pctv452e
[ 1537.557263] pctv452e_power_ctrl: step 4
[ 1537.557491] pctv452e_power_ctrl: step 5
[ 1537.557610] usb 1-4: dvb_usbv2: will pass the complete MPEG2
transport stream to the software demuxer
[ 1537.557670] DVB: registering new adapter (PCTV HDTV USB)
[ 1537.602916] stb0899_attach: Attaching STB0899
[ 1537.611531] DVB: registering adapter 0 frontend 0 (STB0899
Multistandard)...
[ 1537.625143] stb6100_attach: Attaching STB6100
[ 1537.625158] pctv452e_power_ctrl: 0
[ 1537.625173] usb 1-4: dvb_usbv2: 'PCTV HDTV USB' successfully
initialized and connected

I don't know why it say device is in warm state. As I understand warm
means with firmware loaded(?), but this device was completely switched off.


Because it does not need to firmware downloaded by the driver. It 
downloads firmware from the eeprom. As it does not need firmware to be 
downloaded by driver it is always warm from the driver point of view.



1) Mango 24
wuwek:~# szap -n 51 -r
reading channels from file '/root/.szap/channels.conf'
zapping to 51 'Mango 24;TVN':
sat 0, frequency = 11393 MHz V, symbolrate 2750, vpid = 0x0205, apid
= 0x02bc sid = 0x0245
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
status 1f | signal 01c6 | snr 0093 | ber  | unc fffe |
FE_HAS_LOCK

wuwek:~# ffmpeg -i /dev/dvb/adapter0/dvr0
p11-kit: couldn't load module:
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so:
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open
shared object file: No such file or directory
ffmpeg version 0.8.3-6:0.8.3-4, Copyright (c) 2000-2012 the Libav
developers
   built on Jun 26 2012 07:23:46 with gcc 4.7.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a
future release. Please use avconv instead.
[mpeg2video @ 0x8d47940] mpeg_decode_postinit() failure
[mp3 @ 0x8d4a5c0] Header missing
 Last message repeated 2 times
[mpegts @ 0x8d43900] max_analyze_duration reached
[mpegts @ 0x8d43900] Estimating duration from bitrate, this may be
inaccurate
Input #0, mpegts, from '/dev/dvb/adapter0/dvr0':
   Duration: N/A, start: 90810.592967, bitrate: 1 kb/s
 Stream #0.0[0x205]: Video: mpeg2video (Main), yuv420p, 480x576 [PAR
32:15 DAR 16:9], 1 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
 Stream #0.1[0x2bc]: Audio: mp3, 0 channels, s16
At least one output file must be specified

2. Eska TV
wuwek:~# szap -n 52 -r
reading channels from file '/root/.szap/channels.conf'
zapping to 52 'Eska TV;ITI':
sat 0, frequency = 11508 MHz V, symbolrate 2750, vpid = 0x020a, apid
= 0x02d6 sid = 0x
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
status 1f | signal 01ce | snr 008e | ber  | unc fffe |
FE_HAS_LOCK

wuwek:~# ffmpeg -i /dev/dvb/adapter0/dvr0
p11-kit: couldn't load module:
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so:
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open
shared object file: No such file or directory
ffmpeg version 0.8.3-6:0.8.3-4, Copyright (c) 2000-2012 the Libav
developers
   built on Jun 26 2012 07:23:46 with gcc 4.7.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided 

Re: Make menuconfig doesn't work anymore

2012-07-10 Thread VDR User
On Tue, Jul 10, 2012 at 2:16 PM, Martin Herrman
 wrote:
> make[2]: Entering directory `/usr/src/media_build_experimental/linux'
> Applying patches for kernel 3.5.0-rc6
> patch -s -f -N -p1 -i ../backports/api_version.patch
> 1 out of 1 hunk FAILED -- saving rejects to file
> drivers/media/video/v4l2-ioctl.c.rej
> make[2]: *** [apply_patches] Error 1
> make[2]: Leaving directory `/usr/src/media_build_experimental/linux'
> make[1]: *** [Kconfig] Error 2
> make[1]: Leaving directory `/usr/src/media_build_experimental/v4l'
> make: *** [menuconfig] Error 2
>
> Make menuconfig *does* work when configuring a new kernel. I have also
> tried with kernel 3.2.22 and 3.4, but no succes either.

Actually I got the exact same error when compiling a new 3.4.4 kernel.

> Any ideas what is going wrong?

I assume the api_version.patch is bad or needs to be updated. I simple
just commented out the "add api_version.patch" line in
backports/backports.txt and crossed my fingers the drivers I use still
worked -- which they did so all is well here (afaik). But, yeah it
does need a proper fix and I only recommend my cheap workaround with a
YMMV warning.
--
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: pctv452e

2012-07-10 Thread poma
On 07/10/2012 05:58 PM, Devin Heitmueller wrote:
> On Tue, Jul 10, 2012 at 11:51 AM, poma  wrote:
>>> Is this pctv452e device known to have poor reception?
> 
> Traditionally speaking, these problems are usually not the hardware
> itself - it tends to be crappy Linux drivers.  Somebody gets support
> working for a chip on some product, and then somebody else does a
> cut/paste of the code to make some other product work.  They see it
> getting signal lock under optimal tuning conditions and declare
> success.
> 
> Making any given device work *well* tends to be much harder than
> making it work at all.
> 
> Want to rule out bad hardware design?  Drop it into a Windows machine
> and see how it performs.  If it works fine under Windows but poorly
> under Linux, then you definitely have a Linux driver problem.
> 
> Devin
> 

This one is for Marx?

cheers,
poma

--
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: pctv452e

2012-07-10 Thread Marx

W dniu 2012-07-10 11:33, Antti Palosaari pisze:


Seems like stream is broken. It should look like that:

Input #0, mpegts, from '/dev/dvb/adapter0/dvr0':
   Duration: N/A, start: 19013.637311, bitrate: 15224 kb/s
 Stream #0:0[0x231]: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
 Stream #0:1[0x131]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR
64:45 DAR 16:9], 15000 kb/s, 26.89 fps, 25 tbr, 90k tbn, 50 tbc


You have said it works some times. Could you try to using tzap + ffmpeg
cases when it works and when it does not. Use FTA channels to analyze as
I think ffmpeg could not say much about encrypted streams.


It's hard to say it works because I have no GUI on this PC and I don't 
know a method to share directly device/stream into PC.

Hovewer I've tried to tune and analyze several FTA channels.
I have now better results because:
1) i've disconnected pctv device (USB & power)
2) poweroff
3) poweron
4) connect device
If I simply reboot or reconnect device - it doesn't help.

[   67.544510] Linux media interface: v0.10
[   67.565420] Linux video capture interface: v2.00
[   67.834186] saa7146: register extension 'av7110'
[ 1536.841356] usb 1-4: new high-speed USB device number 2 using ehci_hcd
[ 1537.437957] usb 1-4: New USB device found, idVendor=2304, idProduct=021f
[ 1537.437971] usb 1-4: New USB device strings: Mfr=1, Product=2, 
SerialNumber=0

[ 1537.437980] usb 1-4: Product: PCTV452e
[ 1537.437989] usb 1-4: Manufacturer: Pinnacle
[ 1537.556548] usb 1-4: dvb_usbv2: found a 'PCTV HDTV USB' in warm state
[ 1537.556560] pctv452e_power_ctrl: 1
[ 1537.556565] pctv452e_power_ctrl: step 1
[ 1537.556570] pctv452e_power_ctrl: step 2
[ 1537.557057] pctv452e_power_ctrl: step 3
[ 1537.557197] usbcore: registered new interface driver dvb_usb_pctv452e
[ 1537.557263] pctv452e_power_ctrl: step 4
[ 1537.557491] pctv452e_power_ctrl: step 5
[ 1537.557610] usb 1-4: dvb_usbv2: will pass the complete MPEG2 
transport stream to the software demuxer

[ 1537.557670] DVB: registering new adapter (PCTV HDTV USB)
[ 1537.602916] stb0899_attach: Attaching STB0899
[ 1537.611531] DVB: registering adapter 0 frontend 0 (STB0899 
Multistandard)...

[ 1537.625143] stb6100_attach: Attaching STB6100
[ 1537.625158] pctv452e_power_ctrl: 0
[ 1537.625173] usb 1-4: dvb_usbv2: 'PCTV HDTV USB' successfully 
initialized and connected


I don't know why it say device is in warm state. As I understand warm 
means with firmware loaded(?), but this device was completely switched off.


1) Mango 24
wuwek:~# szap -n 51 -r
reading channels from file '/root/.szap/channels.conf'
zapping to 51 'Mango 24;TVN':
sat 0, frequency = 11393 MHz V, symbolrate 2750, vpid = 0x0205, apid 
= 0x02bc sid = 0x0245

using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
status 1f | signal 01c6 | snr 0093 | ber  | unc fffe | 
FE_HAS_LOCK


wuwek:~# ffmpeg -i /dev/dvb/adapter0/dvr0
p11-kit: couldn't load module: 
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: 
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open 
shared object file: No such file or directory

ffmpeg version 0.8.3-6:0.8.3-4, Copyright (c) 2000-2012 the Libav developers
  built on Jun 26 2012 07:23:46 with gcc 4.7.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a 
future release. Please use avconv instead.

[mpeg2video @ 0x8d47940] mpeg_decode_postinit() failure
[mp3 @ 0x8d4a5c0] Header missing
Last message repeated 2 times
[mpegts @ 0x8d43900] max_analyze_duration reached
[mpegts @ 0x8d43900] Estimating duration from bitrate, this may be 
inaccurate

Input #0, mpegts, from '/dev/dvb/adapter0/dvr0':
  Duration: N/A, start: 90810.592967, bitrate: 1 kb/s
Stream #0.0[0x205]: Video: mpeg2video (Main), yuv420p, 480x576 [PAR 
32:15 DAR 16:9], 1 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc

Stream #0.1[0x2bc]: Audio: mp3, 0 channels, s16
At least one output file must be specified

2. Eska TV
wuwek:~# szap -n 52 -r
reading channels from file '/root/.szap/channels.conf'
zapping to 52 'Eska TV;ITI':
sat 0, frequency = 11508 MHz V, symbolrate 2750, vpid = 0x020a, apid 
= 0x02d6 sid = 0x

using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
status 1f | signal 01ce | snr 008e | ber  | unc fffe | 
FE_HAS_LOCK


wuwek:~# ffmpeg -i /dev/dvb/adapter0/dvr0
p11-kit: couldn't load module: 
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: 
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open 
shared object file: No such file or directory

ffmpeg version 0.8.3-6:0.8.3-4, Copyright (c) 2000-2012 the Libav developers
  built on Jun 26 2012 07:23:46 with gcc 4.7.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a 
future release. Please use avconv instead.

[mpegts @ 0x9f1e900] max_analyze_duration reached
[mpegts @ 0x9f1e900] Estimating duration from bitrate, this may be 
inaccurate

Inpu

Re: comments for DVB LNA API

2012-07-10 Thread Antti Palosaari

On 07/10/2012 07:42 PM, Steve Kerrison wrote:

On 10/07/12 17:20, Antti Palosaari wrote:

I am looking how to implement LNA support for the DVB API.

What we need to be configurable at least is: OFF, ON, AUTO.

There is LNAs that support variable gain and likely those will be
sooner or later. Actually I think there is already LNAs integrated to
the RF-tuner that offers adjustable gain. Also looking to NXP catalog
and you will see there is digital TV LNAs with adjustable gain.

Coming from that requirements are:
adjustable gain 0-xxx dB
LNA OFF
LNA ON
LNA AUTO

Setting LNA is easy but how to query capabilities of supported LNA
values? eg. this device has LNA which supports Gain=5dB, Gain=8dB, LNA
auto?

Without having a sample of device capabilities this question may be
irrelevant, but what if the gain is somewhat continuiously configurable
vs. discretized? For example can some be configured just for 5,8 and 11,
whilst some might have some 8-bit value that controls gain between 5 and
11?


Yes.
For example external DVB-T/C LNA NXP BGU7033. It does have 3 modes, 10 
dB, 5 dB and bypass -2 dB.


LNAs offering more adjustable gain is called VGA (variable gain 
amplifier). It could have control interface like 5-bits or some other 
bus like I2C. Those are usually integrated to the silicon RF-tuner and 
in that case configuration is possible via tuner registers. Usually it 
is not needed to configure at all on run-time.



LNA ON (bypass) could be replaced with Gain=0 and LNA ON with Gain>0,
Gain=-1 is for auto example.


How should the API handle differences between the specified gain and the
capabilities of the LNA? Round to nearest possible config if it's within
the operating range; return error if out of range?


I think rounding is best approach.

Maybe it is not necessary to read at all. Just allow user set LNA in 
steps of one number, 0, 1, 2, 3, ..., 100 and let the driver detect 
scale. In that case simple LNA having only one static gain value has 
values: AUTO, 0, 1. LNA having 2 gain levels: AUTO, 0, 1, 2. VGA having 
3 bit control: AUTO, 0, 1, 2, 3, 4, 5, 6, 7.


regards
Antti


--
http://palosaari.fi/


--
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 09/10] ov772x: Compute window size registers at runtime

2012-07-10 Thread Guennadi Liakhovetski
Hi Laurent

On Fri, 6 Jul 2012, Laurent Pinchart wrote:

> Instead of hardcoding register arrays, compute the values at runtime.

Great to see this register-array magic go! Just one nitpick:

> 
> Signed-off-by: Laurent Pinchart 
> ---
>  drivers/media/video/ov772x.c |  149 -
>  1 files changed, 58 insertions(+), 91 deletions(-)
> 
> diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c
> index 07ff709..98b1bdf 100644
> --- a/drivers/media/video/ov772x.c
> +++ b/drivers/media/video/ov772x.c

[snip]

> @@ -574,24 +514,26 @@ static const struct ov772x_color_format ov772x_cfmts[] 
> = {
>  
>  #define VGA_WIDTH   640
>  #define VGA_HEIGHT  480
> -#define QVGA_WIDTH  320
> -#define QVGA_HEIGHT 240
> -#define MAX_WIDTH   VGA_WIDTH
> -#define MAX_HEIGHT  VGA_HEIGHT

You removed QVGA_* macros, because they only were used at one location, 
but you kept VGA_*.

>  
>  static const struct ov772x_win_size ov772x_win_sizes[] = {
>   {
>   .name = "VGA",
> - .width= VGA_WIDTH,
> - .height   = VGA_HEIGHT,
>   .com7_bit = SLCT_VGA,
> - .regs = ov772x_vga_regs,
> + .rect = {
> + .left = 140,
> + .top = 14,
> + .width = 640,
> + .height = 480,

...but here you hard-code .width and .height. I'd propose to use some 
symbolic names for all these sizes.

> + },
>   }, {
>   .name = "QVGA",
> - .width= QVGA_WIDTH,
> - .height   = QVGA_HEIGHT,
>   .com7_bit = SLCT_QVGA,
> - .regs = ov772x_qvga_regs,
> + .rect = {
> + .left = 252,
> + .top = 6,
> + .width = 320,
> + .height = 240,
> + },
>   },
>  };
>  

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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


Make menuconfig doesn't work anymore

2012-07-10 Thread Martin Herrman
All,

I own a Cine CT v6 and compiled drivers for it succesfully using:
-  hg clone http://linuxtv.org/hg/~endriss/media_build_experimental
- cd media_build_experimental
- make download
- make untar
- make menuconfig (only select drivers I need)
- make install
- reboot

This worked succesfully on Ubuntu 11.10, Ubuntu 12.04 and on Gentoo
Linux. After another fresh install of Gentoo Linux (just a couple of
days after the previous one - now with custom compiled kernel), it
doesn't work anymore. The make menuconfig command fails:

htpc media_build_experimental # make menuconfig
make -C /usr/src/media_build_experimental/v4l menuconfig
make[1]: Entering directory `/usr/src/media_build_experimental/v4l'
No version yet, using 3.5.0-rc6
make[1]: Leaving directory `/usr/src/media_build_experimental/v4l'
make[1]: Entering directory `/usr/src/media_build_experimental/v4l'
make -C /lib/modules/3.5.0-rc6/build -f
/usr/src/media_build_experimental/v4l/Makefile.kernel config-targets=1
mixed-targets=0 dot-config=0 SRCDIR=/lib/modules/3.5.0-rc6/source
v4l-mconf
make[2]: Entering directory `/usr/src/linux-3.5-rc6'
  HOSTCC  scripts/basic/fixdep
make -f /lib/modules/3.5.0-rc6/source/scripts/Makefile.build
obj=scripts/kconfig hostprogs-y=mconf scripts/kconfig/mconf
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
make[2]: Leaving directory `/usr/src/linux-3.5-rc6'
make[2]: Entering directory `/usr/src/media_build_experimental/linux'
Applying patches for kernel 3.5.0-rc6
patch -s -f -N -p1 -i ../backports/api_version.patch
1 out of 1 hunk FAILED -- saving rejects to file
drivers/media/video/v4l2-ioctl.c.rej
make[2]: *** [apply_patches] Error 1
make[2]: Leaving directory `/usr/src/media_build_experimental/linux'
make[1]: *** [Kconfig] Error 2
make[1]: Leaving directory `/usr/src/media_build_experimental/v4l'
make: *** [menuconfig] Error 2

Make menuconfig *does* work when configuring a new kernel. I have also
tried with kernel 3.2.22 and 3.4, but no succes either.

Any ideas what is going wrong?

Thanks in advance!

Martin
--
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: OMAP4 support

2012-07-10 Thread Gary Thomas

On 2012-07-10 11:05, Chris Lalancette wrote:

On Tue, Jul 10, 2012 at 9:41 AM, Gary Thomas  wrote:

I'm looking for video support on OMAP4 platforms.  I've found the
PandaBoard camera project
(http://www.omappedia.org/wiki/PandaBoard_Camera_Support)
and this is starting to work.  That said, I'm having some
issues with setting up the pipeline, etc.

Can this list help out?


I'm not sure exactly what kind of cameras you want to get working, but
if you are looking to get CSI2 cameras going through the ISS, Sergio
Aguirre has been working on support.  He also works on the media-ctl
tool, which is used for configuring the media framework pipeline.  The
latest versions that I am aware of are here:

git://gitorious.org/omap4-v4l2-camera/omap4-v4l2-camera.git


Yes, this is the tree I've been working with (pointed to by the page I 
mentioned).

My kernel can see the camera OV5650 and set up the pipeline.  I am able to grab
the raw SGRBG10 data but I'd like to get the ISS to convert this to a more 
usable
UYVY format.  Here's what I tried:
  media-ctl -r
  media-ctl -l '"OMAP4 ISS CSI2a":1 -> "OMAP4 ISS ISP IPIPEIF":0 [1]'
  media-ctl -l '"OMAP4 ISS ISP IPIPEIF":1 -> "OMAP4 ISS ISP IPIPEIF output":0 
[1]'
  media-ctl -f '"ov5650 3-0036":0 [SGRBG10 2592x1944]'
  media-ctl -f '"OMAP4 ISS CSI2a":0 [SGRBG10 2592x1944]'
  media-ctl -f '"OMAP4 ISS ISP IPIPEIF":0 [SGRBG10 2592x1944]','"OMAP4 ISS ISP 
IPIPEIF":1 [UYVY 2592x1944]'

Sadly, I can't get the IPIPEIF element to take SGRGB10 in and put UYVY out (my 
reading
of the manual implies that this _should_ be possible).  I always see this 
pipeline setup:
- entity 5: OMAP4 ISS ISP IPIPEIF (3 pads, 4 links)
type V4L2 subdev subtype Unknown
device node name /dev/v4l-subdev2
pad0: Input [SGRBG10 2592x1944]
<- 'OMAP4 ISS CSI2a':pad1 [ACTIVE]
<- 'OMAP4 ISS CSI2b':pad1 []
pad1: Output [SGRBG10 2592x1944]
-> 'OMAP4 ISS ISP IPIPEIF output':pad0 [ACTIVE]
pad2: Output [SGRBG10 2592x1944]
-> 'OMAP4 ISS ISP resizer':pad0 []

Am I missing something?  How can I make this conversion in the ISS?

Note: if this is not the appropriate place to ask these questions, please
redirect me (hopefully to a useful list :-)

Thanks

--

Gary Thomas |  Consulting for the
MLB Associates  |Embedded world



--
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: ERRORS

2012-07-10 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 Jul 10 19:00:18 CEST 2012
git hash:b7e386360922a15f943b2fbe8d77a19bb86f2e6f
gcc version:  i686-linux-gcc (GCC) 4.7.1
host hardware:x86_64
host os:  3.4.07-marune

linux-git-arm-eabi-davinci: ERRORS
linux-git-arm-eabi-exynos: ERRORS
linux-git-arm-eabi-omap: ERRORS
linux-git-i686: WARNINGS
linux-git-m32r: WARNINGS
linux-git-mips: WARNINGS
linux-git-powerpc64: WARNINGS
linux-git-x86_64: WARNINGS
linux-2.6.31.12-x86_64: ERRORS
linux-2.6.32.6-x86_64: ERRORS
linux-2.6.33-x86_64: ERRORS
linux-2.6.34-x86_64: ERRORS
linux-2.6.35.3-x86_64: ERRORS
linux-2.6.36-x86_64: ERRORS
linux-2.6.37-x86_64: ERRORS
linux-2.6.38.2-x86_64: ERRORS
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-2.6.31.12-i686: ERRORS
linux-2.6.32.6-i686: ERRORS
linux-2.6.33-i686: ERRORS
linux-2.6.34-i686: ERRORS
linux-2.6.35.3-i686: ERRORS
linux-2.6.36-i686: ERRORS
linux-2.6.37-i686: ERRORS
linux-2.6.38.2-i686: ERRORS
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
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


Re: OMAP4 support

2012-07-10 Thread Chris Lalancette
On Tue, Jul 10, 2012 at 9:41 AM, Gary Thomas  wrote:
> I'm looking for video support on OMAP4 platforms.  I've found the
> PandaBoard camera project
> (http://www.omappedia.org/wiki/PandaBoard_Camera_Support)
> and this is starting to work.  That said, I'm having some
> issues with setting up the pipeline, etc.
>
> Can this list help out?

I'm not sure exactly what kind of cameras you want to get working, but
if you are looking to get CSI2 cameras going through the ISS, Sergio
Aguirre has been working on support.  He also works on the media-ctl
tool, which is used for configuring the media framework pipeline.  The
latest versions that I am aware of are here:

git://gitorious.org/omap4-v4l2-camera/omap4-v4l2-camera.git

I've also added Sergio on the CC list.

Hope that helps,
Chris
--
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: comments for DVB LNA API

2012-07-10 Thread Steve Kerrison

Hi Antti,

On 10/07/12 17:20, Antti Palosaari wrote:

I am looking how to implement LNA support for the DVB API.

What we need to be configurable at least is: OFF, ON, AUTO.

There is LNAs that support variable gain and likely those will be
sooner or later. Actually I think there is already LNAs integrated to
the RF-tuner that offers adjustable gain. Also looking to NXP catalog
and you will see there is digital TV LNAs with adjustable gain.

Coming from that requirements are:
adjustable gain 0-xxx dB
LNA OFF
LNA ON
LNA AUTO

Setting LNA is easy but how to query capabilities of supported LNA
values? eg. this device has LNA which supports Gain=5dB, Gain=8dB, LNA
auto?

Without having a sample of device capabilities this question may be
irrelevant, but what if the gain is somewhat continuiously configurable
vs. discretized? For example can some be configured just for 5,8 and 11,
whilst some might have some 8-bit value that controls gain between 5 and 11?


LNA ON (bypass) could be replaced with Gain=0 and LNA ON with Gain>0,
Gain=-1 is for auto example.


How should the API handle differences between the specified gain and the
capabilities of the LNA? Round to nearest possible config if it's within
the operating range; return error if out of range?




regards
Antti



--
Steve Kerrison MEng Hons.
http://www.stevekerrison.com/






--
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


comments for DVB LNA API

2012-07-10 Thread Antti Palosaari

I am looking how to implement LNA support for the DVB API.

What we need to be configurable at least is: OFF, ON, AUTO.

There is LNAs that support variable gain and likely those will be sooner 
or later. Actually I think there is already LNAs integrated to the 
RF-tuner that offers adjustable gain. Also looking to NXP catalog and 
you will see there is digital TV LNAs with adjustable gain.


Coming from that requirements are:
adjustable gain 0-xxx dB
LNA OFF
LNA ON
LNA AUTO

Setting LNA is easy but how to query capabilities of supported LNA 
values? eg. this device has LNA which supports Gain=5dB, Gain=8dB, LNA auto?


LNA ON (bypass) could be replaced with Gain=0 and LNA ON with Gain>0, 
Gain=-1 is for auto example.




regards
Antti

--
http://palosaari.fi/

--
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: pctv452e

2012-07-10 Thread Devin Heitmueller
On Tue, Jul 10, 2012 at 11:51 AM, poma  wrote:
>> Is this pctv452e device known to have poor reception?

Traditionally speaking, these problems are usually not the hardware
itself - it tends to be crappy Linux drivers.  Somebody gets support
working for a chip on some product, and then somebody else does a
cut/paste of the code to make some other product work.  They see it
getting signal lock under optimal tuning conditions and declare
success.

Making any given device work *well* tends to be much harder than
making it work at all.

Want to rule out bad hardware design?  Drop it into a Windows machine
and see how it performs.  If it works fine under Windows but poorly
under Linux, then you definitely have a Linux driver problem.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
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 0/10] staging: solo6x10: General cleaning with ./scripts/checkpatch.pl

2012-07-10 Thread Ezequiel Garcia
Hi Ismael,

On Thu, Jun 21, 2012 at 4:53 PM, Ezequiel Garcia  wrote:
> Hi Mauro,
>
> This patchset aims at cleaning most issues reported by 
> ./scripts/checkpatch.pl.
> I'm not sure if all of them are useful, so if you feel any of the
> patches are too dumb just drop it.
>
> I'm Ccing the author Ben Collins, dispite he's no longer working for
> the device manufacturer Bluecherry.
>
> The patches are based on today's linux-next; I hope this is okey.
> As I don't own this device, I can't provide any test beyond compilation.
>
> Ezequiel Garcia (10):
>  staging: solo6x10: Avoid extern declaration by reworking module parameter
>  staging: solo6x10: Fix several over 80 character lines
>  staging: solo6x10: Declare static const array properly
>  staging: solo6x10: Merge quoted string split across lines
>  staging: solo6x10: Replace printk(KERN_WARNING with dev_warn
>  staging: solo6x10: Remove format type mismatch warning
>  staging: solo6x10: Use DEFINE_PCI_DEVICE_TABLE for struct pci_device_id
>  staging: solo6x10: Replace C++ style comment with C style
>  staging: solo6x10: Use linux/{io,uaccess}.h instead of asm/{io,uaccess}.h
>  staging: solo6x10: Fix TODO file with proper maintainer
>
>  drivers/staging/media/solo6x10/TODO   |2 +-
>  drivers/staging/media/solo6x10/core.c |   14 ++---
>  drivers/staging/media/solo6x10/gpio.c |2 +-
>  drivers/staging/media/solo6x10/i2c.c  |3 +-
>  drivers/staging/media/solo6x10/p2m.c  |8 +++---
>  drivers/staging/media/solo6x10/solo6x10.h |6 ++--
>  drivers/staging/media/solo6x10/tw28.c |6 ++--
>  drivers/staging/media/solo6x10/v4l2-enc.c |   39 
> ++---
>  drivers/staging/media/solo6x10/v4l2.c |   25 +-
>  9 files changed, 54 insertions(+), 51 deletions(-)
>
> Regards,
> Ezequiel.

I'm sending you this patch set because I saw on bluecherry blog that
you're working there,
replacing Ben Collins (author of solo6x10). Please correct me if I'm wrong.

I wonder if you could review this series, test, ack or even nack them :-)
They are mostly style fixes, so there shouldn't be any problems.

Thanks,
Ezequiel.
--
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: pctv452e

2012-07-10 Thread poma
On 07/10/2012 08:43 AM, Marx wrote:
> I've attached stream analysis via ffmpeg in another post. I can upload
> saved stream if needed. I simply don't know how to check if weak signal
> is problem. Szap (or extended version szap-s2) gives me some numbers but
> I don't know how to properly read them.

…ffprobe
Play with a femon, dvbsnoop, …
http://www.linuxtv.org/wiki/index.php/LinuxTV_dvb-apps
http://www.linuxtv.org/wiki/index.php/Dvbsnoop
Read a bit
http://www.linuxtv.org/wiki/index.php/Testing_reception_quality

> Is this pctv452e device known to have poor reception?

modinfo stb6100 | grep author ;)
--
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 5/6] staging/media/solo6x10: use module_pci_driver macro

2012-07-10 Thread Ezequiel Garcia
Hi Devendra,

Thanks for the patch.

On Tue, Jul 10, 2012 at 3:45 AM, Devendra Naga  wrote:
> the driver duplicates the module_pci_driver code,
> how?
> module_pci_driver is used for those drivers whose
> init and exit paths does only register and unregister
> to pci API and nothing else.
>
> so use the module_pci_driver macro instead
>
> Signed-off-by: Devendra Naga 
> ---
>  drivers/staging/media/solo6x10/core.c |   13 +
>  1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/staging/media/solo6x10/core.c 
> b/drivers/staging/media/solo6x10/core.c
> index d2fd842..3ee9b12 100644
> --- a/drivers/staging/media/solo6x10/core.c
> +++ b/drivers/staging/media/solo6x10/core.c
> @@ -318,15 +318,4 @@ static struct pci_driver solo_pci_driver = {
> .remove = solo_pci_remove,
>  };
>
> -static int __init solo_module_init(void)
> -{
> -   return pci_register_driver(&solo_pci_driver);
> -}
> -
> -static void __exit solo_module_exit(void)
> -{
> -   pci_unregister_driver(&solo_pci_driver);
> -}
> -
> -module_init(solo_module_init);
> -module_exit(solo_module_exit);
> +module_pci_driver(solo_pci_driver);
> --
> 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


Since this driver belongs to staging/media you should not send this to
staging but to linux-media mailing list.
Also, the maintainer is Mauro, so it's not necessary to add Greg in Cc.

Also, I'm Ccing Ismael Luceno who seems to be currently working for bluecherry.
Ismael: Is it possible for you to test and/or ack this patch?

Thanks,
Ezequiel.
--
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 2/2] [media] s5p-mfc: update MFC v4l2 driver to support MFC6.x

2012-07-10 Thread Kamil Debski
Hi Arun,

Please find some additional comments below.

> From: Arun Kumar K [mailto:arun...@samsung.com]
> Sent: 06 July 2012 16:00

[snip]


> diff --git a/drivers/media/video/s5p-mfc/Makefile
> b/drivers/media/video/s5p-mfc/Makefile
> index d066340..0308d74 100644
> --- a/drivers/media/video/s5p-mfc/Makefile
> +++ b/drivers/media/video/s5p-mfc/Makefile
> @@ -1,5 +1,6 @@
>  obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC) := s5p-mfc.o
> -s5p-mfc-y += s5p_mfc.o s5p_mfc_intr.o s5p_mfc_opr.o
> +s5p-mfc-y += s5p_mfc.o s5p_mfc_intr.o
>  s5p-mfc-y += s5p_mfc_dec.o s5p_mfc_enc.o
> -s5p-mfc-y += s5p_mfc_ctrl.o s5p_mfc_cmd.o
> -s5p-mfc-y += s5p_mfc_pm.o s5p_mfc_shm.o
> +s5p-mfc-y += s5p_mfc_ctrl.o s5p_mfc_pm.o
> +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC_V5) += s5p_mfc_opr.o s5p_mfc_cmd.o
> s5p_mfc_shm.o
> +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC_V6) += s5p_mfc_opr_v6.o
> s5p_mfc_cmd_v6.o
> diff --git a/drivers/media/video/s5p-mfc/regs-mfc-v6.h
> b/drivers/media/video/s5p-mfc/regs-mfc-v6.h
> new file mode 100644
> index 000..f22a159

This Makefile does not work when compiling the driver as a module.
(I also wrote about this in my previous email)

[snip]

> 
>  #endif /* _REGS_FIMV_H */
> diff --git a/drivers/media/video/s5p-mfc/s5p_mfc.c
> b/drivers/media/video/s5p-mfc/s5p_mfc.c
> index 9bb68e7..bec94bc 100644
> --- a/drivers/media/video/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/video/s5p-mfc/s5p_mfc.c

[snip]

> @@ -285,12 +276,13 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx
> *ctx,
> 
>   dst_frame_status = s5p_mfc_get_dspl_status()
>   & S5P_FIMV_DEC_STATUS_DECODING_STATUS_MASK;
> - res_change = s5p_mfc_get_dspl_status()
> - & S5P_FIMV_DEC_STATUS_RESOLUTION_MASK;
> + res_change = (s5p_mfc_get_dspl_status()
> + & S5P_FIMV_DEC_STATUS_RESOLUTION_MASK)
> + >> S5P_FIMV_DEC_STATUS_RESOLUTION_SHIFT;
>   mfc_debug(2, "Frame Status: %x\n", dst_frame_status);
>   if (ctx->state == MFCINST_RES_CHANGE_INIT)
>   ctx->state = MFCINST_RES_CHANGE_FLUSH;
> - if (res_change) {
> + if (res_change && res_change != 3) {

Maybe 
If (res_change == 1 || res_change == 2) {
would be better, at least it would be more clear.

[snip]


> diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_common.h
> b/drivers/media/video/s5p-mfc/s5p_mfc_common.h
> index bd5706a..8c646f4 100644
> --- a/drivers/media/video/s5p-mfc/s5p_mfc_common.h
> +++ b/drivers/media/video/s5p-mfc/s5p_mfc_common.h

[snip]

> @@ -499,37 +563,42 @@ struct s5p_mfc_ctx {
>   int display_delay;
>   int display_delay_enable;
>   int after_packed_pb;
> + int sei_fp_parse;
> 
>   int dpb_count;
>   int total_dpb_count;
> 
>   /* Buffers */
> - void *ctx_buf;
> - size_t ctx_phys;
> - size_t ctx_ofs;
> - size_t ctx_size;
> -
> - void *desc_buf;
> - size_t desc_phys;
> -
> -
> - void *shm_alloc;
> - void *shm;
> - size_t shm_ofs;
> + unsigned int ctx_size;
> + struct s5p_mfc_priv_buf ctx;
> + struct s5p_mfc_priv_buf dsc;
> + struct s5p_mfc_priv_buf shm;

I think that ctx_size could be integrated in struct s5p_mfc_priv_buf.
Also - why unsigned int, where in other places you use size_t for size?
I think it should be consistent. I would choose size_t.

> 
>   struct s5p_mfc_enc_params enc_params;
> 
>   size_t enc_dst_buf_size;
> + size_t luma_dpb_size;
> + size_t chroma_dpb_size;
> + size_t me_buffer_size;
> + size_t tmv_buffer_size;
> 

^^ You use size_t here.

[snip]

> diff --git a/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
> b/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
> index 08a5cfe..65ff15d 100644
> --- a/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
> +++ b/drivers/media/video/s5p-mfc/s5p_mfc_ctrl.c
> @@ -15,7 +15,6 @@
>  #include 
>  #include 
>  #include 
> -#include "regs-mfc.h"
>  #include "s5p_mfc_cmd.h"
>  #include "s5p_mfc_common.h"
>  #include "s5p_mfc_debug.h"
> @@ -38,12 +37,12 @@ int s5p_mfc_alloc_and_load_firmware(struct
> s5p_mfc_dev *dev)
>* into kernel. */
>   mfc_debug_enter();
>   err = request_firmware((const struct firmware **)&fw_blob,
> -  "s5p-mfc.fw", dev->v4l2_dev.dev);
> +  "mfc_fw.bin", dev->v4l2_dev.dev);

Another name change? This is getting ridiculous. Nein, nein, nein ! ;)
If you _*really*_ need such a change then go ahead and try to convince
me, but I tell you - it's going to be hard.

>   if (err != 0) {
>   mfc_err("Firmware is not present in the /lib/firmware
> directory nor compiled in kernel\n");
>   return -EINVAL;
>   }
> - dev->fw_size = ALIGN(fw_blob->size, FIRMWARE_ALIGN);
> + dev->fw_size = dev->variant->buf_size->fw;

Why is size taken from there instead of the size of the firmware file?
Even if there was some point to do it this way then you really *should*
check if the firmware read 

[PATCH RFCv3] add DTMB support for DVB API

2012-07-10 Thread Antti Palosaari
Cc: Patrick Boettcher 
Cc: Andreas Oberritter 
Cc: Mauro Carvalho Chehab 
Acked-by: Patrick Boettcher 
Signed-off-by: Antti Palosaari 
---
 Documentation/DocBook/media/dvb/dvbproperty.xml |   40 ++-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |   14 ++--
 drivers/media/dvb/dvb-core/dvb_frontend.h   |2 ++
 drivers/media/dvb/frontends/atbm8830.c  |2 +-
 drivers/media/dvb/frontends/lgs8gl5.c   |2 +-
 drivers/media/dvb/frontends/lgs8gxx.c   |2 +-
 include/linux/dvb/frontend.h|   21 ++--
 include/linux/dvb/version.h |2 +-
 8 files changed, 74 insertions(+), 11 deletions(-)

diff --git a/Documentation/DocBook/media/dvb/dvbproperty.xml 
b/Documentation/DocBook/media/dvb/dvbproperty.xml
index e633c09..05230ed 100644
--- a/Documentation/DocBook/media/dvb/dvbproperty.xml
+++ b/Documentation/DocBook/media/dvb/dvbproperty.xml
@@ -194,6 +194,7 @@ get/set up to 64 properties. The actual meaning of each 
property is described on
APSK_16,
APSK_32,
DQPSK,
+   QAM_4_NR,
  } fe_modulation_t;
 

@@ -265,6 +266,7 @@ typedef enum fe_code_rate {
FEC_AUTO,
FEC_3_5,
FEC_9_10,
+   FEC_2_5,
 } fe_code_rate_t;

which correspond to error correction rates of 1/2, 2/3, etc.,
@@ -351,7 +353,7 @@ typedef enum fe_delivery_system {
SYS_ISDBC,
SYS_ATSC,
SYS_ATSCMH,
-   SYS_DMBTH,
+   SYS_DTMB,
SYS_CMMB,
SYS_DAB,
SYS_DVBT2,
@@ -725,6 +727,9 @@ typedef enum fe_guard_interval {
GUARD_INTERVAL_1_128,
GUARD_INTERVAL_19_128,
GUARD_INTERVAL_19_256,
+   GUARD_INTERVAL_PN420,
+   GUARD_INTERVAL_PN595,
+   GUARD_INTERVAL_PN945,
 } fe_guard_interval_t;
 
 
@@ -733,6 +738,7 @@ typedef enum fe_guard_interval {
try to find the correct guard interval (if capable) and 
will use TMCC to fill
in the missing parameters.
2) Intervals 1/128, 19/128 and 19/256 are used only for 
DVB-T2 at present
+   3) DTMB specifies PN420, PN595 and PN945.


DTV_TRANSMISSION_MODE
@@ -749,6 +755,8 @@ typedef enum fe_transmit_mode {
TRANSMISSION_MODE_1K,
TRANSMISSION_MODE_16K,
TRANSMISSION_MODE_32K,
+   TRANSMISSION_MODE_C1,
+   TRANSMISSION_MODE_C3780,
 } fe_transmit_mode_t;
 
Notes:
@@ -760,6 +768,7 @@ typedef enum fe_transmit_mode {
use TMCC to fill in the missing parameters.
3) DVB-T specifies 2K and 8K as valid sizes.
4) DVB-T2 specifies 1K, 2K, 4K, 8K, 16K and 32K.
+   5) DTMB specifies C1 and C3780.


DTV_HIERARCHY
@@ -796,6 +805,17 @@ typedef enum fe_hierarchy {
FE_GET_INFO. In the case of a legacy frontend, the 
result is just the same
as with FE_GET_INFO, but in a more structured format 


+   
+   DTV_INTERLEAVING
+   Interleaving mode
+   
+enum fe_interleaving {
+   INTERLEAVING_NONE,
+   INTERLEAVING_240,
+   INTERLEAVING_720,
+};
+   
+   
 

Properties used on terrestrial delivery systems
@@ -934,6 +954,24 @@ typedef enum fe_hierarchy {
DTV_ATSCMH_SCCC_CODE_MODE_D


+   
+   DTMB delivery system
+   The following parameters are valid for 
DTMB:
+   
+   DTV_API_VERSION
+   DTV_DELIVERY_SYSTEM
+   DTV_TUNE
+   DTV_CLEAR
+   DTV_FREQUENCY
+   DTV_MODULATION
+   DTV_BANDWIDTH_HZ
+   DTV_INVERSION
+   DTV_INNER_FEC
+   DTV_GUARD_INTERVAL
+   DTV_TRANSMISSION_MODE
+   DTV_INTERLEAVING
+   
+   


Properties used on cable delivery systems
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c 
b/drivers/media/dvb/dvb-core/dvb_frontend.c
index aebcdf2..b54c297 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -179,7 +179,7 @@ static enum dvbv3_emulation_type dvbv3_type(u32 
delivery_system)
case SYS_DVBT:
case SYS_DVBT2:
case SYS_ISDBT:
-   case SYS_DMBTH:
+   case SYS_DTMB:
return DVBV3_OFDM;
case SYS_ATSC:
case SYS_ATSCMH:
@@ -997,6 +997,7 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
_DTV_CMD(DTV_CODE_RATE_LP, 1, 0),
_DTV_CMD(DTV_GUARD_INTERVAL, 1, 0),

[PATCH RFCv3] add DTMB support for DVB API

2012-07-10 Thread Antti Palosaari
Changes since v2
* add documentation
* FEC_0x => FEC_x_y
* remove typedef

Some questions still:
1)
Should I use INTERLEAVING_AUTO instead of INTERLEAVING_NONE ?

2)
Which is better, enum fe_interleaving or u8 for interleaving type inside struct 
dtv_frontend_properties?
Only 2 bits is needed to present current values so enum will waste some space.

Cc: Patrick Boettcher 
Cc: Andreas Oberritter 
Cc: Mauro Carvalho Chehab 

Antti Palosaari (1):
  add DTMB support for DVB API

 Documentation/DocBook/media/dvb/dvbproperty.xml |   40 ++-
 drivers/media/dvb/dvb-core/dvb_frontend.c   |   14 ++--
 drivers/media/dvb/dvb-core/dvb_frontend.h   |2 ++
 drivers/media/dvb/frontends/atbm8830.c  |2 +-
 drivers/media/dvb/frontends/lgs8gl5.c   |2 +-
 drivers/media/dvb/frontends/lgs8gxx.c   |2 +-
 include/linux/dvb/frontend.h|   21 ++--
 include/linux/dvb/version.h |2 +-
 8 files changed, 74 insertions(+), 11 deletions(-)

-- 
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: video: USB webcam fails since kernel 3.2

2012-07-10 Thread Jean-Francois Moine
On Tue, 10 Jul 2012 15:56:08 +0300
Martin-Éric Racine  wrote:
[snip]
> I hope that the above already provides some usable answers.

Not a lot :(

Well, I already saw these errors -71. One case was a cable problem.
An other one occurred with skype only, while vlc worked correctly.

So, it would be interesting to know if the (almost) last driver works.
Then, you may try the gspca-2.15.18.tar.gz from my web site:

wget http://moinejf.free.fr/gspca-2.15.18.tar.gz
tar -zxf gspca-2.15.18.tar.gz
cd gspca-2.15.18
make
su
make install
reboot

You may then try cheese. For skype, don't forget to force the
use of the v4l library:

export LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so
skype

If the problem is still there, I'd be glad to get some traces.
For that, as root, do:

echo 0x1f > /sys/module/gspca_main/parameters/debug

then, unplug/replug the webcam, do some capture until the problem
occurs, and send us the last kernel messages starting from the webcam
probe.

Thanks.

-- 
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef |   http://moinejf.free.fr/
--
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 03/10] ov772x: Select the default format at probe time

2012-07-10 Thread Guennadi Liakhovetski
On Fri, 6 Jul 2012, Laurent Pinchart wrote:

> The format and window size are only initialized during the first g_fmt
> call. This leaves the device in an inconsistent state after
> initialization, which will cause problems when implementing pad
> operations. Move the format and window size initialization to probe
> time.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  drivers/media/video/ov772x.c |   63 -
>  1 files changed, 31 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/media/video/ov772x.c b/drivers/media/video/ov772x.c
> index 066bac6..576780a 100644
> --- a/drivers/media/video/ov772x.c
> +++ b/drivers/media/video/ov772x.c
> @@ -547,37 +547,36 @@ static const struct ov772x_color_format ov772x_cfmts[] 
> = {
>  #define MAX_WIDTH   VGA_WIDTH
>  #define MAX_HEIGHT  VGA_HEIGHT
>  
> -static const struct ov772x_win_size ov772x_win_vga = {
> - .name = "VGA",
> - .width= VGA_WIDTH,
> - .height   = VGA_HEIGHT,
> - .com7_bit = SLCT_VGA,
> - .regs = ov772x_vga_regs,
> -};
> -
> -static const struct ov772x_win_size ov772x_win_qvga = {
> - .name = "QVGA",
> - .width= QVGA_WIDTH,
> - .height   = QVGA_HEIGHT,
> - .com7_bit = SLCT_QVGA,
> - .regs = ov772x_qvga_regs,
> +static const struct ov772x_win_size ov772x_win_sizes[] = {
> + {
> + .name = "VGA",
> + .width= VGA_WIDTH,
> + .height   = VGA_HEIGHT,
> + .com7_bit = SLCT_VGA,
> + .regs = ov772x_vga_regs,
> + }, {
> + .name = "QVGA",
> + .width= QVGA_WIDTH,
> + .height   = QVGA_HEIGHT,
> + .com7_bit = SLCT_QVGA,
> + .regs = ov772x_qvga_regs,
> + },
>  };
>  
>  static const struct ov772x_win_size *ov772x_select_win(u32 width, u32 height)
>  {
> - __u32 diff;
> - const struct ov772x_win_size *win;
> -
> - /* default is QVGA */
> - diff = abs(width - ov772x_win_qvga.width) +
> - abs(height - ov772x_win_qvga.height);
> - win = &ov772x_win_qvga;
> -
> - /* VGA */
> - if (diff >
> - abs(width  - ov772x_win_vga.width) +
> - abs(height - ov772x_win_vga.height))
> - win = &ov772x_win_vga;
> + const struct ov772x_win_size *win = &ov772x_win_sizes[0];
> + unsigned int i;
> + u32 best_diff = (u32)-1;

Not a reason enough for a new version, if you don't mind and ig I don't 
forget, I might

#include 
+   u32 best_diff = UINT_MAX;

> +
> + for (i = 0; i < ARRAY_SIZE(ov772x_win_sizes); ++i) {
> + u32 diff = abs(width - ov772x_win_sizes[i].width)
> +  + abs(height - ov772x_win_sizes[i].height);
> + if (diff < best_diff) {
> + best_diff = diff;
> + win = &ov772x_win_sizes[i];
> + }
> + }
>  
>   return win;
>  }

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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


OMAP4 support

2012-07-10 Thread Gary Thomas

I'm looking for video support on OMAP4 platforms.  I've found the
PandaBoard camera project 
(http://www.omappedia.org/wiki/PandaBoard_Camera_Support)
and this is starting to work.  That said, I'm having some
issues with setting up the pipeline, etc.

Can this list help out?

Also, does anyone know of any support for the CPI input interface
which is available on the OMAP4460?

Thanks

--

Gary Thomas |  Consulting for the
MLB Associates  |Embedded world


--
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: video: USB webcam fails since kernel 3.2

2012-07-10 Thread Martin-Éric Racine
Hi Jonathan,

Thank you for these detailed instructions. Find the results of my testing below:

2012/7/9 Jonathan Nieder :
> Hans de Goede wrote:
>
>> Erm, that is quite a bit of work from my side for something which you
>> can easily do yourself, edit gspca.c, search for which_bandwidth
>> and then under the following lines:
>> u32 bandwidth;
>> int i;
>>
>> Add a line like this:
>>   return 2000 * 2000 * 120;
>
> In case it helps, here are some more complete instructions.
>
>  0. Prerequisites:
>
> apt-get install git build-essential
>
>  1. Get the kernel history, if you don't already have it:
>
> git clone \
>   git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Cloned up to the following commit:

commit 2437fccfbfc83bcb868ccc7fdfe2b5310bf07835
Merge: 6c6ee53 d92d95b6
Author: Linus Torvalds 
Date:   Mon Jul 9 13:43:02 2012 -0700

Merge tag 'regulator-3.5' of
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

>  2. Try linus's master:
>
> cd linux
> git fetch origin
> git reset --hard origin/master
> cp /boot/config-$(uname -r) .config; # current configuration
> scripts/config --disable DEBUG_INFO
> make localmodconfig; # optional: minimize configuration
> make deb-pkg; # optionally with -j for parallel build
> dpkg -i ../; # as root
> reboot
> ... test test test ...
>
> Hopefully it reproduces the bug.

Fails as previously.

>  3. Try Hans's first suggested change, as described in the quoted text
> above:

/* compute the minimum bandwidth for the current transfer */
static u32 which_bandwidth(struct gspca_dev *gspca_dev)
{
u32 bandwidth;
int i;

return 2000 * 2000 * 120;

/* get the (max) image size */

> cd linux
> vi drivers/media/video/gspca/gspca.c
> ... make the suggested edits ...
> make deb-pkg; # maybe with -j4
> dpkg -i ../; # as root
> reboot
> ... test test test ...

The camera works again in Cheese, at least some of the time. Other
times, launching Cheese immediately crashes GNOME, which restarts the
X.org server.

However, with Skype 4.0.0.7, it only shows a green square, instead of
the camera's output.

>  4. Try Hans's second suggested change, as described in a previous
> message:
>
> cd linux
> vi drivers/media/video/gspca/gspca.c
> ... make the suggested edits ...
> make deb-pkg; # maybe with -j4
> dpkg -i ../; # as root
> reboot
> ... test test test ...

This produces a severely distorted image for a few seconds, then
Cheese crashes; GNOME itself survives.

Meanwhile, Skype 4.0.0.7 shows a black square, instead of the camera's output.

I hope that the above already provides some usable answers.

Martin-Éric
--
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


[GIT PULL] Davinci VPIF feature enhancement and fixes for v3.5

2012-07-10 Thread Lad, Prabhakar
Hi Mauro,

Please pull the following VPIF driver feature enhancement and fixes for v3.5

Thanks and Regards,
--Prabhakar Lad

The following changes since commit bd0a521e88aa7a06ae7aabaed7ae196ed4ad867a:

  Linux 3.5-rc6 (2012-07-07 17:23:56 -0700)

are available in the git repository at:
  git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git pull_vpif

Lad, Prabhakar (2):
  davinci: vpif capture: migrate driver to videobuf2
  davinci: vpif display: migrate driver to videobuf2

Manjunath Hadli (12):
  davinci: vpif: add check for genuine interrupts in the isr
  davinci: vpif: make generic changes to re-use the vpif drivers on 
da850/omap-l138 soc
  davinci: vpif: make request_irq flags as shared
  davinci: vpif: fix setting of data width in config_vpif_params() function
  davinci: vpif display: size up the memory for the buffers from the buffer 
pool
  davinci: vpif capture: size up the memory for the buffers from the buffer 
pool
  davinci: vpif: add support for clipping on output data
  davinci: vpif display: Add power management support
  davinci: vpif capture:Add power management support
  davinci: vpif: Add suspend/resume callbacks to vpif driver
  davinci: vpif: add build configuration for vpif drivers
  davinci: vpif: Enable selection of the ADV7343 and THS7303

 drivers/media/video/davinci/Kconfig|   30 +-
 drivers/media/video/davinci/Makefile   |8 +-
 drivers/media/video/davinci/vpif.c |   45 ++-
 drivers/media/video/davinci/vpif.h |   45 ++
 drivers/media/video/davinci/vpif_capture.c |  690 +++-
 drivers/media/video/davinci/vpif_capture.h |   16 +-
 drivers/media/video/davinci/vpif_display.c |  684 +++
 drivers/media/video/davinci/vpif_display.h |   23 +-
 include/media/davinci/vpif_types.h |2 +
 9 files changed, 881 insertions(+), 662 deletions(-)
--
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: mx2_camera: Don't modify non volatile parameters in try_fmt.

2012-07-10 Thread Guennadi Liakhovetski
On Tue, 10 Jul 2012, Javier Martin wrote:

> ---
>  drivers/media/video/mx2_camera.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/video/mx2_camera.c 
> b/drivers/media/video/mx2_camera.c
> index d5355de..4a96989 100644
> --- a/drivers/media/video/mx2_camera.c
> +++ b/drivers/media/video/mx2_camera.c
> @@ -1370,6 +1370,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device 
> *icd,
>   __u32 pixfmt = pix->pixelformat;
>   struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
>   struct mx2_camera_dev *pcdev = ici->priv;
> + struct mx2_fmt_cfg *emma_prp;
>   unsigned int width_limit;
>   int ret;
>  
> @@ -1432,7 +1433,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device 
> *icd,
>   __func__, pcdev->s_width, pcdev->s_height);
>  
>   /* If the sensor does not support image size try PrP resizing */
> - pcdev->emma_prp = mx27_emma_prp_get_format(xlate->code,
> + emma_prp = mx27_emma_prp_get_format(xlate->code,
>  xlate->host_fmt->fourcc);
>  
>   memset(pcdev->resizing, 0, sizeof(pcdev->resizing));

You forgot to update this:

if ((mf.width != pix->width || mf.height != pix->height) &&
pcdev->emma_prp->cfg.in_fmt == PRP_CNTL_DATA_IN_YUV422) {



if (mx2_emmaprp_resize(pcdev, &mf, pix, false) < 0)
dev_dbg(icd->parent, "%s: can't resize\n", __func__);
}

> -- 
> 1.7.9.5

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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] media: mx2_camera: Don't modify non volatile parameters in try_fmt.

2012-07-10 Thread Javier Martin
---
 drivers/media/video/mx2_camera.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index d5355de..4a96989 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -1370,6 +1370,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device 
*icd,
__u32 pixfmt = pix->pixelformat;
struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
struct mx2_camera_dev *pcdev = ici->priv;
+   struct mx2_fmt_cfg *emma_prp;
unsigned int width_limit;
int ret;
 
@@ -1432,7 +1433,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device 
*icd,
__func__, pcdev->s_width, pcdev->s_height);
 
/* If the sensor does not support image size try PrP resizing */
-   pcdev->emma_prp = mx27_emma_prp_get_format(xlate->code,
+   emma_prp = mx27_emma_prp_get_format(xlate->code,
   xlate->host_fmt->fourcc);
 
memset(pcdev->resizing, 0, sizeof(pcdev->resizing));
-- 
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 v4] media: Add stk1160 new driver

2012-07-10 Thread Hans Verkuil
On Tue 10 July 2012 14:26:11 Ezequiel Garcia wrote:
> Hi Hans,
> 
> On Tue, Jul 10, 2012 at 3:39 AM, Hans Verkuil  wrote:
> > On Tue July 10 2012 05:17:41 Ezequiel Garcia wrote:
> >> Hey Mauro,
> >>
> >> On Fri, Jul 6, 2012 at 11:41 AM, Ezequiel Garcia  
> >> wrote:
> >> > On Thu, Jul 5, 2012 at 9:01 PM, Mauro Carvalho Chehab
> >> >  wrote:
> >> >> Em 05-07-2012 19:36, Sylwester Nawrocki escreveu:
> >> >>> On 07/06/2012 12:11 AM, Mauro Carvalho Chehab wrote:
> >> > +static int vidioc_dqbuf(struct file *file, void *priv, struct 
> >> > v4l2_buffer *p)
> >> > +{
> >> > +   struct stk1160 *dev = video_drvdata(file);
> >> > +
> >> > +   if (!stk1160_is_owner(dev, file))
> >> > +   return -EBUSY;
> >> > +
> >> > +   return vb2_dqbuf(&dev->vb_vidq, p, file->f_flags&  O_NONBLOCK);
> >
> > Take a look at the latest videobuf2-core.h: I've added helper functions
> > that check the owner. You can probably simplify the driver code quite a bit
> > by using those helpers.
> 
> Ok.
> 
> >
> >> 
> >>  Why to use O_NONBLOCK here? it should be doing whatever userspace 
> >>  wants.
> >> >>>
> >> >>> This is OK, since the third argument to vb2_dqbuf() is a boolean 
> >> >>> indicating
> >> >>> whether this call should be blocking or not. And a "& O_NONBLOCK" 
> >> >>> masks this
> >> >>> information out from file->f_flags.
> >> >>
> >> >> Ah! OK then.
> >> >>
> >> >> It might be better to initialize it during vb2 initialization, at open,
> >> >> instead of requiring this argument every time vb_dqbuf() is called.
> >
> > You can't do this at open since the application can change the NONBLOCK mode
> > after open. So the current approach is correct.
> 
> Yes, that sounds ok. Let's wait until Mauro returns from holiday to discuss 
> this
> with him.
> 
> Also, what do you think about current_norm usage?

Don't use it. Implement g_std instead. current_norm really doesn't add anything
useful, it is a bit too magical and it doesn't work if you have multiple nodes
that share the same std (e.g. video and vbi).

I'm removing it from existing drivers whenever I have the chance, and it will
eventually go away.

Regards,

Hans
--
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 v4] media: Add stk1160 new driver

2012-07-10 Thread Ezequiel Garcia
Hi Hans,

On Tue, Jul 10, 2012 at 3:39 AM, Hans Verkuil  wrote:
> On Tue July 10 2012 05:17:41 Ezequiel Garcia wrote:
>> Hey Mauro,
>>
>> On Fri, Jul 6, 2012 at 11:41 AM, Ezequiel Garcia  
>> wrote:
>> > On Thu, Jul 5, 2012 at 9:01 PM, Mauro Carvalho Chehab
>> >  wrote:
>> >> Em 05-07-2012 19:36, Sylwester Nawrocki escreveu:
>> >>> On 07/06/2012 12:11 AM, Mauro Carvalho Chehab wrote:
>> > +static int vidioc_dqbuf(struct file *file, void *priv, struct 
>> > v4l2_buffer *p)
>> > +{
>> > +   struct stk1160 *dev = video_drvdata(file);
>> > +
>> > +   if (!stk1160_is_owner(dev, file))
>> > +   return -EBUSY;
>> > +
>> > +   return vb2_dqbuf(&dev->vb_vidq, p, file->f_flags&  O_NONBLOCK);
>
> Take a look at the latest videobuf2-core.h: I've added helper functions
> that check the owner. You can probably simplify the driver code quite a bit
> by using those helpers.

Ok.

>
>> 
>>  Why to use O_NONBLOCK here? it should be doing whatever userspace wants.
>> >>>
>> >>> This is OK, since the third argument to vb2_dqbuf() is a boolean 
>> >>> indicating
>> >>> whether this call should be blocking or not. And a "& O_NONBLOCK" masks 
>> >>> this
>> >>> information out from file->f_flags.
>> >>
>> >> Ah! OK then.
>> >>
>> >> It might be better to initialize it during vb2 initialization, at open,
>> >> instead of requiring this argument every time vb_dqbuf() is called.
>
> You can't do this at open since the application can change the NONBLOCK mode
> after open. So the current approach is correct.

Yes, that sounds ok. Let's wait until Mauro returns from holiday to discuss this
with him.

Also, what do you think about current_norm usage?

Regards,
Ezequiel.
--
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


Q: use of enum in struct dtv_frontend_properties

2012-07-10 Thread Antti Palosaari
I am adding DTMB support (again) for DVB API. There is new parameter 
interleaving needed. Currently it has 3 values. I defined it as a enum 
as typedef enum is not allowed anymore in Kernel.


Should I define it as (enum fe_interleaving) or (u8) in struct 
dtv_frontend_properties?


enum fe_interleaving {
INTERLEAVING_NONE,
INTERLEAVING_240,
INTERLEAVING_720,
};

struct dtv_frontend_properties {
enum fe_interleavinginterleaving;
};

*** OR ***:

struct dtv_frontend_properties {
u8interleaving;
};



regards
Antti



--
http://palosaari.fi/

--
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


[GIT PULL] Videobuf dma-contig fix for v3.5

2012-07-10 Thread Lad, Prabhakar
Hi Mauro,
 Please pull the following videobuf dma-contig fix for v3.5

Thanks and Regards,
--Prabhakar Lad

The following changes since commit bd0a521e88aa7a06ae7aabaed7ae196ed4ad867a:

  Linux 3.5-rc6 (2012-07-07 17:23:56 -0700)

are available in the git repository at:
  git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git pull_videobuf_core_fix

Lad, Prabhakar (1):
  videobuf-dma-contig: restore buffer mapping for uncached bufers

 drivers/media/video/videobuf-dma-contig.c |   53 +---
 1 files changed, 32 insertions(+), 21 deletions(-)
--
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 9/9] soc-camera: Push probe-time power management to drivers

2012-07-10 Thread Guennadi Liakhovetski
Hi Laurent

On Thu, 5 Jul 2012, Laurent Pinchart wrote:

> Several client drivers access the hardware at probe time, for instance
> to read the probe chip ID. Such chips need to be powered up when being
> probed.
> 
> soc-camera handles this by powering chips up in the soc-camera probe
> implementation. However, this will break with non soc-camera hosts that
> don't perform the same operations.
> 
> Fix the problem by pushing the power up/down from the soc-camera core
> down to individual drivers on a needs basis.
> 
> Signed-off-by: Laurent Pinchart 
> ---
>  drivers/media/video/imx074.c |   21 --
>  drivers/media/video/mt9m001.c|   17 +++-
>  drivers/media/video/mt9m111.c|   80 +
>  drivers/media/video/mt9t031.c|   37 +++--
>  drivers/media/video/mt9t112.c|   12 +-
>  drivers/media/video/mt9v022.c|5 ++
>  drivers/media/video/ov2640.c |   11 -
>  drivers/media/video/ov5642.c |   21 --
>  drivers/media/video/ov6650.c |   19 ++---
>  drivers/media/video/ov772x.c |   14 ++-
>  drivers/media/video/ov9640.c |   17 ++--
>  drivers/media/video/ov9740.c |   23 +++
>  drivers/media/video/rj54n1cb0c.c |   18 ++--
>  drivers/media/video/soc_camera.c |   20 -
>  drivers/media/video/tw9910.c |   12 +-
>  15 files changed, 204 insertions(+), 123 deletions(-)

[snip]

> diff --git a/drivers/media/video/mt9t031.c b/drivers/media/video/mt9t031.c
> index 9666e20..4f12177 100644
> --- a/drivers/media/video/mt9t031.c
> +++ b/drivers/media/video/mt9t031.c
> @@ -161,14 +161,6 @@ static int mt9t031_idle(struct i2c_client *client)
>   return ret >= 0 ? 0 : -EIO;
>  }
>  
> -static int mt9t031_disable(struct i2c_client *client)
> -{
> - /* Disable the chip */
> - reg_clear(client, MT9T031_OUTPUT_CONTROL, 2);
> -
> - return 0;
> -}
> -
>  static int mt9t031_s_stream(struct v4l2_subdev *sd, int enable)
>  {
>   struct i2c_client *client = v4l2_get_subdevdata(sd);
> @@ -643,9 +635,15 @@ static int mt9t031_video_probe(struct i2c_client *client)
>   s32 data;
>   int ret;
>  
> - /* Enable the chip */
> - data = reg_write(client, MT9T031_CHIP_ENABLE, 1);
> - dev_dbg(&client->dev, "write: %d\n", data);
> + ret = mt9t031_s_power(&mt9t031->subdev, 1);
> + if (ret < 0)
> + return ret;
> +
> + ret = mt9t031_idle(client);
> + if (ret < 0) {
> + dev_err(&client->dev, "Failed to initialise the camera\n");
> + return ret;

grm... don't you have to "goto done" here instead to disable the power again?

> + }
>  
>   /* Read out the chip version register */
>   data = reg_read(client, MT9T031_CHIP_VERSION);
> @@ -657,16 +655,16 @@ static int mt9t031_video_probe(struct i2c_client 
> *client)
>   default:
>   dev_err(&client->dev,
>   "No MT9T031 chip detected, register read %x\n", data);
> - return -ENODEV;
> + ret = -ENODEV;
> + goto done;
>   }
>  
>   dev_info(&client->dev, "Detected a MT9T031 chip ID %x\n", data);
>  
> - ret = mt9t031_idle(client);
> - if (ret < 0)
> - dev_err(&client->dev, "Failed to initialise the camera\n");
> - else
> - v4l2_ctrl_handler_setup(&mt9t031->hdl);
> + ret = v4l2_ctrl_handler_setup(&mt9t031->hdl);
> +
> +done:
> + mt9t031_s_power(&mt9t031->subdev, 0);
>  
>   return ret;
>  }
> @@ -817,12 +815,7 @@ static int mt9t031_probe(struct i2c_client *client,
>   mt9t031->xskip = 1;
>   mt9t031->yskip = 1;
>  
> - mt9t031_idle(client);
> -
>   ret = mt9t031_video_probe(client);
> -
> - mt9t031_disable(client);
> -
>   if (ret) {
>   v4l2_ctrl_handler_free(&mt9t031->hdl);
>   kfree(mt9t031);

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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] media: mx2_camera: Fix mbus format handling

2012-07-10 Thread Javier Martin
Remove MX2_CAMERA_SWAP16 and MX2_CAMERA_PACK_DIR_MSB flags
so that the driver can negotiate with the attached sensor
whether the mbus format needs convertion from UYUV to YUYV
or not.
---
Changes since v3:
 - Remove conversion from UYVY to YUYV.
 - Add 'csicr1' to emma-PrP format structure.

---
 arch/arm/plat-mxc/include/mach/mx2_cam.h |2 --
 drivers/media/video/mx2_camera.c |   27 ++-
 2 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-mxc/include/mach/mx2_cam.h 
b/arch/arm/plat-mxc/include/mach/mx2_cam.h
index 3c080a3..7ded6f1 100644
--- a/arch/arm/plat-mxc/include/mach/mx2_cam.h
+++ b/arch/arm/plat-mxc/include/mach/mx2_cam.h
@@ -23,7 +23,6 @@
 #ifndef __MACH_MX2_CAM_H_
 #define __MACH_MX2_CAM_H_
 
-#define MX2_CAMERA_SWAP16  (1 << 0)
 #define MX2_CAMERA_EXT_VSYNC   (1 << 1)
 #define MX2_CAMERA_CCIR(1 << 2)
 #define MX2_CAMERA_CCIR_INTERLACE  (1 << 3)
@@ -31,7 +30,6 @@
 #define MX2_CAMERA_GATED_CLOCK (1 << 5)
 #define MX2_CAMERA_INV_DATA(1 << 6)
 #define MX2_CAMERA_PCLK_SAMPLE_RISING  (1 << 7)
-#define MX2_CAMERA_PACK_DIR_MSB(1 << 8)
 
 /**
  * struct mx2_camera_platform_data - optional platform data for mx2_camera
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 11a9353..8adef0f 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -119,6 +119,7 @@
 #define CSISR_DRDY (1 << 0)
 
 #define CSICR1 0x00
+#defineCSICR1_FMT_MASK  (CSICR1_PACK_DIR | CSICR1_SWAP16_EN)
 #define CSICR2 0x04
 #define CSISR  (cpu_is_mx27() ? 0x08 : 0x18)
 #define CSISTATFIFO0x0c
@@ -230,6 +231,7 @@ struct mx2_prp_cfg {
u32 src_pixel;
u32 ch1_pixel;
u32 irq_flags;
+   u32 csicr1;
 };
 
 /* prp resizing parameters */
@@ -330,6 +332,7 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
.ch1_pixel  = 0x2ca00565, /* RGB565 */
.irq_flags  = PRP_INTR_RDERR | PRP_INTR_CH1WERR |
PRP_INTR_CH1FC | PRP_INTR_LBOVF,
+   .csicr1 = 0,
}
},
{
@@ -343,6 +346,21 @@ static struct mx2_fmt_cfg mx27_emma_prp_table[] = {
.irq_flags  = PRP_INTR_RDERR | PRP_INTR_CH2WERR |
PRP_INTR_CH2FC | PRP_INTR_LBOVF |
PRP_INTR_CH2OVF,
+   .csicr1 = CSICR1_PACK_DIR,
+   }
+   },
+   {
+   .in_fmt = V4L2_MBUS_FMT_UYVY8_2X8,
+   .out_fmt= V4L2_PIX_FMT_YUV420,
+   .cfg= {
+   .channel= 2,
+   .in_fmt = PRP_CNTL_DATA_IN_YUV422,
+   .out_fmt= PRP_CNTL_CH2_OUT_YUV420,
+   .src_pixel  = 0x22000888, /* YUV422 (YUYV) */
+   .irq_flags  = PRP_INTR_RDERR | PRP_INTR_CH2WERR |
+   PRP_INTR_CH2FC | PRP_INTR_LBOVF |
+   PRP_INTR_CH2OVF,
+   .csicr1 = CSICR1_SWAP16_EN,
}
},
 };
@@ -1018,14 +1036,14 @@ static int mx2_camera_set_bus_param(struct 
soc_camera_device *icd)
return ret;
}
 
+   csicr1 = (csicr1 & ~CSICR1_FMT_MASK) | pcdev->emma_prp->cfg.csicr1;
+
if (common_flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
csicr1 |= CSICR1_REDGE;
if (common_flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
csicr1 |= CSICR1_SOF_POL;
if (common_flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
csicr1 |= CSICR1_HSYNC_POL;
-   if (pcdev->platform_flags & MX2_CAMERA_SWAP16)
-   csicr1 |= CSICR1_SWAP16_EN;
if (pcdev->platform_flags & MX2_CAMERA_EXT_VSYNC)
csicr1 |= CSICR1_EXT_VSYNC;
if (pcdev->platform_flags & MX2_CAMERA_CCIR)
@@ -1036,8 +1054,6 @@ static int mx2_camera_set_bus_param(struct 
soc_camera_device *icd)
csicr1 |= CSICR1_GCLK_MODE;
if (pcdev->platform_flags & MX2_CAMERA_INV_DATA)
csicr1 |= CSICR1_INV_DATA;
-   if (pcdev->platform_flags & MX2_CAMERA_PACK_DIR_MSB)
-   csicr1 |= CSICR1_PACK_DIR;
 
pcdev->csicr1 = csicr1;
 
@@ -1112,7 +1128,8 @@ static int mx2_camera_get_formats(struct 
soc_camera_device *icd,
return 0;
}
 
-   if (code == V4L2_MBUS_FMT_YUYV8_2X8) {
+   if (code == V4L2_MBUS_FMT_YUYV8_2X8 ||
+   code == V4L2_MBUS_FMT_UYVY8_2X8) {
formats++;
if (xlate) {
/*
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a 

Re: [PATCH] [media] V4L: Use NULL pointer instead of plain integer in v4l2-ctrls.c file

2012-07-10 Thread Hans Verkuil
On Tue 10 July 2012 13:14:46 Sachin Kamat wrote:
> Fixes the following sparse warning:
> drivers/media/video/v4l2-ctrls.c:2123:43: warning: Using plain integer as 
> NULL pointer
> 
> Signed-off-by: Sachin Kamat 

Acked-by: Hans Verkuil 

> ---
>  drivers/media/video/v4l2-ctrls.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/v4l2-ctrls.c 
> b/drivers/media/video/v4l2-ctrls.c
> index 9abd9ab..18101d6 100644
> --- a/drivers/media/video/v4l2-ctrls.c
> +++ b/drivers/media/video/v4l2-ctrls.c
> @@ -2120,7 +2120,7 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler 
> *hdl,
>  
>   /* First zero the helper field in the master control references */
>   for (i = 0; i < cs->count; i++)
> - helpers[i].mref->helper = 0;
> + helpers[i].mref->helper = NULL;
>   for (i = 0, h = helpers; i < cs->count; i++, h++) {
>   struct v4l2_ctrl_ref *mref = h->mref;
>  
> 
--
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] [media] V4L: Use NULL pointer instead of plain integer in v4l2-ctrls.c file

2012-07-10 Thread Sachin Kamat
Fixes the following sparse warning:
drivers/media/video/v4l2-ctrls.c:2123:43: warning: Using plain integer as NULL 
pointer

Signed-off-by: Sachin Kamat 
---
 drivers/media/video/v4l2-ctrls.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index 9abd9ab..18101d6 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -2120,7 +2120,7 @@ static int prepare_ext_ctrls(struct v4l2_ctrl_handler 
*hdl,
 
/* First zero the helper field in the master control references */
for (i = 0; i < cs->count; i++)
-   helpers[i].mref->helper = 0;
+   helpers[i].mref->helper = NULL;
for (i = 0, h = helpers; i < cs->count; i++, h++) {
struct v4l2_ctrl_ref *mref = h->mref;
 
-- 
1.7.4.1

--
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 PATCH 8/8] nouveau: Prime execbuffer submission synchronization

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

Signed-off-by: Maarten Lankhorst 
---
 drivers/gpu/drm/nouveau/nouveau_gem.c |  121 +++--
 1 file changed, 116 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c 
b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 11c9c2a..e5d36bb 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -31,6 +31,7 @@
 #include "nouveau_drm.h"
 #include "nouveau_dma.h"
 #include "nouveau_fence.h"
+#include 
 
 #define nouveau_gem_pushbuf_sync(chan) 0
 
@@ -277,6 +278,7 @@ struct validate_op {
struct list_head vram_list;
struct list_head gart_list;
struct list_head both_list;
+   struct list_head prime_list;
 };
 
 static void
@@ -305,9 +307,36 @@ validate_fini_list(struct list_head *list, struct 
nouveau_fence *fence)
 static void
 validate_fini(struct validate_op *op, struct nouveau_fence* fence)
 {
+   struct list_head *entry, *tmp;
+   struct nouveau_bo *nvbo;
+   struct dma_buf *sync_buf;
+   u32 ofs, val;
+
validate_fini_list(&op->vram_list, fence);
validate_fini_list(&op->gart_list, fence);
validate_fini_list(&op->both_list, fence);
+
+   if (list_empty(&op->prime_list))
+   return;
+
+   if (fence &&
+   !nouveau_fence_prime_get(fence, &sync_buf, &ofs, &val)) {
+   dmabufmgr_eu_fence_buffer_objects(sync_buf, ofs, val,
+ &op->prime_list);
+   dma_buf_put(sync_buf);
+   } else
+   dmabufmgr_eu_backoff_reservation(&op->prime_list);
+
+   list_for_each_safe(entry, tmp, &op->prime_list) {
+   struct dmabufmgr_validate *val;
+   val = list_entry(entry, struct dmabufmgr_validate, head);
+   nvbo = val->priv;
+
+   list_del(&val->head);
+   nvbo->reserved_by = NULL;
+   drm_gem_object_unreference_unlocked(nvbo->gem);
+   kfree(val);
+   }
 }
 
 static int
@@ -319,9 +348,9 @@ validate_init(struct nouveau_channel *chan, struct drm_file 
*file_priv,
struct drm_nouveau_private *dev_priv = dev->dev_private;
uint32_t sequence;
int trycnt = 0;
-   int ret, i;
+   int i;
 
-   sequence = atomic_add_return(1, &dev_priv->ttm.validate_sequence);
+   sequence = atomic_inc_return(&dev_priv->ttm.validate_sequence);
 retry:
if (++trycnt > 10) {
NV_ERROR(dev, "%s failed and gave up.\n", __func__);
@@ -332,6 +361,8 @@ retry:
struct drm_nouveau_gem_pushbuf_bo *b = &pbbo[i];
struct drm_gem_object *gem;
struct nouveau_bo *nvbo;
+   int ret = 0, is_prime;
+   struct dmabufmgr_validate *validate = NULL;
 
gem = drm_gem_object_lookup(dev, file_priv, b->handle);
if (!gem) {
@@ -340,6 +371,7 @@ retry:
return -ENOENT;
}
nvbo = gem->driver_private;
+   is_prime = gem->export_dma_buf || gem->import_attach;
 
if (nvbo->reserved_by && nvbo->reserved_by == file_priv) {
NV_ERROR(dev, "multiple instances of buffer %d on "
@@ -349,7 +381,21 @@ retry:
return -EINVAL;
}
 
-   ret = ttm_bo_reserve(&nvbo->bo, true, false, true, sequence);
+   if (likely(!is_prime))
+   ret = ttm_bo_reserve(&nvbo->bo, true, false,
+true, sequence);
+   else {
+   validate = kzalloc(sizeof(*validate), GFP_KERNEL);
+   if (validate) {
+   if (gem->import_attach)
+   validate->bo =
+   gem->import_attach->dmabuf;
+   else
+   validate->bo = gem->export_dma_buf;
+   validate->priv = nvbo;
+   } else
+   ret = -ENOMEM;
+   }
if (ret) {
validate_fini(op, NULL);
if (unlikely(ret == -EAGAIN))
@@ -366,6 +412,9 @@ retry:
b->user_priv = (uint64_t)(unsigned long)nvbo;
nvbo->reserved_by = file_priv;
nvbo->pbbo_index = i;
+   if (is_prime) {
+   list_add_tail(&validate->head, &op->prime_list);
+   } else
if ((b->valid_domains & NOUVEAU_GEM_DOMAIN_VRAM) &&
(b->valid_domains & NOUVEAU_GEM_DOMAIN_GART))
list_add_tail(&nvbo->entry, &op->both_list);
@@ -473,6 +522,60 @@ validate_list(struct nouveau_channel *chan, struct 
list_head *list,
 }
 
 static int
+validate_prime(struct nouveau_chann

[RFC PATCH 5/8] nouveau: Add methods preparing for prime fencing

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

This can be used by nv84 and nvc0 to implement hardware fencing,
earlier systems will require more thought but can fall back to
software for now.

Signed-off-by: Maarten Lankhorst 

---
 drivers/gpu/drm/nouveau/nouveau_bo.c  |6 +-
 drivers/gpu/drm/nouveau/nouveau_channel.c |2 +-
 drivers/gpu/drm/nouveau/nouveau_display.c |2 +-
 drivers/gpu/drm/nouveau/nouveau_dma.h |1 +
 drivers/gpu/drm/nouveau/nouveau_drv.h |5 +
 drivers/gpu/drm/nouveau/nouveau_fence.c   |  242 -
 drivers/gpu/drm/nouveau/nouveau_fence.h   |   44 +-
 drivers/gpu/drm/nouveau/nouveau_gem.c |6 +-
 drivers/gpu/drm/nouveau/nouveau_prime.c   |2 +
 drivers/gpu/drm/nouveau/nv04_fence.c  |4 +-
 drivers/gpu/drm/nouveau/nv10_fence.c  |4 +-
 drivers/gpu/drm/nouveau/nv84_fence.c  |4 +-
 drivers/gpu/drm/nouveau/nvc0_fence.c  |4 +-
 13 files changed, 304 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c 
b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 4318320..a97025a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -52,6 +52,9 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo)
DRM_ERROR("bo %p still attached to GEM object\n", bo);
 
nv10_mem_put_tile_region(dev, nvbo->tile, NULL);
+
+   if (nvbo->fence_import_attach)
+   nouveau_fence_prime_del_bo(nvbo);
kfree(nvbo);
 }
 
@@ -109,6 +112,7 @@ nouveau_bo_new(struct drm_device *dev, int size, int align,
INIT_LIST_HEAD(&nvbo->head);
INIT_LIST_HEAD(&nvbo->entry);
INIT_LIST_HEAD(&nvbo->vma_list);
+   INIT_LIST_HEAD(&nvbo->prime_chan_entries);
nvbo->tile_mode = tile_mode;
nvbo->tile_flags = tile_flags;
nvbo->bo.bdev = &dev_priv->ttm.bdev;
@@ -480,7 +484,7 @@ nouveau_bo_move_accel_cleanup(struct nouveau_channel *chan,
struct nouveau_fence *fence = NULL;
int ret;
 
-   ret = nouveau_fence_new(chan, &fence);
+   ret = nouveau_fence_new(chan, &fence, false);
if (ret)
return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c 
b/drivers/gpu/drm/nouveau/nouveau_channel.c
index 629d8a2..85a8556 100644
--- a/drivers/gpu/drm/nouveau/nouveau_channel.c
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
@@ -362,7 +362,7 @@ nouveau_channel_idle(struct nouveau_channel *chan)
struct nouveau_fence *fence = NULL;
int ret;
 
-   ret = nouveau_fence_new(chan, &fence);
+   ret = nouveau_fence_new(chan, &fence, false);
if (!ret) {
ret = nouveau_fence_wait(fence, false, false);
nouveau_fence_unref(&fence);
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c 
b/drivers/gpu/drm/nouveau/nouveau_display.c
index 69688ef..7c76776 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -466,7 +466,7 @@ nouveau_page_flip_emit(struct nouveau_channel *chan,
}
FIRE_RING (chan);
 
-   ret = nouveau_fence_new(chan, pfence);
+   ret = nouveau_fence_new(chan, pfence, false);
if (ret)
goto fail;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_dma.h 
b/drivers/gpu/drm/nouveau/nouveau_dma.h
index 8db68be..d02ffd3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dma.h
+++ b/drivers/gpu/drm/nouveau/nouveau_dma.h
@@ -74,6 +74,7 @@ enum {
NvEvoSema0  = 0x8010,
NvEvoSema1  = 0x8011,
NvNotify1   = 0x8012,
+   NvSemaPrime = 0x801f,
 
/* G80+ display objects */
NvEvoVRAM   = 0x0100,
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h 
b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 2c17989..ad49594 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -126,6 +126,11 @@ struct nouveau_bo {
 
struct ttm_bo_kmap_obj dma_buf_vmap;
int vmapping_count;
+
+   /* fence related stuff */
+   struct nouveau_bo *sync_bo;
+   struct list_head prime_chan_entries;
+   struct dma_buf_attachment *fence_import_attach;
 };
 
 #define nouveau_bo_tile_layout(nvbo)   \
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c 
b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 3c18049..d4c9c40 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -29,17 +29,64 @@
 
 #include 
 #include 
+#include 
 
 #include "nouveau_drv.h"
 #include "nouveau_ramht.h"
 #include "nouveau_fence.h"
 #include "nouveau_software.h"
 #include "nouveau_dma.h"
+#include "nouveau_fifo.h"
+
+int nouveau_fence_prime_init(struct drm_device *dev,
+struct nouveau_fence_priv *priv, u32 align)
+{
+   int ret = 0;
+#ifdef CONFIG_DMA_SHARED_BUFFER
+   struct nouveau_fifo_priv *pfifo = nv_engine(dev, NVOBJ_ENGINE_FIFO);
+   u32 size = PAGE_AL

[RFC PATCH 7/8] nouveau: nvc0 fence prime implementation

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

Create a read-only mapping for every imported bo, and create a prime
bo in in system memory.

Signed-off-by: Maarten Lankhorst 
---
 drivers/gpu/drm/nouveau/nvc0_fence.c |  104 +-
 1 file changed, 89 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvc0_fence.c 
b/drivers/gpu/drm/nouveau/nvc0_fence.c
index 198e31f..dc6ccab 100644
--- a/drivers/gpu/drm/nouveau/nvc0_fence.c
+++ b/drivers/gpu/drm/nouveau/nvc0_fence.c
@@ -37,6 +37,7 @@ struct nvc0_fence_priv {
 struct nvc0_fence_chan {
struct nouveau_fence_chan base;
struct nouveau_vma vma;
+   struct nouveau_vma prime_vma;
 };
 
 static int
@@ -45,19 +46,23 @@ nvc0_fence_emit(struct nouveau_fence *fence, bool prime)
struct nouveau_channel *chan = fence->channel;
struct nvc0_fence_chan *fctx = chan->engctx[NVOBJ_ENGINE_FENCE];
u64 addr = fctx->vma.offset + chan->id * 16;
-   int ret;
+   int ret, i;
 
-   ret = RING_SPACE(chan, 5);
-   if (ret == 0) {
+   ret = RING_SPACE(chan, prime ? 10 : 5);
+   if (ret)
+   return ret;
+
+   for (i = 0; i < (prime ? 2 : 1); ++i) {
+   if (i)
+   addr = fctx->prime_vma.offset + chan->id * 16;
BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4);
OUT_RING  (chan, upper_32_bits(addr));
OUT_RING  (chan, lower_32_bits(addr));
OUT_RING  (chan, fence->sequence);
OUT_RING  (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG);
-   FIRE_RING (chan);
}
-
-   return ret;
+   FIRE_RING(chan);
+   return 0;
 }
 
 static int
@@ -95,6 +100,8 @@ nvc0_fence_context_del(struct nouveau_channel *chan, int 
engine)
struct nvc0_fence_priv *priv = nv_engine(chan->dev, engine);
struct nvc0_fence_chan *fctx = chan->engctx[engine];
 
+   if (priv->base.prime_bo)
+   nouveau_bo_vma_del(priv->base.prime_bo, &fctx->prime_vma);
nouveau_bo_vma_del(priv->bo, &fctx->vma);
nouveau_fence_context_del(chan->dev, &fctx->base);
chan->engctx[engine] = NULL;
@@ -115,10 +122,16 @@ nvc0_fence_context_new(struct nouveau_channel *chan, int 
engine)
nouveau_fence_context_new(&fctx->base);
 
ret = nouveau_bo_vma_add(priv->bo, chan->vm, &fctx->vma);
+   if (!ret && priv->base.prime_bo)
+   ret = nouveau_bo_vma_add(priv->base.prime_bo, chan->vm,
+&fctx->prime_vma);
if (ret)
nvc0_fence_context_del(chan, engine);
 
-   nouveau_bo_wr32(priv->bo, chan->id * 16/4, 0x);
+   fctx->base.sequence = nouveau_bo_rd32(priv->bo, chan->id * 16/4);
+   if (priv->base.prime_bo)
+   nouveau_bo_wr32(priv->base.prime_bo, chan->id * 16/4,
+   fctx->base.sequence);
return ret;
 }
 
@@ -140,12 +153,55 @@ nvc0_fence_destroy(struct drm_device *dev, int engine)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nvc0_fence_priv *priv = nv_engine(dev, engine);
 
+   nouveau_fence_prime_del(&priv->base);
nouveau_bo_unmap(priv->bo);
+   nouveau_bo_unpin(priv->bo);
nouveau_bo_ref(NULL, &priv->bo);
dev_priv->eng[engine] = NULL;
kfree(priv);
 }
 
+static int
+nvc0_fence_prime_sync(struct nouveau_channel *chan,
+ struct nouveau_bo *bo,
+ u32 ofs, u32 val, u64 sema_start)
+{
+   struct nvc0_fence_chan *fctx = chan->engctx[NVOBJ_ENGINE_FENCE];
+   struct nvc0_fence_priv *priv = nv_engine(chan->dev, NVOBJ_ENGINE_FENCE);
+   int ret = RING_SPACE(chan, 5);
+   if (ret)
+   return ret;
+
+   if (bo == priv->base.prime_bo)
+   sema_start = fctx->prime_vma.offset;
+   else
+   NV_ERROR(chan->dev, "syncing with %08Lx + %08x >= %08x\n",
+   sema_start, ofs, val);
+   sema_start += ofs;
+
+   BEGIN_NVC0(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4);
+   OUT_RING  (chan, upper_32_bits(sema_start));
+   OUT_RING  (chan, lower_32_bits(sema_start));
+   OUT_RING  (chan, val);
+   OUT_RING  (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_GEQUAL |
+NVC0_SUBCHAN_SEMAPHORE_TRIGGER_YIELD);
+   FIRE_RING (chan);
+   return ret;
+}
+
+static void
+nvc0_fence_prime_del_import(struct nouveau_fence_prime_bo_entry *entry) {
+   nouveau_bo_vma_del(entry->bo, &entry->vma);
+}
+
+static int
+nvc0_fence_prime_add_import(struct nouveau_fence_prime_bo_entry *entry) {
+   int ret = nouveau_bo_vma_add_access(entry->bo, entry->chan->vm,
+   &entry->vma, NV_MEM_ACCESS_RO);
+   entry->sema_start = entry->vma.offset;
+   return ret;
+}
+
 int
 nvc0_fence_create(struct drm_device *dev)
 {
@@ -168,17 +224,35 @@ nvc0_fence_create

[RFC PATCH 6/8] nouveau: nv84 fence prime implementation

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

Create a dma object for the prime semaphore and every imported sync bo.

Signed-off-by: Maarten Lankhorst 
---
 drivers/gpu/drm/nouveau/nv84_fence.c |  121 --
 1 file changed, 115 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nv84_fence.c 
b/drivers/gpu/drm/nouveau/nv84_fence.c
index b5cfbcb..f739dfc 100644
--- a/drivers/gpu/drm/nouveau/nv84_fence.c
+++ b/drivers/gpu/drm/nouveau/nv84_fence.c
@@ -31,6 +31,7 @@
 
 struct nv84_fence_chan {
struct nouveau_fence_chan base;
+   u32 sema_start;
 };
 
 struct nv84_fence_priv {
@@ -42,21 +43,25 @@ static int
 nv84_fence_emit(struct nouveau_fence *fence, bool prime)
 {
struct nouveau_channel *chan = fence->channel;
-   int ret = RING_SPACE(chan, 7);
-   if (ret == 0) {
+   int i, ret;
+
+   ret = RING_SPACE(chan, prime ? 14 : 7);
+   if (ret)
+   return ret;
+
+   for (i = 0; i < (prime ? 2 : 1); ++i) {
BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 1);
-   OUT_RING  (chan, NvSema);
+   OUT_RING  (chan, i ? NvSemaPrime : NvSema);
BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4);
OUT_RING  (chan, upper_32_bits(chan->id * 16));
OUT_RING  (chan, lower_32_bits(chan->id * 16));
OUT_RING  (chan, fence->sequence);
OUT_RING  (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG);
-   FIRE_RING (chan);
}
+   FIRE_RING (chan);
return ret;
 }
 
-
 static int
 nv84_fence_sync(struct nouveau_fence *fence,
struct nouveau_channel *prev, struct nouveau_channel *chan)
@@ -82,12 +87,94 @@ nv84_fence_read(struct nouveau_channel *chan)
return nv_ro32(priv->mem, chan->id * 16);
 }
 
+static int
+nv84_fence_prime_sync(struct nouveau_channel *chan,
+ struct nouveau_bo *bo,
+ u32 ofs, u32 val, u64 sema_start)
+{
+   struct nv84_fence_priv *priv = nv_engine(chan->dev, NVOBJ_ENGINE_FENCE);
+   int ret = RING_SPACE(chan, 7);
+   u32 sema = 0;
+   if (ret < 0)
+   return ret;
+
+   if (bo == priv->base.prime_bo) {
+   sema = NvSema;
+   } else {
+   struct sg_table *sgt = bo->bo.sg;
+   struct scatterlist *sg;
+   u32 i;
+   sema = sema_start;
+   for_each_sg(sgt->sgl, sg, sgt->nents, i) {
+   if (ofs < sg->offset + sg->length) {
+   ofs -= sg->offset;
+   break;
+   }
+   sema++;
+   }
+   }
+
+   BEGIN_NV04(chan, 0, NV11_SUBCHAN_DMA_SEMAPHORE, 1);
+   OUT_RING  (chan, sema);
+   BEGIN_NV04(chan, 0, NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH, 4);
+   OUT_RING  (chan, 0);
+   OUT_RING  (chan, ofs);
+   OUT_RING  (chan, val);
+   OUT_RING  (chan, NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_GEQUAL);
+   FIRE_RING (chan);
+   return ret;
+}
+
+static void
+nv84_fence_prime_del_import(struct nouveau_fence_prime_bo_entry *entry) {
+   u32 i;
+   for (i = entry->sema_start; i <  entry->sema_start + entry->sema_len; 
++i)
+   nouveau_ramht_remove(entry->chan, i);
+}
+
+static int
+nv84_fence_prime_add_import(struct nouveau_fence_prime_bo_entry *entry) {
+   struct sg_table *sgt = entry->bo->bo.sg;
+   struct nouveau_channel *chan = entry->chan;
+   struct nv84_fence_chan *fctx = chan->engctx[NVOBJ_ENGINE_FENCE];
+   struct scatterlist *sg;
+   u32 i, sema;
+   int ret;
+
+   sema = entry->sema_start = fctx->sema_start;
+   entry->sema_len = 0;
+
+   for_each_sg(sgt->sgl, sg, sgt->nents, i) {
+   struct nouveau_gpuobj *obj;
+   ret = nouveau_gpuobj_dma_new(chan, NV_CLASS_DMA_FROM_MEMORY,
+sg_dma_address(sg), PAGE_SIZE,
+NV_MEM_ACCESS_RO,
+NV_MEM_TARGET_PCI, &obj);
+   if (ret)
+   goto err;
+
+   ret = nouveau_ramht_insert(chan, sema, obj);
+   nouveau_gpuobj_ref(NULL, &obj);
+   if (ret)
+   goto err;
+   entry->sema_len++;
+   sema++;
+   }
+   fctx->sema_start += (entry->sema_len + 0xff) & ~0xff;
+   return 0;
+
+err:
+   nv84_fence_prime_del_import(entry);
+   return ret;
+}
+
 static void
 nv84_fence_context_del(struct nouveau_channel *chan, int engine)
 {
struct nv84_fence_chan *fctx = chan->engctx[engine];
nouveau_fence_context_del(chan->dev, &fctx->base);
chan->engctx[engine] = NULL;
+
kfree(fctx);
 }
 
@@ -104,6 +191,7 @@ nv84_fence_context_new(struct nouveau_channel *chan, int 
engine)
return -EN

[RFC PATCH 4/8] nouveau: add nouveau_bo_vma_add_access

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

This is needed to allow creation of read-only vm mappings
in fence objects.

Signed-off-by: Maarten Lankhorst 
---
 drivers/gpu/drm/nouveau/nouveau_bo.c  |6 +++---
 drivers/gpu/drm/nouveau/nouveau_drv.h |6 --
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c 
b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 7f80ed5..4318320 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1443,15 +1443,15 @@ nouveau_bo_vma_find(struct nouveau_bo *nvbo, struct 
nouveau_vm *vm)
 }
 
 int
-nouveau_bo_vma_add(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
-  struct nouveau_vma *vma)
+nouveau_bo_vma_add_access(struct nouveau_bo *nvbo, struct nouveau_vm *vm,
+ struct nouveau_vma *vma, u32 access)
 {
const u32 size = nvbo->bo.mem.num_pages << PAGE_SHIFT;
struct nouveau_mem *node = nvbo->bo.mem.mm_node;
int ret;
 
ret = nouveau_vm_get(vm, size, nvbo->page_shift,
-NV_MEM_ACCESS_RW, vma);
+access, vma);
if (ret)
return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h 
b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 7c52eba..2c17989 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -1350,8 +1350,10 @@ extern int nouveau_bo_validate(struct nouveau_bo *, bool 
interruptible,
 
 extern struct nouveau_vma *
 nouveau_bo_vma_find(struct nouveau_bo *, struct nouveau_vm *);
-extern int  nouveau_bo_vma_add(struct nouveau_bo *, struct nouveau_vm *,
-  struct nouveau_vma *);
+#define nouveau_bo_vma_add(nvbo, vm, vma) \
+   nouveau_bo_vma_add_access((nvbo), (vm), (vma), NV_MEM_ACCESS_RW)
+extern int nouveau_bo_vma_add_access(struct nouveau_bo *, struct nouveau_vm *,
+struct nouveau_vma *, u32 access);
 extern void nouveau_bo_vma_del(struct nouveau_bo *, struct nouveau_vma *);
 
 /* nouveau_gem.c */
-- 
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 PATCH 3/8] nouveau: Extend prime code

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

The prime code no longer requires the bo to be backed by a gem object,
and cpu access calls have been implemented. This will be needed for
exporting fence bo's.

Signed-off-by: Maarten Lankhorst 
---
 drivers/gpu/drm/nouveau/nouveau_drv.h   |6 +-
 drivers/gpu/drm/nouveau/nouveau_prime.c |  106 +--
 2 files changed, 79 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h 
b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 8613cb2..7c52eba 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -1374,11 +1374,15 @@ extern int nouveau_gem_ioctl_cpu_fini(struct drm_device 
*, void *,
 extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
  struct drm_file *);
 
+extern int nouveau_gem_prime_export_bo(struct nouveau_bo *nvbo, int flags,
+  u32 size, struct dma_buf **ret);
 extern struct dma_buf *nouveau_gem_prime_export(struct drm_device *dev,
struct drm_gem_object *obj, int flags);
 extern struct drm_gem_object *nouveau_gem_prime_import(struct drm_device *dev,
struct dma_buf *dma_buf);
-
+extern int nouveau_prime_import_bo(struct drm_device *dev,
+  struct dma_buf *dma_buf,
+  struct nouveau_bo **pnvbo, bool gem);
 /* nouveau_display.c */
 int nouveau_display_create(struct drm_device *dev);
 void nouveau_display_destroy(struct drm_device *dev);
diff --git a/drivers/gpu/drm/nouveau/nouveau_prime.c 
b/drivers/gpu/drm/nouveau/nouveau_prime.c
index a25cf2c..537154d3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_prime.c
+++ b/drivers/gpu/drm/nouveau/nouveau_prime.c
@@ -35,7 +35,8 @@ static struct sg_table *nouveau_gem_map_dma_buf(struct 
dma_buf_attachment *attac
  enum dma_data_direction dir)
 {
struct nouveau_bo *nvbo = attachment->dmabuf->priv;
-   struct drm_device *dev = nvbo->gem->dev;
+   struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev);
+   struct drm_device *dev = dev_priv->dev;
int npages = nvbo->bo.num_pages;
struct sg_table *sg;
int nents;
@@ -59,29 +60,37 @@ static void nouveau_gem_dmabuf_release(struct dma_buf 
*dma_buf)
 {
struct nouveau_bo *nvbo = dma_buf->priv;
 
-   if (nvbo->gem->export_dma_buf == dma_buf) {
-   nvbo->gem->export_dma_buf = NULL;
+   nouveau_bo_unpin(nvbo);
+   if (!nvbo->gem)
+   nouveau_bo_ref(NULL, &nvbo);
+   else {
+   if (nvbo->gem->export_dma_buf == dma_buf)
+   nvbo->gem->export_dma_buf = NULL;
drm_gem_object_unreference_unlocked(nvbo->gem);
}
 }
 
 static void *nouveau_gem_kmap_atomic(struct dma_buf *dma_buf, unsigned long 
page_num)
 {
-   return NULL;
+   struct nouveau_bo *nvbo = dma_buf->priv;
+   return kmap_atomic(nvbo->bo.ttm->pages[page_num]);
 }
 
 static void nouveau_gem_kunmap_atomic(struct dma_buf *dma_buf, unsigned long 
page_num, void *addr)
 {
-
+   kunmap_atomic(addr);
 }
+
 static void *nouveau_gem_kmap(struct dma_buf *dma_buf, unsigned long page_num)
 {
-   return NULL;
+   struct nouveau_bo *nvbo = dma_buf->priv;
+   return kmap(nvbo->bo.ttm->pages[page_num]);
 }
 
 static void nouveau_gem_kunmap(struct dma_buf *dma_buf, unsigned long 
page_num, void *addr)
 {
-
+   struct nouveau_bo *nvbo = dma_buf->priv;
+   return kunmap(nvbo->bo.ttm->pages[page_num]);
 }
 
 static int nouveau_gem_prime_mmap(struct dma_buf *dma_buf, struct 
vm_area_struct *vma)
@@ -92,7 +101,8 @@ static int nouveau_gem_prime_mmap(struct dma_buf *dma_buf, 
struct vm_area_struct
 static void *nouveau_gem_prime_vmap(struct dma_buf *dma_buf)
 {
struct nouveau_bo *nvbo = dma_buf->priv;
-   struct drm_device *dev = nvbo->gem->dev;
+   struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev);
+   struct drm_device *dev = dev_priv->dev;
int ret;
 
mutex_lock(&dev->struct_mutex);
@@ -116,7 +126,8 @@ out_unlock:
 static void nouveau_gem_prime_vunmap(struct dma_buf *dma_buf, void *vaddr)
 {
struct nouveau_bo *nvbo = dma_buf->priv;
-   struct drm_device *dev = nvbo->gem->dev;
+   struct drm_nouveau_private *dev_priv = nouveau_bdev(nvbo->bo.bdev);
+   struct drm_device *dev = dev_priv->dev;
 
mutex_lock(&dev->struct_mutex);
nvbo->vmapping_count--;
@@ -140,10 +151,9 @@ static const struct dma_buf_ops nouveau_dmabuf_ops =  {
 };
 
 static int
-nouveau_prime_new(struct drm_device *dev,
- size_t size,
+nouveau_prime_new(struct drm_device *dev, size_t size,
  struct sg_table *sg,
- struct nouveau_bo **pnvbo)
+ struct nouveau_bo **pnvbo, bool gem)
 {
struct nouveau_bo *nvbo;
u32 flag

[RFC PATCH 2/8] prime wip: i915

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

Export the hardware status page so others can read seqno.

Signed-off-by: Maarten Lankhorst 

---
 drivers/gpu/drm/i915/i915_gem_dmabuf.c |   29 --
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   87 
 drivers/gpu/drm/i915/intel_ringbuffer.c|   42 ++
 drivers/gpu/drm/i915/intel_ringbuffer.h|3 +
 4 files changed, 145 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c 
b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
index aa308e1..d6bcfdc 100644
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
@@ -66,12 +66,25 @@ static void i915_gem_unmap_dma_buf(struct 
dma_buf_attachment *attachment,
 static void i915_gem_dmabuf_release(struct dma_buf *dma_buf)
 {
struct drm_i915_gem_object *obj = dma_buf->priv;
+   struct drm_device *dev = obj->base.dev;
+
+   mutex_lock(&dev->struct_mutex);
 
if (obj->base.export_dma_buf == dma_buf) {
-   /* drop the reference on the export fd holds */
obj->base.export_dma_buf = NULL;
-   drm_gem_object_unreference_unlocked(&obj->base);
+   } else {
+   drm_i915_private_t *dev_priv = dev->dev_private;
+   struct intel_ring_buffer *ring;
+   int i;
+
+   for_each_ring(ring, dev_priv, i)
+   WARN_ON(ring->sync_buf == dma_buf);
}
+
+   /* drop the reference on the export fd holds */
+   drm_gem_object_unreference(&obj->base);
+
+   mutex_unlock(&dev->struct_mutex);
 }
 
 static void *i915_gem_dmabuf_vmap(struct dma_buf *dma_buf)
@@ -129,21 +142,25 @@ static void i915_gem_dmabuf_vunmap(struct dma_buf 
*dma_buf, void *vaddr)
 
 static void *i915_gem_dmabuf_kmap_atomic(struct dma_buf *dma_buf, unsigned 
long page_num)
 {
-   return NULL;
+   struct drm_i915_gem_object *obj = dma_buf->priv;
+   return kmap_atomic(obj->pages[page_num]);
 }
 
 static void i915_gem_dmabuf_kunmap_atomic(struct dma_buf *dma_buf, unsigned 
long page_num, void *addr)
 {
-
+   kunmap_atomic(addr);
 }
+
 static void *i915_gem_dmabuf_kmap(struct dma_buf *dma_buf, unsigned long 
page_num)
 {
-   return NULL;
+   struct drm_i915_gem_object *obj = dma_buf->priv;
+   return kmap(obj->pages[page_num]);
 }
 
 static void i915_gem_dmabuf_kunmap(struct dma_buf *dma_buf, unsigned long 
page_num, void *addr)
 {
-
+   struct drm_i915_gem_object *obj = dma_buf->priv;
+   kunmap(obj->pages[page_num]);
 }
 
 static int i915_gem_dmabuf_mmap(struct dma_buf *dma_buf, struct vm_area_struct 
*vma)
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c 
b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 88e2e11..245340e 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -33,6 +33,7 @@
 #include "i915_trace.h"
 #include "intel_drv.h"
 #include 
+#include 
 
 struct change_domains {
uint32_t invalidate_domains;
@@ -556,7 +557,8 @@ err_unpin:
 static int
 i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
struct drm_file *file,
-   struct list_head *objects)
+   struct list_head *objects,
+   struct list_head *prime_val)
 {
drm_i915_private_t *dev_priv = ring->dev->dev_private;
struct drm_i915_gem_object *obj;
@@ -564,6 +566,31 @@ i915_gem_execbuffer_reserve(struct intel_ring_buffer *ring,
bool has_fenced_gpu_access = INTEL_INFO(ring->dev)->gen < 4;
struct list_head ordered_objects;
 
+   list_for_each_entry(obj, objects, exec_list) {
+   struct dmabufmgr_validate *val;
+
+   if (!(obj->base.import_attach ||
+ obj->base.export_dma_buf))
+   continue;
+
+   val = kzalloc(sizeof(*val), GFP_KERNEL);
+   if (!val)
+   return -ENOMEM;
+
+   if (obj->base.export_dma_buf)
+   val->bo = obj->base.export_dma_buf;
+   else
+   val->bo = obj->base.import_attach->dmabuf;
+   val->priv = obj;
+   list_add_tail(&val->head, prime_val);
+   }
+
+   if (!list_empty(prime_val)) {
+   ret = dmabufmgr_eu_reserve_buffers(prime_val);
+   if (ret)
+   return ret;
+   }
+
INIT_LIST_HEAD(&ordered_objects);
while (!list_empty(objects)) {
struct drm_i915_gem_exec_object2 *entry;
@@ -712,6 +739,7 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
  struct drm_file *file,
  struct intel_ring_buffer *ring,
  struct list_head *objects,
+ struct list_head *prime_val,
  struct eb_o

[RFC PATCH 1/8] dma-buf-mgr: Try 2

2012-07-10 Thread Maarten Lankhorst
From: Maarten Lankhorst 

Core code based on ttm_bo and ttm_execbuf_util

Signed-off-by: Maarten Lankhorst 

---
 drivers/base/Makefile |2 +-
 drivers/base/dma-buf-mgr-eu.c |  263 +
 drivers/base/dma-buf-mgr.c|  149 +++
 drivers/base/dma-buf.c|4 +
 include/linux/dma-buf-mgr.h   |  150 +++
 include/linux/dma-buf.h   |   24 
 6 files changed, 591 insertions(+), 1 deletion(-)
 create mode 100644 drivers/base/dma-buf-mgr-eu.c
 create mode 100644 drivers/base/dma-buf-mgr.c
 create mode 100644 include/linux/dma-buf-mgr.h

diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 5aa2d70..86e7598 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_CMA) += dma-contiguous.o
 obj-y  += power/
 obj-$(CONFIG_HAS_DMA)  += dma-mapping.o
 obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
-obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf.o
+obj-$(CONFIG_DMA_SHARED_BUFFER) += dma-buf.o dma-buf-mgr.o dma-buf-mgr-eu.o
 obj-$(CONFIG_ISA)  += isa.o
 obj-$(CONFIG_FW_LOADER)+= firmware_class.o
 obj-$(CONFIG_NUMA) += node.o
diff --git a/drivers/base/dma-buf-mgr-eu.c b/drivers/base/dma-buf-mgr-eu.c
new file mode 100644
index 000..ed5e01c
--- /dev/null
+++ b/drivers/base/dma-buf-mgr-eu.c
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2012 Canonical Ltd
+ *
+ * Based on ttm_bo.c which bears the following copyright notice,
+ * but is dual licensed:
+ *
+ * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **/
+
+#include 
+#include 
+#include 
+
+static void dmabufmgr_eu_backoff_reservation_locked(struct list_head *list)
+{
+   struct dmabufmgr_validate *entry;
+
+   list_for_each_entry(entry, list, head) {
+   struct dma_buf *bo = entry->bo;
+   if (!entry->reserved)
+   continue;
+   entry->reserved = false;
+
+   bo->sync_buf = entry->sync_buf;
+   entry->sync_buf = NULL;
+
+   atomic_set(&bo->reserved, 0);
+   wake_up_all(&bo->event_queue);
+   }
+}
+
+static int
+dmabufmgr_eu_wait_unreserved_locked(struct list_head *list,
+   struct dma_buf *bo)
+{
+   int ret;
+
+   spin_unlock(&dmabufmgr.lru_lock);
+   ret = dmabufmgr_bo_wait_unreserved(bo, true);
+   spin_lock(&dmabufmgr.lru_lock);
+   if (unlikely(ret != 0))
+   dmabufmgr_eu_backoff_reservation_locked(list);
+   return ret;
+}
+
+void
+dmabufmgr_eu_backoff_reservation(struct list_head *list)
+{
+   if (list_empty(list))
+   return;
+
+   spin_lock(&dmabufmgr.lru_lock);
+   dmabufmgr_eu_backoff_reservation_locked(list);
+   spin_unlock(&dmabufmgr.lru_lock);
+}
+EXPORT_SYMBOL_GPL(dmabufmgr_eu_backoff_reservation);
+
+int
+dmabufmgr_eu_reserve_buffers(struct list_head *list)
+{
+   struct dmabufmgr_validate *entry;
+   int ret;
+   u32 val_seq;
+
+   if (list_empty(list))
+   return 0;
+
+   list_for_each_entry(entry, list, head) {
+   entry->reserved = false;
+   entry->sync_buf = NULL;
+   }
+
+retry:
+   spin_lock(&dmabufmgr.lru_lock);
+   val_seq = dmabufmgr.counter++;
+
+   list_for_each_entry(entry, list, head) {
+   struct dma_buf *bo = entry->bo;
+
+retry_this_bo:
+   ret = dmabufmgr_bo_reserve_locked(bo, true, true, true, 
val_seq);
+   switch (ret) {
+   case 0:
+   break;
+   case -EBUSY:
+   ret = dmabufmgr_eu_wait_unreserved_locked(list, bo);
+ 

[RFC PATCH 0/8] Dmabuf synchronization

2012-07-10 Thread Maarten Lankhorst
This patch implements my attempt at dmabuf synchronization.
The core idea is that a lot of devices will have their own
methods of synchronization, but more complicated devices
allow some way of fencing, so why not export those as
dma-buf?

This patchset implements dmabufmgr, which is based on ttm's code.
The ttm code deals with a lot more than just reservation however, 
I took out almost all the code not dealing with reservations.

I used the drm-intel-next-queued tree as base. It contains some i915
flushing changes. I would rather use linux-next, but the deferred
fput code makes my system unbootable. That is unfortunate since
it would reduce the deadlocks happening in dma_buf_put when 2
devices release each other's dmabuf.

The i915 changes implement a simple cpu wait only, the nouveau code
imports the sync dmabuf read-only and maps it to affected channels,
then performs a wait on it in hardware. Since the hardware may still
be processing other commands, it could be the case that no hardware
wait would have to be performed at all.

Only the nouveau nv84 code is tested, but the nvc0 code should work
as well.

--
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] media/video: vpif: fixed vpfe->vpif typo

2012-07-10 Thread Dror Cohen

Signed-off-by: Dror Cohen 
---
 drivers/media/video/davinci/vpif_capture.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/davinci/vpif_capture.c 
b/drivers/media/video/davinci/vpif_capture.c
index 9604695..ce334e2 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -703,7 +703,7 @@ static void vpif_config_addr(struct channel_obj *ch, int 
muxmode)
 }
 
 /**
- * vpfe_mmap : It is used to map kernel space buffers into user spaces
+ * vpif_mmap : It is used to map kernel space buffers into user spaces
  * @filep: file pointer
  * @vma: ptr to vm_area_struct
  */
@@ -812,7 +812,7 @@ static int vpif_open(struct file *filep)
  * vpif_release : function to clean up file close
  * @filep: file pointer
  *
- * This function deletes buffer queue, frees the buffers and the vpfe file
+ * This function deletes buffer queue, frees the buffers and the vpif file
  * handle
  */
 static int vpif_release(struct file *filep)
-- 
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] media/video: vpif: fixed vpfe->vpif typo

2012-07-10 Thread Dror Cohen
This patch fixes two typos in function documentation from vpfe to vpif

--
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: pctv452e

2012-07-10 Thread Antti Palosaari

On 07/10/2012 09:39 AM, Marx wrote:

On 09.07.2012 19:46, Antti Palosaari wrote:


# tune to channel:
szap -r "CHANNEL NAME"

-r option is important here as it routes stream to /dev/dvb/adapter0/dvr0


done


# dump channels from tuned multiplex (if you don't have that command
just skip):
scandvb -c


marx@wuwek:~/zmaz$ scan -c
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
0x 0x10d7: pmt_pid 0x0104 TVN -- TVN (running, scrambled)
0x 0x10d8: pmt_pid 0x0105 TVN -- TVN 24 (running, scrambled)
0x 0x10d9: pmt_pid 0x0106 TVN -- TVN Siedem (running, scrambled)
0x 0x10da: pmt_pid 0x0107 TVN -- nSport (running, scrambled)
0x 0x10dc: pmt_pid 0x0109 TVN -- Mango 24 (running)
0x 0x10dd: pmt_pid 0x010a ITI -- TTV (running, scrambled)
0x 0x10de: pmt_pid 0x010b TVN -- TVN Meteo (running, scrambled)
0x 0x10df: pmt_pid 0x010c TVN -- TVN Turbo (running, scrambled)
0x 0x10e0: pmt_pid 0x010d TVN -- TVN Style (running, scrambled)
0x 0x10e1: pmt_pid 0x010e TVN -- Test (running, scrambled)
0x 0x10e2: pmt_pid 0x010f TVN -- TVN CNBC (running, scrambled)
0x 0x10ed: pmt_pid 0x0118 TVN -- Test_Radio (running)
0x 0x3aca: pmt_pid 0x0101 TVN -- Upload (running)
dumping lists (13 services)
TVN  (0x10d7) 01: PCR == V   V 0x0200 A 0x028a (pol)
TT 0x0240 AC3 0x028b SUB 0x1771
TVN 24   (0x10d8) 01: PCR == V   V 0x0201 A 0x0294 (pol)
0x0295 (org) SUB 0x177c
TVN Siedem   (0x10d9) 01: PCR == V   V 0x0202 A 0x029e (pol)
TT 0x0242 AC3 0x029f SUB 0x1772
nSport   (0x10da) 01: PCR == V   V 0x0203 A 0x02a8 (pol)
Mango 24 (0x10dc) 01: PCR == V   V 0x0205 A 0x02bc (pol)
TT 0x0245
TTV  (0x10dd) 01: PCR == V   V 0x0206 A 0x02c6 (pol)
TT 0x0246 AC3 0x02c7
TVN Meteo(0x10de) 01: PCR == V   V 0x0207 A 0x02d0 (pol)
0x02d1 (org) SUB 0x1782
TVN Turbo(0x10df) 01: PCR == V   V 0x0208 A 0x02da (pol)
TT 0x0247 AC3 0x02db SUB 0x1773
TVN Style(0x10e0) 01: PCR == V   V 0x0209 A 0x02e4 (pol)
TT 0x0248 AC3 0x02e5 SUB 0x1774
Test (0x10e1) 01: PCR == V   V 0x020a A 0x02ee (pol)
TT 0x0249
TVN CNBC (0x10e2) 01: PCR == V   V 0x020b A 0x02f8 (pol)
Test_Radio   (0x10ed) 02: PCR == AA 0x0320 (eng)
Upload   (0x3aca) 01: PCR 0x1fff
Done.




Could be named as scan, dvbscan, scandvb


# save tuned channel to file (lets say 20 second):
cat /dev/dvb/adapter0/dvr0 > test.ts



actually seems like ffmpeg could read directly dvr0
ffmpeg -i /dev/dvb/adapter0/dvr0
takes ~20 seconds or so until results are shown


marx@wuwek:~/zmaz$ ffmpeg -i /dev/dvb/adapter0/dvr0
p11-kit: couldn't load module:
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so:
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open
shared object file: No such file or directory
ffmpeg version 0.8.3-6:0.8.3-4, Copyright (c) 2000-2012 the Libav
developers
   built on Jun 26 2012 07:23:46 with gcc 4.7.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a
future release. Please use avconv instead.
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 5 got 6
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 0 got 1
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 2 got 3
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 5 got 6
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 15 got 0
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 7 got 8
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 11 got 12
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 13 got 14
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 7 got 8
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 15 got 0
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 4 got 5
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 10 got 11
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 2 got 4
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 5 got 3
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 11 got 12
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 14 got 15
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 1 got 2
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 10 got 11
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 1 got 2
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 3 got 1
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 7 got 9
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 10 got 9





# check if ffmpeg finds video and audio
ffmpeg -i test.ts

marx@wuwek:~/zmaz$ ffmpeg -i test.ts
p11-kit: couldn't load module:
/usr/lib/i386-linux

Re: pctv452e

2012-07-10 Thread Marx

On 09.07.2012 19:46, Antti Palosaari wrote:


# tune to channel:
szap -r "CHANNEL NAME"

-r option is important here as it routes stream to /dev/dvb/adapter0/dvr0


done


# dump channels from tuned multiplex (if you don't have that command
just skip):
scandvb -c


marx@wuwek:~/zmaz$ scan -c
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'
0x 0x10d7: pmt_pid 0x0104 TVN -- TVN (running, scrambled)
0x 0x10d8: pmt_pid 0x0105 TVN -- TVN 24 (running, scrambled)
0x 0x10d9: pmt_pid 0x0106 TVN -- TVN Siedem (running, scrambled)
0x 0x10da: pmt_pid 0x0107 TVN -- nSport (running, scrambled)
0x 0x10dc: pmt_pid 0x0109 TVN -- Mango 24 (running)
0x 0x10dd: pmt_pid 0x010a ITI -- TTV (running, scrambled)
0x 0x10de: pmt_pid 0x010b TVN -- TVN Meteo (running, scrambled)
0x 0x10df: pmt_pid 0x010c TVN -- TVN Turbo (running, scrambled)
0x 0x10e0: pmt_pid 0x010d TVN -- TVN Style (running, scrambled)
0x 0x10e1: pmt_pid 0x010e TVN -- Test (running, scrambled)
0x 0x10e2: pmt_pid 0x010f TVN -- TVN CNBC (running, scrambled)
0x 0x10ed: pmt_pid 0x0118 TVN -- Test_Radio (running)
0x 0x3aca: pmt_pid 0x0101 TVN -- Upload (running)
dumping lists (13 services)
TVN  (0x10d7) 01: PCR == V   V 0x0200 A 0x028a (pol) 
TT 0x0240 AC3 0x028b SUB 0x1771
TVN 24   (0x10d8) 01: PCR == V   V 0x0201 A 0x0294 (pol) 
0x0295 (org) SUB 0x177c
TVN Siedem   (0x10d9) 01: PCR == V   V 0x0202 A 0x029e (pol) 
TT 0x0242 AC3 0x029f SUB 0x1772

nSport   (0x10da) 01: PCR == V   V 0x0203 A 0x02a8 (pol)
Mango 24 (0x10dc) 01: PCR == V   V 0x0205 A 0x02bc (pol) 
TT 0x0245
TTV  (0x10dd) 01: PCR == V   V 0x0206 A 0x02c6 (pol) 
TT 0x0246 AC3 0x02c7
TVN Meteo(0x10de) 01: PCR == V   V 0x0207 A 0x02d0 (pol) 
0x02d1 (org) SUB 0x1782
TVN Turbo(0x10df) 01: PCR == V   V 0x0208 A 0x02da (pol) 
TT 0x0247 AC3 0x02db SUB 0x1773
TVN Style(0x10e0) 01: PCR == V   V 0x0209 A 0x02e4 (pol) 
TT 0x0248 AC3 0x02e5 SUB 0x1774
Test (0x10e1) 01: PCR == V   V 0x020a A 0x02ee (pol) 
TT 0x0249

TVN CNBC (0x10e2) 01: PCR == V   V 0x020b A 0x02f8 (pol)
Test_Radio   (0x10ed) 02: PCR == AA 0x0320 (eng)
Upload   (0x3aca) 01: PCR 0x1fff
Done.




Could be named as scan, dvbscan, scandvb


# save tuned channel to file (lets say 20 second):
cat /dev/dvb/adapter0/dvr0 > test.ts



actually seems like ffmpeg could read directly dvr0
ffmpeg -i /dev/dvb/adapter0/dvr0
takes ~20 seconds or so until results are shown


marx@wuwek:~/zmaz$ ffmpeg -i /dev/dvb/adapter0/dvr0
p11-kit: couldn't load module: 
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: 
/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open 
shared object file: No such file or directory

ffmpeg version 0.8.3-6:0.8.3-4, Copyright (c) 2000-2012 the Libav developers
  built on Jun 26 2012 07:23:46 with gcc 4.7.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a 
future release. Please use avconv instead.

[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 5 got 6
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 0 got 1
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 2 got 3
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 5 got 6
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 15 got 0
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 7 got 8
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 11 got 12
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 13 got 14
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 7 got 8
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 15 got 0
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 4 got 5
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 10 got 11
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 2 got 4
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 5 got 3
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 11 got 12
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 14 got 15
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 1 got 2
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 10 got 11
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 1 got 2
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 3 got 1
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 7 got 9
[mpegts @ 0x8cd5900] Continuity check failed for pid 520 expected 10 got 9





# check if ffmpeg finds video and audio
ffmpeg -i test.ts

marx@wuwek:~/zmaz$ ffmpeg -i test.ts
p11-kit: couldn't load module: 
/usr/lib/i386-linux-gnu/pkcs11/gnome-ke

Re: pctv452e

2012-07-10 Thread Marx
I've attached stream analysis via ffmpeg in another post. I can upload 
saved stream if needed. I simply don't know how to check if weak signal 
is problem. Szap (or extended version szap-s2) gives me some numbers but 
I don't know how to properly read them.

Is this pctv452e device known to have poor reception?
Marx

--
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