Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux

* 'for-linus' of git://gitorious.org/linux-omap-dss2/linux:
OMAP: DSS2: don't power off a panel twice
OMAP: DSS2: OMAPFB: Allow usage of def_vrfb only for omap2,3
OMAP: DSS2: OMAPFB: make VRFB depends on OMAP2,3
OMAP: DSS2: OMAPFB: Allow FB_OMAP2 to build without VRFB
arm/omap: simplify conditional
OMAP: DSS2: DSI: Remove extra iounmap in error path
OMAP: DSS2: Use dss_features framework on DSS2 code
OMAP: DSS2: Introduce dss_features files
video/omap: remove mux.h include
ARM: omap/fb: move get_fbmem_region() to .init.text
ARM: omap/fb: move omapfb_reserve_sram to .init.text
ARM: omap/fb: move omap_init_fb to .init.text
OMAP: DSS2: OMAPFB: swap front and back porches for both hsync and vsync
OMAP: DSS2: make filter coefficient tables human readable
OMAP: DSS2: Add SPI dependency to Kconfig of ACX565AKM panel

+478 -231
+7 -7
arch/arm/plat-omap/fb.c
··· 96 96 * Get the region_idx`th region from board config/ATAG and convert it to 97 97 * our internal format. 98 98 */ 99 - static int get_fbmem_region(int region_idx, struct omapfb_mem_region *rg) 99 + static int __init get_fbmem_region(int region_idx, struct omapfb_mem_region *rg) 100 100 { 101 101 const struct omap_fbmem_config *conf; 102 102 u32 paddr; ··· 128 128 * type = 0 && paddr = 0, a default don't care case maps to 129 129 * the SDRAM type. 130 130 */ 131 - if (rg->type || (!rg->type && !rg->paddr)) 131 + if (rg->type || !rg->paddr) 132 132 return 0; 133 133 if (ranges_overlap(rg->paddr, rg->size, mem_start, mem_size)) { 134 134 rg->type = mem_type; ··· 260 260 * this point, since the driver built as a module would have problem with 261 261 * freeing / reallocating the regions. 262 262 */ 263 - unsigned long omapfb_reserve_sram(unsigned long sram_pstart, 263 + unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart, 264 264 unsigned long sram_vstart, 265 265 unsigned long sram_size, 266 266 unsigned long pstart_avail, ··· 334 334 omapfb_config.ctrl_platform_data = data; 335 335 } 336 336 337 - static inline int omap_init_fb(void) 337 + static int __init omap_init_fb(void) 338 338 { 339 339 const struct omap_lcd_config *conf; 340 340 ··· 379 379 omapfb_config = *data; 380 380 } 381 381 382 - static inline int omap_init_fb(void) 382 + static int __init omap_init_fb(void) 383 383 { 384 384 return platform_device_register(&omap_fb_device); 385 385 } ··· 390 390 { 391 391 } 392 392 393 - unsigned long omapfb_reserve_sram(unsigned long sram_pstart, 393 + unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart, 394 394 unsigned long sram_vstart, 395 395 unsigned long sram_size, 396 396 unsigned long start_avail, ··· 409 409 { 410 410 } 411 411 412 - unsigned long omapfb_reserve_sram(unsigned long sram_pstart, 412 + unsigned long __init omapfb_reserve_sram(unsigned long sram_pstart, 413 413 unsigned long sram_vstart, 414 414 unsigned long sram_size, 415 415 unsigned long start_avail,
-31
arch/arm/plat-omap/include/plat/display.h
··· 81 81 OMAP_DSS_COLOR_ARGB32 = 1 << 11, /* ARGB32 */ 82 82 OMAP_DSS_COLOR_RGBA32 = 1 << 12, /* RGBA32 */ 83 83 OMAP_DSS_COLOR_RGBX32 = 1 << 13, /* RGBx32 */ 84 - 85 - OMAP_DSS_COLOR_GFX_OMAP2 = 86 - OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | 87 - OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | 88 - OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | 89 - OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P, 90 - 91 - OMAP_DSS_COLOR_VID_OMAP2 = 92 - OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | 93 - OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | 94 - OMAP_DSS_COLOR_UYVY, 95 - 96 - OMAP_DSS_COLOR_GFX_OMAP3 = 97 - OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | 98 - OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | 99 - OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | 100 - OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | 101 - OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | 102 - OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, 103 - 104 - OMAP_DSS_COLOR_VID1_OMAP3 = 105 - OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | 106 - OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P | 107 - OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_UYVY, 108 - 109 - OMAP_DSS_COLOR_VID2_OMAP3 = 110 - OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | 111 - OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | 112 - OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | 113 - OMAP_DSS_COLOR_UYVY | OMAP_DSS_COLOR_ARGB32 | 114 - OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, 115 84 }; 116 85 117 86 enum omap_lcd_display_type {
+16
arch/arm/plat-omap/include/plat/vrfb.h
··· 35 35 bool yuv_mode; 36 36 }; 37 37 38 + #ifdef CONFIG_OMAP2_VRFB 38 39 extern int omap_vrfb_request_ctx(struct vrfb *vrfb); 39 40 extern void omap_vrfb_release_ctx(struct vrfb *vrfb); 40 41 extern void omap_vrfb_adjust_size(u16 *width, u16 *height, ··· 48 47 extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot); 49 48 extern void omap_vrfb_restore_context(void); 50 49 50 + #else 51 + static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; } 52 + static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {} 53 + static inline void omap_vrfb_adjust_size(u16 *width, u16 *height, 54 + u8 bytespp) {} 55 + static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp) 56 + { return 0; } 57 + static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp) 58 + { return 0; } 59 + static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, 60 + u16 width, u16 height, unsigned bytespp, bool yuv_mode) {} 61 + static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot) 62 + { return 0; } 63 + static inline void omap_vrfb_restore_context(void) {} 64 + #endif 51 65 #endif /* __VRFB_H */
-2
drivers/video/omap/lcd_omap3beagle.c
··· 25 25 #include <linux/gpio.h> 26 26 #include <linux/i2c/twl.h> 27 27 28 - #include <plat/mux.h> 29 - #include <plat/mux.h> 30 28 #include <asm/mach-types.h> 31 29 32 30 #include "omapfb.h"
+1 -1
drivers/video/omap2/displays/Kconfig
··· 40 40 41 41 config PANEL_ACX565AKM 42 42 tristate "ACX565AKM Panel" 43 - depends on OMAP2_DSS_SDI 43 + depends on OMAP2_DSS_SDI && SPI 44 44 select BACKLIGHT_CLASS_DEVICE 45 45 help 46 46 This is the LCD panel used on Nokia N900
+6
drivers/video/omap2/displays/panel-acx565akm.c
··· 587 587 588 588 dev_dbg(&dssdev->dev, "%s\n", __func__); 589 589 590 + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 591 + return 0; 592 + 590 593 mutex_lock(&md->mutex); 591 594 592 595 r = omapdss_sdi_display_enable(dssdev); ··· 646 643 struct acx565akm_device *md = &acx_dev; 647 644 648 645 dev_dbg(&dssdev->dev, "%s\n", __func__); 646 + 647 + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 648 + return; 649 649 650 650 mutex_lock(&md->mutex); 651 651
+6
drivers/video/omap2/displays/panel-generic.c
··· 39 39 { 40 40 int r; 41 41 42 + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 43 + return 0; 44 + 42 45 r = omapdss_dpi_display_enable(dssdev); 43 46 if (r) 44 47 goto err0; ··· 61 58 62 59 static void generic_panel_power_off(struct omap_dss_device *dssdev) 63 60 { 61 + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 62 + return; 63 + 64 64 if (dssdev->platform_disable) 65 65 dssdev->platform_disable(dssdev); 66 66
+6
drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c
··· 43 43 { 44 44 int r; 45 45 46 + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 47 + return 0; 48 + 46 49 r = omapdss_dpi_display_enable(dssdev); 47 50 if (r) 48 51 goto err0; ··· 68 65 69 66 static void sharp_lq_panel_power_off(struct omap_dss_device *dssdev) 70 67 { 68 + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 69 + return; 70 + 71 71 if (dssdev->platform_disable) 72 72 dssdev->platform_disable(dssdev); 73 73
+6
drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
··· 135 135 { 136 136 int r = 0; 137 137 138 + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 139 + return 0; 140 + 138 141 r = omapdss_dpi_display_enable(dssdev); 139 142 if (r) 140 143 goto err0; ··· 160 157 161 158 static void sharp_ls_power_off(struct omap_dss_device *dssdev) 162 159 { 160 + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 161 + return; 162 + 163 163 if (dssdev->platform_disable) 164 164 dssdev->platform_disable(dssdev); 165 165
+6
drivers/video/omap2/displays/panel-toppoly-tdo35s.c
··· 46 46 { 47 47 int r; 48 48 49 + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 50 + return 0; 51 + 49 52 r = omapdss_dpi_display_enable(dssdev); 50 53 if (r) 51 54 goto err0; ··· 68 65 69 66 static void toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev) 70 67 { 68 + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 69 + return; 70 + 71 71 if (dssdev->platform_disable) 72 72 dssdev->platform_disable(dssdev); 73 73
+6
drivers/video/omap2/displays/panel-tpo-td043mtea1.c
··· 269 269 int nreset_gpio = dssdev->reset_gpio; 270 270 int r; 271 271 272 + if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) 273 + return 0; 274 + 272 275 r = omapdss_dpi_display_enable(dssdev); 273 276 if (r) 274 277 goto err0; ··· 310 307 { 311 308 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 312 309 int nreset_gpio = dssdev->reset_gpio; 310 + 311 + if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) 312 + return; 313 313 314 314 tpo_td043_write(tpo_td043->spi, 3, 315 315 TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM);
+1 -1
drivers/video/omap2/dss/Makefile
··· 1 1 obj-$(CONFIG_OMAP2_DSS) += omapdss.o 2 - omapdss-y := core.o dss.o dispc.o display.o manager.o overlay.o 2 + omapdss-y := core.o dss.o dss_features.o dispc.o display.o manager.o overlay.o 3 3 omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o 4 4 omapdss-$(CONFIG_OMAP2_DSS_RFBI) += rfbi.o 5 5 omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o
+3
drivers/video/omap2/dss/core.c
··· 37 37 #include <plat/clock.h> 38 38 39 39 #include "dss.h" 40 + #include "dss_features.h" 40 41 41 42 static struct { 42 43 struct platform_device *pdev; ··· 502 501 int i; 503 502 504 503 core.pdev = pdev; 504 + 505 + dss_features_init(); 505 506 506 507 dss_init_overlay_managers(pdev); 507 508 dss_init_overlays(pdev);
+128 -148
drivers/video/omap2/dss/dispc.c
··· 39 39 #include <plat/display.h> 40 40 41 41 #include "dss.h" 42 + #include "dss_features.h" 42 43 43 44 /* DISPC */ 44 45 #define DISPC_BASE 0x48050400 ··· 138 137 omap_dispc_isr_t isr; 139 138 void *arg; 140 139 u32 mask; 140 + }; 141 + 142 + struct dispc_h_coef { 143 + s8 hc4; 144 + s8 hc3; 145 + u8 hc2; 146 + s8 hc1; 147 + s8 hc0; 148 + }; 149 + 150 + struct dispc_v_coef { 151 + s8 vc22; 152 + s8 vc2; 153 + u8 vc1; 154 + s8 vc0; 155 + s8 vc00; 141 156 }; 142 157 143 158 #define REG_GET(idx, start, end) \ ··· 581 564 int vscaleup, int five_taps) 582 565 { 583 566 /* Coefficients for horizontal up-sampling */ 584 - static const u32 coef_hup[8] = { 585 - 0x00800000, 586 - 0x0D7CF800, 587 - 0x1E70F5FF, 588 - 0x335FF5FE, 589 - 0xF74949F7, 590 - 0xF55F33FB, 591 - 0xF5701EFE, 592 - 0xF87C0DFF, 593 - }; 594 - 595 - /* Coefficients for horizontal down-sampling */ 596 - static const u32 coef_hdown[8] = { 597 - 0x24382400, 598 - 0x28371FFE, 599 - 0x2C361BFB, 600 - 0x303516F9, 601 - 0x11343311, 602 - 0x1635300C, 603 - 0x1B362C08, 604 - 0x1F372804, 605 - }; 606 - 607 - /* Coefficients for horizontal and vertical up-sampling */ 608 - static const u32 coef_hvup[2][8] = { 609 - { 610 - 0x00800000, 611 - 0x037B02FF, 612 - 0x0C6F05FE, 613 - 0x205907FB, 614 - 0x00404000, 615 - 0x075920FE, 616 - 0x056F0CFF, 617 - 0x027B0300, 618 - }, 619 - { 620 - 0x00800000, 621 - 0x0D7CF8FF, 622 - 0x1E70F5FE, 623 - 0x335FF5FB, 624 - 0xF7404000, 625 - 0xF55F33FE, 626 - 0xF5701EFF, 627 - 0xF87C0D00, 628 - }, 629 - }; 630 - 631 - /* Coefficients for horizontal and vertical down-sampling */ 632 - static const u32 coef_hvdown[2][8] = { 633 - { 634 - 0x24382400, 635 - 0x28391F04, 636 - 0x2D381B08, 637 - 0x3237170C, 638 - 0x123737F7, 639 - 0x173732F9, 640 - 0x1B382DFB, 641 - 0x1F3928FE, 642 - }, 643 - { 644 - 0x24382400, 645 - 0x28371F04, 646 - 0x2C361B08, 647 - 0x3035160C, 648 - 0x113433F7, 649 - 0x163530F9, 650 - 0x1B362CFB, 651 - 0x1F3728FE, 652 - }, 567 + static const struct dispc_h_coef coef_hup[8] = { 568 + { 0, 0, 128, 0, 0 }, 569 + { -1, 13, 124, -8, 0 }, 570 + { -2, 30, 112, -11, -1 }, 571 + { -5, 51, 95, -11, -2 }, 572 + { 0, -9, 73, 73, -9 }, 573 + { -2, -11, 95, 51, -5 }, 574 + { -1, -11, 112, 30, -2 }, 575 + { 0, -8, 124, 13, -1 }, 653 576 }; 654 577 655 578 /* Coefficients for vertical up-sampling */ 656 - static const u32 coef_vup[8] = { 657 - 0x00000000, 658 - 0x0000FF00, 659 - 0x0000FEFF, 660 - 0x0000FBFE, 661 - 0x000000F7, 662 - 0x0000FEFB, 663 - 0x0000FFFE, 664 - 0x000000FF, 579 + static const struct dispc_v_coef coef_vup_3tap[8] = { 580 + { 0, 0, 128, 0, 0 }, 581 + { 0, 3, 123, 2, 0 }, 582 + { 0, 12, 111, 5, 0 }, 583 + { 0, 32, 89, 7, 0 }, 584 + { 0, 0, 64, 64, 0 }, 585 + { 0, 7, 89, 32, 0 }, 586 + { 0, 5, 111, 12, 0 }, 587 + { 0, 2, 123, 3, 0 }, 665 588 }; 666 589 590 + static const struct dispc_v_coef coef_vup_5tap[8] = { 591 + { 0, 0, 128, 0, 0 }, 592 + { -1, 13, 124, -8, 0 }, 593 + { -2, 30, 112, -11, -1 }, 594 + { -5, 51, 95, -11, -2 }, 595 + { 0, -9, 73, 73, -9 }, 596 + { -2, -11, 95, 51, -5 }, 597 + { -1, -11, 112, 30, -2 }, 598 + { 0, -8, 124, 13, -1 }, 599 + }; 600 + 601 + /* Coefficients for horizontal down-sampling */ 602 + static const struct dispc_h_coef coef_hdown[8] = { 603 + { 0, 36, 56, 36, 0 }, 604 + { 4, 40, 55, 31, -2 }, 605 + { 8, 44, 54, 27, -5 }, 606 + { 12, 48, 53, 22, -7 }, 607 + { -9, 17, 52, 51, 17 }, 608 + { -7, 22, 53, 48, 12 }, 609 + { -5, 27, 54, 44, 8 }, 610 + { -2, 31, 55, 40, 4 }, 611 + }; 667 612 668 613 /* Coefficients for vertical down-sampling */ 669 - static const u32 coef_vdown[8] = { 670 - 0x00000000, 671 - 0x000004FE, 672 - 0x000008FB, 673 - 0x00000CF9, 674 - 0x0000F711, 675 - 0x0000F90C, 676 - 0x0000FB08, 677 - 0x0000FE04, 614 + static const struct dispc_v_coef coef_vdown_3tap[8] = { 615 + { 0, 36, 56, 36, 0 }, 616 + { 0, 40, 57, 31, 0 }, 617 + { 0, 45, 56, 27, 0 }, 618 + { 0, 50, 55, 23, 0 }, 619 + { 0, 18, 55, 55, 0 }, 620 + { 0, 23, 55, 50, 0 }, 621 + { 0, 27, 56, 45, 0 }, 622 + { 0, 31, 57, 40, 0 }, 678 623 }; 679 624 680 - const u32 *h_coef; 681 - const u32 *hv_coef; 682 - const u32 *hv_coef_mod; 683 - const u32 *v_coef; 625 + static const struct dispc_v_coef coef_vdown_5tap[8] = { 626 + { 0, 36, 56, 36, 0 }, 627 + { 4, 40, 55, 31, -2 }, 628 + { 8, 44, 54, 27, -5 }, 629 + { 12, 48, 53, 22, -7 }, 630 + { -9, 17, 52, 51, 17 }, 631 + { -7, 22, 53, 48, 12 }, 632 + { -5, 27, 54, 44, 8 }, 633 + { -2, 31, 55, 40, 4 }, 634 + }; 635 + 636 + const struct dispc_h_coef *h_coef; 637 + const struct dispc_v_coef *v_coef; 684 638 int i; 685 639 686 640 if (hscaleup) ··· 659 671 else 660 672 h_coef = coef_hdown; 661 673 662 - if (vscaleup) { 663 - hv_coef = coef_hvup[five_taps]; 664 - v_coef = coef_vup; 665 - 666 - if (hscaleup) 667 - hv_coef_mod = NULL; 668 - else 669 - hv_coef_mod = coef_hvdown[five_taps]; 670 - } else { 671 - hv_coef = coef_hvdown[five_taps]; 672 - v_coef = coef_vdown; 673 - 674 - if (hscaleup) 675 - hv_coef_mod = coef_hvup[five_taps]; 676 - else 677 - hv_coef_mod = NULL; 678 - } 674 + if (vscaleup) 675 + v_coef = five_taps ? coef_vup_5tap : coef_vup_3tap; 676 + else 677 + v_coef = five_taps ? coef_vdown_5tap : coef_vdown_3tap; 679 678 680 679 for (i = 0; i < 8; i++) { 681 680 u32 h, hv; 682 681 683 - h = h_coef[i]; 684 - 685 - hv = hv_coef[i]; 686 - 687 - if (hv_coef_mod) { 688 - hv &= 0xffffff00; 689 - hv |= (hv_coef_mod[i] & 0xff); 690 - } 682 + h = FLD_VAL(h_coef[i].hc0, 7, 0) 683 + | FLD_VAL(h_coef[i].hc1, 15, 8) 684 + | FLD_VAL(h_coef[i].hc2, 23, 16) 685 + | FLD_VAL(h_coef[i].hc3, 31, 24); 686 + hv = FLD_VAL(h_coef[i].hc4, 7, 0) 687 + | FLD_VAL(v_coef[i].vc0, 15, 8) 688 + | FLD_VAL(v_coef[i].vc1, 23, 16) 689 + | FLD_VAL(v_coef[i].vc2, 31, 24); 691 690 692 691 _dispc_write_firh_reg(plane, i, h); 693 692 _dispc_write_firhv_reg(plane, i, hv); 694 693 } 695 694 696 - if (!five_taps) 697 - return; 698 - 699 - for (i = 0; i < 8; i++) { 700 - u32 v; 701 - v = v_coef[i]; 702 - _dispc_write_firv_reg(plane, i, v); 695 + if (five_taps) { 696 + for (i = 0; i < 8; i++) { 697 + u32 v; 698 + v = FLD_VAL(v_coef[i].vc00, 7, 0) 699 + | FLD_VAL(v_coef[i].vc22, 15, 8); 700 + _dispc_write_firv_reg(plane, i, v); 701 + } 703 702 } 704 703 } 705 704 ··· 775 800 776 801 static void _dispc_setup_global_alpha(enum omap_plane plane, u8 global_alpha) 777 802 { 778 - 779 - BUG_ON(plane == OMAP_DSS_VIDEO1); 780 - 781 - if (cpu_is_omap24xx()) 803 + if (!dss_has_feature(FEAT_GLOBAL_ALPHA)) 782 804 return; 805 + 806 + BUG_ON(!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) && 807 + plane == OMAP_DSS_VIDEO1); 783 808 784 809 if (plane == OMAP_DSS_GFX) 785 810 REG_FLD_MOD(DISPC_GLOBAL_ALPHA, global_alpha, 7, 0); ··· 950 975 DISPC_VID_FIFO_SIZE_STATUS(1) }; 951 976 u32 size; 952 977 int plane; 978 + u8 start, end; 953 979 954 980 enable_clocks(1); 955 981 956 - for (plane = 0; plane < ARRAY_SIZE(dispc.fifo_size); ++plane) { 957 - if (cpu_is_omap24xx()) 958 - size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 8, 0); 959 - else if (cpu_is_omap34xx()) 960 - size = FLD_GET(dispc_read_reg(fsz_reg[plane]), 10, 0); 961 - else 962 - BUG(); 982 + dss_feat_get_reg_field(FEAT_REG_FIFOSIZE, &start, &end); 963 983 984 + for (plane = 0; plane < ARRAY_SIZE(dispc.fifo_size); ++plane) { 985 + size = FLD_GET(dispc_read_reg(fsz_reg[plane]), start, end); 964 986 dispc.fifo_size[plane] = size; 965 987 } 966 988 ··· 974 1002 const struct dispc_reg ftrs_reg[] = { DISPC_GFX_FIFO_THRESHOLD, 975 1003 DISPC_VID_FIFO_THRESHOLD(0), 976 1004 DISPC_VID_FIFO_THRESHOLD(1) }; 1005 + u8 hi_start, hi_end, lo_start, lo_end; 1006 + 977 1007 enable_clocks(1); 978 1008 979 1009 DSSDBG("fifo(%d) low/high old %u/%u, new %u/%u\n", ··· 984 1010 REG_GET(ftrs_reg[plane], 27, 16), 985 1011 low, high); 986 1012 987 - if (cpu_is_omap24xx()) 988 - dispc_write_reg(ftrs_reg[plane], 989 - FLD_VAL(high, 24, 16) | FLD_VAL(low, 8, 0)); 990 - else 991 - dispc_write_reg(ftrs_reg[plane], 992 - FLD_VAL(high, 27, 16) | FLD_VAL(low, 11, 0)); 1013 + dss_feat_get_reg_field(FEAT_REG_FIFOHIGHTHRESHOLD, &hi_start, &hi_end); 1014 + dss_feat_get_reg_field(FEAT_REG_FIFOLOWTHRESHOLD, &lo_start, &lo_end); 1015 + 1016 + dispc_write_reg(ftrs_reg[plane], 1017 + FLD_VAL(high, hi_start, hi_end) | 1018 + FLD_VAL(low, lo_start, lo_end)); 993 1019 994 1020 enable_clocks(0); 995 1021 } ··· 1009 1035 u32 val; 1010 1036 const struct dispc_reg fir_reg[] = { DISPC_VID_FIR(0), 1011 1037 DISPC_VID_FIR(1) }; 1038 + u8 hinc_start, hinc_end, vinc_start, vinc_end; 1012 1039 1013 1040 BUG_ON(plane == OMAP_DSS_GFX); 1014 1041 1015 - if (cpu_is_omap24xx()) 1016 - val = FLD_VAL(vinc, 27, 16) | FLD_VAL(hinc, 11, 0); 1017 - else 1018 - val = FLD_VAL(vinc, 28, 16) | FLD_VAL(hinc, 12, 0); 1042 + dss_feat_get_reg_field(FEAT_REG_FIRHINC, &hinc_start, &hinc_end); 1043 + dss_feat_get_reg_field(FEAT_REG_FIRVINC, &vinc_start, &vinc_end); 1044 + 1045 + val = FLD_VAL(vinc, vinc_start, vinc_end) | 1046 + FLD_VAL(hinc, hinc_start, hinc_end); 1047 + 1019 1048 dispc_write_reg(fir_reg[plane-1], val); 1020 1049 } 1021 1050 ··· 1544 1567 case OMAP_DSS_COLOR_ARGB16: 1545 1568 case OMAP_DSS_COLOR_ARGB32: 1546 1569 case OMAP_DSS_COLOR_RGBA32: 1570 + if (!dss_has_feature(FEAT_GLOBAL_ALPHA)) 1571 + return -EINVAL; 1547 1572 case OMAP_DSS_COLOR_RGBX32: 1548 1573 if (cpu_is_omap24xx()) 1549 1574 return -EINVAL; ··· 1586 1607 case OMAP_DSS_COLOR_ARGB16: 1587 1608 case OMAP_DSS_COLOR_ARGB32: 1588 1609 case OMAP_DSS_COLOR_RGBA32: 1589 - if (cpu_is_omap24xx()) 1610 + if (!dss_has_feature(FEAT_GLOBAL_ALPHA)) 1590 1611 return -EINVAL; 1591 - if (plane == OMAP_DSS_VIDEO1) 1612 + if (!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) && 1613 + plane == OMAP_DSS_VIDEO1) 1592 1614 return -EINVAL; 1593 1615 break; 1594 1616 ··· 1982 2002 } 1983 2003 void dispc_enable_alpha_blending(enum omap_channel ch, bool enable) 1984 2004 { 1985 - if (cpu_is_omap24xx()) 2005 + if (!dss_has_feature(FEAT_GLOBAL_ALPHA)) 1986 2006 return; 1987 2007 1988 2008 enable_clocks(1); ··· 1996 2016 { 1997 2017 bool enabled; 1998 2018 1999 - if (cpu_is_omap24xx()) 2019 + if (!dss_has_feature(FEAT_GLOBAL_ALPHA)) 2000 2020 return false; 2001 2021 2002 2022 enable_clocks(1);
-1
drivers/video/omap2/dss/dsi.c
··· 3274 3274 3275 3275 dsi.vdds_dsi_reg = dss_get_vdds_dsi(); 3276 3276 if (IS_ERR(dsi.vdds_dsi_reg)) { 3277 - iounmap(dsi.base); 3278 3277 DSSERR("can't get VDDS_DSI regulator\n"); 3279 3278 r = PTR_ERR(dsi.vdds_dsi_reg); 3280 3279 goto err2;
+191
drivers/video/omap2/dss/dss_features.c
··· 1 + /* 2 + * linux/drivers/video/omap2/dss/dss_features.c 3 + * 4 + * Copyright (C) 2010 Texas Instruments 5 + * Author: Archit Taneja <archit@ti.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify it 8 + * under the terms of the GNU General Public License version 2 as published by 9 + * the Free Software Foundation. 10 + * 11 + * This program is distributed in the hope that it will be useful, but WITHOUT 12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 + * more details. 15 + * 16 + * You should have received a copy of the GNU General Public License along with 17 + * this program. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #include <linux/kernel.h> 21 + #include <linux/types.h> 22 + #include <linux/err.h> 23 + #include <linux/slab.h> 24 + 25 + #include <plat/display.h> 26 + #include <plat/cpu.h> 27 + 28 + #include "dss_features.h" 29 + 30 + /* Defines a generic omap register field */ 31 + struct dss_reg_field { 32 + enum dss_feat_reg_field id; 33 + u8 start, end; 34 + }; 35 + 36 + struct omap_dss_features { 37 + const struct dss_reg_field *reg_fields; 38 + const int num_reg_fields; 39 + 40 + const u32 has_feature; 41 + 42 + const int num_mgrs; 43 + const int num_ovls; 44 + const enum omap_display_type *supported_displays; 45 + const enum omap_color_mode *supported_color_modes; 46 + }; 47 + 48 + /* This struct is assigned to one of the below during initialization */ 49 + static struct omap_dss_features *omap_current_dss_features; 50 + 51 + static const struct dss_reg_field omap2_dss_reg_fields[] = { 52 + { FEAT_REG_FIRHINC, 11, 0 }, 53 + { FEAT_REG_FIRVINC, 27, 16 }, 54 + { FEAT_REG_FIFOLOWTHRESHOLD, 8, 0 }, 55 + { FEAT_REG_FIFOHIGHTHRESHOLD, 24, 16 }, 56 + { FEAT_REG_FIFOSIZE, 8, 0 }, 57 + }; 58 + 59 + static const struct dss_reg_field omap3_dss_reg_fields[] = { 60 + { FEAT_REG_FIRHINC, 12, 0 }, 61 + { FEAT_REG_FIRVINC, 28, 16 }, 62 + { FEAT_REG_FIFOLOWTHRESHOLD, 11, 0 }, 63 + { FEAT_REG_FIFOHIGHTHRESHOLD, 27, 16 }, 64 + { FEAT_REG_FIFOSIZE, 10, 0 }, 65 + }; 66 + 67 + static const enum omap_display_type omap2_dss_supported_displays[] = { 68 + /* OMAP_DSS_CHANNEL_LCD */ 69 + OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | 70 + OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI, 71 + 72 + /* OMAP_DSS_CHANNEL_DIGIT */ 73 + OMAP_DISPLAY_TYPE_VENC, 74 + }; 75 + 76 + static const enum omap_display_type omap3_dss_supported_displays[] = { 77 + /* OMAP_DSS_CHANNEL_LCD */ 78 + OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | 79 + OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI, 80 + 81 + /* OMAP_DSS_CHANNEL_DIGIT */ 82 + OMAP_DISPLAY_TYPE_VENC, 83 + }; 84 + 85 + static const enum omap_color_mode omap2_dss_supported_color_modes[] = { 86 + /* OMAP_DSS_GFX */ 87 + OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | 88 + OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | 89 + OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | 90 + OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P, 91 + 92 + /* OMAP_DSS_VIDEO1 */ 93 + OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | 94 + OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | 95 + OMAP_DSS_COLOR_UYVY, 96 + 97 + /* OMAP_DSS_VIDEO2 */ 98 + OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | 99 + OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | 100 + OMAP_DSS_COLOR_UYVY, 101 + }; 102 + 103 + static const enum omap_color_mode omap3_dss_supported_color_modes[] = { 104 + /* OMAP_DSS_GFX */ 105 + OMAP_DSS_COLOR_CLUT1 | OMAP_DSS_COLOR_CLUT2 | 106 + OMAP_DSS_COLOR_CLUT4 | OMAP_DSS_COLOR_CLUT8 | 107 + OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | 108 + OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | 109 + OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_ARGB32 | 110 + OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, 111 + 112 + /* OMAP_DSS_VIDEO1 */ 113 + OMAP_DSS_COLOR_RGB24U | OMAP_DSS_COLOR_RGB24P | 114 + OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_RGB16 | 115 + OMAP_DSS_COLOR_YUV2 | OMAP_DSS_COLOR_UYVY, 116 + 117 + /* OMAP_DSS_VIDEO2 */ 118 + OMAP_DSS_COLOR_RGB12U | OMAP_DSS_COLOR_ARGB16 | 119 + OMAP_DSS_COLOR_RGB16 | OMAP_DSS_COLOR_RGB24U | 120 + OMAP_DSS_COLOR_RGB24P | OMAP_DSS_COLOR_YUV2 | 121 + OMAP_DSS_COLOR_UYVY | OMAP_DSS_COLOR_ARGB32 | 122 + OMAP_DSS_COLOR_RGBA32 | OMAP_DSS_COLOR_RGBX32, 123 + }; 124 + 125 + /* OMAP2 DSS Features */ 126 + static struct omap_dss_features omap2_dss_features = { 127 + .reg_fields = omap2_dss_reg_fields, 128 + .num_reg_fields = ARRAY_SIZE(omap2_dss_reg_fields), 129 + 130 + .num_mgrs = 2, 131 + .num_ovls = 3, 132 + .supported_displays = omap2_dss_supported_displays, 133 + .supported_color_modes = omap2_dss_supported_color_modes, 134 + }; 135 + 136 + /* OMAP3 DSS Features */ 137 + static struct omap_dss_features omap3_dss_features = { 138 + .reg_fields = omap3_dss_reg_fields, 139 + .num_reg_fields = ARRAY_SIZE(omap3_dss_reg_fields), 140 + 141 + .has_feature = FEAT_GLOBAL_ALPHA, 142 + 143 + .num_mgrs = 2, 144 + .num_ovls = 3, 145 + .supported_displays = omap3_dss_supported_displays, 146 + .supported_color_modes = omap3_dss_supported_color_modes, 147 + }; 148 + 149 + /* Functions returning values related to a DSS feature */ 150 + int dss_feat_get_num_mgrs(void) 151 + { 152 + return omap_current_dss_features->num_mgrs; 153 + } 154 + 155 + int dss_feat_get_num_ovls(void) 156 + { 157 + return omap_current_dss_features->num_ovls; 158 + } 159 + 160 + enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel) 161 + { 162 + return omap_current_dss_features->supported_displays[channel]; 163 + } 164 + 165 + enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane) 166 + { 167 + return omap_current_dss_features->supported_color_modes[plane]; 168 + } 169 + 170 + /* DSS has_feature check */ 171 + bool dss_has_feature(enum dss_feat_id id) 172 + { 173 + return omap_current_dss_features->has_feature & id; 174 + } 175 + 176 + void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end) 177 + { 178 + if (id >= omap_current_dss_features->num_reg_fields) 179 + BUG(); 180 + 181 + *start = omap_current_dss_features->reg_fields[id].start; 182 + *end = omap_current_dss_features->reg_fields[id].end; 183 + } 184 + 185 + void dss_features_init(void) 186 + { 187 + if (cpu_is_omap24xx()) 188 + omap_current_dss_features = &omap2_dss_features; 189 + else 190 + omap_current_dss_features = &omap3_dss_features; 191 + }
+50
drivers/video/omap2/dss/dss_features.h
··· 1 + /* 2 + * linux/drivers/video/omap2/dss/dss_features.h 3 + * 4 + * Copyright (C) 2010 Texas Instruments 5 + * Author: Archit Taneja <archit@ti.com> 6 + * 7 + * This program is free software; you can redistribute it and/or modify it 8 + * under the terms of the GNU General Public License version 2 as published by 9 + * the Free Software Foundation. 10 + * 11 + * This program is distributed in the hope that it will be useful, but WITHOUT 12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 + * more details. 15 + * 16 + * You should have received a copy of the GNU General Public License along with 17 + * this program. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #ifndef __OMAP2_DSS_FEATURES_H 21 + #define __OMAP2_DSS_FEATURES_H 22 + 23 + #define MAX_DSS_MANAGERS 2 24 + #define MAX_DSS_OVERLAYS 3 25 + 26 + /* DSS has feature id */ 27 + enum dss_feat_id { 28 + FEAT_GLOBAL_ALPHA = 1 << 0, 29 + FEAT_GLOBAL_ALPHA_VID1 = 1 << 1, 30 + }; 31 + 32 + /* DSS register field id */ 33 + enum dss_feat_reg_field { 34 + FEAT_REG_FIRHINC, 35 + FEAT_REG_FIRVINC, 36 + FEAT_REG_FIFOHIGHTHRESHOLD, 37 + FEAT_REG_FIFOLOWTHRESHOLD, 38 + FEAT_REG_FIFOSIZE, 39 + }; 40 + 41 + /* DSS Feature Functions */ 42 + int dss_feat_get_num_mgrs(void); 43 + int dss_feat_get_num_ovls(void); 44 + enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); 45 + enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane); 46 + 47 + bool dss_has_feature(enum dss_feat_id id); 48 + void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); 49 + void dss_features_init(void); 50 + #endif
+16 -17
drivers/video/omap2/dss/manager.c
··· 33 33 #include <plat/cpu.h> 34 34 35 35 #include "dss.h" 36 + #include "dss_features.h" 36 37 37 38 static int num_managers; 38 39 static struct list_head manager_list; ··· 449 448 450 449 static struct { 451 450 spinlock_t lock; 452 - struct overlay_cache_data overlay_cache[3]; 453 - struct manager_cache_data manager_cache[2]; 451 + struct overlay_cache_data overlay_cache[MAX_DSS_OVERLAYS]; 452 + struct manager_cache_data manager_cache[MAX_DSS_MANAGERS]; 454 453 455 454 bool irq_enabled; 456 455 } dss_cache; ··· 883 882 { 884 883 struct overlay_cache_data *oc; 885 884 struct manager_cache_data *mc; 886 - const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache); 887 - const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache); 885 + const int num_ovls = dss_feat_get_num_ovls(); 886 + const int num_mgrs = dss_feat_get_num_mgrs(); 888 887 int i; 889 888 int r; 890 - bool mgr_busy[2]; 891 - bool mgr_go[2]; 889 + bool mgr_busy[MAX_DSS_MANAGERS]; 890 + bool mgr_go[MAX_DSS_MANAGERS]; 892 891 bool busy; 893 892 894 893 r = 0; ··· 990 989 { 991 990 struct overlay_cache_data *oc; 992 991 struct manager_cache_data *mc; 993 - const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache); 992 + const int num_ovls = dss_feat_get_num_ovls(); 994 993 struct omap_overlay_manager *mgr; 995 994 int i; 996 995 u16 x, y, w, h; ··· 1122 1121 { 1123 1122 struct manager_cache_data *mc; 1124 1123 struct overlay_cache_data *oc; 1125 - const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache); 1126 - const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache); 1124 + const int num_ovls = dss_feat_get_num_ovls(); 1125 + const int num_mgrs = dss_feat_get_num_mgrs(); 1127 1126 struct omap_overlay_manager *mgr; 1128 1127 int i; 1129 1128 ··· 1152 1151 { 1153 1152 struct manager_cache_data *mc; 1154 1153 struct overlay_cache_data *oc; 1155 - const int num_ovls = ARRAY_SIZE(dss_cache.overlay_cache); 1156 - const int num_mgrs = ARRAY_SIZE(dss_cache.manager_cache); 1154 + const int num_ovls = dss_feat_get_num_ovls(); 1155 + const int num_mgrs = dss_feat_get_num_mgrs(); 1157 1156 int i, r; 1158 - bool mgr_busy[2]; 1157 + bool mgr_busy[MAX_DSS_MANAGERS]; 1159 1158 1160 1159 mgr_busy[0] = dispc_go_busy(0); 1161 1160 mgr_busy[1] = dispc_go_busy(1); ··· 1462 1461 1463 1462 num_managers = 0; 1464 1463 1465 - for (i = 0; i < 2; ++i) { 1464 + for (i = 0; i < dss_feat_get_num_mgrs(); ++i) { 1466 1465 struct omap_overlay_manager *mgr; 1467 1466 mgr = kzalloc(sizeof(*mgr), GFP_KERNEL); 1468 1467 ··· 1472 1471 case 0: 1473 1472 mgr->name = "lcd"; 1474 1473 mgr->id = OMAP_DSS_CHANNEL_LCD; 1475 - mgr->supported_displays = 1476 - OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI | 1477 - OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI; 1478 1474 break; 1479 1475 case 1: 1480 1476 mgr->name = "tv"; 1481 1477 mgr->id = OMAP_DSS_CHANNEL_DIGIT; 1482 - mgr->supported_displays = OMAP_DISPLAY_TYPE_VENC; 1483 1478 break; 1484 1479 } 1485 1480 ··· 1491 1494 mgr->disable = &dss_mgr_disable; 1492 1495 1493 1496 mgr->caps = OMAP_DSS_OVL_MGR_CAP_DISPC; 1497 + mgr->supported_displays = 1498 + dss_feat_get_supported_displays(mgr->id); 1494 1499 1495 1500 dss_overlay_setup_dispc_manager(mgr); 1496 1501
+10 -14
drivers/video/omap2/dss/overlay.c
··· 35 35 #include <plat/cpu.h> 36 36 37 37 #include "dss.h" 38 + #include "dss_features.h" 38 39 39 40 static int num_overlays; 40 41 static struct list_head overlay_list; ··· 238 237 /* Video1 plane does not support global alpha 239 238 * to always make it 255 completely opaque 240 239 */ 241 - if (ovl->id == OMAP_DSS_VIDEO1) 240 + if (!dss_has_feature(FEAT_GLOBAL_ALPHA_VID1) && 241 + ovl->id == OMAP_DSS_VIDEO1) 242 242 info.global_alpha = 255; 243 243 else 244 244 info.global_alpha = simple_strtoul(buf, NULL, 10); ··· 512 510 list_add_tail(&overlay->list, &overlay_list); 513 511 } 514 512 515 - static struct omap_overlay *dispc_overlays[3]; 513 + static struct omap_overlay *dispc_overlays[MAX_DSS_OVERLAYS]; 516 514 517 515 void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr) 518 516 { 519 - mgr->num_overlays = 3; 517 + mgr->num_overlays = dss_feat_get_num_ovls(); 520 518 mgr->overlays = dispc_overlays; 521 519 } 522 520 ··· 537 535 538 536 num_overlays = 0; 539 537 540 - for (i = 0; i < 3; ++i) { 538 + for (i = 0; i < dss_feat_get_num_ovls(); ++i) { 541 539 struct omap_overlay *ovl; 542 540 ovl = kzalloc(sizeof(*ovl), GFP_KERNEL); 543 541 ··· 547 545 case 0: 548 546 ovl->name = "gfx"; 549 547 ovl->id = OMAP_DSS_GFX; 550 - ovl->supported_modes = cpu_is_omap34xx() ? 551 - OMAP_DSS_COLOR_GFX_OMAP3 : 552 - OMAP_DSS_COLOR_GFX_OMAP2; 553 548 ovl->caps = OMAP_DSS_OVL_CAP_DISPC; 554 549 ovl->info.global_alpha = 255; 555 550 break; 556 551 case 1: 557 552 ovl->name = "vid1"; 558 553 ovl->id = OMAP_DSS_VIDEO1; 559 - ovl->supported_modes = cpu_is_omap34xx() ? 560 - OMAP_DSS_COLOR_VID1_OMAP3 : 561 - OMAP_DSS_COLOR_VID_OMAP2; 562 554 ovl->caps = OMAP_DSS_OVL_CAP_SCALE | 563 555 OMAP_DSS_OVL_CAP_DISPC; 564 556 ovl->info.global_alpha = 255; ··· 560 564 case 2: 561 565 ovl->name = "vid2"; 562 566 ovl->id = OMAP_DSS_VIDEO2; 563 - ovl->supported_modes = cpu_is_omap34xx() ? 564 - OMAP_DSS_COLOR_VID2_OMAP3 : 565 - OMAP_DSS_COLOR_VID_OMAP2; 566 567 ovl->caps = OMAP_DSS_OVL_CAP_SCALE | 567 568 OMAP_DSS_OVL_CAP_DISPC; 568 569 ovl->info.global_alpha = 255; ··· 571 578 ovl->set_overlay_info = &dss_ovl_set_overlay_info; 572 579 ovl->get_overlay_info = &dss_ovl_get_overlay_info; 573 580 ovl->wait_for_go = &dss_ovl_wait_for_go; 581 + 582 + ovl->supported_modes = 583 + dss_feat_get_supported_color_modes(ovl->id); 574 584 575 585 omap_dss_add_overlay(ovl); 576 586 ··· 647 651 } 648 652 649 653 if (mgr) { 650 - for (i = 0; i < 3; i++) { 654 + for (i = 0; i < dss_feat_get_num_ovls(); i++) { 651 655 struct omap_overlay *ovl; 652 656 ovl = omap_dss_get_overlay(i); 653 657 if (!ovl->manager || force) {
+1 -1
drivers/video/omap2/omapfb/Kconfig
··· 3 3 depends on FB && OMAP2_DSS 4 4 5 5 select OMAP2_VRAM 6 - select OMAP2_VRFB 6 + select OMAP2_VRFB if ARCH_OMAP2 || ARCH_OMAP3 7 7 select FB_CFB_FILLRECT 8 8 select FB_CFB_COPYAREA 9 9 select FB_CFB_IMAGEBLIT
+18 -8
drivers/video/omap2/omapfb/omapfb-main.c
··· 714 714 var->pixclock = timings.pixel_clock != 0 ? 715 715 KHZ2PICOS(timings.pixel_clock) : 716 716 0; 717 - var->left_margin = timings.hfp; 718 - var->right_margin = timings.hbp; 719 - var->upper_margin = timings.vfp; 720 - var->lower_margin = timings.vbp; 717 + var->left_margin = timings.hbp; 718 + var->right_margin = timings.hfp; 719 + var->upper_margin = timings.vbp; 720 + var->lower_margin = timings.vfp; 721 721 var->hsync_len = timings.hsw; 722 722 var->vsync_len = timings.vsw; 723 723 } else { ··· 2059 2059 2060 2060 if (r != 0) { 2061 2061 timings->pixel_clock = PICOS2KHZ(var.pixclock); 2062 - timings->hfp = var.left_margin; 2063 - timings->hbp = var.right_margin; 2064 - timings->vfp = var.upper_margin; 2065 - timings->vbp = var.lower_margin; 2062 + timings->hbp = var.left_margin; 2063 + timings->hfp = var.right_margin; 2064 + timings->vbp = var.upper_margin; 2065 + timings->vfp = var.lower_margin; 2066 2066 timings->hsw = var.hsync_len; 2067 2067 timings->vsw = var.vsync_len; 2068 2068 timings->x_res = var.xres; ··· 2197 2197 r = -ENOMEM; 2198 2198 goto err0; 2199 2199 } 2200 + 2201 + /* TODO : Replace cpu check with omap_has_vrfb once HAS_FEATURE 2202 + * available for OMAP2 and OMAP3 2203 + */ 2204 + if (def_vrfb && !cpu_is_omap24xx() && !cpu_is_omap34xx()) { 2205 + def_vrfb = 0; 2206 + dev_warn(&pdev->dev, "VRFB is not supported on this hardware, " 2207 + "ignoring the module parameter vrfb=y\n"); 2208 + } 2209 + 2200 2210 2201 2211 mutex_init(&fbdev->mtx); 2202 2212