diff options
Diffstat (limited to 'drivers/video/omap2/omapfb/omapfb-main.c')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 101 |
1 files changed, 2 insertions, 99 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index ce158311ff59..b00db4068d21 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -1399,7 +1399,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size, | |||
1399 | 1399 | ||
1400 | if (!paddr) { | 1400 | if (!paddr) { |
1401 | DBG("allocating %lu bytes for fb %d\n", size, ofbi->id); | 1401 | DBG("allocating %lu bytes for fb %d\n", size, ofbi->id); |
1402 | r = omap_vram_alloc(OMAP_VRAM_MEMTYPE_SDRAM, size, &paddr); | 1402 | r = omap_vram_alloc(size, &paddr); |
1403 | } else { | 1403 | } else { |
1404 | DBG("reserving %lu bytes at %lx for fb %d\n", size, paddr, | 1404 | DBG("reserving %lu bytes at %lx for fb %d\n", size, paddr, |
1405 | ofbi->id); | 1405 | ofbi->id); |
@@ -1487,60 +1487,6 @@ static int omapfb_alloc_fbmem_display(struct fb_info *fbi, unsigned long size, | |||
1487 | return omapfb_alloc_fbmem(fbi, size, paddr); | 1487 | return omapfb_alloc_fbmem(fbi, size, paddr); |
1488 | } | 1488 | } |
1489 | 1489 | ||
1490 | static enum omap_color_mode fb_format_to_dss_mode(enum omapfb_color_format fmt) | ||
1491 | { | ||
1492 | enum omap_color_mode mode; | ||
1493 | |||
1494 | switch (fmt) { | ||
1495 | case OMAPFB_COLOR_RGB565: | ||
1496 | mode = OMAP_DSS_COLOR_RGB16; | ||
1497 | break; | ||
1498 | case OMAPFB_COLOR_YUV422: | ||
1499 | mode = OMAP_DSS_COLOR_YUV2; | ||
1500 | break; | ||
1501 | case OMAPFB_COLOR_CLUT_8BPP: | ||
1502 | mode = OMAP_DSS_COLOR_CLUT8; | ||
1503 | break; | ||
1504 | case OMAPFB_COLOR_CLUT_4BPP: | ||
1505 | mode = OMAP_DSS_COLOR_CLUT4; | ||
1506 | break; | ||
1507 | case OMAPFB_COLOR_CLUT_2BPP: | ||
1508 | mode = OMAP_DSS_COLOR_CLUT2; | ||
1509 | break; | ||
1510 | case OMAPFB_COLOR_CLUT_1BPP: | ||
1511 | mode = OMAP_DSS_COLOR_CLUT1; | ||
1512 | break; | ||
1513 | case OMAPFB_COLOR_RGB444: | ||
1514 | mode = OMAP_DSS_COLOR_RGB12U; | ||
1515 | break; | ||
1516 | case OMAPFB_COLOR_YUY422: | ||
1517 | mode = OMAP_DSS_COLOR_UYVY; | ||
1518 | break; | ||
1519 | case OMAPFB_COLOR_ARGB16: | ||
1520 | mode = OMAP_DSS_COLOR_ARGB16; | ||
1521 | break; | ||
1522 | case OMAPFB_COLOR_RGB24U: | ||
1523 | mode = OMAP_DSS_COLOR_RGB24U; | ||
1524 | break; | ||
1525 | case OMAPFB_COLOR_RGB24P: | ||
1526 | mode = OMAP_DSS_COLOR_RGB24P; | ||
1527 | break; | ||
1528 | case OMAPFB_COLOR_ARGB32: | ||
1529 | mode = OMAP_DSS_COLOR_ARGB32; | ||
1530 | break; | ||
1531 | case OMAPFB_COLOR_RGBA32: | ||
1532 | mode = OMAP_DSS_COLOR_RGBA32; | ||
1533 | break; | ||
1534 | case OMAPFB_COLOR_RGBX32: | ||
1535 | mode = OMAP_DSS_COLOR_RGBX32; | ||
1536 | break; | ||
1537 | default: | ||
1538 | mode = -EINVAL; | ||
1539 | } | ||
1540 | |||
1541 | return mode; | ||
1542 | } | ||
1543 | |||
1544 | static int omapfb_parse_vram_param(const char *param, int max_entries, | 1490 | static int omapfb_parse_vram_param(const char *param, int max_entries, |
1545 | unsigned long *sizes, unsigned long *paddrs) | 1491 | unsigned long *sizes, unsigned long *paddrs) |
1546 | { | 1492 | { |
@@ -1614,23 +1560,6 @@ static int omapfb_allocate_all_fbs(struct omapfb2_device *fbdev) | |||
1614 | memset(&vram_paddrs, 0, sizeof(vram_paddrs)); | 1560 | memset(&vram_paddrs, 0, sizeof(vram_paddrs)); |
1615 | } | 1561 | } |
1616 | 1562 | ||
1617 | if (fbdev->dev->platform_data) { | ||
1618 | struct omapfb_platform_data *opd; | ||
1619 | opd = fbdev->dev->platform_data; | ||
1620 | for (i = 0; i < opd->mem_desc.region_cnt; ++i) { | ||
1621 | if (!vram_sizes[i]) { | ||
1622 | unsigned long size; | ||
1623 | unsigned long paddr; | ||
1624 | |||
1625 | size = opd->mem_desc.region[i].size; | ||
1626 | paddr = opd->mem_desc.region[i].paddr; | ||
1627 | |||
1628 | vram_sizes[i] = size; | ||
1629 | vram_paddrs[i] = paddr; | ||
1630 | } | ||
1631 | } | ||
1632 | } | ||
1633 | |||
1634 | for (i = 0; i < fbdev->num_fbs; i++) { | 1563 | for (i = 0; i < fbdev->num_fbs; i++) { |
1635 | /* allocate memory automatically only for fb0, or if | 1564 | /* allocate memory automatically only for fb0, or if |
1636 | * excplicitly defined with vram or plat data option */ | 1565 | * excplicitly defined with vram or plat data option */ |
@@ -1669,7 +1598,7 @@ int omapfb_realloc_fbmem(struct fb_info *fbi, unsigned long size, int type) | |||
1669 | int old_type = rg->type; | 1598 | int old_type = rg->type; |
1670 | int r; | 1599 | int r; |
1671 | 1600 | ||
1672 | if (type > OMAPFB_MEMTYPE_MAX) | 1601 | if (type != OMAPFB_MEMTYPE_SDRAM) |
1673 | return -EINVAL; | 1602 | return -EINVAL; |
1674 | 1603 | ||
1675 | size = PAGE_ALIGN(size); | 1604 | size = PAGE_ALIGN(size); |
@@ -1828,32 +1757,6 @@ static int omapfb_fb_init(struct omapfb2_device *fbdev, struct fb_info *fbi) | |||
1828 | 1757 | ||
1829 | var->rotate = def_rotate; | 1758 | var->rotate = def_rotate; |
1830 | 1759 | ||
1831 | /* | ||
1832 | * Check if there is a default color format set in the board file, | ||
1833 | * and use this format instead the default deducted from the | ||
1834 | * display bpp. | ||
1835 | */ | ||
1836 | if (fbdev->dev->platform_data) { | ||
1837 | struct omapfb_platform_data *opd; | ||
1838 | int id = ofbi->id; | ||
1839 | |||
1840 | opd = fbdev->dev->platform_data; | ||
1841 | if (opd->mem_desc.region[id].format_used) { | ||
1842 | enum omap_color_mode mode; | ||
1843 | enum omapfb_color_format format; | ||
1844 | |||
1845 | format = opd->mem_desc.region[id].format; | ||
1846 | mode = fb_format_to_dss_mode(format); | ||
1847 | if (mode < 0) { | ||
1848 | r = mode; | ||
1849 | goto err; | ||
1850 | } | ||
1851 | r = dss_mode_to_fb_mode(mode, var); | ||
1852 | if (r < 0) | ||
1853 | goto err; | ||
1854 | } | ||
1855 | } | ||
1856 | |||
1857 | if (display) { | 1760 | if (display) { |
1858 | u16 w, h; | 1761 | u16 w, h; |
1859 | int rotation = (var->rotate + ofbi->rotation[0]) % 4; | 1762 | int rotation = (var->rotate + ofbi->rotation[0]) % 4; |