mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
drm/i915/opregion: add function to check if headless sku
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. v3: Dummy version is now static inline function v2: Check also opregion version Bspec: 53441 Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Jouni Högander <jouni.hogander@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220610085429.52935-2-jouni.hogander@intel.com
This commit is contained in:
parent
8d2ba05b09
commit
eb2983c09f
2 changed files with 21 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
static inline bool intel_opregion_headless_sku(struct drm_i915_private *i915)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ACPI */
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue