Two stages are required to setup up main link to be ready to transmit
video stream.
Stage 1: dp_hpd_plug_handle() perform link training to set up main link
stage 2: user space framework (msm_dp_display_enable()) to enable pixel
clock and transfer main link to video ready state.
At current implementation, when dongle unplugged dp_hdp_unplug_handle()
has to wait until stage 2 completed before it can send link down uevent
to user space framework to disable pixel clock followed by tearing down
main link. This introduce unnecessary latency if dongle unplugged happen
after stage 1 and before stage 2. It also has possibility leave main link
stay at ready state after dongle unplugged if framework does not response
to link down uevent notification. This will prevent next dongle plug in
from working. This scenario could possibly happen when dongle unplug while
system in the middle of suspending.
This patch allow unplug handle to tear down main link and notify
framework link down immediately if dongle unplugged happen after
stage 1 and before stage 2. With this approach, dp driver is much
more resilient to any different scenarios. Also redundant both
dp_connect_pending_timeout() and dp_disconnect_pending_timeout()
are removed to reduce logic complexity.
Changes in V2:
-- return -EINVAL at msm_dp_display_enable() if not in correct state
-- replace ST_CONNECT_PENDING with ST_MAINLINK_READY
Fixes: 8ede2ecc3e
("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Patchwork: https://patchwork.freedesktop.org/patch/483391/
Link: https://lore.kernel.org/r/1650927382-22461-1-git-send-email-quic_khsieh@quicinc.com
[DB: fixed return values due to conversion to function merge]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef _DP_CTRL_H_
|
|
#define _DP_CTRL_H_
|
|
|
|
#include "dp_aux.h"
|
|
#include "dp_panel.h"
|
|
#include "dp_link.h"
|
|
#include "dp_parser.h"
|
|
#include "dp_power.h"
|
|
#include "dp_catalog.h"
|
|
|
|
struct dp_ctrl {
|
|
bool orientation;
|
|
atomic_t aborted;
|
|
u32 pixel_rate;
|
|
bool wide_bus_en;
|
|
};
|
|
|
|
int dp_ctrl_on_link(struct dp_ctrl *dp_ctrl);
|
|
int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl);
|
|
int dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl);
|
|
int dp_ctrl_off_link(struct dp_ctrl *dp_ctrl);
|
|
int dp_ctrl_off(struct dp_ctrl *dp_ctrl);
|
|
void dp_ctrl_push_idle(struct dp_ctrl *dp_ctrl);
|
|
void dp_ctrl_isr(struct dp_ctrl *dp_ctrl);
|
|
void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl);
|
|
struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link,
|
|
struct dp_panel *panel, struct drm_dp_aux *aux,
|
|
struct dp_power *power, struct dp_catalog *catalog,
|
|
struct dp_parser *parser);
|
|
|
|
void dp_ctrl_reset_irq_ctrl(struct dp_ctrl *dp_ctrl, bool enable);
|
|
void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl);
|
|
void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl);
|
|
void dp_ctrl_irq_phy_exit(struct dp_ctrl *dp_ctrl);
|
|
|
|
#endif /* _DP_CTRL_H_ */
|