drm/i915: Parametrize DDI_BUF_TRANS registers

FIXME: Should there be a WARN(i != 9) or something, or what does the
entry 9 comment mean?

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Ville Syrjälä 2015-09-18 20:03:22 +03:00 committed by Daniel Vetter
parent 184d7c0622
commit 9712e68840
2 changed files with 11 additions and 11 deletions

View File

@ -7197,7 +7197,8 @@ enum skl_disp_power_wells {
/* DDI Buffer Translations */ /* DDI Buffer Translations */
#define DDI_BUF_TRANS_A 0x64E00 #define DDI_BUF_TRANS_A 0x64E00
#define DDI_BUF_TRANS_B 0x64E60 #define DDI_BUF_TRANS_B 0x64E60
#define DDI_BUF_TRANS(port) _PORT(port, DDI_BUF_TRANS_A, DDI_BUF_TRANS_B) #define DDI_BUF_TRANS_LO(port, i) (_PORT(port, DDI_BUF_TRANS_A, DDI_BUF_TRANS_B) + (i) * 8)
#define DDI_BUF_TRANS_HI(port, i) (_PORT(port, DDI_BUF_TRANS_A, DDI_BUF_TRANS_B) + (i) * 8 + 4)
/* Sideband Interface (SBI) is programmed indirectly, via /* Sideband Interface (SBI) is programmed indirectly, via
* SBI_ADDR, which contains the register offset; and SBI_DATA, * SBI_ADDR, which contains the register offset; and SBI_DATA,

View File

@ -414,7 +414,6 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port,
bool supports_hdmi) bool supports_hdmi)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
u32 reg;
u32 iboost_bit = 0; u32 iboost_bit = 0;
int i, n_hdmi_entries, n_dp_entries, n_edp_entries, hdmi_default_entry, int i, n_hdmi_entries, n_dp_entries, n_edp_entries, hdmi_default_entry,
size; size;
@ -505,11 +504,11 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port,
BUG(); BUG();
} }
for (i = 0, reg = DDI_BUF_TRANS(port); i < size; i++) { for (i = 0; i < size; i++) {
I915_WRITE(reg, ddi_translations[i].trans1 | iboost_bit); I915_WRITE(DDI_BUF_TRANS_LO(port, i),
reg += 4; ddi_translations[i].trans1 | iboost_bit);
I915_WRITE(reg, ddi_translations[i].trans2); I915_WRITE(DDI_BUF_TRANS_HI(port, i),
reg += 4; ddi_translations[i].trans2);
} }
if (!supports_hdmi) if (!supports_hdmi)
@ -521,10 +520,10 @@ static void intel_prepare_ddi_buffers(struct drm_device *dev, enum port port,
hdmi_level = hdmi_default_entry; hdmi_level = hdmi_default_entry;
/* Entry 9 is for HDMI: */ /* Entry 9 is for HDMI: */
I915_WRITE(reg, ddi_translations_hdmi[hdmi_level].trans1 | iboost_bit); I915_WRITE(DDI_BUF_TRANS_LO(port, i),
reg += 4; ddi_translations_hdmi[hdmi_level].trans1 | iboost_bit);
I915_WRITE(reg, ddi_translations_hdmi[hdmi_level].trans2); I915_WRITE(DDI_BUF_TRANS_HI(port, i),
reg += 4; ddi_translations_hdmi[hdmi_level].trans2);
} }
/* Program DDI buffers translations for DP. By default, program ports A-D in DP /* Program DDI buffers translations for DP. By default, program ports A-D in DP