aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/intel-agp.c97
-rw-r--r--drivers/char/drm/drm_pciids.h5
-rw-r--r--drivers/char/drm/i915_dma.c90
-rw-r--r--drivers/char/drm/i915_drm.h5
-rw-r--r--drivers/char/drm/i915_drv.h2
-rw-r--r--drivers/char/drm/radeon_ioc32.c31
-rw-r--r--drivers/char/random.c2
-rw-r--r--drivers/char/tty_io.c14
8 files changed, 177 insertions, 69 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index d383168b75fa..0439ee951a11 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -1810,68 +1810,69 @@ static int find_gmch(u16 device)
1810static const struct intel_driver_description { 1810static const struct intel_driver_description {
1811 unsigned int chip_id; 1811 unsigned int chip_id;
1812 unsigned int gmch_chip_id; 1812 unsigned int gmch_chip_id;
1813 unsigned int multi_gmch_chip; /* if we have more gfx chip type on this HB. */
1813 char *name; 1814 char *name;
1814 const struct agp_bridge_driver *driver; 1815 const struct agp_bridge_driver *driver;
1815 const struct agp_bridge_driver *gmch_driver; 1816 const struct agp_bridge_driver *gmch_driver;
1816} intel_agp_chipsets[] = { 1817} intel_agp_chipsets[] = {
1817 { PCI_DEVICE_ID_INTEL_82443LX_0, 0, "440LX", &intel_generic_driver, NULL }, 1818 { PCI_DEVICE_ID_INTEL_82443LX_0, 0, 0, "440LX", &intel_generic_driver, NULL },
1818 { PCI_DEVICE_ID_INTEL_82443BX_0, 0, "440BX", &intel_generic_driver, NULL }, 1819 { PCI_DEVICE_ID_INTEL_82443BX_0, 0, 0, "440BX", &intel_generic_driver, NULL },
1819 { PCI_DEVICE_ID_INTEL_82443GX_0, 0, "440GX", &intel_generic_driver, NULL }, 1820 { PCI_DEVICE_ID_INTEL_82443GX_0, 0, 0, "440GX", &intel_generic_driver, NULL },
1820 { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, "i810", 1821 { PCI_DEVICE_ID_INTEL_82810_MC1, PCI_DEVICE_ID_INTEL_82810_IG1, 0, "i810",
1821 NULL, &intel_810_driver }, 1822 NULL, &intel_810_driver },
1822 { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, "i810", 1823 { PCI_DEVICE_ID_INTEL_82810_MC3, PCI_DEVICE_ID_INTEL_82810_IG3, 0, "i810",
1823 NULL, &intel_810_driver }, 1824 NULL, &intel_810_driver },
1824 { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, "i810", 1825 { PCI_DEVICE_ID_INTEL_82810E_MC, PCI_DEVICE_ID_INTEL_82810E_IG, 0, "i810",
1825 NULL, &intel_810_driver }, 1826 NULL, &intel_810_driver },
1826 { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, "i815", 1827 { PCI_DEVICE_ID_INTEL_82815_MC, PCI_DEVICE_ID_INTEL_82815_CGC, 0, "i815",
1827 &intel_810_driver, &intel_815_driver }, 1828 &intel_815_driver, &intel_810_driver },
1828 { PCI_DEVICE_ID_INTEL_82820_HB, 0, "i820", &intel_820_driver, NULL }, 1829 { PCI_DEVICE_ID_INTEL_82820_HB, 0, 0, "i820", &intel_820_driver, NULL },
1829 { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, "i820", &intel_820_driver, NULL }, 1830 { PCI_DEVICE_ID_INTEL_82820_UP_HB, 0, 0, "i820", &intel_820_driver, NULL },
1830 { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, "830M", 1831 { PCI_DEVICE_ID_INTEL_82830_HB, PCI_DEVICE_ID_INTEL_82830_CGC, 0, "830M",
1831 &intel_830mp_driver, &intel_830_driver }, 1832 &intel_830mp_driver, &intel_830_driver },
1832 { PCI_DEVICE_ID_INTEL_82840_HB, 0, "i840", &intel_840_driver, NULL }, 1833 { PCI_DEVICE_ID_INTEL_82840_HB, 0, 0, "i840", &intel_840_driver, NULL },
1833 { PCI_DEVICE_ID_INTEL_82845_HB, 0, "845G", &intel_845_driver, NULL }, 1834 { PCI_DEVICE_ID_INTEL_82845_HB, 0, 0, "845G", &intel_845_driver, NULL },
1834 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, "830M", 1835 { PCI_DEVICE_ID_INTEL_82845G_HB, PCI_DEVICE_ID_INTEL_82845G_IG, 0, "830M",
1835 &intel_845_driver, &intel_830_driver }, 1836 &intel_845_driver, &intel_830_driver },
1836 { PCI_DEVICE_ID_INTEL_82850_HB, 0, "i850", &intel_850_driver, NULL }, 1837 { PCI_DEVICE_ID_INTEL_82850_HB, 0, 0, "i850", &intel_850_driver, NULL },
1837 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, "855PM", &intel_845_driver, NULL }, 1838 { PCI_DEVICE_ID_INTEL_82855PM_HB, 0, 0, "855PM", &intel_845_driver, NULL },
1838 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, "855GM", 1839 { PCI_DEVICE_ID_INTEL_82855GM_HB, PCI_DEVICE_ID_INTEL_82855GM_IG, 0, "855GM",
1839 &intel_845_driver, &intel_830_driver }, 1840 &intel_845_driver, &intel_830_driver },
1840 { PCI_DEVICE_ID_INTEL_82860_HB, 0, "i860", &intel_860_driver, NULL }, 1841 { PCI_DEVICE_ID_INTEL_82860_HB, 0, 0, "i860", &intel_860_driver, NULL },
1841 { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, "865", 1842 { PCI_DEVICE_ID_INTEL_82865_HB, PCI_DEVICE_ID_INTEL_82865_IG, 0, "865",
1842 &intel_845_driver, &intel_830_driver }, 1843 &intel_845_driver, &intel_830_driver },
1843 { PCI_DEVICE_ID_INTEL_82875_HB, 0, "i875", &intel_845_driver, NULL }, 1844 { PCI_DEVICE_ID_INTEL_82875_HB, 0, 0, "i875", &intel_845_driver, NULL },
1844 { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, "915G", 1845 { PCI_DEVICE_ID_INTEL_82915G_HB, PCI_DEVICE_ID_INTEL_82915G_IG, 0, "915G",
1845 &intel_845_driver, &intel_915_driver }, 1846 &intel_845_driver, &intel_915_driver },
1846 { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, "915GM", 1847 { PCI_DEVICE_ID_INTEL_82915GM_HB, PCI_DEVICE_ID_INTEL_82915GM_IG, 0, "915GM",
1847 &intel_845_driver, &intel_915_driver }, 1848 &intel_845_driver, &intel_915_driver },
1848 { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, "945G", 1849 { PCI_DEVICE_ID_INTEL_82945G_HB, PCI_DEVICE_ID_INTEL_82945G_IG, 0, "945G",
1849 &intel_845_driver, &intel_915_driver }, 1850 &intel_845_driver, &intel_915_driver },
1850 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, "945GM", 1851 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GM_IG, 1, "945GM",
1851 &intel_845_driver, &intel_915_driver }, 1852 &intel_845_driver, &intel_915_driver },
1852 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, "945GME", 1853 { PCI_DEVICE_ID_INTEL_82945GM_HB, PCI_DEVICE_ID_INTEL_82945GME_IG, 0, "945GME",
1853 &intel_845_driver, &intel_915_driver }, 1854 &intel_845_driver, &intel_915_driver },
1854 { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, "946GZ", 1855 { PCI_DEVICE_ID_INTEL_82946GZ_HB, PCI_DEVICE_ID_INTEL_82946GZ_IG, 0, "946GZ",
1855 &intel_845_driver, &intel_i965_driver }, 1856 &intel_845_driver, &intel_i965_driver },
1856 { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, "965G", 1857 { PCI_DEVICE_ID_INTEL_82965G_1_HB, PCI_DEVICE_ID_INTEL_82965G_1_IG, 0, "965G",
1857 &intel_845_driver, &intel_i965_driver }, 1858 &intel_845_driver, &intel_i965_driver },
1858 { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, "965Q", 1859 { PCI_DEVICE_ID_INTEL_82965Q_HB, PCI_DEVICE_ID_INTEL_82965Q_IG, 0, "965Q",
1859 &intel_845_driver, &intel_i965_driver }, 1860 &intel_845_driver, &intel_i965_driver },
1860 { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, "965G", 1861 { PCI_DEVICE_ID_INTEL_82965G_HB, PCI_DEVICE_ID_INTEL_82965G_IG, 0, "965G",
1861 &intel_845_driver, &intel_i965_driver }, 1862 &intel_845_driver, &intel_i965_driver },
1862 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, "965GM", 1863 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GM_IG, 1, "965GM",
1863 &intel_845_driver, &intel_i965_driver }, 1864 &intel_845_driver, &intel_i965_driver },
1864 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, "965GME/GLE", 1865 { PCI_DEVICE_ID_INTEL_82965GM_HB, PCI_DEVICE_ID_INTEL_82965GME_IG, 0, "965GME/GLE",
1865 &intel_845_driver, &intel_i965_driver }, 1866 &intel_845_driver, &intel_i965_driver },
1866 { PCI_DEVICE_ID_INTEL_7505_0, 0, "E7505", &intel_7505_driver, NULL }, 1867 { PCI_DEVICE_ID_INTEL_7505_0, 0, 0, "E7505", &intel_7505_driver, NULL },
1867 { PCI_DEVICE_ID_INTEL_7205_0, 0, "E7205", &intel_7505_driver, NULL }, 1868 { PCI_DEVICE_ID_INTEL_7205_0, 0, 0, "E7205", &intel_7505_driver, NULL },
1868 { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, "G33", 1869 { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, 0, "G33",
1869 &intel_845_driver, &intel_g33_driver }, 1870 &intel_845_driver, &intel_g33_driver },
1870 { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, "Q35", 1871 { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, 0, "Q35",
1871 &intel_845_driver, &intel_g33_driver }, 1872 &intel_845_driver, &intel_g33_driver },
1872 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, "Q33", 1873 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33",
1873 &intel_845_driver, &intel_g33_driver }, 1874 &intel_845_driver, &intel_g33_driver },
1874 { 0, 0, NULL, NULL, NULL } 1875 { 0, 0, 0, NULL, NULL, NULL }
1875}; 1876};
1876 1877
1877static int __devinit agp_intel_probe(struct pci_dev *pdev, 1878static int __devinit agp_intel_probe(struct pci_dev *pdev,
@@ -1892,10 +1893,19 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1892 /* In case that multiple models of gfx chip may 1893 /* In case that multiple models of gfx chip may
1893 stand on same host bridge type, this can be 1894 stand on same host bridge type, this can be
1894 sure we detect the right IGD. */ 1895 sure we detect the right IGD. */
1895 if ((pdev->device == intel_agp_chipsets[i].chip_id) && 1896 if (pdev->device == intel_agp_chipsets[i].chip_id) {
1896 ((intel_agp_chipsets[i].gmch_chip_id == 0) || 1897 if ((intel_agp_chipsets[i].gmch_chip_id != 0) &&
1897 find_gmch(intel_agp_chipsets[i].gmch_chip_id))) 1898 find_gmch(intel_agp_chipsets[i].gmch_chip_id)) {
1898 break; 1899 bridge->driver =
1900 intel_agp_chipsets[i].gmch_driver;
1901 break;
1902 } else if (intel_agp_chipsets[i].multi_gmch_chip) {
1903 continue;
1904 } else {
1905 bridge->driver = intel_agp_chipsets[i].driver;
1906 break;
1907 }
1908 }
1899 } 1909 }
1900 1910
1901 if (intel_agp_chipsets[i].name == NULL) { 1911 if (intel_agp_chipsets[i].name == NULL) {
@@ -1906,11 +1916,6 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1906 return -ENODEV; 1916 return -ENODEV;
1907 } 1917 }
1908 1918
1909 if (intel_agp_chipsets[i].gmch_chip_id != 0)
1910 bridge->driver = intel_agp_chipsets[i].gmch_driver;
1911 else
1912 bridge->driver = intel_agp_chipsets[i].driver;
1913
1914 if (bridge->driver == NULL) { 1919 if (bridge->driver == NULL) {
1915 printk(KERN_WARNING PFX "Failed to find bridge device " 1920 printk(KERN_WARNING PFX "Failed to find bridge device "
1916 "(chip_id: %04x)\n", intel_agp_chipsets[i].gmch_chip_id); 1921 "(chip_id: %04x)\n", intel_agp_chipsets[i].gmch_chip_id);
diff --git a/drivers/char/drm/drm_pciids.h b/drivers/char/drm/drm_pciids.h
index 177ccc07f968..aa6335032d1e 100644
--- a/drivers/char/drm/drm_pciids.h
+++ b/drivers/char/drm/drm_pciids.h
@@ -300,10 +300,15 @@
300 {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 300 {0x8086, 0x2592, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
301 {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 301 {0x8086, 0x2772, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
302 {0x8086, 0x27a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 302 {0x8086, 0x27a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
303 {0x8086, 0x27ae, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
303 {0x8086, 0x2972, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 304 {0x8086, 0x2972, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
304 {0x8086, 0x2982, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 305 {0x8086, 0x2982, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
305 {0x8086, 0x2992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 306 {0x8086, 0x2992, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
306 {0x8086, 0x29a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 307 {0x8086, 0x29a2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
308 {0x8086, 0x29b2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
309 {0x8086, 0x29c2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
310 {0x8086, 0x29d2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
307 {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 311 {0x8086, 0x2a02, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
312 {0x8086, 0x2a12, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
308 {0, 0, 0} 313 {0, 0, 0}
309 314
diff --git a/drivers/char/drm/i915_dma.c b/drivers/char/drm/i915_dma.c
index 1ba15d9a171a..ea52740af4f6 100644
--- a/drivers/char/drm/i915_dma.c
+++ b/drivers/char/drm/i915_dma.c
@@ -35,7 +35,12 @@
35 dev->pci_device == 0x2982 || \ 35 dev->pci_device == 0x2982 || \
36 dev->pci_device == 0x2992 || \ 36 dev->pci_device == 0x2992 || \
37 dev->pci_device == 0x29A2 || \ 37 dev->pci_device == 0x29A2 || \
38 dev->pci_device == 0x2A02) 38 dev->pci_device == 0x2A02 || \
39 dev->pci_device == 0x2A12)
40
41#define IS_G33(dev) (dev->pci_device == 0x29b2 || \
42 dev->pci_device == 0x29c2 || \
43 dev->pci_device == 0x29d2)
39 44
40/* Really want an OS-independent resettable timer. Would like to have 45/* Really want an OS-independent resettable timer. Would like to have
41 * this loop run for (eg) 3 sec, but have the timer reset every time 46 * this loop run for (eg) 3 sec, but have the timer reset every time
@@ -106,6 +111,12 @@ static int i915_dma_cleanup(drm_device_t * dev)
106 I915_WRITE(0x02080, 0x1ffff000); 111 I915_WRITE(0x02080, 0x1ffff000);
107 } 112 }
108 113
114 if (dev_priv->status_gfx_addr) {
115 dev_priv->status_gfx_addr = 0;
116 drm_core_ioremapfree(&dev_priv->hws_map, dev);
117 I915_WRITE(0x2080, 0x1ffff000);
118 }
119
109 drm_free(dev->dev_private, sizeof(drm_i915_private_t), 120 drm_free(dev->dev_private, sizeof(drm_i915_private_t),
110 DRM_MEM_DRIVER); 121 DRM_MEM_DRIVER);
111 122
@@ -179,26 +190,24 @@ static int i915_initialize(drm_device_t * dev,
179 dev_priv->allow_batchbuffer = 1; 190 dev_priv->allow_batchbuffer = 1;
180 191
181 /* Program Hardware Status Page */ 192 /* Program Hardware Status Page */
182 dev_priv->status_page_dmah = drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 193 if (!IS_G33(dev)) {
183 0xffffffff); 194 dev_priv->status_page_dmah =
195 drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
196
197 if (!dev_priv->status_page_dmah) {
198 dev->dev_private = (void *)dev_priv;
199 i915_dma_cleanup(dev);
200 DRM_ERROR("Can not allocate hardware status page\n");
201 return DRM_ERR(ENOMEM);
202 }
203 dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr;
204 dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr;
184 205
185 if (!dev_priv->status_page_dmah) { 206 memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
186 dev->dev_private = (void *)dev_priv; 207 I915_WRITE(0x02080, dev_priv->dma_status_page);
187 i915_dma_cleanup(dev);
188 DRM_ERROR("Can not allocate hardware status page\n");
189 return DRM_ERR(ENOMEM);
190 } 208 }
191 dev_priv->hw_status_page = dev_priv->status_page_dmah->vaddr;
192 dev_priv->dma_status_page = dev_priv->status_page_dmah->busaddr;
193
194 memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
195 DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
196
197 I915_WRITE(0x02080, dev_priv->dma_status_page);
198 DRM_DEBUG("Enabled hardware status page\n"); 209 DRM_DEBUG("Enabled hardware status page\n");
199
200 dev->dev_private = (void *)dev_priv; 210 dev->dev_private = (void *)dev_priv;
201
202 return 0; 211 return 0;
203} 212}
204 213
@@ -231,7 +240,10 @@ static int i915_dma_resume(drm_device_t * dev)
231 } 240 }
232 DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page); 241 DRM_DEBUG("hw status page @ %p\n", dev_priv->hw_status_page);
233 242
234 I915_WRITE(0x02080, dev_priv->dma_status_page); 243 if (dev_priv->status_gfx_addr != 0)
244 I915_WRITE(0x02080, dev_priv->status_gfx_addr);
245 else
246 I915_WRITE(0x02080, dev_priv->dma_status_page);
235 DRM_DEBUG("Enabled hardware status page\n"); 247 DRM_DEBUG("Enabled hardware status page\n");
236 248
237 return 0; 249 return 0;
@@ -739,6 +751,47 @@ static int i915_setparam(DRM_IOCTL_ARGS)
739 return 0; 751 return 0;
740} 752}
741 753
754static int i915_set_status_page(DRM_IOCTL_ARGS)
755{
756 DRM_DEVICE;
757 drm_i915_private_t *dev_priv = dev->dev_private;
758 drm_i915_hws_addr_t hws;
759
760 if (!dev_priv) {
761 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
762 return DRM_ERR(EINVAL);
763 }
764 DRM_COPY_FROM_USER_IOCTL(hws, (drm_i915_hws_addr_t __user *) data,
765 sizeof(hws));
766 printk(KERN_DEBUG "set status page addr 0x%08x\n", (u32)hws.addr);
767
768 dev_priv->status_gfx_addr = hws.addr & (0x1ffff<<12);
769
770 dev_priv->hws_map.offset = dev->agp->agp_info.aper_base + hws.addr;
771 dev_priv->hws_map.size = 4*1024;
772 dev_priv->hws_map.type = 0;
773 dev_priv->hws_map.flags = 0;
774 dev_priv->hws_map.mtrr = 0;
775
776 drm_core_ioremap(&dev_priv->hws_map, dev);
777 if (dev_priv->hws_map.handle == NULL) {
778 dev->dev_private = (void *)dev_priv;
779 i915_dma_cleanup(dev);
780 dev_priv->status_gfx_addr = 0;
781 DRM_ERROR("can not ioremap virtual address for"
782 " G33 hw status page\n");
783 return DRM_ERR(ENOMEM);
784 }
785 dev_priv->hw_status_page = dev_priv->hws_map.handle;
786
787 memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
788 I915_WRITE(0x02080, dev_priv->status_gfx_addr);
789 DRM_DEBUG("load hws 0x2080 with gfx mem 0x%x\n",
790 dev_priv->status_gfx_addr);
791 DRM_DEBUG("load hws at %p\n", dev_priv->hw_status_page);
792 return 0;
793}
794
742int i915_driver_load(drm_device_t *dev, unsigned long flags) 795int i915_driver_load(drm_device_t *dev, unsigned long flags)
743{ 796{
744 /* i915 has 4 more counters */ 797 /* i915 has 4 more counters */
@@ -785,6 +838,7 @@ drm_ioctl_desc_t i915_ioctls[] = {
785 [DRM_IOCTL_NR(DRM_I915_SET_VBLANK_PIPE)] = { i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY }, 838 [DRM_IOCTL_NR(DRM_I915_SET_VBLANK_PIPE)] = { i915_vblank_pipe_set, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY },
786 [DRM_IOCTL_NR(DRM_I915_GET_VBLANK_PIPE)] = { i915_vblank_pipe_get, DRM_AUTH }, 839 [DRM_IOCTL_NR(DRM_I915_GET_VBLANK_PIPE)] = { i915_vblank_pipe_get, DRM_AUTH },
787 [DRM_IOCTL_NR(DRM_I915_VBLANK_SWAP)] = {i915_vblank_swap, DRM_AUTH}, 840 [DRM_IOCTL_NR(DRM_I915_VBLANK_SWAP)] = {i915_vblank_swap, DRM_AUTH},
841 [DRM_IOCTL_NR(DRM_I915_HWS_ADDR)] = {i915_set_status_page, DRM_AUTH},
788}; 842};
789 843
790int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); 844int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls);
diff --git a/drivers/char/drm/i915_drm.h b/drivers/char/drm/i915_drm.h
index 96a468886a7a..7b7b68b96f31 100644
--- a/drivers/char/drm/i915_drm.h
+++ b/drivers/char/drm/i915_drm.h
@@ -142,6 +142,7 @@ typedef struct _drm_i915_sarea {
142#define DRM_I915_SET_VBLANK_PIPE 0x0d 142#define DRM_I915_SET_VBLANK_PIPE 0x0d
143#define DRM_I915_GET_VBLANK_PIPE 0x0e 143#define DRM_I915_GET_VBLANK_PIPE 0x0e
144#define DRM_I915_VBLANK_SWAP 0x0f 144#define DRM_I915_VBLANK_SWAP 0x0f
145#define DRM_I915_HWS_ADDR 0x11
145 146
146#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 147#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
147#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) 148#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -262,4 +263,8 @@ typedef struct drm_i915_vblank_swap {
262 unsigned int sequence; 263 unsigned int sequence;
263} drm_i915_vblank_swap_t; 264} drm_i915_vblank_swap_t;
264 265
266typedef struct drm_i915_hws_addr {
267 uint64_t addr;
268} drm_i915_hws_addr_t;
269
265#endif /* _I915_DRM_H_ */ 270#endif /* _I915_DRM_H_ */
diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h
index 93cdcfe6aa84..85e323acb95d 100644
--- a/drivers/char/drm/i915_drv.h
+++ b/drivers/char/drm/i915_drv.h
@@ -91,6 +91,8 @@ typedef struct drm_i915_private {
91 void *hw_status_page; 91 void *hw_status_page;
92 dma_addr_t dma_status_page; 92 dma_addr_t dma_status_page;
93 unsigned long counter; 93 unsigned long counter;
94 unsigned int status_gfx_addr;
95 drm_local_map_t hws_map;
94 96
95 unsigned int cpp; 97 unsigned int cpp;
96 int back_offset; 98 int back_offset;
diff --git a/drivers/char/drm/radeon_ioc32.c b/drivers/char/drm/radeon_ioc32.c
index 1f1f9cc055a4..56decda2a71f 100644
--- a/drivers/char/drm/radeon_ioc32.c
+++ b/drivers/char/drm/radeon_ioc32.c
@@ -349,6 +349,36 @@ static int compat_radeon_irq_emit(struct file *file, unsigned int cmd,
349 DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request); 349 DRM_IOCTL_RADEON_IRQ_EMIT, (unsigned long)request);
350} 350}
351 351
352/* The two 64-bit arches where alignof(u64)==4 in 32-bit code */
353#if defined (CONFIG_X86_64) || defined(CONFIG_IA64)
354typedef struct drm_radeon_setparam32 {
355 int param;
356 u64 value;
357} __attribute__((packed)) drm_radeon_setparam32_t;
358
359static int compat_radeon_cp_setparam(struct file *file, unsigned int cmd,
360 unsigned long arg)
361{
362 drm_radeon_setparam32_t req32;
363 drm_radeon_setparam_t __user *request;
364
365 if (copy_from_user(&req32, (void __user *) arg, sizeof(req32)))
366 return -EFAULT;
367
368 request = compat_alloc_user_space(sizeof(*request));
369 if (!access_ok(VERIFY_WRITE, request, sizeof(*request))
370 || __put_user(req32.param, &request->param)
371 || __put_user((void __user *)(unsigned long)req32.value,
372 &request->value))
373 return -EFAULT;
374
375 return drm_ioctl(file->f_dentry->d_inode, file,
376 DRM_IOCTL_RADEON_SETPARAM, (unsigned long) request);
377}
378#else
379#define compat_radeon_cp_setparam NULL
380#endif /* X86_64 || IA64 */
381
352drm_ioctl_compat_t *radeon_compat_ioctls[] = { 382drm_ioctl_compat_t *radeon_compat_ioctls[] = {
353 [DRM_RADEON_CP_INIT] = compat_radeon_cp_init, 383 [DRM_RADEON_CP_INIT] = compat_radeon_cp_init,
354 [DRM_RADEON_CLEAR] = compat_radeon_cp_clear, 384 [DRM_RADEON_CLEAR] = compat_radeon_cp_clear,
@@ -357,6 +387,7 @@ drm_ioctl_compat_t *radeon_compat_ioctls[] = {
357 [DRM_RADEON_VERTEX2] = compat_radeon_cp_vertex2, 387 [DRM_RADEON_VERTEX2] = compat_radeon_cp_vertex2,
358 [DRM_RADEON_CMDBUF] = compat_radeon_cp_cmdbuf, 388 [DRM_RADEON_CMDBUF] = compat_radeon_cp_cmdbuf,
359 [DRM_RADEON_GETPARAM] = compat_radeon_cp_getparam, 389 [DRM_RADEON_GETPARAM] = compat_radeon_cp_getparam,
390 [DRM_RADEON_SETPARAM] = compat_radeon_cp_setparam,
360 [DRM_RADEON_ALLOC] = compat_radeon_mem_alloc, 391 [DRM_RADEON_ALLOC] = compat_radeon_mem_alloc,
361 [DRM_RADEON_IRQ_EMIT] = compat_radeon_irq_emit, 392 [DRM_RADEON_IRQ_EMIT] = compat_radeon_irq_emit,
362}; 393};
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 0474cac4a84e..7f5271272f91 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -794,7 +794,7 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
794 794
795 buf[0] ^= buf[3]; 795 buf[0] ^= buf[3];
796 buf[1] ^= buf[4]; 796 buf[1] ^= buf[4];
797 buf[0] ^= rol32(buf[3], 16); 797 buf[2] ^= rol32(buf[2], 16);
798 memcpy(out, buf, EXTRACT_SIZE); 798 memcpy(out, buf, EXTRACT_SIZE);
799 memset(buf, 0, sizeof(buf)); 799 memset(buf, 0, sizeof(buf));
800} 800}
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 3752edc30c36..a96f26a63fa2 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1173,8 +1173,14 @@ static unsigned int hung_up_tty_poll(struct file * filp, poll_table * wait)
1173 return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM; 1173 return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM;
1174} 1174}
1175 1175
1176static long hung_up_tty_ioctl(struct file * file, 1176static int hung_up_tty_ioctl(struct inode * inode, struct file * file,
1177 unsigned int cmd, unsigned long arg) 1177 unsigned int cmd, unsigned long arg)
1178{
1179 return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
1180}
1181
1182static long hung_up_tty_compat_ioctl(struct file * file,
1183 unsigned int cmd, unsigned long arg)
1178{ 1184{
1179 return cmd == TIOCSPGRP ? -ENOTTY : -EIO; 1185 return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
1180} 1186}
@@ -1222,8 +1228,8 @@ static const struct file_operations hung_up_tty_fops = {
1222 .read = hung_up_tty_read, 1228 .read = hung_up_tty_read,
1223 .write = hung_up_tty_write, 1229 .write = hung_up_tty_write,
1224 .poll = hung_up_tty_poll, 1230 .poll = hung_up_tty_poll,
1225 .unlocked_ioctl = hung_up_tty_ioctl, 1231 .ioctl = hung_up_tty_ioctl,
1226 .compat_ioctl = hung_up_tty_ioctl, 1232 .compat_ioctl = hung_up_tty_compat_ioctl,
1227 .release = tty_release, 1233 .release = tty_release,
1228}; 1234};
1229 1235