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

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

drm/msm/dp: abort aux and ctrl when simulation is switched off



While running the DisplayPort simulation, if the simulation is
abruptly switched off, AUX and CTRL may continue processing
like in a normal DisplayPort connected mode. This may result
in an unstable DP driver state and may affect subsequent hot
plugs.
Abort the AUX and CTRL processing when DP simulation is
switched off. This brings the DP driver into stable state when
simulation is switched off.

CRs-Fixed: 2368984
Change-Id: Ib243b0628e1c642ec2f50adfaa17ca3aebdc2687
Signed-off-by: default avatarAjay Singh Parmar <aparmar@codeaurora.org>
parent 975a325a
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, 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
@@ -20,7 +20,6 @@
#include "dp_power.h"
#include "dp_catalog.h"
#include "dp_aux.h"
#include "dp_ctrl.h"
#include "dp_debug.h"
#include "drm_connector.h"
#include "sde_connector.h"
@@ -50,6 +49,7 @@ struct dp_debug_private {
	struct device *dev;
	struct dp_debug dp_debug;
	struct dp_parser *parser;
	struct dp_ctrl *ctrl;
};

static int dp_debug_get_edid_buf(struct dp_debug_private *debug)
@@ -1454,6 +1454,9 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim)
		debug->aux->set_sim_mode(debug->aux, true,
			debug->edid, debug->dpcd);
	} else {
		debug->aux->abort(debug->aux);
		debug->ctrl->abort(debug->ctrl);

		debug->aux->set_sim_mode(debug->aux, false, NULL, NULL);
		debug->dp_debug.sim_mode = false;

@@ -1991,7 +1994,8 @@ struct dp_debug *dp_debug_get(struct dp_debug_in *in)
	struct dp_debug_private *debug;
	struct dp_debug *dp_debug;

	if (!in->dev || !in->panel || !in->hpd || !in->link || !in->catalog) {
	if (!in->dev || !in->panel || !in->hpd || !in->link ||
	    !in->catalog || !in->ctrl) {
		pr_err("invalid input\n");
		rc = -EINVAL;
		goto error;
@@ -2012,6 +2016,7 @@ struct dp_debug *dp_debug_get(struct dp_debug_in *in)
	debug->connector = in->connector;
	debug->catalog = in->catalog;
	debug->parser = in->parser;
	debug->ctrl = in->ctrl;

	dp_debug = &debug->dp_debug;
	dp_debug->vdisplay = 0;
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, 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
@@ -16,6 +16,7 @@
#define _DP_DEBUG_H_

#include "dp_panel.h"
#include "dp_ctrl.h"
#include "dp_link.h"
#include "dp_usbpd.h"
#include "dp_aux.h"
@@ -72,6 +73,7 @@ struct dp_debug_in {
	struct drm_connector **connector;
	struct dp_catalog *catalog;
	struct dp_parser *parser;
	struct dp_ctrl *ctrl;
};

/**
+1 −0
Original line number Diff line number Diff line
@@ -1232,6 +1232,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
	debug_in.connector = &dp->dp_display.base_connector;
	debug_in.catalog = dp->catalog;
	debug_in.parser = dp->parser;
	debug_in.ctrl = dp->ctrl;

	dp->debug = dp_debug_get(&debug_in);
	if (IS_ERR(dp->debug)) {