#define dpms_blanked(dpms) ((dpms) != DRM_MODE_DPMS_ON)
-static void armada_drm_crtc_update(struct armada_crtc *dcrtc)
+static void armada_drm_crtc_update(struct armada_crtc *dcrtc, bool enable)
{
uint32_t dumb_ctrl;
dumb_ctrl = dcrtc->cfg_dumb_ctrl;
- if (!dpms_blanked(dcrtc->dpms))
+ if (enable)
dumb_ctrl |= CFG_DUMB_ENA;
/*
* force LCD_D[23:0] to output blank color, overriding the GPIO or
* SPI usage. So leave it as-is unless in DUMB24_RGB888_0 mode.
*/
- if (dpms_blanked(dcrtc->dpms) &&
- (dumb_ctrl & DUMB_MASK) == DUMB24_RGB888_0) {
+ if (!enable && (dumb_ctrl & DUMB_MASK) == DUMB24_RGB888_0) {
dumb_ctrl &= ~DUMB_MASK;
dumb_ctrl |= DUMB_BLANK;
}
else if (dcrtc->variant->enable)
dcrtc->variant->enable(dcrtc, &crtc->hwmode);
dcrtc->dpms = dpms;
- armada_drm_crtc_update(dcrtc);
+ armada_drm_crtc_update(dcrtc, !dpms_blanked(dcrtc->dpms));
if (!dpms_blanked(dpms))
drm_crtc_vblank_on(&dcrtc->crtc);
else if (dcrtc->variant->disable)
struct armada_crtc *dcrtc = drm_to_armada_crtc(crtc);
dcrtc->dpms = DRM_MODE_DPMS_ON;
- armada_drm_crtc_update(dcrtc);
+ armada_drm_crtc_update(dcrtc, true);
drm_crtc_vblank_on(crtc);
armada_drm_crtc_queue_state_event(crtc);