aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-04-04 20:56:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-04 20:56:07 -0400
commitb2a8b4b81966094703088a7bc76a313af841924d (patch)
tree944235c53261c1897f0b7507bed438c18187714c
parentbdfd6b7d761c7bb8bc93055dac5040ece7d58e10 (diff)
parent5df23979bc628934febe02e80f9644ec67603ee8 (diff)
Merge branch 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: drm: fix "persistant" typo drm/radeon/kms: add some new ontario pci ids drm/radeon/kms: pageflipping cleanup for avivo+ drm/radeon/kms: Add support for tv-out dongle on G5 9600 drm: export drm_find_cea_extension to drivers drm/radeon/kms: add some sanity checks to obj info record parsingi (v2) drm/i915: Reset GMBUS controller after NAK drm/i915: Busy-spin wait_for condition in atomic contexts drm/i915/lvds: Always return connected in the absence of better information
-rw-r--r--drivers/gpu/drm/drm_edid.c3
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h2
-rw-r--r--drivers/gpu/drm/i915/intel_i2c.c25
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c10
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c2
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c20
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c11
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c13
-rw-r--r--drivers/gpu/drm/radeon/radeon_combios.c13
-rw-r--r--drivers/gpu/drm/radeon/rs600.c11
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo.c10
-rw-r--r--drivers/gpu/drm/ttm/ttm_tt.c16
-rw-r--r--include/drm/drm_crtc.h1
-rw-r--r--include/drm/drm_pciids.h2
-rw-r--r--include/drm/ttm/ttm_bo_api.h18
-rw-r--r--include/drm/ttm/ttm_bo_driver.h4
16 files changed, 94 insertions, 67 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 9c595e3b9c20..adc9358c9bec 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1297,7 +1297,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
1297/** 1297/**
1298 * Search EDID for CEA extension block. 1298 * Search EDID for CEA extension block.
1299 */ 1299 */
1300static u8 *drm_find_cea_extension(struct edid *edid) 1300u8 *drm_find_cea_extension(struct edid *edid)
1301{ 1301{
1302 u8 *edid_ext = NULL; 1302 u8 *edid_ext = NULL;
1303 int i; 1303 int i;
@@ -1318,6 +1318,7 @@ static u8 *drm_find_cea_extension(struct edid *edid)
1318 1318
1319 return edid_ext; 1319 return edid_ext;
1320} 1320}
1321EXPORT_SYMBOL(drm_find_cea_extension);
1321 1322
1322/** 1323/**
1323 * drm_detect_hdmi_monitor - detect whether monitor is hdmi. 1324 * drm_detect_hdmi_monitor - detect whether monitor is hdmi.
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 5daa991cb287..f5b0d8306d83 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -39,7 +39,7 @@
39 ret__ = -ETIMEDOUT; \ 39 ret__ = -ETIMEDOUT; \
40 break; \ 40 break; \
41 } \ 41 } \
42 if (W && !in_dbg_master()) msleep(W); \ 42 if (W && !(in_atomic() || in_dbg_master())) msleep(W); \
43 } \ 43 } \
44 ret__; \ 44 ret__; \
45}) 45})
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 82d04c5899d2..d3b903bce7c5 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -259,7 +259,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
259 if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) 259 if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50))
260 goto timeout; 260 goto timeout;
261 if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) 261 if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
262 return 0; 262 goto clear_err;
263 263
264 val = I915_READ(GMBUS3 + reg_offset); 264 val = I915_READ(GMBUS3 + reg_offset);
265 do { 265 do {
@@ -287,7 +287,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
287 if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50)) 287 if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50))
288 goto timeout; 288 goto timeout;
289 if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) 289 if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
290 return 0; 290 goto clear_err;
291 291
292 val = loop = 0; 292 val = loop = 0;
293 do { 293 do {
@@ -302,14 +302,31 @@ gmbus_xfer(struct i2c_adapter *adapter,
302 if (i + 1 < num && wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_WAIT_PHASE), 50)) 302 if (i + 1 < num && wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_WAIT_PHASE), 50))
303 goto timeout; 303 goto timeout;
304 if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER) 304 if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
305 return 0; 305 goto clear_err;
306 } 306 }
307 307
308 return num; 308 goto done;
309
310clear_err:
311 /* Toggle the Software Clear Interrupt bit. This has the effect
312 * of resetting the GMBUS controller and so clearing the
313 * BUS_ERROR raised by the slave's NAK.
314 */
315 I915_WRITE(GMBUS1 + reg_offset, GMBUS_SW_CLR_INT);
316 I915_WRITE(GMBUS1 + reg_offset, 0);
317
318done:
319 /* Mark the GMBUS interface as disabled. We will re-enable it at the
320 * start of the next xfer, till then let it sleep.
321 */
322 I915_WRITE(GMBUS0 + reg_offset, 0);
323 return i;
309 324
310timeout: 325timeout:
311 DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n", 326 DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n",
312 bus->reg0 & 0xff, bus->adapter.name); 327 bus->reg0 & 0xff, bus->adapter.name);
328 I915_WRITE(GMBUS0 + reg_offset, 0);
329
313 /* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */ 330 /* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */
314 bus->force_bit = intel_gpio_create(dev_priv, bus->reg0 & 0xff); 331 bus->force_bit = intel_gpio_create(dev_priv, bus->reg0 & 0xff);
315 if (!bus->force_bit) 332 if (!bus->force_bit)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 1a311ad01116..86cd30bcb619 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -473,19 +473,13 @@ static enum drm_connector_status
473intel_lvds_detect(struct drm_connector *connector, bool force) 473intel_lvds_detect(struct drm_connector *connector, bool force)
474{ 474{
475 struct drm_device *dev = connector->dev; 475 struct drm_device *dev = connector->dev;
476 enum drm_connector_status status = connector_status_connected; 476 enum drm_connector_status status;
477 477
478 status = intel_panel_detect(dev); 478 status = intel_panel_detect(dev);
479 if (status != connector_status_unknown) 479 if (status != connector_status_unknown)
480 return status; 480 return status;
481 481
482 /* ACPI lid methods were generally unreliable in this generation, so 482 return connector_status_connected;
483 * don't even bother.
484 */
485 if (IS_GEN2(dev) || IS_GEN3(dev))
486 return connector_status_connected;
487
488 return status;
489} 483}
490 484
491/** 485/**
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index e8b04f4aed7e..b52e46018245 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -97,7 +97,7 @@ nouveau_gem_new(struct drm_device *dev, struct nouveau_channel *chan,
97 return -ENOMEM; 97 return -ENOMEM;
98 } 98 }
99 99
100 nvbo->bo.persistant_swap_storage = nvbo->gem->filp; 100 nvbo->bo.persistent_swap_storage = nvbo->gem->filp;
101 nvbo->gem->driver_private = nvbo; 101 nvbo->gem->driver_private = nvbo;
102 return 0; 102 return 0;
103} 103}
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 10e41af6b026..b41ec59c7100 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -1009,6 +1009,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
1009 uint64_t fb_location; 1009 uint64_t fb_location;
1010 uint32_t fb_format, fb_pitch_pixels, tiling_flags; 1010 uint32_t fb_format, fb_pitch_pixels, tiling_flags;
1011 u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE); 1011 u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE);
1012 u32 tmp;
1012 int r; 1013 int r;
1013 1014
1014 /* no fb bound */ 1015 /* no fb bound */
@@ -1137,6 +1138,15 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
1137 WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset, 1138 WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
1138 (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); 1139 (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
1139 1140
1141 /* pageflip setup */
1142 /* make sure flip is at vb rather than hb */
1143 tmp = RREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
1144 tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN;
1145 WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
1146
1147 /* set pageflip to happen anywhere in vblank interval */
1148 WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
1149
1140 if (!atomic && fb && fb != crtc->fb) { 1150 if (!atomic && fb && fb != crtc->fb) {
1141 radeon_fb = to_radeon_framebuffer(fb); 1151 radeon_fb = to_radeon_framebuffer(fb);
1142 rbo = gem_to_radeon_bo(radeon_fb->obj); 1152 rbo = gem_to_radeon_bo(radeon_fb->obj);
@@ -1167,6 +1177,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
1167 uint64_t fb_location; 1177 uint64_t fb_location;
1168 uint32_t fb_format, fb_pitch_pixels, tiling_flags; 1178 uint32_t fb_format, fb_pitch_pixels, tiling_flags;
1169 u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE; 1179 u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE;
1180 u32 tmp;
1170 int r; 1181 int r;
1171 1182
1172 /* no fb bound */ 1183 /* no fb bound */
@@ -1294,6 +1305,15 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
1294 WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset, 1305 WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
1295 (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay); 1306 (crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
1296 1307
1308 /* pageflip setup */
1309 /* make sure flip is at vb rather than hb */
1310 tmp = RREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
1311 tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN;
1312 WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
1313
1314 /* set pageflip to happen anywhere in vblank interval */
1315 WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
1316
1297 if (!atomic && fb && fb != crtc->fb) { 1317 if (!atomic && fb && fb != crtc->fb) {
1298 radeon_fb = to_radeon_framebuffer(fb); 1318 radeon_fb = to_radeon_framebuffer(fb);
1299 rbo = gem_to_radeon_bo(radeon_fb->obj); 1319 rbo = gem_to_radeon_bo(radeon_fb->obj);
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 941080a77940..0b0cc74c08c0 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -43,17 +43,6 @@ static void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
43 43
44void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc) 44void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc)
45{ 45{
46 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc];
47 u32 tmp;
48
49 /* make sure flip is at vb rather than hb */
50 tmp = RREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
51 tmp &= ~EVERGREEN_GRPH_SURFACE_UPDATE_H_RETRACE_EN;
52 WREG32(EVERGREEN_GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
53
54 /* set pageflip to happen anywhere in vblank interval */
55 WREG32(EVERGREEN_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
56
57 /* enable the pflip int */ 46 /* enable the pflip int */
58 radeon_irq_kms_pflip_irq_get(rdev, crtc); 47 radeon_irq_kms_pflip_irq_get(rdev, crtc);
59} 48}
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 02d5c415f499..99768d9d91da 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -675,7 +675,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
675 ATOM_ENCODER_CAP_RECORD *cap_record; 675 ATOM_ENCODER_CAP_RECORD *cap_record;
676 u16 caps = 0; 676 u16 caps = 0;
677 677
678 while (record->ucRecordType > 0 && 678 while (record->ucRecordSize > 0 &&
679 record->ucRecordType > 0 &&
679 record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) { 680 record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
680 switch (record->ucRecordType) { 681 switch (record->ucRecordType) {
681 case ATOM_ENCODER_CAP_RECORD_TYPE: 682 case ATOM_ENCODER_CAP_RECORD_TYPE:
@@ -720,7 +721,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
720 break; 721 break;
721 } 722 }
722 723
723 while (record->ucRecordType > 0 && 724 while (record->ucRecordSize > 0 &&
725 record->ucRecordType > 0 &&
724 record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) { 726 record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
725 switch (record->ucRecordType) { 727 switch (record->ucRecordType) {
726 case ATOM_I2C_RECORD_TYPE: 728 case ATOM_I2C_RECORD_TYPE:
@@ -782,10 +784,9 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
782 ATOM_HPD_INT_RECORD *hpd_record; 784 ATOM_HPD_INT_RECORD *hpd_record;
783 ATOM_I2C_ID_CONFIG_ACCESS *i2c_config; 785 ATOM_I2C_ID_CONFIG_ACCESS *i2c_config;
784 786
785 while (record->ucRecordType > 0 787 while (record->ucRecordSize > 0 &&
786 && record-> 788 record->ucRecordType > 0 &&
787 ucRecordType <= 789 record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
788 ATOM_MAX_OBJECT_RECORD_NUMBER) {
789 switch (record->ucRecordType) { 790 switch (record->ucRecordType) {
790 case ATOM_I2C_RECORD_TYPE: 791 case ATOM_I2C_RECORD_TYPE:
791 i2c_record = 792 i2c_record =
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c
index cf602e2d0718..8caf546c8e92 100644
--- a/drivers/gpu/drm/radeon/radeon_combios.c
+++ b/drivers/gpu/drm/radeon/radeon_combios.c
@@ -2079,6 +2079,19 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
2079 DRM_MODE_CONNECTOR_DVII, &ddc_i2c, 2079 DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
2080 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I, 2080 CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
2081 &hpd); 2081 &hpd);
2082 /* TV - TV DAC */
2083 ddc_i2c.valid = false;
2084 hpd.hpd = RADEON_HPD_NONE;
2085 radeon_add_legacy_encoder(dev,
2086 radeon_get_encoder_enum(dev,
2087 ATOM_DEVICE_TV1_SUPPORT,
2088 2),
2089 ATOM_DEVICE_TV1_SUPPORT);
2090 radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT,
2091 DRM_MODE_CONNECTOR_SVIDEO,
2092 &ddc_i2c,
2093 CONNECTOR_OBJECT_ID_SVIDEO,
2094 &hpd);
2082 break; 2095 break;
2083 default: 2096 default:
2084 DRM_INFO("Connector table: %d (invalid)\n", 2097 DRM_INFO("Connector table: %d (invalid)\n",
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 19763f5df5e1..876cebc4b8ba 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -48,17 +48,6 @@ int rs600_mc_wait_for_idle(struct radeon_device *rdev);
48 48
49void rs600_pre_page_flip(struct radeon_device *rdev, int crtc) 49void rs600_pre_page_flip(struct radeon_device *rdev, int crtc)
50{ 50{
51 struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc];
52 u32 tmp;
53
54 /* make sure flip is at vb rather than hb */
55 tmp = RREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset);
56 tmp &= ~AVIVO_D1GRPH_SURFACE_UPDATE_H_RETRACE_EN;
57 WREG32(AVIVO_D1GRPH_FLIP_CONTROL + radeon_crtc->crtc_offset, tmp);
58
59 /* set pageflip to happen anywhere in vblank interval */
60 WREG32(AVIVO_D1MODE_MASTER_UPDATE_MODE + radeon_crtc->crtc_offset, 0);
61
62 /* enable the pflip int */ 51 /* enable the pflip int */
63 radeon_irq_kms_pflip_irq_get(rdev, crtc); 52 radeon_irq_kms_pflip_irq_get(rdev, crtc);
64} 53}
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 0b6a55ac2f87..2e618b5ac465 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -1168,7 +1168,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
1168 uint32_t page_alignment, 1168 uint32_t page_alignment,
1169 unsigned long buffer_start, 1169 unsigned long buffer_start,
1170 bool interruptible, 1170 bool interruptible,
1171 struct file *persistant_swap_storage, 1171 struct file *persistent_swap_storage,
1172 size_t acc_size, 1172 size_t acc_size,
1173 void (*destroy) (struct ttm_buffer_object *)) 1173 void (*destroy) (struct ttm_buffer_object *))
1174{ 1174{
@@ -1211,7 +1211,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
1211 bo->priv_flags = 0; 1211 bo->priv_flags = 0;
1212 bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED); 1212 bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED);
1213 bo->seq_valid = false; 1213 bo->seq_valid = false;
1214 bo->persistant_swap_storage = persistant_swap_storage; 1214 bo->persistent_swap_storage = persistent_swap_storage;
1215 bo->acc_size = acc_size; 1215 bo->acc_size = acc_size;
1216 atomic_inc(&bo->glob->bo_count); 1216 atomic_inc(&bo->glob->bo_count);
1217 1217
@@ -1260,7 +1260,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
1260 uint32_t page_alignment, 1260 uint32_t page_alignment,
1261 unsigned long buffer_start, 1261 unsigned long buffer_start,
1262 bool interruptible, 1262 bool interruptible,
1263 struct file *persistant_swap_storage, 1263 struct file *persistent_swap_storage,
1264 struct ttm_buffer_object **p_bo) 1264 struct ttm_buffer_object **p_bo)
1265{ 1265{
1266 struct ttm_buffer_object *bo; 1266 struct ttm_buffer_object *bo;
@@ -1282,7 +1282,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
1282 1282
1283 ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, 1283 ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment,
1284 buffer_start, interruptible, 1284 buffer_start, interruptible,
1285 persistant_swap_storage, acc_size, NULL); 1285 persistent_swap_storage, acc_size, NULL);
1286 if (likely(ret == 0)) 1286 if (likely(ret == 0))
1287 *p_bo = bo; 1287 *p_bo = bo;
1288 1288
@@ -1863,7 +1863,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
1863 if (bo->bdev->driver->swap_notify) 1863 if (bo->bdev->driver->swap_notify)
1864 bo->bdev->driver->swap_notify(bo); 1864 bo->bdev->driver->swap_notify(bo);
1865 1865
1866 ret = ttm_tt_swapout(bo->ttm, bo->persistant_swap_storage); 1866 ret = ttm_tt_swapout(bo->ttm, bo->persistent_swap_storage);
1867out: 1867out:
1868 1868
1869 /** 1869 /**
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 86d5b1745a45..90e23e0bfadb 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -332,7 +332,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
332 ttm_tt_free_page_directory(ttm); 332 ttm_tt_free_page_directory(ttm);
333 } 333 }
334 334
335 if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP) && 335 if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) &&
336 ttm->swap_storage) 336 ttm->swap_storage)
337 fput(ttm->swap_storage); 337 fput(ttm->swap_storage);
338 338
@@ -503,7 +503,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
503 page_cache_release(from_page); 503 page_cache_release(from_page);
504 } 504 }
505 505
506 if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP)) 506 if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP))
507 fput(swap_storage); 507 fput(swap_storage);
508 ttm->swap_storage = NULL; 508 ttm->swap_storage = NULL;
509 ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED; 509 ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
@@ -514,7 +514,7 @@ out_err:
514 return ret; 514 return ret;
515} 515}
516 516
517int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) 517int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
518{ 518{
519 struct address_space *swap_space; 519 struct address_space *swap_space;
520 struct file *swap_storage; 520 struct file *swap_storage;
@@ -540,7 +540,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
540 return 0; 540 return 0;
541 } 541 }
542 542
543 if (!persistant_swap_storage) { 543 if (!persistent_swap_storage) {
544 swap_storage = shmem_file_setup("ttm swap", 544 swap_storage = shmem_file_setup("ttm swap",
545 ttm->num_pages << PAGE_SHIFT, 545 ttm->num_pages << PAGE_SHIFT,
546 0); 546 0);
@@ -549,7 +549,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
549 return PTR_ERR(swap_storage); 549 return PTR_ERR(swap_storage);
550 } 550 }
551 } else 551 } else
552 swap_storage = persistant_swap_storage; 552 swap_storage = persistent_swap_storage;
553 553
554 swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 554 swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
555 555
@@ -577,12 +577,12 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
577 ttm_tt_free_alloced_pages(ttm); 577 ttm_tt_free_alloced_pages(ttm);
578 ttm->swap_storage = swap_storage; 578 ttm->swap_storage = swap_storage;
579 ttm->page_flags |= TTM_PAGE_FLAG_SWAPPED; 579 ttm->page_flags |= TTM_PAGE_FLAG_SWAPPED;
580 if (persistant_swap_storage) 580 if (persistent_swap_storage)
581 ttm->page_flags |= TTM_PAGE_FLAG_PERSISTANT_SWAP; 581 ttm->page_flags |= TTM_PAGE_FLAG_PERSISTENT_SWAP;
582 582
583 return 0; 583 return 0;
584out_err: 584out_err:
585 if (!persistant_swap_storage) 585 if (!persistent_swap_storage)
586 fput(swap_storage); 586 fput(swap_storage);
587 587
588 return ret; 588 return ret;
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 60edf9be31e5..aaec09713bee 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -778,6 +778,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
778 void *data, struct drm_file *file_priv); 778 void *data, struct drm_file *file_priv);
779extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 779extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
780 void *data, struct drm_file *file_priv); 780 void *data, struct drm_file *file_priv);
781extern u8 *drm_find_cea_extension(struct edid *edid);
781extern bool drm_detect_hdmi_monitor(struct edid *edid); 782extern bool drm_detect_hdmi_monitor(struct edid *edid);
782extern bool drm_detect_monitor_audio(struct edid *edid); 783extern bool drm_detect_monitor_audio(struct edid *edid);
783extern int drm_mode_page_flip_ioctl(struct drm_device *dev, 784extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 820ee9029482..816e30cbd968 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -472,6 +472,8 @@
472 {0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 472 {0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
473 {0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 473 {0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
474 {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 474 {0x1002, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
475 {0x1002, 0x9806, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
476 {0x1002, 0x9807, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
475 {0, 0, 0} 477 {0, 0, 0}
476 478
477#define r128_PCI_IDS \ 479#define r128_PCI_IDS \
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 50852aad260a..a6bd117c9ff1 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -158,9 +158,9 @@ struct ttm_tt;
158 * the object is destroyed. 158 * the object is destroyed.
159 * @event_queue: Queue for processes waiting on buffer object status change. 159 * @event_queue: Queue for processes waiting on buffer object status change.
160 * @mem: structure describing current placement. 160 * @mem: structure describing current placement.
161 * @persistant_swap_storage: Usually the swap storage is deleted for buffers 161 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
162 * pinned in physical memory. If this behaviour is not desired, this member 162 * pinned in physical memory. If this behaviour is not desired, this member
163 * holds a pointer to a persistant shmem object. 163 * holds a pointer to a persistent shmem object.
164 * @ttm: TTM structure holding system pages. 164 * @ttm: TTM structure holding system pages.
165 * @evicted: Whether the object was evicted without user-space knowing. 165 * @evicted: Whether the object was evicted without user-space knowing.
166 * @cpu_writes: For synchronization. Number of cpu writers. 166 * @cpu_writes: For synchronization. Number of cpu writers.
@@ -221,7 +221,7 @@ struct ttm_buffer_object {
221 */ 221 */
222 222
223 struct ttm_mem_reg mem; 223 struct ttm_mem_reg mem;
224 struct file *persistant_swap_storage; 224 struct file *persistent_swap_storage;
225 struct ttm_tt *ttm; 225 struct ttm_tt *ttm;
226 bool evicted; 226 bool evicted;
227 227
@@ -459,9 +459,9 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo);
459 * user buffer object. 459 * user buffer object.
460 * @interruptible: If needing to sleep to wait for GPU resources, 460 * @interruptible: If needing to sleep to wait for GPU resources,
461 * sleep interruptible. 461 * sleep interruptible.
462 * @persistant_swap_storage: Usually the swap storage is deleted for buffers 462 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
463 * pinned in physical memory. If this behaviour is not desired, this member 463 * pinned in physical memory. If this behaviour is not desired, this member
464 * holds a pointer to a persistant shmem object. Typically, this would 464 * holds a pointer to a persistent shmem object. Typically, this would
465 * point to the shmem object backing a GEM object if TTM is used to back a 465 * point to the shmem object backing a GEM object if TTM is used to back a
466 * GEM user interface. 466 * GEM user interface.
467 * @acc_size: Accounted size for this object. 467 * @acc_size: Accounted size for this object.
@@ -490,7 +490,7 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev,
490 uint32_t page_alignment, 490 uint32_t page_alignment,
491 unsigned long buffer_start, 491 unsigned long buffer_start,
492 bool interrubtible, 492 bool interrubtible,
493 struct file *persistant_swap_storage, 493 struct file *persistent_swap_storage,
494 size_t acc_size, 494 size_t acc_size,
495 void (*destroy) (struct ttm_buffer_object *)); 495 void (*destroy) (struct ttm_buffer_object *));
496/** 496/**
@@ -506,9 +506,9 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev,
506 * user buffer object. 506 * user buffer object.
507 * @interruptible: If needing to sleep while waiting for GPU resources, 507 * @interruptible: If needing to sleep while waiting for GPU resources,
508 * sleep interruptible. 508 * sleep interruptible.
509 * @persistant_swap_storage: Usually the swap storage is deleted for buffers 509 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
510 * pinned in physical memory. If this behaviour is not desired, this member 510 * pinned in physical memory. If this behaviour is not desired, this member
511 * holds a pointer to a persistant shmem object. Typically, this would 511 * holds a pointer to a persistent shmem object. Typically, this would
512 * point to the shmem object backing a GEM object if TTM is used to back a 512 * point to the shmem object backing a GEM object if TTM is used to back a
513 * GEM user interface. 513 * GEM user interface.
514 * @p_bo: On successful completion *p_bo points to the created object. 514 * @p_bo: On successful completion *p_bo points to the created object.
@@ -528,7 +528,7 @@ extern int ttm_bo_create(struct ttm_bo_device *bdev,
528 uint32_t page_alignment, 528 uint32_t page_alignment,
529 unsigned long buffer_start, 529 unsigned long buffer_start,
530 bool interruptible, 530 bool interruptible,
531 struct file *persistant_swap_storage, 531 struct file *persistent_swap_storage,
532 struct ttm_buffer_object **p_bo); 532 struct ttm_buffer_object **p_bo);
533 533
534/** 534/**
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index efed0820d9fa..960b52181d4e 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -122,7 +122,7 @@ struct ttm_backend {
122#define TTM_PAGE_FLAG_USER_DIRTY (1 << 2) 122#define TTM_PAGE_FLAG_USER_DIRTY (1 << 2)
123#define TTM_PAGE_FLAG_WRITE (1 << 3) 123#define TTM_PAGE_FLAG_WRITE (1 << 3)
124#define TTM_PAGE_FLAG_SWAPPED (1 << 4) 124#define TTM_PAGE_FLAG_SWAPPED (1 << 4)
125#define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) 125#define TTM_PAGE_FLAG_PERSISTENT_SWAP (1 << 5)
126#define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) 126#define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6)
127#define TTM_PAGE_FLAG_DMA32 (1 << 7) 127#define TTM_PAGE_FLAG_DMA32 (1 << 7)
128 128
@@ -714,7 +714,7 @@ extern void ttm_tt_cache_flush(struct page *pages[], unsigned long num_pages);
714 */ 714 */
715extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement); 715extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement);
716extern int ttm_tt_swapout(struct ttm_tt *ttm, 716extern int ttm_tt_swapout(struct ttm_tt *ttm,
717 struct file *persistant_swap_storage); 717 struct file *persistent_swap_storage);
718 718
719/* 719/*
720 * ttm_bo.c 720 * ttm_bo.c