On Mon, 2022-06-06 at 13:15 +0000, Souza, Jose wrote: > On Mon, 2022-06-06 at 11:16 +0300, Jani Nikula wrote: > > On Mon, 06 Jun 2022, "Hogander, Jouni" <jouni.hogander@xxxxxxxxx> > > wrote: > > > On Fri, 2022-06-03 at 16:32 +0000, Souza, Jose wrote: > > > > On Fri, 2022-06-03 at 13:14 +0000, Hogander, Jouni wrote: > > > > > On Fri, 2022-06-03 at 15:43 +0300, Jani Nikula wrote: > > > > > > On Fri, 03 Jun 2022, Jouni Högander < > > > > > > jouni.hogander@xxxxxxxxx> > > > > > > wrote: > > > > > > > Export headless sku bit (bit 13) from opregion->header- > > > > > > > >pcon as > > > > > > > an > > > > > > > interface to check if our device is headless > > > > > > > configuration. > > > > > > > > > > > > > > Bspec: 53441 > > > > > > > Signed-off-by: Jouni Högander <jouni.hogander@xxxxxxxxx> > > > > > > > --- > > > > > > > drivers/gpu/drm/i915/display/intel_opregion.c | 12 > > > > > > > ++++++++++++ > > > > > > > drivers/gpu/drm/i915/display/intel_opregion.h | 7 > > > > > > > +++++++ > > > > > > > 2 files changed, 19 insertions(+) > > > > > > > > > > > > > > diff --git > > > > > > > a/drivers/gpu/drm/i915/display/intel_opregion.c > > > > > > > b/drivers/gpu/drm/i915/display/intel_opregion.c > > > > > > > index f31e8c3f8ce0..eab3f2e6b786 100644 > > > > > > > --- a/drivers/gpu/drm/i915/display/intel_opregion.c > > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_opregion.c > > > > > > > @@ -53,6 +53,8 @@ > > > > > > > #define MBOX_ASLE_EXTBIT(4)/* Mailbox #5 */ > > > > > > > #define MBOX_BACKLIGHTBIT(5)/* Mailbox #2 > > > > > > > (valid from v3.x) */ > > > > > > > > > > > > > > +#define PCON_HEADLESS_SKUBIT(13) > > > > > > > > > > > > Here we go again. > > > > > > > > > > > > What does headless mean here? The spec does not say. Does > > > > > > it have > > > > > > display hardware? Apparently yes, since otherwise we > > > > > > wouldn't be > > > > > > here. > > > > > > > > > > This is for hybrid setup with several display hw and the > > > > > panel wont > > > > > be > > > > > connected into device driven by i915 driver. > > > > > > > > > > > We have INTEL_DISPLAY_ENABLED() which should do the right > > > > > > thing > > > > > > when > > > > > > you > > > > > > do have display hardware and have done output setup etc. > > > > > > but want > > > > > > to > > > > > > force them disconnected, i.e. you take the hardware over > > > > > > properly, > > > > > > but > > > > > > put it to sleep for power savings. > > > > > > > > > > > > Maybe we should bolt this opregion check in that macro? > > > > > > > > > > > > Maybe we need to use INTEL_DISPLAY_ENABLED() also to > > > > > > prevent > > > > > > polling. > > > > > > > > > > Thank you for pointing this out. HAS_DISPLAY I already notice > > > > > and > > > > > it's > > > > > not suitable for what we want here. I think bolting this > > > > > check into > > > > > INTEL_DISPLAY_ENABLED as you suggested is enough. That will > > > > > prevent > > > > > waking up the hw into D0 state for polling. > > > > > > > > A headless sku should not have any DDI ports enabled, much > > > > easier > > > > check for that. > > > > > > Could you please clarify this a bit? What exactly you are > > > thinking > > > should be checked? Aren't DDI port also disabled when non- > > > headless > > > setup is in runtime suspend? > > > > I also think "headless" and "DDI ports enabled" need clarification. > > They > > are overloaded terms. > > In a properly setup headless sku, VBT should have all ports marked as > disabled. > > intel_ddi_init() { > ... > > if (!init_dp && !init_hdmi) { > drm_dbg_kms(&dev_priv->drm, > "VBT says port %c is not DVI/HDMI/DP compatible, respect it\n", > port_name(port)); > return; > } > > > All DDI should return earlier in the above. > So you can use the number of enabled connectors to know if it is a > headless sku or not. > > So you can skip the pooling in case there is no connectors. I went through this and to my understanding this polling doesn't happen in setup where all ports are marked as disabled in VBT. Connector is not initialized at all -> polling is not enabled when runtime suspend happens. BR, Jouni Högander