aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2013-02-19 14:21:45 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-03-04 17:15:38 -0500
commitc20cd31252554b927ae1cce1c71ae8a769b1bd74 (patch)
tree95858efce35011e52223142d0c92de6bcb9c78c3
parente2debe919a859a350a542a361705a51e4567b6db (diff)
drm/i915: unify the definitions of the HDMI/SDVO register
Since they're all the same register, leave all the #defines at the same place, organized by Gen and also specify which bits are used by only a specific port or encoding. Also remove a few unused duplicates and adjust indentation. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h111
1 files changed, 55 insertions, 56 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 448e13c26c87..330b64d2614a 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1680,43 +1680,68 @@
1680#define SDVOC_HOTPLUG_INT_STATUS_I915 (1 << 7) 1680#define SDVOC_HOTPLUG_INT_STATUS_I915 (1 << 7)
1681#define SDVOB_HOTPLUG_INT_STATUS_I915 (1 << 6) 1681#define SDVOB_HOTPLUG_INT_STATUS_I915 (1 << 6)
1682 1682
1683/* SDVO port control */ 1683/* SDVO and HDMI port control.
1684#define GEN3_SDVOB 0x61140 1684 * The same register may be used for SDVO or HDMI */
1685#define GEN3_SDVOC 0x61160 1685#define GEN3_SDVOB 0x61140
1686#define PCH_SDVOB 0xe1140 1686#define GEN3_SDVOC 0x61160
1687#define SDVO_ENABLE (1 << 31) 1687#define GEN4_HDMIB GEN3_SDVOB
1688#define SDVO_PIPE_B_SELECT (1 << 30) 1688#define GEN4_HDMIC GEN3_SDVOC
1689#define SDVO_STALL_SELECT (1 << 29) 1689#define PCH_SDVOB 0xe1140
1690#define SDVO_INTERRUPT_ENABLE (1 << 26) 1690#define PCH_HDMIB PCH_SDVOB
1691#define PCH_HDMIC 0xe1150
1692#define PCH_HDMID 0xe1160
1693
1694/* Gen 3 SDVO bits: */
1695#define SDVO_ENABLE (1 << 31)
1696#define SDVO_PIPE_B_SELECT (1 << 30)
1697#define SDVO_STALL_SELECT (1 << 29)
1698#define SDVO_INTERRUPT_ENABLE (1 << 26)
1691/** 1699/**
1692 * 915G/GM SDVO pixel multiplier. 1700 * 915G/GM SDVO pixel multiplier.
1693 *
1694 * Programmed value is multiplier - 1, up to 5x. 1701 * Programmed value is multiplier - 1, up to 5x.
1695 *
1696 * \sa DPLL_MD_UDI_MULTIPLIER_MASK 1702 * \sa DPLL_MD_UDI_MULTIPLIER_MASK
1697 */ 1703 */
1698#define SDVO_PORT_MULTIPLY_MASK (7 << 23) 1704#define SDVO_PORT_MULTIPLY_MASK (7 << 23)
1699#define SDVO_PORT_MULTIPLY_SHIFT 23 1705#define SDVO_PORT_MULTIPLY_SHIFT 23
1700#define SDVO_PHASE_SELECT_MASK (15 << 19) 1706#define SDVO_PHASE_SELECT_MASK (15 << 19)
1701#define SDVO_PHASE_SELECT_DEFAULT (6 << 19) 1707#define SDVO_PHASE_SELECT_DEFAULT (6 << 19)
1702#define SDVO_CLOCK_OUTPUT_INVERT (1 << 18) 1708#define SDVO_CLOCK_OUTPUT_INVERT (1 << 18)
1703#define SDVOC_GANG_MODE (1 << 16) 1709#define SDVOC_GANG_MODE (1 << 16) /* Port C only */
1704#define SDVO_ENCODING_SDVO (0x0 << 10) 1710#define SDVO_BORDER_ENABLE (1 << 7) /* SDVO only */
1705#define SDVO_ENCODING_HDMI (0x2 << 10) 1711#define SDVOB_PCIE_CONCURRENCY (1 << 3) /* Port B only */
1706/** Requird for HDMI operation */ 1712#define SDVO_DETECTED (1 << 2)
1707#define SDVO_NULL_PACKETS_DURING_VSYNC (1 << 9)
1708#define SDVO_COLOR_RANGE_16_235 (1 << 8)
1709#define SDVO_BORDER_ENABLE (1 << 7)
1710#define SDVO_AUDIO_ENABLE (1 << 6)
1711/** New with 965, default is to be set */
1712#define SDVO_VSYNC_ACTIVE_HIGH (1 << 4)
1713/** New with 965, default is to be set */
1714#define SDVO_HSYNC_ACTIVE_HIGH (1 << 3)
1715#define SDVOB_PCIE_CONCURRENCY (1 << 3)
1716#define SDVO_DETECTED (1 << 2)
1717/* Bits to be preserved when writing */ 1713/* Bits to be preserved when writing */
1718#define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14) | (1 << 26)) 1714#define SDVOB_PRESERVE_MASK ((1 << 17) | (1 << 16) | (1 << 14) | \
1719#define SDVOC_PRESERVE_MASK ((1 << 17) | (1 << 26)) 1715 SDVO_INTERRUPT_ENABLE)
1716#define SDVOC_PRESERVE_MASK ((1 << 17) | SDVO_INTERRUPT_ENABLE)
1717
1718/* Gen 4 SDVO/HDMI bits: */
1719#define COLOR_FORMAT_8bpc (0 << 26)
1720#define SDVO_ENCODING_SDVO (0 << 10)
1721#define SDVO_ENCODING_HDMI (2 << 10)
1722#define SDVO_NULL_PACKETS_DURING_VSYNC (1 << 9) /* HDMI only */
1723#define SDVO_COLOR_RANGE_16_235 (1 << 8) /* HDMI only */
1724#define SDVO_AUDIO_ENABLE (1 << 6)
1725/* VSYNC/HSYNC bits new with 965, default is to be set */
1726#define SDVO_VSYNC_ACTIVE_HIGH (1 << 4)
1727#define SDVO_HSYNC_ACTIVE_HIGH (1 << 3)
1728
1729/* Gen 5 (IBX) SDVO/HDMI bits: */
1730#define COLOR_FORMAT_12bpc (3 << 26) /* HDMI only */
1731#define SDVOB_HOTPLUG_ENABLE (1 << 23) /* SDVO only */
1732
1733/* Gen 6 (CPT) SDVO/HDMI bits: */
1734#define TRANSCODER_CPT(pipe) ((pipe) << 29)
1735#define TRANSCODER_MASK_CPT (3 << 29)
1736
1737/* Repeated but still used bits: */
1738#define PORT_ENABLE (1 << 31)
1739#define TRANSCODER(pipe) ((pipe) << 30)
1740#define TRANSCODER_MASK (1 << 30)
1741#define HDMI_MODE_SELECT (1 << 9)
1742#define DVI_MODE_SELECT (0 << 9)
1743#define PORT_DETECTED (1 << 2)
1744
1720 1745
1721/* DVO port control */ 1746/* DVO port control */
1722#define DVOA 0x61120 1747#define DVOA 0x61120
@@ -3983,32 +4008,6 @@
3983#define FDI_PLL_CTL_1 0xfe000 4008#define FDI_PLL_CTL_1 0xfe000
3984#define FDI_PLL_CTL_2 0xfe004 4009#define FDI_PLL_CTL_2 0xfe004
3985 4010
3986/* The same register may be used for SDVO or HDMI */
3987#define GEN4_HDMIB GEN3_SDVOB
3988#define GEN4_HDMIC GEN3_SDVOC
3989#define PCH_HDMIB PCH_SDVOB
3990#define PCH_HDMIC 0xe1150
3991#define PCH_HDMID 0xe1160
3992#define PORT_ENABLE (1 << 31)
3993#define TRANSCODER(pipe) ((pipe) << 30)
3994#define TRANSCODER_CPT(pipe) ((pipe) << 29)
3995#define TRANSCODER_MASK (1 << 30)
3996#define TRANSCODER_MASK_CPT (3 << 29)
3997#define COLOR_FORMAT_8bpc (0)
3998#define COLOR_FORMAT_12bpc (3 << 26)
3999#define SDVOB_HOTPLUG_ENABLE (1 << 23)
4000#define SDVO_ENCODING (0)
4001#define TMDS_ENCODING (2 << 10)
4002#define NULL_PACKET_VSYNC_ENABLE (1 << 9)
4003/* CPT */
4004#define HDMI_MODE_SELECT (1 << 9)
4005#define DVI_MODE_SELECT (0)
4006#define SDVOB_BORDER_ENABLE (1 << 7)
4007#define AUDIO_ENABLE (1 << 6)
4008#define VSYNC_ACTIVE_HIGH (1 << 4)
4009#define HSYNC_ACTIVE_HIGH (1 << 3)
4010#define PORT_DETECTED (1 << 2)
4011
4012#define PCH_LVDS 0xe1180 4011#define PCH_LVDS 0xe1180
4013#define LVDS_DETECTED (1 << 1) 4012#define LVDS_DETECTED (1 << 1)
4014 4013