Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mpeg2] Re: Porting kfir for kernel 2.6



Anssi Hannula wrote:
Klaus Schmidinger wrote:

Anssi Hannula wrote:

Klaus Schmidinger wrote:

Anssi Hannula wrote:

...
The easiest-to-solve possible problem is the parameters module sends to Kfir. I had to alter them sligtly because they made some floating-point arithmetics, which can't be used in kernel code.

To see any differences in module behaviour, I attach two patches, one for 2.4 (against cvs) and an other one for 2.6 (rev3). They produce verbose output whenever parameters are downloaded to Kfir. Please test them both with the same module parameters (debug=1 included), do cat /dev/video0 > x.x and get the debug output from syslog. Parameter may be reported multiple times in the log, post everything.

Logs attached.

Sorry, of course just the critical line was linewrapped, and didn't match my regexp search-replace.
Do the same with these patches.

Logs attached.

That line indeed appears to be a problem.
I attached a patch for use with 2.4, which prints some values to help making the line 2.6-compatible.

Then let's hope this was the only reason why there is no data.


------------------------------------------------------------------------

diff -Nur -x CVS -x kfir_micro.h -x micro kfir/driver/kfir.c kfir-2.4-debug/driver/kfir.c
--- kfir/driver/kfir.c 2005-01-05 02:29:17.000000000 +0200
+++ kfir-2.4-debug/driver/kfir.c 2005-01-23 20:17:42.484502256 +0200
@@ -1075,8 +1075,21 @@
kfir->Par[KFIR_ADR_C2/4] = (WORD)((1<<16)/1.4);
kfir->Par[KFIR_ADR_STD_PICT_DEL/4] = (WORD)(90000000UL/MulFrameRate);
- kfir->Par[KFIR_ADR_FIRST_PICT_DEL/4] = - (WORD) ((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate));
+#define INFOPRINTK(x) printk("kfir: %s: %u\n", #x, x)
+ printk("kfir: KFIR_ADR_FIRST_PICT_DEL parameter debug info:\n");
+ INFOPRINTK(Params->VBFBufferSize);
+ INFOPRINTK((QWORD)((double)Params->VBFBufferSize));
+ INFOPRINTK(MulBitRate);
+ INFOPRINTK((QWORD)((double)MulBitRate));
+ INFOPRINTK((WORD) ((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate)));
+ INFOPRINTK((QWORD)((double)((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate))));
+ INFOPRINTK(((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate)));
+ INFOPRINTK(((double)Params->VBFBufferSize)*16384.0*2.0);
+ INFOPRINTK((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0);
+ INFOPRINTK((double)Params->VBFBufferSize);
+ INFOPRINTK((double)MulBitRate);
+ INFOPRINTK((double)((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate)));
+ kfir->Par[KFIR_ADR_FIRST_PICT_DEL/4] = (WORD) ((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate));
Data=RMUL(MulBitRate*2,
When I try to insmod kfir.o I get

  kfir.o: unresolved symbol __fixunsdfdi

and before that the compiler tells me

  kfir.c: In function `Kfir_DownLoadParams':
  kfir.c:1089: warning: unsigned int format, different type arg (arg 3)
  kfir.c:1091: warning: unsigned int format, different type arg (arg 3)
  kfir.c:1093: warning: unsigned int format, different type arg (arg 3)
  kfir.c:1094: warning: unsigned int format, double arg (arg 3)
  kfir.c:1095: warning: unsigned int format, double arg (arg 3)
  kfir.c:1096: warning: unsigned int format, double arg (arg 3)
  kfir.c:1097: warning: unsigned int format, double arg (arg 3)
  kfir.c:1098: warning: unsigned int format, double arg (arg 3)
  kfir.c:1099: warning: unsigned int format, double arg (arg 3)

So I've commented out the first 6 INFOPRINTK and defined

  #define INFOPRINTD(x) printk("kfir: %s: %f\n", #x, x)

and used that for the rest, but that just gave me

  Jan 24 18:05:26 video kernel: kfir: Download parameters...kfir: KFIR_ADR_FIRST_PICT_DEL parameter debug info:
  Jan 24 18:05:26 video kernel: kfir: ((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate)): %%f
  Jan 24 18:05:26 video kernel: kfir: ((double)Params->VBFBufferSize)*16384.0*2.0: %%f
  Jan 24 18:05:26 video kernel: kfir: (((double)Params->VBFBufferSize)*16384.0*2.0)/8.0: %%f
  Jan 24 18:05:26 video kernel: kfir: (double)Params->VBFBufferSize: %%f
  Jan 24 18:05:26 video kernel: kfir: (double)MulBitRate: %%f
  Jan 24 18:05:26 video kernel: kfir: (double)((((((double)Params->VBFBufferSize)*16384.0*2.0)/8.0)*90000.0)/((double)MulBitRate)): %%f
  Jan 24 18:05:26 video kernel: kfir: done

I wonder why the '%' appears twice?!

Maybe you can fix these lines so that they actually work.

Klaus




Home | Main Index | Thread Index