diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-16 11:47:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-16 11:47:31 -0400 |
commit | 7c21738efd0b5e8c2a9ac2440e7ffbf432d6f239 (patch) | |
tree | d65f02ae98b229604e04df9984632272686cef9a /drivers | |
parent | eed631e0d741d1a1067cfc6d709fdf2363126f9c (diff) | |
parent | 752d2635ebb12b6122ba05775f7d1ccfef14b275 (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: Take lock around probes for drm_fb_helper_hotplug_event
drm/i915: Revert i915.semaphore=1 default from 47ae63e0
vga_switcheroo: don't toggle-switch devices
drm/radeon/kms: add some evergreen/ni safe regs
drm/radeon/kms: fix extended lvds info parsing
drm/radeon/kms: fix tiling reg on fusion
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 26 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/evergreend.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/reg_srcs/cayman | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/reg_srcs/evergreen | 1 | ||||
-rw-r--r-- | drivers/gpu/vga/vga_switcheroo.c | 6 |
7 files changed, 43 insertions, 11 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 11d7a72c22d9..140b9525b48a 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -1516,17 +1516,33 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel) | |||
1516 | } | 1516 | } |
1517 | EXPORT_SYMBOL(drm_fb_helper_initial_config); | 1517 | EXPORT_SYMBOL(drm_fb_helper_initial_config); |
1518 | 1518 | ||
1519 | bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | 1519 | /** |
1520 | * drm_fb_helper_hotplug_event - respond to a hotplug notification by | ||
1521 | * probing all the outputs attached to the fb. | ||
1522 | * @fb_helper: the drm_fb_helper | ||
1523 | * | ||
1524 | * LOCKING: | ||
1525 | * Called at runtime, must take mode config lock. | ||
1526 | * | ||
1527 | * Scan the connectors attached to the fb_helper and try to put together a | ||
1528 | * setup after *notification of a change in output configuration. | ||
1529 | * | ||
1530 | * RETURNS: | ||
1531 | * 0 on success and a non-zero error code otherwise. | ||
1532 | */ | ||
1533 | int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | ||
1520 | { | 1534 | { |
1535 | struct drm_device *dev = fb_helper->dev; | ||
1521 | int count = 0; | 1536 | int count = 0; |
1522 | u32 max_width, max_height, bpp_sel; | 1537 | u32 max_width, max_height, bpp_sel; |
1523 | bool bound = false, crtcs_bound = false; | 1538 | bool bound = false, crtcs_bound = false; |
1524 | struct drm_crtc *crtc; | 1539 | struct drm_crtc *crtc; |
1525 | 1540 | ||
1526 | if (!fb_helper->fb) | 1541 | if (!fb_helper->fb) |
1527 | return false; | 1542 | return 0; |
1528 | 1543 | ||
1529 | list_for_each_entry(crtc, &fb_helper->dev->mode_config.crtc_list, head) { | 1544 | mutex_lock(&dev->mode_config.mutex); |
1545 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | ||
1530 | if (crtc->fb) | 1546 | if (crtc->fb) |
1531 | crtcs_bound = true; | 1547 | crtcs_bound = true; |
1532 | if (crtc->fb == fb_helper->fb) | 1548 | if (crtc->fb == fb_helper->fb) |
@@ -1535,7 +1551,8 @@ bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | |||
1535 | 1551 | ||
1536 | if (!bound && crtcs_bound) { | 1552 | if (!bound && crtcs_bound) { |
1537 | fb_helper->delayed_hotplug = true; | 1553 | fb_helper->delayed_hotplug = true; |
1538 | return false; | 1554 | mutex_unlock(&dev->mode_config.mutex); |
1555 | return 0; | ||
1539 | } | 1556 | } |
1540 | DRM_DEBUG_KMS("\n"); | 1557 | DRM_DEBUG_KMS("\n"); |
1541 | 1558 | ||
@@ -1546,6 +1563,7 @@ bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper) | |||
1546 | count = drm_fb_helper_probe_connector_modes(fb_helper, max_width, | 1563 | count = drm_fb_helper_probe_connector_modes(fb_helper, max_width, |
1547 | max_height); | 1564 | max_height); |
1548 | drm_setup_crtcs(fb_helper); | 1565 | drm_setup_crtcs(fb_helper); |
1566 | mutex_unlock(&dev->mode_config.mutex); | ||
1549 | 1567 | ||
1550 | return drm_fb_helper_single_fb_probe(fb_helper, bpp_sel); | 1568 | return drm_fb_helper_single_fb_probe(fb_helper, bpp_sel); |
1551 | } | 1569 | } |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index c20eac3379e6..9073e3bfb08c 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -1780,7 +1780,10 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
1780 | 1780 | ||
1781 | 1781 | ||
1782 | mc_shared_chmap = RREG32(MC_SHARED_CHMAP); | 1782 | mc_shared_chmap = RREG32(MC_SHARED_CHMAP); |
1783 | mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG); | 1783 | if (rdev->flags & RADEON_IS_IGP) |
1784 | mc_arb_ramcfg = RREG32(FUS_MC_ARB_RAMCFG); | ||
1785 | else | ||
1786 | mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG); | ||
1784 | 1787 | ||
1785 | switch (rdev->config.evergreen.max_tile_pipes) { | 1788 | switch (rdev->config.evergreen.max_tile_pipes) { |
1786 | case 1: | 1789 | case 1: |
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h index 94533849927e..fc40e0cc3451 100644 --- a/drivers/gpu/drm/radeon/evergreend.h +++ b/drivers/gpu/drm/radeon/evergreend.h | |||
@@ -200,6 +200,7 @@ | |||
200 | #define BURSTLENGTH_SHIFT 9 | 200 | #define BURSTLENGTH_SHIFT 9 |
201 | #define BURSTLENGTH_MASK 0x00000200 | 201 | #define BURSTLENGTH_MASK 0x00000200 |
202 | #define CHANSIZE_OVERRIDE (1 << 11) | 202 | #define CHANSIZE_OVERRIDE (1 << 11) |
203 | #define FUS_MC_ARB_RAMCFG 0x2768 | ||
203 | #define MC_VM_AGP_TOP 0x2028 | 204 | #define MC_VM_AGP_TOP 0x2028 |
204 | #define MC_VM_AGP_BOT 0x202C | 205 | #define MC_VM_AGP_BOT 0x202C |
205 | #define MC_VM_AGP_BASE 0x2030 | 206 | #define MC_VM_AGP_BASE 0x2030 |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index dd881d035f09..90dfb2b8cf03 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -1574,9 +1574,17 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct | |||
1574 | ATOM_FAKE_EDID_PATCH_RECORD *fake_edid_record; | 1574 | ATOM_FAKE_EDID_PATCH_RECORD *fake_edid_record; |
1575 | ATOM_PANEL_RESOLUTION_PATCH_RECORD *panel_res_record; | 1575 | ATOM_PANEL_RESOLUTION_PATCH_RECORD *panel_res_record; |
1576 | bool bad_record = false; | 1576 | bool bad_record = false; |
1577 | u8 *record = (u8 *)(mode_info->atom_context->bios + | 1577 | u8 *record; |
1578 | data_offset + | 1578 | |
1579 | le16_to_cpu(lvds_info->info.usModePatchTableOffset)); | 1579 | if ((frev == 1) && (crev < 2)) |
1580 | /* absolute */ | ||
1581 | record = (u8 *)(mode_info->atom_context->bios + | ||
1582 | le16_to_cpu(lvds_info->info.usModePatchTableOffset)); | ||
1583 | else | ||
1584 | /* relative */ | ||
1585 | record = (u8 *)(mode_info->atom_context->bios + | ||
1586 | data_offset + | ||
1587 | le16_to_cpu(lvds_info->info.usModePatchTableOffset)); | ||
1580 | while (*record != ATOM_RECORD_END_TYPE) { | 1588 | while (*record != ATOM_RECORD_END_TYPE) { |
1581 | switch (*record) { | 1589 | switch (*record) { |
1582 | case LCD_MODE_PATCH_RECORD_MODE_TYPE: | 1590 | case LCD_MODE_PATCH_RECORD_MODE_TYPE: |
diff --git a/drivers/gpu/drm/radeon/reg_srcs/cayman b/drivers/gpu/drm/radeon/reg_srcs/cayman index 6334f8ac1209..0aa8e85a9457 100644 --- a/drivers/gpu/drm/radeon/reg_srcs/cayman +++ b/drivers/gpu/drm/radeon/reg_srcs/cayman | |||
@@ -33,6 +33,7 @@ cayman 0x9400 | |||
33 | 0x00008E48 SQ_EX_ALLOC_TABLE_SLOTS | 33 | 0x00008E48 SQ_EX_ALLOC_TABLE_SLOTS |
34 | 0x00009100 SPI_CONFIG_CNTL | 34 | 0x00009100 SPI_CONFIG_CNTL |
35 | 0x0000913C SPI_CONFIG_CNTL_1 | 35 | 0x0000913C SPI_CONFIG_CNTL_1 |
36 | 0x00009508 TA_CNTL_AUX | ||
36 | 0x00009830 DB_DEBUG | 37 | 0x00009830 DB_DEBUG |
37 | 0x00009834 DB_DEBUG2 | 38 | 0x00009834 DB_DEBUG2 |
38 | 0x00009838 DB_DEBUG3 | 39 | 0x00009838 DB_DEBUG3 |
diff --git a/drivers/gpu/drm/radeon/reg_srcs/evergreen b/drivers/gpu/drm/radeon/reg_srcs/evergreen index 7e1637176e08..0e28cae7ea43 100644 --- a/drivers/gpu/drm/radeon/reg_srcs/evergreen +++ b/drivers/gpu/drm/radeon/reg_srcs/evergreen | |||
@@ -46,6 +46,7 @@ evergreen 0x9400 | |||
46 | 0x00008E48 SQ_EX_ALLOC_TABLE_SLOTS | 46 | 0x00008E48 SQ_EX_ALLOC_TABLE_SLOTS |
47 | 0x00009100 SPI_CONFIG_CNTL | 47 | 0x00009100 SPI_CONFIG_CNTL |
48 | 0x0000913C SPI_CONFIG_CNTL_1 | 48 | 0x0000913C SPI_CONFIG_CNTL_1 |
49 | 0x00009508 TA_CNTL_AUX | ||
49 | 0x00009700 VC_CNTL | 50 | 0x00009700 VC_CNTL |
50 | 0x00009714 VC_ENHANCE | 51 | 0x00009714 VC_ENHANCE |
51 | 0x00009830 DB_DEBUG | 52 | 0x00009830 DB_DEBUG |
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index e01cacba685f..498b284e5ef9 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c | |||
@@ -219,9 +219,6 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client) | |||
219 | int i; | 219 | int i; |
220 | struct vga_switcheroo_client *active = NULL; | 220 | struct vga_switcheroo_client *active = NULL; |
221 | 221 | ||
222 | if (new_client->active == true) | ||
223 | return 0; | ||
224 | |||
225 | for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) { | 222 | for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) { |
226 | if (vgasr_priv.clients[i].active == true) { | 223 | if (vgasr_priv.clients[i].active == true) { |
227 | active = &vgasr_priv.clients[i]; | 224 | active = &vgasr_priv.clients[i]; |
@@ -372,6 +369,9 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, | |||
372 | goto out; | 369 | goto out; |
373 | } | 370 | } |
374 | 371 | ||
372 | if (client->active == true) | ||
373 | goto out; | ||
374 | |||
375 | /* okay we want a switch - test if devices are willing to switch */ | 375 | /* okay we want a switch - test if devices are willing to switch */ |
376 | can_switch = true; | 376 | can_switch = true; |
377 | for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) { | 377 | for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) { |