{
struct analogix_dp_device *dp = to_dp(connector);
- if (on == connector->loader_protect)
- return 0;
-
- if (on) {
+ if (on)
pm_runtime_get_sync(dp->dev);
-
- connector->loader_protect = true;
- } else {
+ else
pm_runtime_put(dp->dev);
- connector->loader_protect = false;
- }
-
return 0;
}
dp->plat_data->power_off(dp->plat_data);
pm_runtime_put_sync(dp->dev);
- if (dp->connector.loader_protect) {
- pm_runtime_put_sync(dp->dev);
- dp->connector.loader_protect = false;
- }
dp->dpms_mode = DRM_MODE_DPMS_OFF;
}
for_each_connector_in_state(old_state, connector, old_conn_state, i) {
const struct drm_encoder_helper_funcs *funcs;
+ const struct drm_connector_helper_funcs *conn_funcs;
struct drm_encoder *encoder;
struct drm_crtc_state *old_crtc_state;
DRM_DEBUG_ATOMIC("disabling [ENCODER:%d:%s]\n",
encoder->base.id, encoder->name);
+ conn_funcs = connector->helper_private;
+ if (connector->loader_protect) {
+ drm_bridge_pre_enable(encoder->bridge);
+
+ if (funcs->enable)
+ funcs->enable(encoder);
+ else
+ funcs->commit(encoder);
+
+ drm_bridge_enable(encoder->bridge);
+
+ if (conn_funcs->loader_protect)
+ conn_funcs->loader_protect(connector, false);
+ connector->loader_protect = false;
+ }
/*
* Each encoder has at most one connector (since we always steal
* it away), so we won't call disable hooks twice.
conn_state->best_encoder = funcs->best_encoder(connector);
if (funcs->loader_protect)
funcs->loader_protect(connector, true);
+ connector->loader_protect = true;
num_modes = connector->funcs->fill_modes(connector, 4096, 4096);
if (!num_modes) {
dev_err(drm_dev->dev, "connector[%s] can't found any modes\n",
error:
if (funcs->loader_protect)
funcs->loader_protect(connector, false);
+ connector->loader_protect = false;
return ret;
}