Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62950625 authored by Ajay Singh Parmar's avatar Ajay Singh Parmar
Browse files

msm: mdss: hdmi: check for scrambler override



In some cases, scrambling may need to be forced on or off based on
sink requirements. To support such requirements, scrambler override
may be imposed. If scrambler override has been enabled, use
override value to enable or disable scrambler.

Change-Id: I9556c6457258598e6b6758573bb0263d53e612da
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent fe142d0b
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -2346,6 +2346,24 @@ bool hdmi_edid_get_scdc_support(void *input)
	return scdc_present;
	return scdc_present;
}
}


/**
 * hdmi_edid_sink_scramble_override() - check if override has been enabled
 * @input: edid data
 *
 * Return true if scrambling override is enabled false otherwise.
 */
bool hdmi_edid_sink_scramble_override(void *input)
{
	struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;

	if (edid_ctrl->edid_override &&
		(edid_ctrl->override_data.scramble != -1))
		return true;

	return false;

}

bool hdmi_edid_get_sink_scrambler_support(void *input)
bool hdmi_edid_get_sink_scrambler_support(void *input)
{
{
	struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;
	struct hdmi_edid_ctrl *edid_ctrl = (struct hdmi_edid_ctrl *)input;
+2 −1
Original line number Original line Diff line number Diff line
/* Copyright (c) 2010-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2010-2016, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * it under the terms of the GNU General Public License version 2 and
@@ -32,6 +32,7 @@ int hdmi_edid_parser(void *edid_ctrl);
u32 hdmi_edid_get_raw_data(void *edid_ctrl, u8 *buf, u32 size);
u32 hdmi_edid_get_raw_data(void *edid_ctrl, u8 *buf, u32 size);
u8 hdmi_edid_get_sink_scaninfo(void *edid_ctrl, u32 resolution);
u8 hdmi_edid_get_sink_scaninfo(void *edid_ctrl, u32 resolution);
u32 hdmi_edid_get_sink_mode(void *edid_ctrl);
u32 hdmi_edid_get_sink_mode(void *edid_ctrl);
bool hdmi_edid_sink_scramble_override(void *input);
bool hdmi_edid_get_sink_scrambler_support(void *input);
bool hdmi_edid_get_sink_scrambler_support(void *input);
bool hdmi_edid_get_scdc_support(void *input);
bool hdmi_edid_get_scdc_support(void *input);
int hdmi_edid_get_audio_blk(void *edid_ctrl,
int hdmi_edid_get_audio_blk(void *edid_ctrl,
+7 −5
Original line number Original line Diff line number Diff line
@@ -3308,15 +3308,17 @@ int hdmi_tx_setup_scrambler(struct hdmi_tx_ctrl *hdmi_ctrl)


	rate = hdmi_tx_setup_tmds_clk_rate(hdmi_ctrl);
	rate = hdmi_tx_setup_tmds_clk_rate(hdmi_ctrl);


	if (rate > HDMI_TX_SCRAMBLER_THRESHOLD_RATE_KHZ) {
	scrambler_on = hdmi_edid_get_sink_scrambler_support(edid_data);
		scrambler_on = true;

		tmds_clock_ratio = 1;
	if (!hdmi_edid_sink_scramble_override(edid_data)) {
	} else {
		if (rate > HDMI_TX_SCRAMBLER_THRESHOLD_RATE_KHZ)
		if (hdmi_edid_get_sink_scrambler_support(edid_data))
			scrambler_on = true;
			scrambler_on = true;
	}
	}


	if (scrambler_on) {
	if (scrambler_on) {
		if (rate > HDMI_TX_SCRAMBLER_THRESHOLD_RATE_KHZ)
			tmds_clock_ratio = 1;

		rc = hdmi_scdc_write(&hdmi_ctrl->ddc_ctrl,
		rc = hdmi_scdc_write(&hdmi_ctrl->ddc_ctrl,
			HDMI_TX_SCDC_TMDS_BIT_CLOCK_RATIO_UPDATE,
			HDMI_TX_SCDC_TMDS_BIT_CLOCK_RATIO_UPDATE,
			tmds_clock_ratio);
			tmds_clock_ratio);