All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Jouni Högander" <jouni.hogander@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 1/3] drm/i915/opregion: add function to check if headless sku
Date: Fri, 10 Jun 2022 11:02:57 +0300	[thread overview]
Message-ID: <878rq50wum.fsf@intel.com> (raw)
In-Reply-To: <20220610071704.4150527-2-jouni.hogander@intel.com>

On Fri, 10 Jun 2022, Jouni Högander <jouni.hogander@intel.com> wrote:
> Export headless sku bit (bit 13) from opregion->header->pcon as an
> interface to check if our device is headless configuration.
>
> This is mainly targeted for hybrid gfx systems. E.g. when display
> is not supposed to be connected discrete graphics card it's
> opregion can inform this is headless graphics card.
>
> v2: Check also opregion version
>
> Bspec: 53441
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_opregion.c | 14 ++++++++++++++
>  drivers/gpu/drm/i915/display/intel_opregion.h |  7 +++++++
>  2 files changed, 21 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_opregion.c b/drivers/gpu/drm/i915/display/intel_opregion.c
> index f31e8c3f8ce0..6876ba30d5a9 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_EXT		BIT(4)	/* Mailbox #5 */
>  #define MBOX_BACKLIGHT		BIT(5)	/* Mailbox #2 (valid from v3.x) */
>  
> +#define PCON_HEADLESS_SKU	BIT(13)
> +
>  struct opregion_header {
>  	u8 signature[16];
>  	u32 size;
> @@ -1135,6 +1137,18 @@ struct edid *intel_opregion_get_edid(struct intel_connector *intel_connector)
>  	return new_edid;
>  }
>  
> +bool intel_opregion_headless_sku(struct drm_i915_private *i915)
> +{
> +	struct intel_opregion *opregion = &i915->opregion;
> +	struct opregion_header *header = opregion->header;
> +
> +	if (!header || header->over.major < 2 ||
> +	    (header->over.major == 2 && header->over.minor < 3))
> +		return false;
> +
> +	return opregion->header->pcon & PCON_HEADLESS_SKU;
> +}
> +
>  void intel_opregion_register(struct drm_i915_private *i915)
>  {
>  	struct intel_opregion *opregion = &i915->opregion;
> diff --git a/drivers/gpu/drm/i915/display/intel_opregion.h b/drivers/gpu/drm/i915/display/intel_opregion.h
> index 82cc0ba34af7..5ad96e1d8278 100644
> --- a/drivers/gpu/drm/i915/display/intel_opregion.h
> +++ b/drivers/gpu/drm/i915/display/intel_opregion.h
> @@ -76,6 +76,8 @@ int intel_opregion_notify_adapter(struct drm_i915_private *dev_priv,
>  int intel_opregion_get_panel_type(struct drm_i915_private *dev_priv);
>  struct edid *intel_opregion_get_edid(struct intel_connector *connector);
>  
> +bool intel_opregion_headless_sku(struct drm_i915_private *i915);
> +
>  #else /* CONFIG_ACPI*/
>  
>  static inline int intel_opregion_setup(struct drm_i915_private *dev_priv)
> @@ -127,6 +129,11 @@ intel_opregion_get_edid(struct intel_connector *connector)
>  	return NULL;
>  }
>  
> +bool intel_opregion_headless_sku(struct drm_i915_private *i915)

This needs to be static inline.

With that fixed, the series is

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


> +{
> +	return false;
> +}
> +
>  #endif /* CONFIG_ACPI */
>  
>  #endif

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-06-10  8:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  7:17 [Intel-gfx] [PATCH v2 0/3] Disable connector polling for a headless sku Jouni Högander
2022-06-10  7:17 ` [Intel-gfx] [PATCH v2 1/3] drm/i915/opregion: add function to check if " Jouni Högander
2022-06-10  8:02   ` Jani Nikula [this message]
2022-06-10  7:17 ` [Intel-gfx] [PATCH v2 2/3] drm/i915: Do not start connector polling if display is disabled Jouni Högander
2022-06-10  7:17 ` [Intel-gfx] [PATCH v2 3/3] drm/i915: Do not start connector polling on headless sku Jouni Högander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rq50wum.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jouni.hogander@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.