<div dir="ltr"><br><br>Paul Kocialkowski於 2017年6月15日星期四 UTC+8下午9時57分09秒寫道:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi,
<br>
<br>So far, there are two ways of testing for pixel-perfect frames using the
<br>Chamelium that are in IGT. The first one grabs a full frame from the Chamelium
<br>and compares it pixel-to-pixel with the cairo reference, which works well for
<br>DP/HDMI.
<br>
<br>For VGA, this is probably not the case (because the link is analogue). In that
<br>case, I will look into implementing some fuzzy testing, probably inspired by
<br>what piglit (probably) does to compare output frames with references.
<br>
<br>For pixel-perfect testing, grabbing a full frame and testing it with memcmp
<br>comes with a significant time penalty (about 2 seconds for 1080p). The Chamelium
<br>also provides a CRC mechanism that is faster and does not require retrieving the
<br>frame, that IGT currently also supports. It compares the CRC calculated by the
<br>Chamelium (implemented in the HDL) with a hardcoded reference value.
<br>
<br>This approach currently fails for me (the values I get don't match the hardcoded
<br>reference). There are reasons why it is not really reasonable: fonts rendering
<br>may change between machines (e.g. use of anti-aliasing) and cairo version
<br>changes could introduce slight rendering changes too (not to mention changes in
<br>the test pattern itself). So instead of comparing the CRC with a hardcoded
<br>reference value, I think it would make a lot more sense to actually calculate
<br>the CRC based on the cairo image that is the actual reference (and that we
<br>should assume may change between runs/machines).
<br>
<br>I am currently looking into the CRC calculation mechanism used by the Chamelium
<br>and trying to reproduce it in C code. Is this a known algorithm for which a
<br>reference/optimized implementation exists, or something custom that the folks
<br>over at Google came up with?
<br>
<br>Any thoughts, comments or suggestions?
<br></blockquote><div><br></div><div><div>I feel bad about the stupid hash algorithm I came up with, but here is the document:</div><div><span style="font-size: 13px;">https://docs.google.com/document/d/1_HjEMA8fBoHkUbpUZq-OXtITfiomCb1HBKN07T-POlY/edit#heading=h.jqek3kkh9qjm</span><br></div><div><span style="font-size: 13px;">You can also ask it to hash just part of the frame instead of the whole frame (i.e. cropping before hashing).</span><br></div></div><div><span style="font-size: 13px;"><br></span></div><div><span style="font-size: 13px;">Thanks,</span></div><div><span style="font-size: 13px;">Chih-Chung Chang</span></div><div><span style="font-size: 13px;"><br></span></div><div> </div><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
<br>Cheers!
<br>
<br>--
<br>Paul Kocialkowski <<a href="mailto:paul.kocialkowski@linux.intel.com" target="_blank" rel="nofollow" onmousedown="this.href='mailto:paul.kocialkowski@linux.intel.com';return true;" onclick="this.href='mailto:paul.kocialkowski@linux.intel.com';return true;">paul.kocialkowski@linux.<wbr>intel.com</a>>
<br>Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
<br></blockquote></div>