crtc_state->active = true;
} else {
- const struct drm_crtc_helper_funcs *funcs;
const struct drm_encoder_helper_funcs *encoder_helper_funcs;
const struct drm_connector_helper_funcs *connector_helper_funcs;
+ struct rockchip_drm_private *priv = drm_dev->dev_private;
struct drm_encoder *encoder;
+ int pipe = drm_crtc_index(crtc);
- funcs = crtc->helper_private;
connector_helper_funcs = connector->helper_private;
- if (!funcs || !funcs->enable ||
+ if (!priv->crtc_funcs[pipe] ||
+ !priv->crtc_funcs[pipe]->loader_protect ||
!connector_helper_funcs ||
!connector_helper_funcs->best_encoder)
return -ENXIO;
conn_state);
if (ret)
return ret;
- funcs->enable(crtc);
+ priv->crtc_funcs[pipe]->loader_protect(crtc, true);
}
primary_state = drm_atomic_get_plane_state(state, crtc->primary);
/*
* Rockchip drm private crtc funcs.
+ * @loader_protect: protect loader logo crtc's power
* @enable_vblank: enable crtc vblank irq.
* @disable_vblank: disable crtc vblank irq.
*/
struct rockchip_crtc_funcs {
+ int (*loader_protect)(struct drm_crtc *crtc, bool on);
int (*enable_vblank)(struct drm_crtc *crtc);
void (*disable_vblank)(struct drm_crtc *crtc);
void (*wait_for_update)(struct drm_crtc *crtc);
/* mutex vsync_ work */
struct mutex vsync_mutex;
bool vsync_work_pending;
+ bool loader_protect;
struct completion dsp_hold_completion;
struct completion wait_update_complete;
struct drm_pending_vblank_event *event;
spin_unlock_irqrestore(&drm->event_lock, flags);
}
+static int vop_crtc_loader_protect(struct drm_crtc *crtc, bool on)
+{
+ struct vop *vop = to_vop(crtc);
+
+ if (on == vop->loader_protect)
+ return 0;
+
+ if (on) {
+ vop_enable(crtc);
+ vop->loader_protect = true;
+ } else {
+ vop_crtc_disable(crtc);
+
+ vop->loader_protect = false;
+ }
+
+ return 0;
+}
+
static const struct rockchip_crtc_funcs private_crtc_funcs = {
+ .loader_protect = vop_crtc_loader_protect,
.enable_vblank = vop_crtc_enable_vblank,
.disable_vblank = vop_crtc_disable_vblank,
.wait_for_update = vop_crtc_wait_for_update,