aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2009-06-25 23:23:55 -0400
committerEric Anholt <eric@anholt.net>2009-07-01 14:16:09 -0400
commit7662c8bd6545c12ac7b2b39e4554c3ba34789c50 (patch)
treeb6bd6bc9725e355cd7e57c3183dfba99af719a5e /drivers/gpu/drm/i915/i915_dma.c
parent63eeaf38251183ec2b1caee11e4a2c040cb5ce6c (diff)
drm/i915: add FIFO watermark support
This patch from jbarnes and myself adds FIFO watermark control to the driver. This is needed for both power saving features on new platforms with the so-called "big FIFO" and for controlling FIFO allocation between pipes in multi-head configurations. It's also necessary infrastructure to support things like framebuffer compression and configuration supportability checks (i.e. checking a configuration against available bandwidth). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index f83364974a8..6096600aff6 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1082,6 +1082,44 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master)
1082 master->driver_priv = NULL; 1082 master->driver_priv = NULL;
1083} 1083}
1084 1084
1085static void i915_get_mem_freq(struct drm_device *dev)
1086{
1087 drm_i915_private_t *dev_priv = dev->dev_private;
1088 u32 tmp;
1089
1090 if (!IS_IGD(dev))
1091 return;
1092
1093 tmp = I915_READ(CLKCFG);
1094
1095 switch (tmp & CLKCFG_FSB_MASK) {
1096 case CLKCFG_FSB_533:
1097 dev_priv->fsb_freq = 533; /* 133*4 */
1098 break;
1099 case CLKCFG_FSB_800:
1100 dev_priv->fsb_freq = 800; /* 200*4 */
1101 break;
1102 case CLKCFG_FSB_667:
1103 dev_priv->fsb_freq = 667; /* 167*4 */
1104 break;
1105 case CLKCFG_FSB_400:
1106 dev_priv->fsb_freq = 400; /* 100*4 */
1107 break;
1108 }
1109
1110 switch (tmp & CLKCFG_MEM_MASK) {
1111 case CLKCFG_MEM_533:
1112 dev_priv->mem_freq = 533;
1113 break;
1114 case CLKCFG_MEM_667:
1115 dev_priv->mem_freq = 667;
1116 break;
1117 case CLKCFG_MEM_800:
1118 dev_priv->mem_freq = 800;
1119 break;
1120 }
1121}
1122
1085/** 1123/**
1086 * i915_driver_load - setup chip and create an initial config 1124 * i915_driver_load - setup chip and create an initial config
1087 * @dev: DRM device 1125 * @dev: DRM device
@@ -1165,6 +1203,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
1165 goto out_iomapfree; 1203 goto out_iomapfree;
1166 } 1204 }
1167 1205
1206 i915_get_mem_freq(dev);
1207
1168 /* On the 945G/GM, the chipset reports the MSI capability on the 1208 /* On the 945G/GM, the chipset reports the MSI capability on the
1169 * integrated graphics even though the support isn't actually there 1209 * integrated graphics even though the support isn't actually there
1170 * according to the published specs. It doesn't appear to function 1210 * according to the published specs. It doesn't appear to function