From: Mark Kettenis Subject: Re: sys/qcdpc: blank eDP panels during suspend To: Kirill A. Korinsky Cc: tech@openbsd.org Date: Mon, 05 Oct 2026 21:46:37 +0200 > Date: Mon, 05 Oct 2026 16:17:09 +0200 > From: Kirill A. Korinsky > > and here I belive the correct diff. So as I indicated earlier today, I have some questions about this diff. * What does this command actually do? I thought I had a copy of the relevant standard somewhere, but I haven't found it yet. The name of the command suggests that it blanks the display. But what we actually want is to power down the display... * Does this disable the backlight? * Do all eDP panels support this command? As far as I can tell the Linux kernel doesn't use it. That could mean that it doesn't work across the board. At some point I looked into powering off the panel in my vivobook. But this Samsung panel seems to require some specific power sequencing to turn it back on. I'll see if I can find that tree again... > Index: sys/dev/fdt/qcdpc.c > =================================================================== > RCS file: /home/cvs/src/sys/dev/fdt/qcdpc.c,v > diff -u -p -r1.2 qcdpc.c > --- sys/dev/fdt/qcdpc.c 9 Mar 2026 23:57:53 -0000 1.2 > +++ sys/dev/fdt/qcdpc.c 5 Oct 2026 14:05:20 -0000 > @@ -71,15 +71,19 @@ struct qcdpc_softc { > > struct drm_edp_backlight_info sc_bl; > uint32_t sc_bl_level; > + uint8_t sc_bl_control; > + int sc_bl_suspended; > }; > > struct qcdpc_softc *qcdpc_bl; > > int qcdpc_match(struct device *, void *, void *); > void qcdpc_attach(struct device *, struct device *, void *); > +int qcdpc_activate(struct device *, int); > > const struct cfattach qcdpc_ca = { > - sizeof(struct qcdpc_softc), qcdpc_match, qcdpc_attach > + sizeof(struct qcdpc_softc), qcdpc_match, qcdpc_attach, > + NULL, qcdpc_activate > }; > > struct cfdriver qcdpc_cd = { > @@ -174,6 +178,46 @@ qcdpc_attach(struct device *parent, stru > fa.fa_node = node; > config_found(self, &fa, qcdpc_print); > } > +} > + > +int > +qcdpc_activate(struct device *self, int act) > +{ > + struct qcdpc_softc *sc = (struct qcdpc_softc *)self; > + int ret; > + > + switch (act) { > + case DVACT_QUIESCE: > + ret = config_activate_children(self, act); > + if (ret) > + return ret; > + if (!sc->sc_bl.aux_enable) > + break; > + > + if (!sc->sc_bl_suspended) { > + if (drm_dp_dpcd_read_byte(&sc->sc_aux, > + DP_EDP_DISPLAY_CONTROL_REGISTER, > + &sc->sc_bl_control) < 0) > + break; > + sc->sc_bl_suspended = 1; > + } > + (void) drm_dp_dpcd_write_byte(&sc->sc_aux, > + DP_EDP_DISPLAY_CONTROL_REGISTER, > + DP_EDP_BLACK_VIDEO_ENABLE); > + break; > + case DVACT_WAKEUP: > + if (sc->sc_bl_suspended) { > + if (drm_dp_dpcd_write_byte(&sc->sc_aux, > + DP_EDP_DISPLAY_CONTROL_REGISTER, > + sc->sc_bl_control) == 0) > + sc->sc_bl_suspended = 0; > + } > + return config_activate_children(self, act); > + default: > + return config_activate_children(self, act); > + } > + > + return ret; > } > > int > > > -- > wbr, Kirill > >