On Tue, 16 Jun 2009, Trent Piepho wrote: > On Tue, 16 Jun 2009, Mauro Carvalho Chehab wrote: > > Em Tue, 16 Jun 2009 17:57:20 +0200 (CEST) > > Guennadi Liakhovetski <g.liakhovetski@xxxxxx> escreveu: > > > On Sat, 30 May 2009, Trent Piepho wrote: > > > + if (walign + halign < salign) { > > > + /* Max walign where there is still a valid width */ > > > + unsigned int wmaxa = __fls(wmax ^ (wmin - 1)); > > > > > > I cannot follow correctness of the above, sorry. Take a simple example: > > > wmax=0x7f, wmin=7, wmaxa = __fls(0x7f ^ 6) = __fls(0x79) = 0. And the > > > comment says it's the "maximum walign where there is still a valid width." > > > What am I missing? > > > > > > + > > > + /* up the smaller alignment until we have enough */ > > > + do { > > > + if (walign <= halign && walign < wmaxa) { > > > > > > > As I'm still cooking the patches, I prefer to postpone the align ones until we > > are comfortable with them. > > > > Trent, > > > > Could you please take a look on the above comments > > There is no bug with the wmaxa code, but there is a different bug > elsewhere. > > Please pull from http://linuxtv.org/hg/~tap/fix > > for the following changeset: > > 01/01: v4l2: Fix flaw in alignment code > http://linuxtv.org/hg/~tap/fix?cmd=changeset;node=4ef7fb102b6c /* up the smaller alignment until we have enough */ do { - if (walign <= halign && walign < wmaxa) { + if (halign >= hmaxa || + (walign <= halign && walign < wmaxa)) { Do I understand it right now, that as soon as your halign now reaches hmaxa, you'll stop incrementing halign and then keep incrementing walign even beyond wmaxa?... *w = clamp_align(*w, wmin, wmax, walign + 1); walign = __ffs(*w); } else { 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 majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html