Skip to content

Commit

Permalink
drm/i915/dg1: Add fake PCH
Browse files Browse the repository at this point in the history
DG1 has the south engine display on the same PCI device. Ideally we
could use HAS_PCH_SPLIT(), but that macro is misused all across the
code base to rather signify a range of gens. So add a fake one for DG1
to be used where needed.

Cc: Aditya Swarup <[email protected]>
Signed-off-by: Lucas De Marchi <[email protected]>
Reviewed-by: Anusha Srivatsa <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
lucasdemarchi committed Jul 14, 2020
1 parent f619e51 commit 51e3a64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/i915/intel_pch.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ void intel_detect_pch(struct drm_i915_private *dev_priv)
{
struct pci_dev *pch = NULL;

/* DG1 has south engine display on the same PCI device */
if (IS_DG1(dev_priv)) {
dev_priv->pch_type = PCH_DG1;
return;
}

/*
* The reason to probe ISA bridge instead of Dev31:Fun0 is to
* make graphics device passthrough work easy for VMM, that only
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/i915/intel_pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ enum intel_pch {
PCH_JSP, /* Jasper Lake PCH */
PCH_MCC, /* Mule Creek Canyon PCH */
PCH_TGP, /* Tiger Lake PCH */

/* Fake PCHs, functionality handled on the same PCI dev */
PCH_DG1 = 1024,
};

#define INTEL_PCH_DEVICE_ID_MASK 0xff80
Expand Down Expand Up @@ -56,6 +59,7 @@ enum intel_pch {

#define INTEL_PCH_TYPE(dev_priv) ((dev_priv)->pch_type)
#define INTEL_PCH_ID(dev_priv) ((dev_priv)->pch_id)
#define HAS_PCH_DG1(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_DG1)
#define HAS_PCH_JSP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_JSP)
#define HAS_PCH_MCC(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_MCC)
#define HAS_PCH_TGP(dev_priv) (INTEL_PCH_TYPE(dev_priv) == PCH_TGP)
Expand Down

0 comments on commit 51e3a64

Please sign in to comment.