def verify_short_blanking(self): """On baytrail systems with a known panel, checks the kernel log for a message that a short blanking mode has been added.""" logging.info('Running verify_short_blanking') if self._gpu_type != 'baytrail' or utils.has_no_monitor(): return '' # Open the EDID to find the panel model. param_path = '/sys/class/drm/card0-eDP-1/edid' if not os.path.exists(param_path): logging.error('Error: %s not found.', param_path) return self.handle_error( 'Short blanking not added (no EDID found). ') with open(param_path, 'r') as edp_edid_file: edp_edid_file.seek(8) data = edp_edid_file.read(2) manufacturer = int(struct.unpack('<H', data)[0]) data = edp_edid_file.read(2) product_code = int(struct.unpack('<H', data)[0]) # This is not the panel we are looking for (AUO B116XTN02.2) if manufacturer != 0xaf06 or product_code != 0x225c: return '' # Get the downclock message from the logs. reader = cros_logging.LogReader() reader.set_start_by_reboot(-1) if not reader.can_find( 'Modified preferred into a short blanking mode'): return self.handle_error('Short blanking not added. ') return ''
def verify_graphics_fbc(self): """ On systems which support FBC, check that we can get into FBC; idle before doing so, and retry every second for 20 seconds.""" logging.info('Running verify_graphics_fbc') # Link's FBC is disabled (crbug.com/338588). # TODO(marcheu): remove this when/if we fix this bug. board = utils.get_board() if board == 'link': return '' # Machines which don't have a monitor can't get FBC. if utils.has_no_monitor(): return '' if (self._gpu_type == 'haswell' or self._gpu_type == 'ivybridge' or self._gpu_type == 'sandybridge'): tries = 0 found = False param_path = self.get_valid_path(FBC_PATHS) if not param_path: return 'FBC_PATHS not found.' while not found and tries < 20: time.sleep(1) with open(param_path, 'r') as fbc_info_file: for line in fbc_info_file: if re.search('FBC enabled', line): found = True break tries += 1 if not found: return self.handle_error('Did not see FBC enabled. ', param_path) return ''