Skip to content

Commit b2a8b4b

Browse files
committed
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
2 parents bdfd6b7 + 5df2397 commit b2a8b4b

File tree

16 files changed

+94
-67
lines changed

16 files changed

+94
-67
lines changed

drivers/gpu/drm/drm_edid.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
12971297
/**
12981298
* Search EDID for CEA extension block.
12991299
*/
1300-
static u8 *drm_find_cea_extension(struct edid *edid)
1300+
u8 *drm_find_cea_extension(struct edid *edid)
13011301
{
13021302
u8 *edid_ext = NULL;
13031303
int i;
@@ -1318,6 +1318,7 @@ static u8 *drm_find_cea_extension(struct edid *edid)
13181318

13191319
return edid_ext;
13201320
}
1321+
EXPORT_SYMBOL(drm_find_cea_extension);
13211322

13221323
/**
13231324
* drm_detect_hdmi_monitor - detect whether monitor is hdmi.

drivers/gpu/drm/i915/intel_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
ret__ = -ETIMEDOUT; \
4040
break; \
4141
} \
42-
if (W && !in_dbg_master()) msleep(W); \
42+
if (W && !(in_atomic() || in_dbg_master())) msleep(W); \
4343
} \
4444
ret__; \
4545
})

drivers/gpu/drm/i915/intel_i2c.c

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
259259
if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50))
260260
goto timeout;
261261
if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
262-
return 0;
262+
goto clear_err;
263263

264264
val = I915_READ(GMBUS3 + reg_offset);
265265
do {
@@ -287,7 +287,7 @@ gmbus_xfer(struct i2c_adapter *adapter,
287287
if (wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_RDY), 50))
288288
goto timeout;
289289
if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
290-
return 0;
290+
goto clear_err;
291291

292292
val = loop = 0;
293293
do {
@@ -302,14 +302,31 @@ gmbus_xfer(struct i2c_adapter *adapter,
302302
if (i + 1 < num && wait_for(I915_READ(GMBUS2 + reg_offset) & (GMBUS_SATOER | GMBUS_HW_WAIT_PHASE), 50))
303303
goto timeout;
304304
if (I915_READ(GMBUS2 + reg_offset) & GMBUS_SATOER)
305-
return 0;
305+
goto clear_err;
306306
}
307307

308-
return num;
308+
goto done;
309+
310+
clear_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+
318+
done:
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;
309324

310325
timeout:
311326
DRM_INFO("GMBUS timed out, falling back to bit banging on pin %d [%s]\n",
312327
bus->reg0 & 0xff, bus->adapter.name);
328+
I915_WRITE(GMBUS0 + reg_offset, 0);
329+
313330
/* Hardware may not support GMBUS over these pins? Try GPIO bitbanging instead. */
314331
bus->force_bit = intel_gpio_create(dev_priv, bus->reg0 & 0xff);
315332
if (!bus->force_bit)

drivers/gpu/drm/i915/intel_lvds.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -473,19 +473,13 @@ static enum drm_connector_status
473473
intel_lvds_detect(struct drm_connector *connector, bool force)
474474
{
475475
struct drm_device *dev = connector->dev;
476-
enum drm_connector_status status = connector_status_connected;
476+
enum drm_connector_status status;
477477

478478
status = intel_panel_detect(dev);
479479
if (status != connector_status_unknown)
480480
return status;
481481

482-
/* ACPI lid methods were generally unreliable in this generation, so
483-
* don't even bother.
484-
*/
485-
if (IS_GEN2(dev) || IS_GEN3(dev))
486-
return connector_status_connected;
487-
488-
return status;
482+
return connector_status_connected;
489483
}
490484

491485
/**

drivers/gpu/drm/nouveau/nouveau_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ nouveau_gem_new(struct drm_device *dev, struct nouveau_channel *chan,
9797
return -ENOMEM;
9898
}
9999

100-
nvbo->bo.persistant_swap_storage = nvbo->gem->filp;
100+
nvbo->bo.persistent_swap_storage = nvbo->gem->filp;
101101
nvbo->gem->driver_private = nvbo;
102102
return 0;
103103
}

drivers/gpu/drm/radeon/atombios_crtc.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
10091009
uint64_t fb_location;
10101010
uint32_t fb_format, fb_pitch_pixels, tiling_flags;
10111011
u32 fb_swap = EVERGREEN_GRPH_ENDIAN_SWAP(EVERGREEN_GRPH_ENDIAN_NONE);
1012+
u32 tmp;
10121013
int r;
10131014

10141015
/* no fb bound */
@@ -1137,6 +1138,15 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
11371138
WREG32(EVERGREEN_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
11381139
(crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
11391140

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+
11401150
if (!atomic && fb && fb != crtc->fb) {
11411151
radeon_fb = to_radeon_framebuffer(fb);
11421152
rbo = gem_to_radeon_bo(radeon_fb->obj);
@@ -1167,6 +1177,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
11671177
uint64_t fb_location;
11681178
uint32_t fb_format, fb_pitch_pixels, tiling_flags;
11691179
u32 fb_swap = R600_D1GRPH_SWAP_ENDIAN_NONE;
1180+
u32 tmp;
11701181
int r;
11711182

11721183
/* no fb bound */
@@ -1294,6 +1305,15 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
12941305
WREG32(AVIVO_D1MODE_VIEWPORT_SIZE + radeon_crtc->crtc_offset,
12951306
(crtc->mode.hdisplay << 16) | crtc->mode.vdisplay);
12961307

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+
12971317
if (!atomic && fb && fb != crtc->fb) {
12981318
radeon_fb = to_radeon_framebuffer(fb);
12991319
rbo = gem_to_radeon_bo(radeon_fb->obj);

drivers/gpu/drm/radeon/evergreen.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,6 @@ static void evergreen_pcie_gen2_enable(struct radeon_device *rdev);
4343

4444
void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc)
4545
{
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-
5746
/* enable the pflip int */
5847
radeon_irq_kms_pflip_irq_get(rdev, crtc);
5948
}

drivers/gpu/drm/radeon/radeon_atombios.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
675675
ATOM_ENCODER_CAP_RECORD *cap_record;
676676
u16 caps = 0;
677677

678-
while (record->ucRecordType > 0 &&
678+
while (record->ucRecordSize > 0 &&
679+
record->ucRecordType > 0 &&
679680
record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
680681
switch (record->ucRecordType) {
681682
case ATOM_ENCODER_CAP_RECORD_TYPE:
@@ -720,7 +721,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
720721
break;
721722
}
722723

723-
while (record->ucRecordType > 0 &&
724+
while (record->ucRecordSize > 0 &&
725+
record->ucRecordType > 0 &&
724726
record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
725727
switch (record->ucRecordType) {
726728
case ATOM_I2C_RECORD_TYPE:
@@ -782,10 +784,9 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
782784
ATOM_HPD_INT_RECORD *hpd_record;
783785
ATOM_I2C_ID_CONFIG_ACCESS *i2c_config;
784786

785-
while (record->ucRecordType > 0
786-
&& record->
787-
ucRecordType <=
788-
ATOM_MAX_OBJECT_RECORD_NUMBER) {
787+
while (record->ucRecordSize > 0 &&
788+
record->ucRecordType > 0 &&
789+
record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) {
789790
switch (record->ucRecordType) {
790791
case ATOM_I2C_RECORD_TYPE:
791792
i2c_record =

drivers/gpu/drm/radeon/radeon_combios.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,6 +2079,19 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev)
20792079
DRM_MODE_CONNECTOR_DVII, &ddc_i2c,
20802080
CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I,
20812081
&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);
20822095
break;
20832096
default:
20842097
DRM_INFO("Connector table: %d (invalid)\n",

drivers/gpu/drm/radeon/rs600.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,6 @@ int rs600_mc_wait_for_idle(struct radeon_device *rdev);
4848

4949
void rs600_pre_page_flip(struct radeon_device *rdev, int crtc)
5050
{
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-
6251
/* enable the pflip int */
6352
radeon_irq_kms_pflip_irq_get(rdev, crtc);
6453
}

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
11681168
uint32_t page_alignment,
11691169
unsigned long buffer_start,
11701170
bool interruptible,
1171-
struct file *persistant_swap_storage,
1171+
struct file *persistent_swap_storage,
11721172
size_t acc_size,
11731173
void (*destroy) (struct ttm_buffer_object *))
11741174
{
@@ -1211,7 +1211,7 @@ int ttm_bo_init(struct ttm_bo_device *bdev,
12111211
bo->priv_flags = 0;
12121212
bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED);
12131213
bo->seq_valid = false;
1214-
bo->persistant_swap_storage = persistant_swap_storage;
1214+
bo->persistent_swap_storage = persistent_swap_storage;
12151215
bo->acc_size = acc_size;
12161216
atomic_inc(&bo->glob->bo_count);
12171217

@@ -1260,7 +1260,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
12601260
uint32_t page_alignment,
12611261
unsigned long buffer_start,
12621262
bool interruptible,
1263-
struct file *persistant_swap_storage,
1263+
struct file *persistent_swap_storage,
12641264
struct ttm_buffer_object **p_bo)
12651265
{
12661266
struct ttm_buffer_object *bo;
@@ -1282,7 +1282,7 @@ int ttm_bo_create(struct ttm_bo_device *bdev,
12821282

12831283
ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment,
12841284
buffer_start, interruptible,
1285-
persistant_swap_storage, acc_size, NULL);
1285+
persistent_swap_storage, acc_size, NULL);
12861286
if (likely(ret == 0))
12871287
*p_bo = bo;
12881288

@@ -1863,7 +1863,7 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink)
18631863
if (bo->bdev->driver->swap_notify)
18641864
bo->bdev->driver->swap_notify(bo);
18651865

1866-
ret = ttm_tt_swapout(bo->ttm, bo->persistant_swap_storage);
1866+
ret = ttm_tt_swapout(bo->ttm, bo->persistent_swap_storage);
18671867
out:
18681868

18691869
/**

drivers/gpu/drm/ttm/ttm_tt.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
332332
ttm_tt_free_page_directory(ttm);
333333
}
334334

335-
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP) &&
335+
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) &&
336336
ttm->swap_storage)
337337
fput(ttm->swap_storage);
338338

@@ -503,7 +503,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
503503
page_cache_release(from_page);
504504
}
505505

506-
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP))
506+
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP))
507507
fput(swap_storage);
508508
ttm->swap_storage = NULL;
509509
ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED;
@@ -514,7 +514,7 @@ static int ttm_tt_swapin(struct ttm_tt *ttm)
514514
return ret;
515515
}
516516

517-
int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
517+
int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage)
518518
{
519519
struct address_space *swap_space;
520520
struct file *swap_storage;
@@ -540,7 +540,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
540540
return 0;
541541
}
542542

543-
if (!persistant_swap_storage) {
543+
if (!persistent_swap_storage) {
544544
swap_storage = shmem_file_setup("ttm swap",
545545
ttm->num_pages << PAGE_SHIFT,
546546
0);
@@ -549,7 +549,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
549549
return PTR_ERR(swap_storage);
550550
}
551551
} else
552-
swap_storage = persistant_swap_storage;
552+
swap_storage = persistent_swap_storage;
553553

554554
swap_space = swap_storage->f_path.dentry->d_inode->i_mapping;
555555

@@ -577,12 +577,12 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage)
577577
ttm_tt_free_alloced_pages(ttm);
578578
ttm->swap_storage = swap_storage;
579579
ttm->page_flags |= TTM_PAGE_FLAG_SWAPPED;
580-
if (persistant_swap_storage)
581-
ttm->page_flags |= TTM_PAGE_FLAG_PERSISTANT_SWAP;
580+
if (persistent_swap_storage)
581+
ttm->page_flags |= TTM_PAGE_FLAG_PERSISTENT_SWAP;
582582

583583
return 0;
584584
out_err:
585-
if (!persistant_swap_storage)
585+
if (!persistent_swap_storage)
586586
fput(swap_storage);
587587

588588
return ret;

include/drm/drm_crtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
778778
void *data, struct drm_file *file_priv);
779779
extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
780780
void *data, struct drm_file *file_priv);
781+
extern u8 *drm_find_cea_extension(struct edid *edid);
781782
extern bool drm_detect_hdmi_monitor(struct edid *edid);
782783
extern bool drm_detect_monitor_audio(struct edid *edid);
783784
extern int drm_mode_page_flip_ioctl(struct drm_device *dev,

include/drm/drm_pciids.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@
472472
{0x1002, 0x9803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
473473
{0x1002, 0x9804, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
474474
{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}, \
475477
{0, 0, 0}
476478

477479
#define r128_PCI_IDS \

0 commit comments

Comments
 (0)