John Bradford ([email protected]) wrote:
> 36 < hwrate < 3332
^^^^^^ should be 'newsize'
Yeap, and the following couple of lines:
/* 36 < newsize 3332; rounding it off
* to the nearest power of 2, no less than 256
*/
for (new2size = 384; new2size < newsize; new2size <<= 1);
new2size -= new2size / 3;
safely replace the whole following block:
if (newsize < 208)
newsize = 208;
if (newsize > 4096)
newsize = 4096;
for (new2size = 128; new2size < newsize; new2size <<= 1);
if (new2size - newsize > newsize - (new2size >> 1))
new2size >>= 1;
if (new2size > 4096) {
printk(KERN_ERR "VIDC: error: dma buffer (%d) %d > 4K\n",
newsize, new2size);
new2size = 4096;
}
Would somebody test this?
A.
>
> John Bradford ([email protected]) wrote:
>
> > 36 < hwrate < 3332
> ^^^^^^ should be 'newsize'
>
> Yeap, and the following couple of lines:
>
> /* 36 < newsize 3332; rounding it off
> * to the nearest power of 2, no less than 256
> */
> for (new2size = 384; new2size < newsize; new2size <<= 1);
> new2size -= new2size / 3;
>
> safely replace the whole following block:
>
> if (newsize < 208)
> newsize = 208;
> if (newsize > 4096)
> newsize = 4096;
> for (new2size = 128; new2size < newsize; new2size <<= 1);
> if (new2size - newsize > newsize - (new2size >> 1))
> new2size >>= 1;
> if (new2size > 4096) {
> printk(KERN_ERR "VIDC: error: dma buffer (%d) %d > 4K\n",
> newsize, new2size);
> new2size = 4096;
> }
>
> Would somebody test this?
The only change I'd make would be:
- /* 36 < newsize 3332; rounding it off
+ /* 36 <= newsize <= 3332; rounding it off
John