~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/video/uvesafb.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
        struct uvesafb_task *utask;
74
74
        struct uvesafb_ktask *task;
75
75
 
76
 
        if (!cap_raised(nsp->eff_cap, CAP_SYS_ADMIN))
 
76
        if (!cap_raised(current_cap(), CAP_SYS_ADMIN))
77
77
                return;
78
78
 
79
79
        if (msg->seq >= UVESAFB_TASKS_MAX)
1552
1552
                        int rc;
1553
1553
 
1554
1554
                        /* Find the largest power-of-two */
1555
 
                        while (temp_size & (temp_size - 1))
1556
 
                                temp_size &= (temp_size - 1);
 
1555
                        temp_size = roundup_pow_of_two(temp_size);
1557
1556
 
1558
1557
                        /* Try and find a power of two to add */
1559
1558
                        do {
1566
1565
#endif /* CONFIG_MTRR */
1567
1566
}
1568
1567
 
 
1568
static void __devinit uvesafb_ioremap(struct fb_info *info)
 
1569
{
 
1570
#ifdef CONFIG_X86
 
1571
        switch (mtrr) {
 
1572
        case 1: /* uncachable */
 
1573
                info->screen_base = ioremap_nocache(info->fix.smem_start, info->fix.smem_len);
 
1574
                break;
 
1575
        case 2: /* write-back */
 
1576
                info->screen_base = ioremap_cache(info->fix.smem_start, info->fix.smem_len);
 
1577
                break;
 
1578
        case 3: /* write-combining */
 
1579
                info->screen_base = ioremap_wc(info->fix.smem_start, info->fix.smem_len);
 
1580
                break;
 
1581
        case 4: /* write-through */
 
1582
        default:
 
1583
                info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
 
1584
                break;
 
1585
        }
 
1586
#else
 
1587
        info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
 
1588
#endif /* CONFIG_X86 */
 
1589
}
1569
1590
 
1570
1591
static ssize_t uvesafb_show_vbe_ver(struct device *dev,
1571
1592
                struct device_attribute *attr, char *buf)
1736
1757
 
1737
1758
        uvesafb_init_info(info, mode);
1738
1759
 
 
1760
        if (!request_region(0x3c0, 32, "uvesafb")) {
 
1761
                printk(KERN_ERR "uvesafb: request region 0x3c0-0x3e0 failed\n");
 
1762
                err = -EIO;
 
1763
                goto out_mode;
 
1764
        }
 
1765
 
1739
1766
        if (!request_mem_region(info->fix.smem_start, info->fix.smem_len,
1740
1767
                                "uvesafb")) {
1741
1768
                printk(KERN_ERR "uvesafb: cannot reserve video memory at "
1742
1769
                                "0x%lx\n", info->fix.smem_start);
1743
1770
                err = -EIO;
1744
 
                goto out_mode;
 
1771
                goto out_reg;
1745
1772
        }
1746
1773
 
1747
 
        info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
 
1774
        uvesafb_init_mtrr(info);
 
1775
        uvesafb_ioremap(info);
1748
1776
 
1749
1777
        if (!info->screen_base) {
1750
1778
                printk(KERN_ERR
1755
1783
                goto out_mem;
1756
1784
        }
1757
1785
 
1758
 
        if (!request_region(0x3c0, 32, "uvesafb")) {
1759
 
                printk(KERN_ERR "uvesafb: request region 0x3c0-0x3e0 failed\n");
1760
 
                err = -EIO;
1761
 
                goto out_unmap;
1762
 
        }
1763
 
 
1764
 
        uvesafb_init_mtrr(info);
1765
1786
        platform_set_drvdata(dev, info);
1766
1787
 
1767
1788
        if (register_framebuffer(info) < 0) {
1768
1789
                printk(KERN_ERR
1769
1790
                        "uvesafb: failed to register framebuffer device\n");
1770
1791
                err = -EINVAL;
1771
 
                goto out_reg;
 
1792
                goto out_unmap;
1772
1793
        }
1773
1794
 
1774
1795
        printk(KERN_INFO "uvesafb: framebuffer at 0x%lx, mapped to 0x%p, "
1785
1806
 
1786
1807
        return 0;
1787
1808
 
1788
 
out_reg:
1789
 
        release_region(0x3c0, 32);
1790
1809
out_unmap:
1791
1810
        iounmap(info->screen_base);
1792
1811
out_mem:
1793
1812
        release_mem_region(info->fix.smem_start, info->fix.smem_len);
 
1813
out_reg:
 
1814
        release_region(0x3c0, 32);
1794
1815
out_mode:
1795
1816
        if (!list_empty(&info->modelist))
1796
1817
                fb_destroy_modelist(&info->modelist);