|
From: Jukka A. <juk...@ik...> - 2008-04-17 00:11:29
|
Ronald C.F. Antony wrote: > b) we DO use floating point in drivers/video/xbox/conexant.c > > Now if all the other screen drivers can figure out the parameters w/o > floating point calcuations, why does the XBOX chip need such tricks? > First, all screen dimensions are integer in the first place. Second, > even things like clock rates, etc. can be made integer by getting the > proper unit e.g. 0.3 seconds are 300ms. > > If the code were a bit more readable/documented, then I'd take it > upon myself to convert that into integer math, but given the > potential to fry screens and graphic chips with the wrong data in the > registers, that's not something I want to debug without having a > clear understanding of what is supposed to be going on. :) > > The amount and kind of math done in floating point seems trivial, but > it's not clear to me what precision is required and what some of > these parameters mean, because fields in some structs are not > documented, etc. > > Any takers for either explaining me the details or converting this to > integer math? It seems odd that for one such module we run afoul of > the rules. The floating-point calculations are probably there just because setting up the video encoder is hairy business and it was the easiest way to go forward with trying to get control of the thing. Those who last touched the code were probably just glad to get it working and obviously lost the interest in optimizing the calculations once the pieces fell in place. In order to understand the Conexant CX25871 calculations, you need to read the data sheet / programming documentation. This document has been available from Conexant as a free download - a PDF file. However, Conexant seems to have reorganized their site (again), and I couldn't find the document now. You can get it from me, though, if you need it. -- znark |