Merge "disp: msm: dp: skip link training in simulation mode"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
cf51cabb69
@@ -70,6 +70,7 @@ struct dp_ctrl_private {
|
|||||||
bool mst_mode;
|
bool mst_mode;
|
||||||
bool fec_mode;
|
bool fec_mode;
|
||||||
bool dsc_mode;
|
bool dsc_mode;
|
||||||
|
bool sim_mode;
|
||||||
|
|
||||||
atomic_t aborted;
|
atomic_t aborted;
|
||||||
|
|
||||||
@@ -328,6 +329,12 @@ static int dp_ctrl_link_training_1(struct dp_ctrl_private *ctrl)
|
|||||||
ctrl->aux->state &= ~DP_STATE_TRAIN_1_SUCCEEDED;
|
ctrl->aux->state &= ~DP_STATE_TRAIN_1_SUCCEEDED;
|
||||||
ctrl->aux->state |= DP_STATE_TRAIN_1_STARTED;
|
ctrl->aux->state |= DP_STATE_TRAIN_1_STARTED;
|
||||||
|
|
||||||
|
if (ctrl->sim_mode) {
|
||||||
|
DP_DEBUG("simulation enabled, skip clock recovery\n");
|
||||||
|
ret = 0;
|
||||||
|
goto skip_training;
|
||||||
|
}
|
||||||
|
|
||||||
dp_ctrl_state_ctrl(ctrl, 0);
|
dp_ctrl_state_ctrl(ctrl, 0);
|
||||||
/* Make sure to clear the current pattern before starting a new one */
|
/* Make sure to clear the current pattern before starting a new one */
|
||||||
wmb();
|
wmb();
|
||||||
@@ -398,6 +405,7 @@ static int dp_ctrl_link_training_1(struct dp_ctrl_private *ctrl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip_training:
|
||||||
ctrl->aux->state &= ~DP_STATE_TRAIN_1_STARTED;
|
ctrl->aux->state &= ~DP_STATE_TRAIN_1_STARTED;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
@@ -451,6 +459,12 @@ static int dp_ctrl_link_training_2(struct dp_ctrl_private *ctrl)
|
|||||||
ctrl->aux->state &= ~DP_STATE_TRAIN_2_SUCCEEDED;
|
ctrl->aux->state &= ~DP_STATE_TRAIN_2_SUCCEEDED;
|
||||||
ctrl->aux->state |= DP_STATE_TRAIN_2_STARTED;
|
ctrl->aux->state |= DP_STATE_TRAIN_2_STARTED;
|
||||||
|
|
||||||
|
if (ctrl->sim_mode) {
|
||||||
|
DP_DEBUG("simulation enabled, skip channel equalization\n");
|
||||||
|
ret = 0;
|
||||||
|
goto skip_training;
|
||||||
|
}
|
||||||
|
|
||||||
dp_ctrl_state_ctrl(ctrl, 0);
|
dp_ctrl_state_ctrl(ctrl, 0);
|
||||||
/* Make sure to clear the current pattern before starting a new one */
|
/* Make sure to clear the current pattern before starting a new one */
|
||||||
wmb();
|
wmb();
|
||||||
@@ -505,6 +519,7 @@ static int dp_ctrl_link_training_2(struct dp_ctrl_private *ctrl)
|
|||||||
ctrl->link->adjust_levels(ctrl->link, link_status);
|
ctrl->link->adjust_levels(ctrl->link, link_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip_training:
|
||||||
ctrl->aux->state &= ~DP_STATE_TRAIN_2_STARTED;
|
ctrl->aux->state &= ~DP_STATE_TRAIN_2_STARTED;
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
@@ -1397,6 +1412,18 @@ static void dp_ctrl_isr(struct dp_ctrl *dp_ctrl)
|
|||||||
dp_ctrl_idle_patterns_sent(ctrl);
|
dp_ctrl_idle_patterns_sent(ctrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dp_ctrl_set_sim_mode(struct dp_ctrl *dp_ctrl, bool en)
|
||||||
|
{
|
||||||
|
struct dp_ctrl_private *ctrl;
|
||||||
|
|
||||||
|
if (!dp_ctrl)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
|
||||||
|
ctrl->sim_mode = en;
|
||||||
|
DP_INFO("sim_mode=%d\n", ctrl->sim_mode);
|
||||||
|
}
|
||||||
|
|
||||||
struct dp_ctrl *dp_ctrl_get(struct dp_ctrl_in *in)
|
struct dp_ctrl *dp_ctrl_get(struct dp_ctrl_in *in)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
@@ -1445,6 +1472,7 @@ struct dp_ctrl *dp_ctrl_get(struct dp_ctrl_in *in)
|
|||||||
dp_ctrl->stream_off = dp_ctrl_stream_off;
|
dp_ctrl->stream_off = dp_ctrl_stream_off;
|
||||||
dp_ctrl->stream_pre_off = dp_ctrl_stream_pre_off;
|
dp_ctrl->stream_pre_off = dp_ctrl_stream_pre_off;
|
||||||
dp_ctrl->set_mst_channel_info = dp_ctrl_set_mst_channel_info;
|
dp_ctrl->set_mst_channel_info = dp_ctrl_set_mst_channel_info;
|
||||||
|
dp_ctrl->set_sim_mode = dp_ctrl_set_sim_mode;
|
||||||
|
|
||||||
return dp_ctrl;
|
return dp_ctrl;
|
||||||
error:
|
error:
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
#include "dp_parser.h"
|
#include "dp_parser.h"
|
||||||
#include "dp_power.h"
|
#include "dp_power.h"
|
||||||
#include "dp_catalog.h"
|
#include "dp_catalog.h"
|
||||||
|
#include "dp_debug.h"
|
||||||
|
|
||||||
struct dp_ctrl {
|
struct dp_ctrl {
|
||||||
int (*init)(struct dp_ctrl *dp_ctrl, bool flip, bool reset);
|
int (*init)(struct dp_ctrl *dp_ctrl, bool flip, bool reset);
|
||||||
@@ -30,6 +31,7 @@ struct dp_ctrl {
|
|||||||
void (*set_mst_channel_info)(struct dp_ctrl *dp_ctrl,
|
void (*set_mst_channel_info)(struct dp_ctrl *dp_ctrl,
|
||||||
enum dp_stream_id strm,
|
enum dp_stream_id strm,
|
||||||
u32 ch_start_slot, u32 ch_tot_slots);
|
u32 ch_start_slot, u32 ch_tot_slots);
|
||||||
|
void (*set_sim_mode)(struct dp_ctrl *dp_ctrl, bool en);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dp_ctrl_in {
|
struct dp_ctrl_in {
|
||||||
|
@@ -1603,6 +1603,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim)
|
|||||||
debug->dp_debug.sim_mode = true;
|
debug->dp_debug.sim_mode = true;
|
||||||
debug->aux->set_sim_mode(debug->aux, true,
|
debug->aux->set_sim_mode(debug->aux, true,
|
||||||
debug->edid, debug->dpcd);
|
debug->edid, debug->dpcd);
|
||||||
|
debug->ctrl->set_sim_mode(debug->ctrl, true);
|
||||||
} else {
|
} else {
|
||||||
if (debug->hotplug) {
|
if (debug->hotplug) {
|
||||||
DP_WARN("sim mode off before hotplug disconnect\n");
|
DP_WARN("sim mode off before hotplug disconnect\n");
|
||||||
@@ -1613,6 +1614,7 @@ static void dp_debug_set_sim_mode(struct dp_debug_private *debug, bool sim)
|
|||||||
debug->ctrl->abort(debug->ctrl, true);
|
debug->ctrl->abort(debug->ctrl, true);
|
||||||
|
|
||||||
debug->aux->set_sim_mode(debug->aux, false, NULL, NULL);
|
debug->aux->set_sim_mode(debug->aux, false, NULL, NULL);
|
||||||
|
debug->ctrl->set_sim_mode(debug->ctrl, false);
|
||||||
debug->dp_debug.sim_mode = false;
|
debug->dp_debug.sim_mode = false;
|
||||||
|
|
||||||
debug->panel->set_edid(debug->panel, 0);
|
debug->panel->set_edid(debug->panel, 0);
|
||||||
|
Reference in New Issue
Block a user