/**
 * This function called by edid_print tool internally
 * @ctx		: hdmi context handle
 * @edid		: edid information
 *
 * Returns nothing. Called by edid_print tool to print
 * edid information to dmesg for debugging purposes
 */
static void __hdmi_report_edid(hdmi_context_t *ctx, edid_info_t *edid)
{
	int i = 0;

	LOG_PRINT(LOG_LEVEL_HIGH, "----------------------\n");
	LOG_PRINT(LOG_LEVEL_HIGH, "Name     : %s\n", edid->product_name);
	LOG_PRINT(LOG_LEVEL_HIGH, "Year     : %d\n", edid->product_year);
	LOG_PRINT(LOG_LEVEL_HIGH, "SN       : %d\n", edid->product_sn);
	LOG_PRINT(LOG_LEVEL_HIGH, "Type     : %s\n",
			edid->hdmi ? "HDMI" : "DVI");
	LOG_PRINT(LOG_LEVEL_HIGH, "YCbCr444 : %s\n",
			edid->ycbcr444 ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "YCbCr422 : %s\n",
			edid->ycbcr422 ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "30 bpp   : %s\n",
			edid->dc_30 ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "36 bpp   : %s\n",
			edid->dc_36 ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "48 bpp   : %s\n",
			edid->dc_48 ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "DC_YUV   : %s\n",
			edid->dc_y444 ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "Max CLK  : %d\n",
			edid->max_tmds_clock);
	LOG_PRINT(LOG_LEVEL_HIGH, "Lip sync : %s\n",
			edid->latency_present ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "ILip sync: %s\n",
			edid->latency_int_present ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "Vid lat  : %d\n",
			edid->latency_video);
	LOG_PRINT(LOG_LEVEL_HIGH, "Aud lat  : %d\n",
			edid->latency_audio);
	LOG_PRINT(LOG_LEVEL_HIGH, "IVid lat : %d\n",
			edid->latency_video_interlaced);
	LOG_PRINT(LOG_LEVEL_HIGH, "IAud lat : %d\n",
			edid->latency_audio_interlaced);
	LOG_PRINT(LOG_LEVEL_HIGH, "HDMI VID : %s\n",
			edid->hdmi_video_present ? "Y" : "N");
	LOG_PRINT(LOG_LEVEL_HIGH, "HDMI 3D  : %s\n",
			edid->enabled_3d ? "Y" : "N");

	LOG_PRINT(LOG_LEVEL_HIGH, "SPA      : %d.%d.%d.%d\n",
		  (edid->spa & 0xF000) >> 12,
		  (edid->spa & 0x0F00) >> 8,
		  (edid->spa & 0x00F0) >> 4, (edid->spa & 0x000F) >> 0);

	LOG_PRINT(LOG_LEVEL_HIGH, "Supported timings [%d]:\n",
		  edid->num_timings);

	for (i = 0; i < edid->num_timings; i++)
		print_pd_timing(&edid->timings[i], edid->order[i]);

	LOG_PRINT(LOG_LEVEL_HIGH, "Audio capabilities:\n");
	for (i = 0; i < edid->num_caps; i++)
		print_audio_capability(&edid->audio_caps[i]);

	print_speaker_layout(edid->speaker_map);
	LOG_PRINT(LOG_LEVEL_HIGH, "----------------------\n");
}
Example #2
0
/*
 * add_timings()
 */
static otm_hdmi_ret_t add_timings(edid_info_t *edid,
				const otm_hdmi_timing_t *pdt,
				unsigned int order)
{
	otm_hdmi_ret_t rc = OTM_HDMI_SUCCESS;
	int i, j;

	/* Safety checks */
	VERIFY((edid != NULL) && (pdt != NULL), rc,
				OTM_HDMI_ERR_NULL_ARG, exit);

	/* Is there room for more timings at all? */
	VERIFY(edid->num_timings < MAX_TIMINGS, rc,
				OTM_HDMI_ERR_INVAL, exit);

	/* Print info about it */
	print_pd_timing(pdt, order);

	/* Do not add modes that we dont support */
	i = find_timing_tp(edid->ref_timings, edid->num_ref_timings, pdt);
	VERIFY(i > -1, rc, OTM_HDMI_ERR_INVAL, exit);

	/* Do not add duplicates; Update discovery order though for cases when
	 * a mode was decoded from DTD first
	 */
	if ((j = find_timing(edid->timings, edid->num_timings, pdt)) != -1) {
		edid->order[j] = !edid->order[j] ? order : edid->order[j];
		goto exit;
	}
	/* Save discovery order	*/
	edid->order[edid->num_timings] = order;

	/* Add timing */
	edid->timings[edid->num_timings++] = *edid->ref_timings[i];

	/* Update supported family of refresh rates */
	edid->supports_60Hz = edid->supports_60Hz
	    || pdt->refresh == OTM_HDMI_REFRESH_60;
	edid->supports_50Hz = edid->supports_50Hz
	    || pdt->refresh == OTM_HDMI_REFRESH_50;

exit:
	return rc;
}