Skip to content

Commit fc1caf6

Browse files
committed
Merge branch 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (204 commits) agp: intel-agp: do not use PCI resources before pci_enable_device() agp: efficeon-agp: do not use PCI resources before pci_enable_device() drm: kill BKL from common code drm/kms: Simplify setup of the initial I2C encoder config. drm,io-mapping: Specify slot to use for atomic mappings drm/radeon/kms: only expose underscan on avivo chips drm/radeon: add new pci ids drm: Cleanup after failing to create master->unique and dev->name drm/radeon: tone down overchatty acpi debug messages. drm/radeon/kms: enable underscan option for digital connectors drm/radeon/kms: fix calculation of h/v scaling factors drm/radeon/kms/igp: sideport is AMD only drm/radeon/kms: handle the case of no active displays properly in the bandwidth code drm: move ttm global code to core drm drm/i915: Clear the Ironlake dithering flags when the pipe doesn't want it. drm/radeon/kms: make sure HPD is set to NONE on analog-only connectors drm/radeon/kms: make sure rio_mem is valid before unmapping it drm/agp/i915: trim stolen space to 32M drm/i915: Unset cursor if out-of-bounds upon mode change (v4) drm/i915: Unreference object not handle on creation ...
2 parents 9779714 + 96576a9 commit fc1caf6

204 files changed

Lines changed: 6990 additions & 4990 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/char/agp/efficeon-agp.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,17 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev,
371371
bridge->dev = pdev;
372372
bridge->capndx = cap_ptr;
373373

374+
/*
375+
* If the device has not been properly setup, the following will catch
376+
* the problem and should stop the system from crashing.
377+
* 20030610 - hamish@zot.org
378+
*/
379+
if (pci_enable_device(pdev)) {
380+
printk(KERN_ERR PFX "Unable to Enable PCI device\n");
381+
agp_put_bridge(bridge);
382+
return -ENODEV;
383+
}
384+
374385
/*
375386
* The following fixes the case where the BIOS has "forgotten" to
376387
* provide an address range for the GART.
@@ -385,17 +396,6 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev,
385396
}
386397
}
387398

388-
/*
389-
* If the device has not been properly setup, the following will catch
390-
* the problem and should stop the system from crashing.
391-
* 20030610 - hamish@zot.org
392-
*/
393-
if (pci_enable_device(pdev)) {
394-
printk(KERN_ERR PFX "Unable to Enable PCI device\n");
395-
agp_put_bridge(bridge);
396-
return -ENODEV;
397-
}
398-
399399
/* Fill in the mode register */
400400
if (cap_ptr) {
401401
pci_read_config_dword(pdev,

‎drivers/char/agp/intel-agp.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,9 @@ static const struct intel_driver_description {
816816
{ PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG,
817817
"HD Graphics", NULL, &intel_i965_driver },
818818
{ PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_IG,
819-
"Sandybridge", NULL, &intel_i965_driver },
819+
"Sandybridge", NULL, &intel_gen6_driver },
820820
{ PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_IG,
821-
"Sandybridge", NULL, &intel_i965_driver },
821+
"Sandybridge", NULL, &intel_gen6_driver },
822822
{ 0, 0, NULL, NULL, NULL }
823823
};
824824

@@ -907,6 +907,17 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
907907

908908
dev_info(&pdev->dev, "Intel %s Chipset\n", intel_agp_chipsets[i].name);
909909

910+
/*
911+
* If the device has not been properly setup, the following will catch
912+
* the problem and should stop the system from crashing.
913+
* 20030610 - hamish@zot.org
914+
*/
915+
if (pci_enable_device(pdev)) {
916+
dev_err(&pdev->dev, "can't enable PCI device\n");
917+
agp_put_bridge(bridge);
918+
return -ENODEV;
919+
}
920+
910921
/*
911922
* The following fixes the case where the BIOS has "forgotten" to
912923
* provide an address range for the GART.
@@ -921,17 +932,6 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
921932
}
922933
}
923934

924-
/*
925-
* If the device has not been properly setup, the following will catch
926-
* the problem and should stop the system from crashing.
927-
* 20030610 - hamish@zot.org
928-
*/
929-
if (pci_enable_device(pdev)) {
930-
dev_err(&pdev->dev, "can't enable PCI device\n");
931-
agp_put_bridge(bridge);
932-
return -ENODEV;
933-
}
934-
935935
/* Fill in the mode register */
936936
if (cap_ptr) {
937937
pci_read_config_dword(pdev,

‎drivers/char/agp/intel-agp.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@
6060
#define I810_PTE_LOCAL 0x00000002
6161
#define I810_PTE_VALID 0x00000001
6262
#define I830_PTE_SYSTEM_CACHED 0x00000006
63+
/* GT PTE cache control fields */
64+
#define GEN6_PTE_UNCACHED 0x00000002
65+
#define GEN6_PTE_LLC 0x00000004
66+
#define GEN6_PTE_LLC_MLC 0x00000006
67+
#define GEN6_PTE_GFDT 0x00000008
68+
6369
#define I810_SMRAM_MISCC 0x70
6470
#define I810_GFX_MEM_WIN_SIZE 0x00010000
6571
#define I810_GFX_MEM_WIN_32M 0x00010000

‎drivers/char/agp/intel-gtt.c‎

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#define USE_PCI_DMA_API 1
2626
#endif
2727

28+
/* Max amount of stolen space, anything above will be returned to Linux */
29+
int intel_max_stolen = 32 * 1024 * 1024;
30+
EXPORT_SYMBOL(intel_max_stolen);
31+
2832
static const struct aper_size_info_fixed intel_i810_sizes[] =
2933
{
3034
{64, 16384, 4},
@@ -104,7 +108,7 @@ static int intel_agp_map_memory(struct agp_memory *mem)
104108
DBG("try mapping %lu pages\n", (unsigned long)mem->page_count);
105109

106110
if (sg_alloc_table(&st, mem->page_count, GFP_KERNEL))
107-
return -ENOMEM;
111+
goto err;
108112

109113
mem->sg_list = sg = st.sgl;
110114

@@ -113,11 +117,14 @@ static int intel_agp_map_memory(struct agp_memory *mem)
113117

114118
mem->num_sg = pci_map_sg(intel_private.pcidev, mem->sg_list,
115119
mem->page_count, PCI_DMA_BIDIRECTIONAL);
116-
if (unlikely(!mem->num_sg)) {
117-
intel_agp_free_sglist(mem);
118-
return -ENOMEM;
119-
}
120+
if (unlikely(!mem->num_sg))
121+
goto err;
122+
120123
return 0;
124+
125+
err:
126+
sg_free_table(&st);
127+
return -ENOMEM;
121128
}
122129

123130
static void intel_agp_unmap_memory(struct agp_memory *mem)
@@ -176,7 +183,7 @@ static void intel_agp_insert_sg_entries(struct agp_memory *mem,
176183
if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB ||
177184
agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB)
178185
{
179-
cache_bits = I830_PTE_SYSTEM_CACHED;
186+
cache_bits = GEN6_PTE_LLC_MLC;
180187
}
181188

182189
for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
@@ -710,7 +717,12 @@ static void intel_i830_init_gtt_entries(void)
710717
break;
711718
}
712719
}
713-
if (gtt_entries > 0) {
720+
if (!local && gtt_entries > intel_max_stolen) {
721+
dev_info(&agp_bridge->dev->dev,
722+
"detected %dK stolen memory, trimming to %dK\n",
723+
gtt_entries / KB(1), intel_max_stolen / KB(1));
724+
gtt_entries = intel_max_stolen / KB(4);
725+
} else if (gtt_entries > 0) {
714726
dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n",
715727
gtt_entries / KB(1), local ? "local" : "stolen");
716728
gtt_entries /= KB(4);
@@ -797,6 +809,10 @@ static int intel_i830_create_gatt_table(struct agp_bridge_data *bridge)
797809

798810
/* we have to call this as early as possible after the MMIO base address is known */
799811
intel_i830_init_gtt_entries();
812+
if (intel_private.gtt_entries == 0) {
813+
iounmap(intel_private.registers);
814+
return -ENOMEM;
815+
}
800816

801817
agp_bridge->gatt_table = NULL;
802818

@@ -1282,6 +1298,11 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
12821298

12831299
/* we have to call this as early as possible after the MMIO base address is known */
12841300
intel_i830_init_gtt_entries();
1301+
if (intel_private.gtt_entries == 0) {
1302+
iounmap(intel_private.gtt);
1303+
iounmap(intel_private.registers);
1304+
return -ENOMEM;
1305+
}
12851306

12861307
agp_bridge->gatt_table = NULL;
12871308

@@ -1309,6 +1330,16 @@ static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge,
13091330
return addr | bridge->driver->masks[type].mask;
13101331
}
13111332

1333+
static unsigned long intel_gen6_mask_memory(struct agp_bridge_data *bridge,
1334+
dma_addr_t addr, int type)
1335+
{
1336+
/* Shift high bits down */
1337+
addr |= (addr >> 28) & 0xff;
1338+
1339+
/* Type checking must be done elsewhere */
1340+
return addr | bridge->driver->masks[type].mask;
1341+
}
1342+
13121343
static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size)
13131344
{
13141345
u16 snb_gmch_ctl;
@@ -1390,6 +1421,11 @@ static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge)
13901421

13911422
/* we have to call this as early as possible after the MMIO base address is known */
13921423
intel_i830_init_gtt_entries();
1424+
if (intel_private.gtt_entries == 0) {
1425+
iounmap(intel_private.gtt);
1426+
iounmap(intel_private.registers);
1427+
return -ENOMEM;
1428+
}
13931429

13941430
agp_bridge->gatt_table = NULL;
13951431

@@ -1517,6 +1553,39 @@ static const struct agp_bridge_driver intel_i965_driver = {
15171553
#endif
15181554
};
15191555

1556+
static const struct agp_bridge_driver intel_gen6_driver = {
1557+
.owner = THIS_MODULE,
1558+
.aperture_sizes = intel_i830_sizes,
1559+
.size_type = FIXED_APER_SIZE,
1560+
.num_aperture_sizes = 4,
1561+
.needs_scratch_page = true,
1562+
.configure = intel_i9xx_configure,
1563+
.fetch_size = intel_i9xx_fetch_size,
1564+
.cleanup = intel_i915_cleanup,
1565+
.mask_memory = intel_gen6_mask_memory,
1566+
.masks = intel_i810_masks,
1567+
.agp_enable = intel_i810_agp_enable,
1568+
.cache_flush = global_cache_flush,
1569+
.create_gatt_table = intel_i965_create_gatt_table,
1570+
.free_gatt_table = intel_i830_free_gatt_table,
1571+
.insert_memory = intel_i915_insert_entries,
1572+
.remove_memory = intel_i915_remove_entries,
1573+
.alloc_by_type = intel_i830_alloc_by_type,
1574+
.free_by_type = intel_i810_free_by_type,
1575+
.agp_alloc_page = agp_generic_alloc_page,
1576+
.agp_alloc_pages = agp_generic_alloc_pages,
1577+
.agp_destroy_page = agp_generic_destroy_page,
1578+
.agp_destroy_pages = agp_generic_destroy_pages,
1579+
.agp_type_to_mask_type = intel_i830_type_to_mask_type,
1580+
.chipset_flush = intel_i915_chipset_flush,
1581+
#ifdef USE_PCI_DMA_API
1582+
.agp_map_page = intel_agp_map_page,
1583+
.agp_unmap_page = intel_agp_unmap_page,
1584+
.agp_map_memory = intel_agp_map_memory,
1585+
.agp_unmap_memory = intel_agp_unmap_memory,
1586+
#endif
1587+
};
1588+
15201589
static const struct agp_bridge_driver intel_g33_driver = {
15211590
.owner = THIS_MODULE,
15221591
.aperture_sizes = intel_i830_sizes,

‎drivers/gpu/drm/Kconfig‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
menuconfig DRM
88
tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
9-
depends on (AGP || AGP=n) && PCI && !EMULATED_CMPXCHG && MMU
9+
depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && MMU
1010
select I2C
1111
select I2C_ALGOBIT
1212
select SLOW_WORK
@@ -17,7 +17,7 @@ menuconfig DRM
1717
These modules provide support for synchronization, security, and
1818
DMA transfers. Please see <http://dri.sourceforge.net/> for more
1919
details. You should also select and configure AGP
20-
(/dev/agpgart) support.
20+
(/dev/agpgart) support if it is available for your platform.
2121

2222
config DRM_KMS_HELPER
2323
tristate
@@ -61,6 +61,7 @@ config DRM_RADEON
6161
select DRM_KMS_HELPER
6262
select DRM_TTM
6363
select POWER_SUPPLY
64+
select HWMON
6465
help
6566
Choose this option if you have an ATI Radeon graphics card. There
6667
are both PCI and AGP versions. You don't need to choose this to
@@ -130,7 +131,7 @@ endchoice
130131

131132
config DRM_MGA
132133
tristate "Matrox g200/g400"
133-
depends on DRM
134+
depends on DRM && PCI
134135
select FW_LOADER
135136
help
136137
Choose this option if you have a Matrox G200, G400 or G450 graphics
@@ -148,14 +149,14 @@ config DRM_SIS
148149

149150
config DRM_VIA
150151
tristate "Via unichrome video cards"
151-
depends on DRM
152+
depends on DRM && PCI
152153
help
153154
Choose this option if you have a Via unichrome or compatible video
154155
chipset. If M is selected the module will be called via.
155156

156157
config DRM_SAVAGE
157158
tristate "Savage video cards"
158-
depends on DRM
159+
depends on DRM && PCI
159160
help
160161
Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister
161162
chipset. If M is selected the module will be called savage.

‎drivers/gpu/drm/Makefile‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@ drm-y := drm_auth.o drm_buffer.o drm_bufs.o drm_cache.o \
99
drm_drv.o drm_fops.o drm_gem.o drm_ioctl.o drm_irq.o \
1010
drm_lock.o drm_memory.o drm_proc.o drm_stub.o drm_vm.o \
1111
drm_agpsupport.o drm_scatter.o ati_pcigart.o drm_pci.o \
12-
drm_sysfs.o drm_hashtab.o drm_sman.o drm_mm.o \
12+
drm_platform.o drm_sysfs.o drm_hashtab.o drm_sman.o drm_mm.o \
1313
drm_crtc.o drm_modes.o drm_edid.o \
14-
drm_info.o drm_debugfs.o drm_encoder_slave.o
14+
drm_info.o drm_debugfs.o drm_encoder_slave.o \
15+
drm_trace_points.o drm_global.o
1516

1617
drm-$(CONFIG_COMPAT) += drm_ioc32.o
1718

1819
drm_kms_helper-y := drm_fb_helper.o drm_crtc_helper.o drm_dp_i2c_helper.o
1920

2021
obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
2122

23+
CFLAGS_drm_trace_points.o := -I$(src)
24+
2225
obj-$(CONFIG_DRM) += drm.o
2326
obj-$(CONFIG_DRM_TTM) += ttm/
2427
obj-$(CONFIG_DRM_TDFX) += tdfx/

‎drivers/gpu/drm/drm_bufs.c‎

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,6 @@
3939
#include <asm/shmparam.h>
4040
#include "drmP.h"
4141

42-
resource_size_t drm_get_resource_start(struct drm_device *dev, unsigned int resource)
43-
{
44-
return pci_resource_start(dev->pdev, resource);
45-
}
46-
EXPORT_SYMBOL(drm_get_resource_start);
47-
48-
resource_size_t drm_get_resource_len(struct drm_device *dev, unsigned int resource)
49-
{
50-
return pci_resource_len(dev->pdev, resource);
51-
}
52-
53-
EXPORT_SYMBOL(drm_get_resource_len);
54-
5542
static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
5643
struct drm_local_map *map)
5744
{
@@ -189,7 +176,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
189176
switch (map->type) {
190177
case _DRM_REGISTERS:
191178
case _DRM_FRAME_BUFFER:
192-
#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__)
179+
#if !defined(__sparc__) && !defined(__alpha__) && !defined(__ia64__) && !defined(__powerpc64__) && !defined(__x86_64__) && !defined(__arm__)
193180
if (map->offset + (map->size-1) < map->offset ||
194181
map->offset < virt_to_phys(high_memory)) {
195182
kfree(map);

0 commit comments

Comments
 (0)