mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
drm/bridge: synopsys: dw-hdmi-qp: support pre disable/post enable crtc
Change-Id: If11faf7c1ca6079f2f6fef4c8b914b07615b65b3 Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
This commit is contained in:
@@ -3496,6 +3496,8 @@ static void dw_hdmi_qp_bridge_atomic_disable(struct drm_bridge *bridge,
|
||||
|
||||
extcon_set_state_sync(hdmi->extcon, EXTCON_DISP_HDMI, false);
|
||||
handle_plugged_change(hdmi, false);
|
||||
if (hdmi->plat_data->crtc_pre_disable)
|
||||
hdmi->plat_data->crtc_pre_disable(data, bridge->encoder->crtc);
|
||||
mutex_lock(&hdmi->mutex);
|
||||
|
||||
if (hdmi->dclk_en) {
|
||||
@@ -3570,6 +3572,9 @@ static void dw_hdmi_qp_bridge_atomic_enable(struct drm_bridge *bridge,
|
||||
if (link_cfg && link_cfg->frl_mode)
|
||||
queue_work(hdmi->workqueue, &hdmi->flt_work);
|
||||
|
||||
if (hdmi->plat_data->crtc_post_enable)
|
||||
hdmi->plat_data->crtc_post_enable(data, bridge->encoder->crtc);
|
||||
|
||||
dw_hdmi_qp_init_audio_infoframe(hdmi);
|
||||
dw_hdmi_qp_audio_enable(hdmi);
|
||||
hdmi_clk_regenerator_update_pixel_clock(hdmi);
|
||||
|
||||
@@ -3200,6 +3200,46 @@ static void dw_hdmi_rockchip_get_mode_color_caps(struct drm_connector *connector
|
||||
hdmi->mode_color_caps, &connector->base, property);
|
||||
}
|
||||
|
||||
static void dw_hdmi_rockchip_crtc_post_enable(void *data, struct drm_crtc *crtc)
|
||||
{
|
||||
struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
|
||||
int output_if;
|
||||
|
||||
switch (hdmi->id) {
|
||||
case 0:
|
||||
output_if = VOP_OUTPUT_IF_HDMI0;
|
||||
break;
|
||||
case 1:
|
||||
output_if = VOP_OUTPUT_IF_HDMI1;
|
||||
break;
|
||||
default:
|
||||
dev_err(hdmi->dev, "invalid id:%d\n", hdmi->id);
|
||||
return;
|
||||
}
|
||||
|
||||
rockchip_drm_crtc_output_post_enable(crtc, output_if);
|
||||
}
|
||||
|
||||
static void dw_hdmi_rockchip_crtc_pre_disable(void *data, struct drm_crtc *crtc)
|
||||
{
|
||||
struct rockchip_hdmi *hdmi = (struct rockchip_hdmi *)data;
|
||||
int output_if;
|
||||
|
||||
switch (hdmi->id) {
|
||||
case 0:
|
||||
output_if = VOP_OUTPUT_IF_HDMI0;
|
||||
break;
|
||||
case 1:
|
||||
output_if = VOP_OUTPUT_IF_HDMI1;
|
||||
break;
|
||||
default:
|
||||
dev_err(hdmi->dev, "invalid id:%d\n", hdmi->id);
|
||||
return;
|
||||
}
|
||||
|
||||
rockchip_drm_crtc_output_pre_disable(crtc, output_if);
|
||||
}
|
||||
|
||||
static const struct drm_prop_enum_list color_depth_enum_list[] = {
|
||||
{ 0, "Automatic" }, /* Prefer highest color depth */
|
||||
{ 8, "24bit" },
|
||||
@@ -4433,6 +4473,10 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
|
||||
dw_hdmi_rockchip_force_frl_rate;
|
||||
plat_data->get_mode_color_caps =
|
||||
dw_hdmi_rockchip_get_mode_color_caps;
|
||||
plat_data->crtc_pre_disable =
|
||||
dw_hdmi_rockchip_crtc_pre_disable;
|
||||
plat_data->crtc_post_enable =
|
||||
dw_hdmi_rockchip_crtc_post_enable;
|
||||
plat_data->property_ops = &dw_hdmi_rockchip_property_ops;
|
||||
|
||||
secondary = rockchip_hdmi_find_by_id(dev->driver, !hdmi->id);
|
||||
|
||||
@@ -284,6 +284,8 @@ struct dw_hdmi_plat_data {
|
||||
void (*force_frl_rate)(void *data, u8 rate);
|
||||
void (*get_mode_color_caps)(struct drm_connector *connector, struct drm_display_info *info,
|
||||
void *data);
|
||||
void (*crtc_pre_disable)(void *data, struct drm_crtc *crtc);
|
||||
void (*crtc_post_enable)(void *data, struct drm_crtc *crtc);
|
||||
|
||||
/* Vendor Property support */
|
||||
const struct dw_hdmi_property_ops *property_ops;
|
||||
|
||||
Reference in New Issue
Block a user