.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * A framebuffer driver for VBE 2.0+ compliant video cards |
---|
3 | 4 | * |
---|
.. | .. |
---|
44 | 45 | }; |
---|
45 | 46 | |
---|
46 | 47 | static int mtrr = 3; /* enable mtrr by default */ |
---|
47 | | -static bool blank = 1; /* enable blanking by default */ |
---|
| 48 | +static bool blank = true; /* enable blanking by default */ |
---|
48 | 49 | static int ypan = 1; /* 0: scroll, 1: ypan, 2: ywrap */ |
---|
49 | 50 | static bool pmi_setpal = true; /* use PMI for palette changes */ |
---|
50 | 51 | static bool nocrtc; /* ignore CRTC settings */ |
---|
.. | .. |
---|
1439 | 1440 | |
---|
1440 | 1441 | /* Disable blanking if the user requested so. */ |
---|
1441 | 1442 | if (!blank) |
---|
1442 | | - info->fbops->fb_blank = NULL; |
---|
| 1443 | + uvesafb_ops.fb_blank = NULL; |
---|
1443 | 1444 | |
---|
1444 | 1445 | /* |
---|
1445 | 1446 | * Find out how much IO memory is required for the mode with |
---|
.. | .. |
---|
1509 | 1510 | (par->ypan ? FBINFO_HWACCEL_YPAN : 0); |
---|
1510 | 1511 | |
---|
1511 | 1512 | if (!par->ypan) |
---|
1512 | | - info->fbops->fb_pan_display = NULL; |
---|
| 1513 | + uvesafb_ops.fb_pan_display = NULL; |
---|
1513 | 1514 | } |
---|
1514 | 1515 | |
---|
1515 | 1516 | static void uvesafb_init_mtrr(struct fb_info *info) |
---|
.. | .. |
---|
1543 | 1544 | static ssize_t uvesafb_show_vbe_ver(struct device *dev, |
---|
1544 | 1545 | struct device_attribute *attr, char *buf) |
---|
1545 | 1546 | { |
---|
1546 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1547 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1547 | 1548 | struct uvesafb_par *par = info->par; |
---|
1548 | 1549 | |
---|
1549 | 1550 | return snprintf(buf, PAGE_SIZE, "%.4x\n", par->vbe_ib.vbe_version); |
---|
.. | .. |
---|
1554 | 1555 | static ssize_t uvesafb_show_vbe_modes(struct device *dev, |
---|
1555 | 1556 | struct device_attribute *attr, char *buf) |
---|
1556 | 1557 | { |
---|
1557 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1558 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1558 | 1559 | struct uvesafb_par *par = info->par; |
---|
1559 | 1560 | int ret = 0, i; |
---|
1560 | 1561 | |
---|
1561 | 1562 | for (i = 0; i < par->vbe_modes_cnt && ret < PAGE_SIZE; i++) { |
---|
1562 | | - ret += snprintf(buf + ret, PAGE_SIZE - ret, |
---|
| 1563 | + ret += scnprintf(buf + ret, PAGE_SIZE - ret, |
---|
1563 | 1564 | "%dx%d-%d, 0x%.4x\n", |
---|
1564 | 1565 | par->vbe_modes[i].x_res, par->vbe_modes[i].y_res, |
---|
1565 | 1566 | par->vbe_modes[i].depth, par->vbe_modes[i].mode_id); |
---|
.. | .. |
---|
1573 | 1574 | static ssize_t uvesafb_show_vendor(struct device *dev, |
---|
1574 | 1575 | struct device_attribute *attr, char *buf) |
---|
1575 | 1576 | { |
---|
1576 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1577 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1577 | 1578 | struct uvesafb_par *par = info->par; |
---|
1578 | 1579 | |
---|
1579 | 1580 | if (par->vbe_ib.oem_vendor_name_ptr) |
---|
.. | .. |
---|
1588 | 1589 | static ssize_t uvesafb_show_product_name(struct device *dev, |
---|
1589 | 1590 | struct device_attribute *attr, char *buf) |
---|
1590 | 1591 | { |
---|
1591 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1592 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1592 | 1593 | struct uvesafb_par *par = info->par; |
---|
1593 | 1594 | |
---|
1594 | 1595 | if (par->vbe_ib.oem_product_name_ptr) |
---|
.. | .. |
---|
1603 | 1604 | static ssize_t uvesafb_show_product_rev(struct device *dev, |
---|
1604 | 1605 | struct device_attribute *attr, char *buf) |
---|
1605 | 1606 | { |
---|
1606 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1607 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1607 | 1608 | struct uvesafb_par *par = info->par; |
---|
1608 | 1609 | |
---|
1609 | 1610 | if (par->vbe_ib.oem_product_rev_ptr) |
---|
.. | .. |
---|
1618 | 1619 | static ssize_t uvesafb_show_oem_string(struct device *dev, |
---|
1619 | 1620 | struct device_attribute *attr, char *buf) |
---|
1620 | 1621 | { |
---|
1621 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1622 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1622 | 1623 | struct uvesafb_par *par = info->par; |
---|
1623 | 1624 | |
---|
1624 | 1625 | if (par->vbe_ib.oem_string_ptr) |
---|
.. | .. |
---|
1633 | 1634 | static ssize_t uvesafb_show_nocrtc(struct device *dev, |
---|
1634 | 1635 | struct device_attribute *attr, char *buf) |
---|
1635 | 1636 | { |
---|
1636 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1637 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1637 | 1638 | struct uvesafb_par *par = info->par; |
---|
1638 | 1639 | |
---|
1639 | 1640 | return snprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc); |
---|
.. | .. |
---|
1642 | 1643 | static ssize_t uvesafb_store_nocrtc(struct device *dev, |
---|
1643 | 1644 | struct device_attribute *attr, const char *buf, size_t count) |
---|
1644 | 1645 | { |
---|
1645 | | - struct fb_info *info = platform_get_drvdata(to_platform_device(dev)); |
---|
| 1646 | + struct fb_info *info = dev_get_drvdata(dev); |
---|
1646 | 1647 | struct uvesafb_par *par = info->par; |
---|
1647 | 1648 | |
---|
1648 | 1649 | if (count > 0) { |
---|
.. | .. |
---|
1755 | 1756 | out_unmap: |
---|
1756 | 1757 | iounmap(info->screen_base); |
---|
1757 | 1758 | out_mem: |
---|
| 1759 | + arch_phys_wc_del(par->mtrr_handle); |
---|
1758 | 1760 | release_mem_region(info->fix.smem_start, info->fix.smem_len); |
---|
1759 | 1761 | out_reg: |
---|
1760 | 1762 | release_region(0x3c0, 32); |
---|
.. | .. |
---|
1823 | 1825 | else if (!strcmp(this_opt, "ywrap")) |
---|
1824 | 1826 | ypan = 2; |
---|
1825 | 1827 | else if (!strcmp(this_opt, "vgapal")) |
---|
1826 | | - pmi_setpal = 0; |
---|
| 1828 | + pmi_setpal = false; |
---|
1827 | 1829 | else if (!strcmp(this_opt, "pmipal")) |
---|
1828 | | - pmi_setpal = 1; |
---|
| 1830 | + pmi_setpal = true; |
---|
1829 | 1831 | else if (!strncmp(this_opt, "mtrr:", 5)) |
---|
1830 | 1832 | mtrr = simple_strtoul(this_opt+5, NULL, 0); |
---|
1831 | 1833 | else if (!strcmp(this_opt, "nomtrr")) |
---|
1832 | 1834 | mtrr = 0; |
---|
1833 | 1835 | else if (!strcmp(this_opt, "nocrtc")) |
---|
1834 | | - nocrtc = 1; |
---|
| 1836 | + nocrtc = true; |
---|
1835 | 1837 | else if (!strcmp(this_opt, "noedid")) |
---|
1836 | | - noedid = 1; |
---|
| 1838 | + noedid = true; |
---|
1837 | 1839 | else if (!strcmp(this_opt, "noblank")) |
---|
1838 | | - blank = 0; |
---|
| 1840 | + blank = false; |
---|
1839 | 1841 | else if (!strncmp(this_opt, "vtotal:", 7)) |
---|
1840 | 1842 | vram_total = simple_strtoul(this_opt + 7, NULL, 0); |
---|
1841 | 1843 | else if (!strncmp(this_opt, "vremap:", 7)) |
---|
.. | .. |
---|
1979 | 1981 | module_param(vram_remap, uint, 0); |
---|
1980 | 1982 | MODULE_PARM_DESC(vram_remap, "Set amount of video memory to be used [MiB]"); |
---|
1981 | 1983 | module_param(vram_total, uint, 0); |
---|
1982 | | -MODULE_PARM_DESC(vram_total, "Set total amount of video memoery [MiB]"); |
---|
| 1984 | +MODULE_PARM_DESC(vram_total, "Set total amount of video memory [MiB]"); |
---|
1983 | 1985 | module_param(maxclk, ushort, 0); |
---|
1984 | 1986 | MODULE_PARM_DESC(maxclk, "Maximum pixelclock [MHz], overrides EDID data"); |
---|
1985 | 1987 | module_param(maxhf, ushort, 0); |
---|