diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-15 00:19:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-15 00:19:54 -0500 |
commit | 049ffa8ab33a63b3bff672d1a0ee6a35ad253fe8 (patch) | |
tree | 70f4c684818b1c9871fa800088427e40d260592e /drivers/gpu/drm/i915/intel_sideband.c | |
parent | c681427e5ca22925fcc1be76a2e260a11e0a8498 (diff) | |
parent | 0846c728e20a0cd1e43fb75a3015f3b176a26466 (diff) |
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie:
"This is a combo of -next and some -fixes that came in in the
intervening time.
Highlights:
New drivers:
ARM Armada driver for Marvell Armada 510 SOCs
Intel:
Broadwell initial support under a default off switch,
Stereo/3D HDMI mode support
Valleyview improvements
Displayport improvements
Haswell fixes
initial mipi dsi panel support
CRC support for debugging
build with CONFIG_FB=n
Radeon:
enable DPM on a number of GPUs by default
secondary GPU powerdown support
enable HDMI audio by default
Hawaii support
Nouveau:
dynamic pm code infrastructure reworked, does nothing major yet
GK208 modesetting support
MSI fixes, on by default again
PMPEG improvements
pageflipping fixes
GMA500:
minnowboard SDVO support
VMware:
misc fixes
MSM:
prime, plane and rendernodes support
Tegra:
rearchitected to put the drm driver into the drm subsystem.
HDMI and gr2d support for tegra 114 SoC
QXL:
oops fix, and multi-head fixes
DRM core:
sysfs lifetime fixes
client capability ioctl
further cleanups to device midlayer
more vblank timestamp fixes"
* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (789 commits)
drm/nouveau: do not map evicted vram buffers in nouveau_bo_vma_add
drm/nvc0-/gr: shift wrapping bug in nvc0_grctx_generate_r406800
drm/nouveau/pwr: fix missing mutex unlock in a failure path
drm/nv40/therm: fix slowing down fan when pstate undefined
drm/nv11-: synchronise flips to vblank, unless async flip requested
drm/nvc0-: remove nasty fifo swmthd hack for flip completion method
drm/nv10-: we no longer need to create nvsw object on user channels
drm/nouveau: always queue flips relative to kernel channel activity
drm/nouveau: there is no need to reserve/fence the new fb when flipping
drm/nouveau: when bailing out of a pushbuf ioctl, do not remove previous fence
drm/nouveau: allow nouveau_fence_ref() to be a noop
drm/nvc8/mc: msi rearm is via the nvc0 method
drm/ttm: Fix vma page_prot bit manipulation
drm/vmwgfx: Fix a couple of compile / sparse warnings and errors
drm/vmwgfx: Resource evict fixes
drm/edid: compare actual vrefresh for all modes for quirks
drm: shmob_drm: Convert to clk_prepare/unprepare
drm/nouveau: fix 32-bit build
drm/i915/opregion: fix build error on CONFIG_ACPI=n
Revert "drm/radeon/audio: don't set speaker allocation on DCE4+"
...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_sideband.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_sideband.c | 79 |
1 files changed, 73 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_sideband.c b/drivers/gpu/drm/i915/intel_sideband.c index 9a0e6c5ea540..9944d8135e87 100644 --- a/drivers/gpu/drm/i915/intel_sideband.c +++ b/drivers/gpu/drm/i915/intel_sideband.c | |||
@@ -25,7 +25,10 @@ | |||
25 | #include "i915_drv.h" | 25 | #include "i915_drv.h" |
26 | #include "intel_drv.h" | 26 | #include "intel_drv.h" |
27 | 27 | ||
28 | /* IOSF sideband */ | 28 | /* |
29 | * IOSF sideband, see VLV2_SidebandMsg_HAS.docx and | ||
30 | * VLV_VLV2_PUNIT_HAS_0.8.docx | ||
31 | */ | ||
29 | static int vlv_sideband_rw(struct drm_i915_private *dev_priv, u32 devfn, | 32 | static int vlv_sideband_rw(struct drm_i915_private *dev_priv, u32 devfn, |
30 | u32 port, u32 opcode, u32 addr, u32 *val) | 33 | u32 port, u32 opcode, u32 addr, u32 *val) |
31 | { | 34 | { |
@@ -101,19 +104,83 @@ u32 vlv_nc_read(struct drm_i915_private *dev_priv, u8 addr) | |||
101 | return val; | 104 | return val; |
102 | } | 105 | } |
103 | 106 | ||
104 | u32 vlv_dpio_read(struct drm_i915_private *dev_priv, int reg) | 107 | u32 vlv_gpio_nc_read(struct drm_i915_private *dev_priv, u32 reg) |
105 | { | 108 | { |
106 | u32 val = 0; | 109 | u32 val = 0; |
110 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPIO_NC, | ||
111 | PUNIT_OPCODE_REG_READ, reg, &val); | ||
112 | return val; | ||
113 | } | ||
107 | 114 | ||
108 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, IOSF_PORT_DPIO, | 115 | void vlv_gpio_nc_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) |
109 | DPIO_OPCODE_REG_READ, reg, &val); | 116 | { |
117 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPIO_NC, | ||
118 | PUNIT_OPCODE_REG_WRITE, reg, &val); | ||
119 | } | ||
120 | |||
121 | u32 vlv_cck_read(struct drm_i915_private *dev_priv, u32 reg) | ||
122 | { | ||
123 | u32 val = 0; | ||
124 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCK, | ||
125 | PUNIT_OPCODE_REG_READ, reg, &val); | ||
126 | return val; | ||
127 | } | ||
128 | |||
129 | void vlv_cck_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) | ||
130 | { | ||
131 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCK, | ||
132 | PUNIT_OPCODE_REG_WRITE, reg, &val); | ||
133 | } | ||
134 | |||
135 | u32 vlv_ccu_read(struct drm_i915_private *dev_priv, u32 reg) | ||
136 | { | ||
137 | u32 val = 0; | ||
138 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCU, | ||
139 | PUNIT_OPCODE_REG_READ, reg, &val); | ||
140 | return val; | ||
141 | } | ||
110 | 142 | ||
143 | void vlv_ccu_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) | ||
144 | { | ||
145 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCU, | ||
146 | PUNIT_OPCODE_REG_WRITE, reg, &val); | ||
147 | } | ||
148 | |||
149 | u32 vlv_gps_core_read(struct drm_i915_private *dev_priv, u32 reg) | ||
150 | { | ||
151 | u32 val = 0; | ||
152 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPS_CORE, | ||
153 | PUNIT_OPCODE_REG_READ, reg, &val); | ||
154 | return val; | ||
155 | } | ||
156 | |||
157 | void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) | ||
158 | { | ||
159 | vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPS_CORE, | ||
160 | PUNIT_OPCODE_REG_WRITE, reg, &val); | ||
161 | } | ||
162 | |||
163 | static u32 vlv_get_phy_port(enum pipe pipe) | ||
164 | { | ||
165 | u32 port = IOSF_PORT_DPIO; | ||
166 | |||
167 | WARN_ON ((pipe != PIPE_A) && (pipe != PIPE_B)); | ||
168 | |||
169 | return port; | ||
170 | } | ||
171 | |||
172 | u32 vlv_dpio_read(struct drm_i915_private *dev_priv, enum pipe pipe, int reg) | ||
173 | { | ||
174 | u32 val = 0; | ||
175 | |||
176 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, vlv_get_phy_port(pipe), | ||
177 | DPIO_OPCODE_REG_READ, reg, &val); | ||
111 | return val; | 178 | return val; |
112 | } | 179 | } |
113 | 180 | ||
114 | void vlv_dpio_write(struct drm_i915_private *dev_priv, int reg, u32 val) | 181 | void vlv_dpio_write(struct drm_i915_private *dev_priv, enum pipe pipe, int reg, u32 val) |
115 | { | 182 | { |
116 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, IOSF_PORT_DPIO, | 183 | vlv_sideband_rw(dev_priv, DPIO_DEVFN, vlv_get_phy_port(pipe), |
117 | DPIO_OPCODE_REG_WRITE, reg, &val); | 184 | DPIO_OPCODE_REG_WRITE, reg, &val); |
118 | } | 185 | } |
119 | 186 | ||