Convert chameleon tests to Freon.

TEST=Ran on X and Freon variant of parrot
     test_that --args "chameleon_host=$CHAMELEON_IP" $DUT_IP suite:chameleon_hdmi
BUG=chromium:423527, chromium:451787, chromium:451800
CQ-DEPEND=CL:242131

Change-Id: I9f145c387a22529b369e6017894ae20c5f6f429f
Reviewed-on: https://chromium-review.googlesource.com/250674
Tested-by: Ilja Friedel <ihf@chromium.org>
Reviewed-by: Hung-ying Tyan <tyanh@chromium.org>
Commit-Queue: Ilja Friedel <ihf@chromium.org>
diff --git a/client/cros/graphics/drm.py b/client/cros/graphics/drm.py
index fdadfb8..10d42f4 100644
--- a/client/cros/graphics/drm.py
+++ b/client/cros/graphics/drm.py
@@ -75,17 +75,17 @@
         if self._l:
             self._l.drmModeFreeResources(self)
 
-    def getCrtc(self, index):
+    def getCrtc(self, crtc_id=None):
         """
         Obtain the CRTC at a given index.
 
         @param index: The CRTC to get.
         """
 
-        if not 0 <= index < self.count_crtcs:
-            raise IndexError("CRTC index out of range")
+        if not crtc_id:
+            crtc_id = self.crtcs[0]
 
-        crtc = self._l.drmModeGetCrtc(self._fd, self.crtcs[index]).contents
+        crtc = self._l.drmModeGetCrtc(self._fd, crtc_id).contents
         crtc._fd = self._fd
         crtc._l = self._l
         return crtc
@@ -131,7 +131,7 @@
             return fb
         else:
             raise RuntimeError("CRTC %d doesn't have a framebuffer!" %
-                    self.crtc_id)
+                               self.crtc_id)
 
 
 class drm_mode_map_dumb(Structure):
@@ -203,7 +203,7 @@
         mapDumb.handle = self.handle
 
         rv = self._l.drmIoctl(self._fd, DRM_IOCTL_MODE_MAP_DUMB,
-                pointer(mapDumb))
+                              pointer(mapDumb))
         if rv:
             raise IOError(rv, os.strerror(rv))
 
@@ -213,7 +213,7 @@
         # compared to C; check the documentation before altering this
         # incantation.
         self._map = mmap.mmap(self._fd, size, flags=mmap.MAP_SHARED,
-                prot=mmap.PROT_READ, offset=mapDumb.offset)
+                              prot=mmap.PROT_READ, offset=mapDumb.offset)
 
     def unmap(self):
         """
@@ -357,15 +357,14 @@
     return pixels
 
 
-def crtcScreenshot(crtc):
+def crtcScreenshot(crtc_id=None):
     """
     Take a screenshot, returning an image object.
 
     @param crtc: The CRTC to screenshot.
     """
-
     d = drmFromMinor(0)
-    fb = d.resources().getCrtc(crtc).fb()
+    fb = d.resources().getCrtc(crtc_id).fb()
     image = Image.new("RGB", (fb.width, fb.height))
     pixels = _screenshot(image, fb)