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

Commit ae1f84aa authored by Narender Ankam's avatar Narender Ankam
Browse files

msm: mdss: hdmi: update fbdev HDMI driver



Update fbdev based HDMI driver and all dependencies
taking msm-4.4 kernel as a working reference.
msm-4.4 kernel reference 'commit 8eba91adf8db
(msm: mdss: hdmi: fix HDCP1.4 authentication issues)'

On top of it, make necessary HDMI driver changes including HPD
uevent notifications to be compatible with msm-4.14 kernel.
Also make necessary HDCP 1x and 2x driver changes to be
compatible with hdcp_qseecom library of msm-4.14 kernel.

Change-Id: I177aae275d3b6afbb92724736a43c45e412a60f3
Signed-off-by: default avatarNarender Ankam <nankam@codeaurora.org>
parent d4172aa9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@ obj-$(CONFIG_FB_MSM_MDSS_EDP_PANEL) += mdss_edp_aux.o

obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_tx.o
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_panel.o
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_hdcp.o
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdcp_1x.o
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdcp_2x.o
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_hdcp2p2.o
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_cec.o
obj-$(CONFIG_FB_MSM_MDSS_HDMI_PANEL) += mdss_hdmi_audio.o
+43 −24
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ static struct cec_ctl *cec_get_ctl(struct device *dev)
	struct mdss_panel_info *pinfo;

	if (!dev) {
		pr_err("invalid input\n");
		pr_err("invalid device\n");
		goto error;
	}

@@ -83,8 +83,13 @@ static int cec_msg_send(struct cec_ctl *ctl, struct cec_msg *msg)
	int ret = -EINVAL;
	struct cec_ops *ops;

	if (!ctl || !msg) {
		pr_err("invalid input\n");
	if (!ctl) {
		pr_err("invalid cec ctl\n");
		goto end;
	}

	if (!msg) {
		pr_err("invalid cec message\n");
		goto end;
	}

@@ -101,8 +106,13 @@ static void cec_dump_msg(struct cec_ctl *ctl, struct cec_msg *msg)
	int i;
	unsigned long flags;

	if (!ctl || !msg) {
		pr_err("invalid input\n");
	if (!ctl) {
		pr_err("invalid cec ctl\n");
		return;
	}

	if (!msg) {
		pr_err("invalid cec message\n");
		return;
	}

@@ -136,7 +146,7 @@ static int cec_disable(struct cec_ctl *ctl)
	struct cec_ops *ops;

	if (!ctl) {
		pr_err("Invalid input\n");
		pr_err("invalid cec ctl\n");
		goto end;
	}

@@ -165,7 +175,7 @@ static int cec_enable(struct cec_ctl *ctl)
	struct cec_ops *ops;

	if (!ctl) {
		pr_err("Invalid input\n");
		pr_err("invalid cec ctl\n");
		goto end;
	}

@@ -189,8 +199,13 @@ static int cec_send_abort_opcode(struct cec_ctl *ctl,
	int i = 0;
	struct cec_msg out_msg;

	if (!ctl || !in_msg) {
		pr_err("Invalid input\n");
	if (!ctl) {
		pr_err("invalid cec ctl\n");
		return -EINVAL;
	}

	if (!in_msg) {
		pr_err("invalid cec message\n");
		return -EINVAL;
	}

@@ -209,10 +224,14 @@ static int cec_msg_parser(struct cec_ctl *ctl, struct cec_msg *in_msg)
	int rc = 0, i = 0;
	struct cec_msg out_msg;

	if (!ctl || !in_msg) {
		pr_err("Invalid input\n");
		rc = -EINVAL;
		goto end;
	if (!ctl) {
		pr_err("invalid cec ctl\n");
		return -EINVAL;
	}

	if (!in_msg) {
		pr_err("invalid cec message\n");
		return -EINVAL;
	}

	pr_debug("in_msg->opcode = 0x%x\n", in_msg->opcode);
@@ -345,7 +364,7 @@ static int cec_msg_recv(void *data, struct cec_msg *msg)
	int ret = 0;

	if (!ctl) {
		pr_err("invalid input\n");
		pr_err("invalid cec ctl\n");
		ret = -EINVAL;
		goto end;
	}
@@ -395,7 +414,7 @@ static ssize_t cec_rda_enable(struct device *dev,
	struct cec_ctl *ctl = cec_get_ctl(dev);

	if (!ctl) {
		pr_err("Invalid input\n");
		pr_err("invalid cec ctl\n");
		ret = -EINVAL;
		goto end;
	}
@@ -423,7 +442,7 @@ static ssize_t cec_wta_enable(struct device *dev,
	struct cec_ops *ops;

	if (!ctl) {
		pr_err("Invalid input\n");
		pr_err("invalid cec ctl\n");
		ret = -EINVAL;
		goto end;
	}
@@ -475,7 +494,7 @@ static ssize_t cec_rda_enable_compliance(struct device *dev,
	struct cec_ctl *ctl = cec_get_ctl(dev);

	if (!ctl) {
		pr_err("Invalid ctl\n");
		pr_err("invalid cec ctl\n");
		return -EINVAL;
	}

@@ -497,7 +516,7 @@ static ssize_t cec_wta_enable_compliance(struct device *dev,
	struct cec_ops *ops;

	if (!ctl) {
		pr_err("Invalid ctl\n");
		pr_err("invalid cec ctl\n");
		ret = -EINVAL;
		goto end;
	}
@@ -543,7 +562,7 @@ static ssize_t cec_rda_logical_addr(struct device *dev,
	struct cec_ctl *ctl = cec_get_ctl(dev);

	if (!ctl) {
		pr_err("Invalid ctl\n");
		pr_err("invalid cec ctl\n");
		return -EINVAL;
	}

@@ -564,7 +583,7 @@ static ssize_t cec_wta_logical_addr(struct device *dev,
	struct cec_ops *ops;

	if (!ctl) {
		pr_err("Invalid ctl\n");
		pr_err("invalid cec ctl\n");
		ret = -EINVAL;
		goto end;
	}
@@ -578,7 +597,7 @@ static ssize_t cec_wta_logical_addr(struct device *dev,
	}

	if (logical_addr < 0 || logical_addr > 15) {
		pr_err("Invalid logical address\n");
		pr_err("invalid logical address\n");
		ret = -EINVAL;
		goto end;
	}
@@ -604,7 +623,7 @@ static ssize_t cec_rda_msg(struct device *dev,
	ssize_t ret;

	if (!ctl) {
		pr_err("Invalid ctl\n");
		pr_err("invalid cec ctl\n");
		ret = -EINVAL;
		goto end;
	}
@@ -660,7 +679,7 @@ static ssize_t cec_wta_msg(struct device *dev,
	struct cec_ctl *ctl = cec_get_ctl(dev);

	if (!ctl) {
		pr_err("Invalid ctl\n");
		pr_err("invalid cec ctl\n");
		ret = -EINVAL;
		goto end;
	}
@@ -763,7 +782,7 @@ void *cec_abstract_init(struct cec_abstract_init_data *init_data)
	int ret = 0;

	if (!init_data) {
		pr_err("invalid input\n");
		pr_err("invalid cec abstract init data\n");
		ret = -EINVAL;
		goto end;
	}
+4 −4
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ static bool mdss_dba_check_audio_support(struct mdss_dba_utils_data *udata)
{
	bool dvi_mode = false;
	int audio_blk_size = 0;
	struct msm_hdmi_audio_edid_blk audio_blk;
	struct msm_ext_disp_audio_edid_blk audio_blk;

	if (!udata) {
		pr_debug("%s: Invalid input\n", __func__);
@@ -307,7 +307,7 @@ static bool mdss_dba_check_audio_support(struct mdss_dba_utils_data *udata)
	memset(&audio_blk, 0, sizeof(audio_blk));

	/* check if sink is in DVI mode */
	dvi_mode = !hdmi_edid_get_sink_mode(udata->edid_data);
	dvi_mode = hdmi_edid_is_dvi_mode(udata->edid_data);

	/* get the audio block size info from EDID */
	hdmi_edid_get_audio_blk(udata->edid_data, &audio_blk);
@@ -328,7 +328,7 @@ static void mdss_dba_utils_dba_cb(void *data, enum msm_dba_callback_event event)
	bool operands_present = false;
	u32 no_of_operands, size, i;
	u32 operands_offset = MAX_CEC_FRAME_SIZE - MAX_OPERAND_SIZE;
	struct msm_hdmi_audio_edid_blk blk;
	struct msm_ext_disp_audio_edid_blk blk;

	if (!udata) {
		pr_err("Invalid data\n");
@@ -578,7 +578,7 @@ int mdss_dba_utils_video_on(void *data, struct mdss_panel_info *pinfo)
	video_cfg.h_pulse_width = pinfo->lcdc.h_pulse_width;
	video_cfg.v_pulse_width = pinfo->lcdc.v_pulse_width;
	video_cfg.pclk_khz = (unsigned long)pinfo->clk_rate / 1000;
	video_cfg.hdmi_mode = hdmi_edid_get_sink_mode(ud->edid_data);
	video_cfg.hdmi_mode = !hdmi_edid_is_dvi_mode(ud->edid_data);

	/* Calculate number of DSI lanes configured */
	video_cfg.num_of_input_lanes = 0;
+87 −0
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2014-2015, 2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2014-2018, The Linux Foundation. All rights reserved.
 *
 * 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
@@ -10,24 +10,35 @@
 * GNU General Public License for more details.
 */

#ifndef __MDSS_HDMI_HDCP_H__
#define __MDSS_HDMI_HDCP_H__
#ifndef __MDSS_HDCP_H__
#define __MDSS_HDCP_H__

#include "mdss_hdmi_util.h"
#include <video/msm_hdmi_modes.h>
#include <soc/qcom/scm.h>
#include <linux/hdcp_qseecom.h>
#include "mdss_hdmi_util.h"

#define HDCP_SRM_CHECK_FAIL 29
#define MAX_DEVICES_SUPPORTED 127
#define RECV_ID_SIZE 5

enum hdcp_client_id {
	HDCP_CLIENT_HDMI,
	HDCP_CLIENT_MAX,
};

enum hdmi_hdcp_state {
enum hdcp_states {
	HDCP_STATE_INACTIVE,
	HDCP_STATE_AUTHENTICATING,
	HDCP_STATE_AUTHENTICATED,
	HDCP_STATE_AUTH_FAIL,
	HDCP_STATE_AUTH_FAIL_NOREAUTH,
	HDCP_STATE_AUTH_ENC_NONE,
	HDCP_STATE_AUTH_ENC_1X,
	HDCP_STATE_AUTH_ENC_2P2
};

struct hdmi_hdcp_init_data {
struct hdcp_init_data {
	struct dss_io_data *core_io;
	struct dss_io_data *qfprom_io;
	struct dss_io_data *hdcp_io;
@@ -35,30 +46,42 @@ struct hdmi_hdcp_init_data {
	struct kobject *sysfs_kobj;
	struct workqueue_struct *workq;
	void *cb_data;
	void (*notify_status)(void *cb_data, enum hdmi_hdcp_state status);
	void (*notify_status)(void *cb_data, enum hdcp_states status);
	struct hdmi_tx_ddc_ctrl *ddc_ctrl;
	u8 sink_rx_status;
	u16 *version;
	u32 phy_addr;
	u32 hdmi_tx_ver;
	struct msm_hdmi_mode_timing_info *timing;
	bool tethered;
	bool sec_access;
	enum hdcp_client_id client_id;
};

struct hdmi_hdcp_ops {
	int (*hdmi_hdcp_isr)(void *ptr);
	int (*hdmi_hdcp_reauthenticate)(void *input);
	int (*hdmi_hdcp_authenticate)(void *hdcp_ctrl);
struct hdcp_ops {
	int (*isr)(void *ptr);
	int (*cp_irq)(void *ptr);
	int (*reauthenticate)(void *input);
	int (*authenticate)(void *hdcp_ctrl);
	bool (*feature_supported)(void *input);
	void (*hdmi_hdcp_off)(void *hdcp_ctrl);
	void (*off)(void *hdcp_ctrl);
};

struct hdcp_client_ops {
	void (*notify_lvl_change)(void *client_ctx, int min_lvl);
	void (*srm_cb)(void *client_ctx);
};

void *hdmi_hdcp_init(struct hdmi_hdcp_init_data *init_data);
void *hdmi_hdcp2p2_init(struct hdmi_hdcp_init_data *init_data);
void hdmi_hdcp_deinit(void *input);
void *hdcp_1x_init(struct hdcp_init_data *init_data);
void hdcp_1x_deinit(void *input);

void *hdmi_hdcp2p2_init(struct hdcp_init_data *init_data);
void hdmi_hdcp2p2_deinit(void *input);

struct hdmi_hdcp_ops *hdmi_hdcp_start(void *input);
struct hdmi_hdcp_ops *hdmi_hdcp2p2_start(void *input);
struct hdcp_ops *hdcp_1x_start(void *input);
struct hdcp_ops *hdmi_hdcp2p2_start(void *input);

const char *hdcp_state_name(enum hdmi_hdcp_state hdcp_state);
const char *hdcp_state_name(enum hdcp_states hdcp_state);
void hdcp_1x_set_enc(void *input, bool enc);

#endif /* __MDSS_HDMI_HDCP_H__ */
#endif /* __MDSS_HDCP_H__ */
+1806 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading