-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The HTI or HDPORT handling is sprinkled around. Centralize to one place. Add a note about how subtle the mapping from HDPORT_STATE register to dpll mask actually is. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221109144209.3624739-1-jani.nikula@intel.com
- Loading branch information
Jani Nikula
committed
Nov 17, 2022
1 parent
164312d
commit 03120fe
Showing
8 changed files
with
79 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// SPDX-License-Identifier: MIT | ||
/* | ||
* Copyright © 2022 Intel Corporation | ||
*/ | ||
|
||
#include "i915_drv.h" | ||
#include "intel_de.h" | ||
#include "intel_display.h" | ||
#include "intel_hti.h" | ||
#include "intel_hti_regs.h" | ||
|
||
void intel_hti_init(struct drm_i915_private *i915) | ||
{ | ||
/* | ||
* If the platform has HTI, we need to find out whether it has reserved | ||
* any display resources before we create our display outputs. | ||
*/ | ||
if (INTEL_INFO(i915)->display.has_hti) | ||
i915->hti_state = intel_de_read(i915, HDPORT_STATE); | ||
} | ||
|
||
bool intel_hti_uses_phy(struct drm_i915_private *i915, enum phy phy) | ||
{ | ||
return i915->hti_state & HDPORT_ENABLED && | ||
i915->hti_state & HDPORT_DDI_USED(phy); | ||
} | ||
|
||
u32 intel_hti_dpll_mask(struct drm_i915_private *i915) | ||
{ | ||
if (!(i915->hti_state & HDPORT_ENABLED)) | ||
return 0; | ||
|
||
/* | ||
* Note: This is subtle. The values must coincide with what's defined | ||
* for the platform. | ||
*/ | ||
return REG_FIELD_GET(HDPORT_DPLL_USED_MASK, i915->hti_state); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* | ||
* Copyright © 2022 Intel Corporation | ||
*/ | ||
|
||
#ifndef __INTEL_HTI_H__ | ||
#define __INTEL_HTI_H__ | ||
|
||
#include <linux/types.h> | ||
|
||
struct drm_i915_private; | ||
enum phy; | ||
|
||
void intel_hti_init(struct drm_i915_private *i915); | ||
bool intel_hti_uses_phy(struct drm_i915_private *i915, enum phy phy); | ||
u32 intel_hti_dpll_mask(struct drm_i915_private *i915); | ||
|
||
#endif /* __INTEL_HTI_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* SPDX-License-Identifier: MIT */ | ||
/* | ||
* Copyright © 2022 Intel Corporation | ||
*/ | ||
|
||
#ifndef __INTEL_HTI_REGS_H__ | ||
#define __INTEL_HTI_REGS_H__ | ||
|
||
#include "i915_reg_defs.h" | ||
|
||
#define HDPORT_STATE _MMIO(0x45050) | ||
#define HDPORT_DPLL_USED_MASK REG_GENMASK(15, 12) | ||
#define HDPORT_DDI_USED(phy) REG_BIT(2 * (phy) + 1) | ||
#define HDPORT_ENABLED REG_BIT(0) | ||
|
||
#endif /* __INTEL_HTI_REGS_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters