diff --git a/Documentation/devicetree/bindings/display/simple-framebuffer.txt b/Documentation/devicetree/bindings/display/simple-framebuffer.txt index 4474ef6e0b95..8c9e9f515c87 100644 --- a/Documentation/devicetree/bindings/display/simple-framebuffer.txt +++ b/Documentation/devicetree/bindings/display/simple-framebuffer.txt @@ -47,10 +47,14 @@ Required properties: - a8b8g8r8 (32-bit pixels, d[31:24]=a, d[23:16]=b, d[15:8]=g, d[7:0]=r). Optional properties: -- clocks : List of clocks used by the framebuffer. Clocks listed here - are expected to already be configured correctly. The OS must - ensure these clocks are not modified or disabled while the - simple framebuffer remains active. +- clocks : List of clocks used by the framebuffer. +- *-supply : Any number of regulators used by the framebuffer. These should + be named according to the names in the device's design. + + The above resources are expected to already be configured correctly. + The OS must ensure they are not modified or disabled while the simple + framebuffer remains active. + - display : phandle pointing to the primary display hardware node Example: @@ -68,6 +72,7 @@ chosen { stride = <(1600 * 2)>; format = "r5g6b5"; clocks = <&ahb_gates 36>, <&ahb_gates 43>, <&ahb_gates 44>; + lcd-supply = <®_dc1sw>; display = <&lcdc0>; }; stdout-path = "display0"; diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index f858aa25fbb2..8727d841bfd2 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -62,7 +62,7 @@ obj-$(CONFIG_DRM_ARMADA) += armada/ obj-$(CONFIG_DRM_ATMEL_HLCDC) += atmel-hlcdc/ obj-$(CONFIG_DRM_RCAR_DU) += rcar-du/ obj-$(CONFIG_DRM_SHMOBILE) +=shmobile/ -obj-$(CONFIG_DRM_OMAP) += omapdrm/ +obj-y += omapdrm/ obj-y += tilcdc/ obj-$(CONFIG_DRM_QXL) += qxl/ obj-$(CONFIG_DRM_BOCHS) += bochs/ diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig index 6c220cd3497a..336ad4de9981 100644 --- a/drivers/gpu/drm/omapdrm/Kconfig +++ b/drivers/gpu/drm/omapdrm/Kconfig @@ -1,9 +1,8 @@ - config DRM_OMAP tristate "OMAP DRM" depends on DRM depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM - depends on OMAP2_DSS + select OMAP2_DSS select DRM_KMS_HELPER select DRM_KMS_FB_HELPER select FB_SYS_FILLRECT @@ -14,13 +13,18 @@ config DRM_OMAP help DRM display driver for OMAP2/3/4 based boards. +if DRM_OMAP + config DRM_OMAP_NUM_CRTCS int "Number of CRTCs" range 1 10 default 1 if ARCH_OMAP2 || ARCH_OMAP3 default 2 if ARCH_OMAP4 - depends on DRM_OMAP help Select the number of video overlays which can be used as framebuffers. The remaining overlays are reserved for video. +source "drivers/gpu/drm/omapdrm/dss/Kconfig" +source "drivers/gpu/drm/omapdrm/displays/Kconfig" + +endif diff --git a/drivers/gpu/drm/omapdrm/Makefile b/drivers/gpu/drm/omapdrm/Makefile index 368c1ec6805a..fe4c2228bc18 100644 --- a/drivers/gpu/drm/omapdrm/Makefile +++ b/drivers/gpu/drm/omapdrm/Makefile @@ -3,6 +3,9 @@ # Direct Rendering Infrastructure (DRI) # +obj-y += dss/ +obj-y += displays/ + ccflags-y := -Iinclude/drm -Werror omapdrm-y := omap_drv.o \ omap_irq.o \ diff --git a/drivers/video/fbdev/omap2/displays-new/Kconfig b/drivers/gpu/drm/omapdrm/displays/Kconfig similarity index 96% rename from drivers/video/fbdev/omap2/displays-new/Kconfig rename to drivers/gpu/drm/omapdrm/displays/Kconfig index 574710141a61..2a618afe0f53 100644 --- a/drivers/video/fbdev/omap2/displays-new/Kconfig +++ b/drivers/gpu/drm/omapdrm/displays/Kconfig @@ -1,5 +1,4 @@ -menu "OMAP Display Device Drivers (new device model)" - depends on OMAP2_DSS +menu "OMAPDRM External Display Device Drivers" config DISPLAY_ENCODER_OPA362 tristate "OPA362 external analog amplifier" diff --git a/drivers/video/fbdev/omap2/displays-new/Makefile b/drivers/gpu/drm/omapdrm/displays/Makefile similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/Makefile rename to drivers/gpu/drm/omapdrm/displays/Makefile diff --git a/drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c b/drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/connector-analog-tv.c rename to drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c diff --git a/drivers/video/fbdev/omap2/displays-new/connector-dvi.c b/drivers/gpu/drm/omapdrm/displays/connector-dvi.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/connector-dvi.c rename to drivers/gpu/drm/omapdrm/displays/connector-dvi.c diff --git a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/connector-hdmi.c rename to drivers/gpu/drm/omapdrm/displays/connector-hdmi.c diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-opa362.c b/drivers/gpu/drm/omapdrm/displays/encoder-opa362.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/encoder-opa362.c rename to drivers/gpu/drm/omapdrm/displays/encoder-opa362.c diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c b/drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/encoder-tfp410.c rename to drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c rename to drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c similarity index 98% rename from drivers/video/fbdev/omap2/displays-new/panel-dpi.c rename to drivers/gpu/drm/omapdrm/displays/panel-dpi.c index f7be3489f744..e780fd4f8b46 100644 --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c +++ b/drivers/gpu/drm/omapdrm/displays/panel-dpi.c @@ -83,8 +83,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev) if (r) return r; - if (ddata->enable_gpio) - gpiod_set_value_cansleep(ddata->enable_gpio, 1); + gpiod_set_value_cansleep(ddata->enable_gpio, 1); if (gpio_is_valid(ddata->backlight_gpio)) gpio_set_value_cansleep(ddata->backlight_gpio, 1); @@ -102,12 +101,11 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev) if (!omapdss_device_is_enabled(dssdev)) return; - if (ddata->enable_gpio) - gpiod_set_value_cansleep(ddata->enable_gpio, 0); - if (gpio_is_valid(ddata->backlight_gpio)) gpio_set_value_cansleep(ddata->backlight_gpio, 0); + gpiod_set_value_cansleep(ddata->enable_gpio, 0); + in->ops.dpi->disable(in); dssdev->state = OMAP_DSS_DISPLAY_DISABLED; diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dsi-cm.c b/drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/panel-dsi-cm.c rename to drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c diff --git a/drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c b/drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/panel-lgphilips-lb035q02.c rename to drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c diff --git a/drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c b/drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/panel-nec-nl8048hl11.c rename to drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c diff --git a/drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c b/drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/panel-sharp-ls037v7dw01.c rename to drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c diff --git a/drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/panel-sony-acx565akm.c rename to drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/panel-tpo-td028ttec1.c rename to drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c diff --git a/drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c b/drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c similarity index 100% rename from drivers/video/fbdev/omap2/displays-new/panel-tpo-td043mtea1.c rename to drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/gpu/drm/omapdrm/dss/Kconfig similarity index 100% rename from drivers/video/fbdev/omap2/dss/Kconfig rename to drivers/gpu/drm/omapdrm/dss/Kconfig diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/gpu/drm/omapdrm/dss/Makefile similarity index 100% rename from drivers/video/fbdev/omap2/dss/Makefile rename to drivers/gpu/drm/omapdrm/dss/Makefile diff --git a/drivers/video/fbdev/omap2/dss/apply.c b/drivers/gpu/drm/omapdrm/dss/apply.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/apply.c rename to drivers/gpu/drm/omapdrm/dss/apply.c diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/core.c rename to drivers/gpu/drm/omapdrm/dss/core.c diff --git a/drivers/video/fbdev/omap2/dss/dispc-compat.c b/drivers/gpu/drm/omapdrm/dss/dispc-compat.c similarity index 98% rename from drivers/video/fbdev/omap2/dss/dispc-compat.c rename to drivers/gpu/drm/omapdrm/dss/dispc-compat.c index 633c461fbc6e..0918b3bfe82a 100644 --- a/drivers/video/fbdev/omap2/dss/dispc-compat.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc-compat.c @@ -476,7 +476,7 @@ static void dispc_mgr_disable_lcd_out(enum omap_channel channel) int r; u32 irq; - if (dispc_mgr_is_enabled(channel) == false) + if (!dispc_mgr_is_enabled(channel)) return; /* @@ -524,7 +524,7 @@ static void dispc_mgr_enable_digit_out(void) int r; u32 irq_mask; - if (dispc_mgr_is_enabled(OMAP_DSS_CHANNEL_DIGIT) == true) + if (dispc_mgr_is_enabled(OMAP_DSS_CHANNEL_DIGIT)) return; /* @@ -562,7 +562,7 @@ static void dispc_mgr_disable_digit_out(void) u32 irq_mask; int num_irqs; - if (dispc_mgr_is_enabled(OMAP_DSS_CHANNEL_DIGIT) == false) + if (!dispc_mgr_is_enabled(OMAP_DSS_CHANNEL_DIGIT)) return; /* diff --git a/drivers/video/fbdev/omap2/dss/dispc-compat.h b/drivers/gpu/drm/omapdrm/dss/dispc-compat.h similarity index 100% rename from drivers/video/fbdev/omap2/dss/dispc-compat.h rename to drivers/gpu/drm/omapdrm/dss/dispc-compat.h diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c similarity index 96% rename from drivers/video/fbdev/omap2/dss/dispc.c rename to drivers/gpu/drm/omapdrm/dss/dispc.c index be716c9ffb88..6b50476ec669 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c @@ -99,6 +99,11 @@ struct dispc_features { /* PIXEL_INC is not added to the last pixel of a line */ bool last_pixel_inc_missing:1; + + /* POL_FREQ has ALIGN bit */ + bool supports_sync_align:1; + + bool has_writeback:1; }; #define DISPC_MAX_NR_FIFOS 5 @@ -246,6 +251,11 @@ struct color_conv_coef { int full_range; }; +static unsigned long dispc_fclk_rate(void); +static unsigned long dispc_core_clk_rate(void); +static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel); +static unsigned long dispc_mgr_pclk_rate(enum omap_channel channel); + static unsigned long dispc_plane_pclk_rate(enum omap_plane plane); static unsigned long dispc_plane_lclk_rate(enum omap_plane plane); @@ -571,7 +581,7 @@ EXPORT_SYMBOL(dispc_mgr_go_busy); void dispc_mgr_go(enum omap_channel channel) { - WARN_ON(dispc_mgr_is_enabled(channel) == false); + WARN_ON(!dispc_mgr_is_enabled(channel)); WARN_ON(dispc_mgr_go_busy(channel)); DSSDBG("GO %s\n", mgr_desc[channel].name); @@ -707,19 +717,20 @@ static void dispc_setup_color_conv_coef(void) { int i; int num_ovl = dss_feat_get_num_ovls(); - int num_wb = dss_feat_get_num_wbs(); const struct color_conv_coef ctbl_bt601_5_ovl = { + /* YUV -> RGB */ 298, 409, 0, 298, -208, -100, 298, 0, 517, 0, }; const struct color_conv_coef ctbl_bt601_5_wb = { - 66, 112, -38, 129, -94, -74, 25, -18, 112, 0, + /* RGB -> YUV */ + 66, 129, 25, 112, -94, -18, -38, -74, 112, 0, }; for (i = 1; i < num_ovl; i++) dispc_ovl_write_color_conv_coef(i, &ctbl_bt601_5_ovl); - for (; i < num_wb; i++) - dispc_ovl_write_color_conv_coef(i, &ctbl_bt601_5_wb); + if (dispc.feat->has_writeback) + dispc_ovl_write_color_conv_coef(OMAP_DSS_WB, &ctbl_bt601_5_wb); } static void dispc_ovl_set_ba0(enum omap_plane plane, u32 paddr) @@ -970,6 +981,10 @@ void dispc_ovl_set_channel_out(enum omap_plane plane, enum omap_channel channel) return; } break; + case OMAP_DSS_CHANNEL_WB: + chan = 0; + chan2 = 3; + break; default: BUG(); return; @@ -988,7 +1003,6 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane) { int shift; u32 val; - enum omap_channel channel; switch (plane) { case OMAP_DSS_GFX: @@ -1006,23 +1020,23 @@ static enum omap_channel dispc_ovl_get_channel_out(enum omap_plane plane) val = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); - if (dss_has_feature(FEAT_MGR_LCD3)) { - if (FLD_GET(val, 31, 30) == 0) - channel = FLD_GET(val, shift, shift); - else if (FLD_GET(val, 31, 30) == 1) - channel = OMAP_DSS_CHANNEL_LCD2; - else - channel = OMAP_DSS_CHANNEL_LCD3; - } else if (dss_has_feature(FEAT_MGR_LCD2)) { - if (FLD_GET(val, 31, 30) == 0) - channel = FLD_GET(val, shift, shift); - else - channel = OMAP_DSS_CHANNEL_LCD2; - } else { - channel = FLD_GET(val, shift, shift); - } + if (FLD_GET(val, shift, shift) == 1) + return OMAP_DSS_CHANNEL_DIGIT; - return channel; + if (!dss_has_feature(FEAT_MGR_LCD2)) + return OMAP_DSS_CHANNEL_LCD; + + switch (FLD_GET(val, 31, 30)) { + case 0: + default: + return OMAP_DSS_CHANNEL_LCD; + case 1: + return OMAP_DSS_CHANNEL_LCD2; + case 2: + return OMAP_DSS_CHANNEL_LCD3; + case 3: + return OMAP_DSS_CHANNEL_WB; + } } void dispc_wb_set_channel_in(enum dss_writeback_channel channel) @@ -1050,6 +1064,8 @@ static void dispc_configure_burst_sizes(void) /* Configure burst size always to maximum size */ for (i = 0; i < dss_feat_get_num_ovls(); ++i) dispc_ovl_set_burst_size(i, burst_size); + if (dispc.feat->has_writeback) + dispc_ovl_set_burst_size(OMAP_DSS_WB, burst_size); } static u32 dispc_ovl_get_burst_size(enum omap_plane plane) @@ -1196,6 +1212,17 @@ static void dispc_init_fifos(void) dispc_ovl_set_fifo_threshold(i, low, high); } + + if (dispc.feat->has_writeback) { + u32 low, high; + const bool use_fifomerge = false; + const bool manual_update = false; + + dispc_ovl_compute_fifo_thresholds(OMAP_DSS_WB, &low, &high, + use_fifomerge, manual_update); + + dispc_ovl_set_fifo_threshold(OMAP_DSS_WB, low, high); + } } static u32 dispc_ovl_get_fifo_size(enum omap_plane plane) @@ -1248,7 +1275,6 @@ void dispc_ovl_set_fifo_threshold(enum omap_plane plane, u32 low, u32 high) plane != OMAP_DSS_WB) dispc_write_reg(DISPC_OVL_PRELOAD(plane), min(high, 0xfffu)); } -EXPORT_SYMBOL(dispc_ovl_set_fifo_threshold); void dispc_enable_fifomerge(bool enable) { @@ -1307,7 +1333,6 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane, *fifo_high = total_fifo_size - buf_unit; } } -EXPORT_SYMBOL(dispc_ovl_compute_fifo_thresholds); static void dispc_ovl_set_mflag(enum omap_plane plane, bool enable) { @@ -1364,6 +1389,25 @@ static void dispc_init_mflag(void) dispc_ovl_set_mflag_threshold(i, low, high); } + + if (dispc.feat->has_writeback) { + u32 size = dispc_ovl_get_fifo_size(OMAP_DSS_WB); + u32 unit = dss_feat_get_buffer_size_unit(); + u32 low, high; + + dispc_ovl_set_mflag(OMAP_DSS_WB, true); + + /* + * Simulation team suggests below thesholds: + * HT = fifosize * 5 / 8; + * LT = fifosize * 4 / 8; + */ + + low = size * 4 / 8 / unit; + high = size * 5 / 8 / unit; + + dispc_ovl_set_mflag_threshold(OMAP_DSS_WB, low, high); + } } static void dispc_ovl_set_fir(enum omap_plane plane, @@ -2438,7 +2482,7 @@ static int dispc_ovl_calc_scaling(unsigned long pclk, unsigned long lclk, if (width == out_width && height == out_height) return 0; - if (pclk == 0 || mgr_timings->pixelclock == 0) { + if (!mem_to_mem && (pclk == 0 || mgr_timings->pixelclock == 0)) { DSSERR("cannot calculate scaling settings: pclk is zero\n"); return -EINVAL; } @@ -2816,8 +2860,25 @@ int dispc_wb_setup(const struct omap_dss_writeback_info *wi, l = dispc_read_reg(DISPC_OVL_ATTRIBUTES(plane)); l = FLD_MOD(l, truncation, 10, 10); /* TRUNCATIONENABLE */ l = FLD_MOD(l, mem_to_mem, 19, 19); /* WRITEBACKMODE */ + if (mem_to_mem) + l = FLD_MOD(l, 1, 26, 24); /* CAPTUREMODE */ + else + l = FLD_MOD(l, 0, 26, 24); /* CAPTUREMODE */ dispc_write_reg(DISPC_OVL_ATTRIBUTES(plane), l); + if (mem_to_mem) { + /* WBDELAYCOUNT */ + REG_FLD_MOD(DISPC_OVL_ATTRIBUTES2(plane), 0, 7, 0); + } else { + int wbdelay; + + wbdelay = min(mgr_timings->vfp + mgr_timings->vsw + + mgr_timings->vbp, 255); + + /* WBDELAYCOUNT */ + REG_FLD_MOD(DISPC_OVL_ATTRIBUTES2(plane), wbdelay, 7, 0); + } + return r; } @@ -2896,7 +2957,7 @@ static void dispc_mgr_set_lcd_type_tft(enum omap_channel channel) mgr_fld_write(channel, DISPC_MGR_FLD_STNTFT, 1); } -void dispc_set_loadmode(enum omap_dss_load_mode mode) +static void dispc_set_loadmode(enum omap_dss_load_mode mode) { REG_FLD_MOD(DISPC_CONFIG, mode, 2, 1); } @@ -3163,6 +3224,10 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, FLD_VAL(hs, 13, 13) | FLD_VAL(vs, 12, 12); + /* always set ALIGN bit when available */ + if (dispc.feat->supports_sync_align) + l |= (1 << 18); + dispc_write_reg(DISPC_POL_FREQ(channel), l); if (dispc.syscon_pol) { @@ -3220,7 +3285,7 @@ void dispc_mgr_set_timings(enum omap_channel channel, DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); } else { - if (t.interlace == true) + if (t.interlace) t.y_res /= 2; } @@ -3237,7 +3302,7 @@ static void dispc_mgr_set_lcd_divisor(enum omap_channel channel, u16 lck_div, dispc_write_reg(DISPC_DIVISORo(channel), FLD_VAL(lck_div, 23, 16) | FLD_VAL(pck_div, 7, 0)); - if (dss_has_feature(FEAT_CORE_CLK_DIV) == false && + if (!dss_has_feature(FEAT_CORE_CLK_DIV) && channel == OMAP_DSS_CHANNEL_LCD) dispc.core_clk_rate = dispc_fclk_rate() / lck_div; } @@ -3251,7 +3316,7 @@ static void dispc_mgr_get_lcd_divisor(enum omap_channel channel, int *lck_div, *pck_div = FLD_GET(l, 7, 0); } -unsigned long dispc_fclk_rate(void) +static unsigned long dispc_fclk_rate(void) { struct dss_pll *pll; unsigned long r = 0; @@ -3282,7 +3347,7 @@ unsigned long dispc_fclk_rate(void) return r; } -unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) +static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) { struct dss_pll *pll; int lcd; @@ -3323,7 +3388,7 @@ unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) } } -unsigned long dispc_mgr_pclk_rate(enum omap_channel channel) +static unsigned long dispc_mgr_pclk_rate(enum omap_channel channel) { unsigned long r; @@ -3348,7 +3413,7 @@ void dispc_set_tv_pclk(unsigned long pclk) dispc.tv_pclk_rate = pclk; } -unsigned long dispc_core_clk_rate(void) +static unsigned long dispc_core_clk_rate(void) { return dispc.core_clk_rate; } @@ -3448,6 +3513,7 @@ static void dispc_dump_regs(struct seq_file *s) [OMAP_DSS_VIDEO1] = "VID1", [OMAP_DSS_VIDEO2] = "VID2", [OMAP_DSS_VIDEO3] = "VID3", + [OMAP_DSS_WB] = "WB", }; const char **p_names; @@ -3554,6 +3620,35 @@ static void dispc_dump_regs(struct seq_file *s) DUMPREG(i, DISPC_OVL_ATTRIBUTES2); } + if (dispc.feat->has_writeback) { + i = OMAP_DSS_WB; + DUMPREG(i, DISPC_OVL_BA0); + DUMPREG(i, DISPC_OVL_BA1); + DUMPREG(i, DISPC_OVL_SIZE); + DUMPREG(i, DISPC_OVL_ATTRIBUTES); + DUMPREG(i, DISPC_OVL_FIFO_THRESHOLD); + DUMPREG(i, DISPC_OVL_FIFO_SIZE_STATUS); + DUMPREG(i, DISPC_OVL_ROW_INC); + DUMPREG(i, DISPC_OVL_PIXEL_INC); + + if (dss_has_feature(FEAT_MFLAG)) + DUMPREG(i, DISPC_OVL_MFLAG_THRESHOLD); + + DUMPREG(i, DISPC_OVL_FIR); + DUMPREG(i, DISPC_OVL_PICTURE_SIZE); + DUMPREG(i, DISPC_OVL_ACCU0); + DUMPREG(i, DISPC_OVL_ACCU1); + if (dss_has_feature(FEAT_HANDLE_UV_SEPARATE)) { + DUMPREG(i, DISPC_OVL_BA0_UV); + DUMPREG(i, DISPC_OVL_BA1_UV); + DUMPREG(i, DISPC_OVL_FIR2); + DUMPREG(i, DISPC_OVL_ACCU2_0); + DUMPREG(i, DISPC_OVL_ACCU2_1); + } + if (dss_has_feature(FEAT_ATTR2)) + DUMPREG(i, DISPC_OVL_ATTRIBUTES2); + } + #undef DISPC_REG #undef DUMPREG @@ -3854,6 +3949,8 @@ static const struct dispc_features omap44xx_dispc_feats = { .num_fifos = 5, .gfx_fifo_workaround = true, .set_max_preload = true, + .supports_sync_align = true, + .has_writeback = true, }; static const struct dispc_features omap54xx_dispc_feats = { @@ -3875,6 +3972,8 @@ static const struct dispc_features omap54xx_dispc_feats = { .gfx_fifo_workaround = true, .mstandby_workaround = true, .set_max_preload = true, + .supports_sync_align = true, + .has_writeback = true, }; static int dispc_init_features(struct platform_device *pdev) diff --git a/drivers/video/fbdev/omap2/dss/dispc.h b/drivers/gpu/drm/omapdrm/dss/dispc.h similarity index 99% rename from drivers/video/fbdev/omap2/dss/dispc.h rename to drivers/gpu/drm/omapdrm/dss/dispc.h index 3043d6e0a5f9..483744223dd1 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.h +++ b/drivers/gpu/drm/omapdrm/dss/dispc.h @@ -908,6 +908,8 @@ static inline u16 DISPC_MFLAG_THRESHOLD_OFFSET(enum omap_plane plane) return 0x0868; case OMAP_DSS_VIDEO3: return 0x086c; + case OMAP_DSS_WB: + return 0x0870; default: BUG(); return 0; diff --git a/drivers/video/fbdev/omap2/dss/dispc_coefs.c b/drivers/gpu/drm/omapdrm/dss/dispc_coefs.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/dispc_coefs.c rename to drivers/gpu/drm/omapdrm/dss/dispc_coefs.c diff --git a/drivers/video/fbdev/omap2/dss/display-sysfs.c b/drivers/gpu/drm/omapdrm/dss/display-sysfs.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/display-sysfs.c rename to drivers/gpu/drm/omapdrm/dss/display-sysfs.c diff --git a/drivers/video/fbdev/omap2/dss/display.c b/drivers/gpu/drm/omapdrm/dss/display.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/display.c rename to drivers/gpu/drm/omapdrm/dss/display.c diff --git a/drivers/video/fbdev/omap2/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/dpi.c rename to drivers/gpu/drm/omapdrm/dss/dpi.c index fb45b6432968..7953e6a52346 100644 --- a/drivers/video/fbdev/omap2/dss/dpi.c +++ b/drivers/gpu/drm/omapdrm/dss/dpi.c @@ -395,7 +395,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev) goto err_no_reg; } - if (out == NULL || out->manager == NULL) { + if (out->manager == NULL) { DSSERR("failed to enable display: no output/manager\n"); r = -ENODEV; goto err_no_out_mgr; diff --git a/drivers/video/fbdev/omap2/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/dsi.c rename to drivers/gpu/drm/omapdrm/dss/dsi.c index b3606def5b7b..43be4b2a7b05 100644 --- a/drivers/video/fbdev/omap2/dss/dsi.c +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c @@ -144,7 +144,7 @@ struct dsi_reg { u16 module; u16 idx; }; #define DSI_IRQ_TA_TIMEOUT (1 << 20) #define DSI_IRQ_ERROR_MASK \ (DSI_IRQ_HS_TX_TIMEOUT | DSI_IRQ_LP_RX_TIMEOUT | DSI_IRQ_SYNC_LOST | \ - DSI_IRQ_TA_TIMEOUT | DSI_IRQ_SYNC_LOST) + DSI_IRQ_TA_TIMEOUT) #define DSI_IRQ_CHANNEL_MASK 0xf /* Virtual channel interrupts */ @@ -3833,7 +3833,7 @@ static int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel) u16 word_count; int r; - if (out == NULL || out->manager == NULL) { + if (out->manager == NULL) { DSSERR("failed to enable display: no output/manager\n"); return -ENODEV; } diff --git a/drivers/video/fbdev/omap2/dss/dss-of.c b/drivers/gpu/drm/omapdrm/dss/dss-of.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/dss-of.c rename to drivers/gpu/drm/omapdrm/dss/dss-of.c diff --git a/drivers/video/fbdev/omap2/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/dss.c rename to drivers/gpu/drm/omapdrm/dss/dss.c index 9200a8668b49..f95ff319e68e 100644 --- a/drivers/video/fbdev/omap2/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1264,12 +1264,18 @@ static int dss_runtime_suspend(struct device *dev) { dss_save_context(); dss_set_min_bus_tput(dev, 0); + + pinctrl_pm_select_sleep_state(dev); + return 0; } static int dss_runtime_resume(struct device *dev) { int r; + + pinctrl_pm_select_default_state(dev); + /* * Set an arbitrarily high tput request to ensure OPP100. * What we should really do is to make a request to stay in OPP100, diff --git a/drivers/video/fbdev/omap2/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h similarity index 97% rename from drivers/video/fbdev/omap2/dss/dss.h rename to drivers/gpu/drm/omapdrm/dss/dss.h index 2406bcdb831a..9a6453235585 100644 --- a/drivers/video/fbdev/omap2/dss/dss.h +++ b/drivers/gpu/drm/omapdrm/dss/dss.h @@ -343,7 +343,8 @@ u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt); #else static inline u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt) { - WARN("%s: DSI not compiled in, returning pixel_size as 0\n", __func__); + WARN(1, "%s: DSI not compiled in, returning pixel_size as 0\n", + __func__); return 0; } #endif @@ -378,7 +379,6 @@ void dispc_lcd_enable_signal(bool enable); void dispc_pck_free_enable(bool enable); void dispc_enable_fifomerge(bool enable); void dispc_enable_gamma_table(bool enable); -void dispc_set_loadmode(enum omap_dss_load_mode mode); typedef bool (*dispc_div_calc_func)(int lckd, int pckd, unsigned long lck, unsigned long pck, void *data); @@ -388,7 +388,6 @@ bool dispc_div_calc(unsigned long dispc, bool dispc_mgr_timings_ok(enum omap_channel channel, const struct omap_video_timings *timings); -unsigned long dispc_fclk_rate(void); int dispc_calc_clock_rates(unsigned long dispc_fclk_rate, struct dispc_clock_info *cinfo); @@ -398,9 +397,6 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane plane, u32 *fifo_low, u32 *fifo_high, bool use_fifomerge, bool manual_update); -unsigned long dispc_mgr_lclk_rate(enum omap_channel channel); -unsigned long dispc_mgr_pclk_rate(enum omap_channel channel); -unsigned long dispc_core_clk_rate(void); void dispc_mgr_set_clock_div(enum omap_channel channel, const struct dispc_clock_info *cinfo); int dispc_mgr_get_clock_div(enum omap_channel channel, diff --git a/drivers/video/fbdev/omap2/dss/dss_features.c b/drivers/gpu/drm/omapdrm/dss/dss_features.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/dss_features.c rename to drivers/gpu/drm/omapdrm/dss/dss_features.c index b0b6dfd657bf..c886a2927f73 100644 --- a/drivers/video/fbdev/omap2/dss/dss_features.c +++ b/drivers/gpu/drm/omapdrm/dss/dss_features.c @@ -46,7 +46,6 @@ struct omap_dss_features { const int num_mgrs; const int num_ovls; - const int num_wbs; const enum omap_display_type *supported_displays; const enum omap_dss_output_id *supported_outputs; const enum omap_color_mode *supported_color_modes; @@ -735,7 +734,6 @@ static const struct omap_dss_features omap4430_es1_0_dss_features = { .num_mgrs = 3, .num_ovls = 4, - .num_wbs = 1, .supported_displays = omap4_dss_supported_displays, .supported_outputs = omap4_dss_supported_outputs, .supported_color_modes = omap4_dss_supported_color_modes, @@ -757,7 +755,6 @@ static const struct omap_dss_features omap4430_es2_0_1_2_dss_features = { .num_mgrs = 3, .num_ovls = 4, - .num_wbs = 1, .supported_displays = omap4_dss_supported_displays, .supported_outputs = omap4_dss_supported_outputs, .supported_color_modes = omap4_dss_supported_color_modes, @@ -779,7 +776,6 @@ static const struct omap_dss_features omap4_dss_features = { .num_mgrs = 3, .num_ovls = 4, - .num_wbs = 1, .supported_displays = omap4_dss_supported_displays, .supported_outputs = omap4_dss_supported_outputs, .supported_color_modes = omap4_dss_supported_color_modes, @@ -825,11 +821,6 @@ int dss_feat_get_num_ovls(void) } EXPORT_SYMBOL(dss_feat_get_num_ovls); -int dss_feat_get_num_wbs(void) -{ - return omap_current_dss_features->num_wbs; -} - unsigned long dss_feat_get_param_min(enum dss_range_param param) { return omap_current_dss_features->dss_params[param].min; @@ -844,13 +835,11 @@ enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel { return omap_current_dss_features->supported_displays[channel]; } -EXPORT_SYMBOL(dss_feat_get_supported_displays); enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel) { return omap_current_dss_features->supported_outputs[channel]; } -EXPORT_SYMBOL(dss_feat_get_supported_outputs); enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane) { diff --git a/drivers/video/fbdev/omap2/dss/dss_features.h b/drivers/gpu/drm/omapdrm/dss/dss_features.h similarity index 94% rename from drivers/video/fbdev/omap2/dss/dss_features.h rename to drivers/gpu/drm/omapdrm/dss/dss_features.h index 100f7a2d0638..3d67d39f192f 100644 --- a/drivers/video/fbdev/omap2/dss/dss_features.h +++ b/drivers/gpu/drm/omapdrm/dss/dss_features.h @@ -86,7 +86,6 @@ enum dss_range_param { }; /* DSS Feature Functions */ -int dss_feat_get_num_wbs(void); unsigned long dss_feat_get_param_min(enum dss_range_param param); unsigned long dss_feat_get_param_max(enum dss_range_param param); enum omap_overlay_caps dss_feat_get_overlay_caps(enum omap_plane plane); @@ -102,4 +101,8 @@ bool dss_feat_rotation_type_supported(enum omap_dss_rotation_type rot_type); bool dss_has_feature(enum dss_feat_id id); void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end); void dss_features_init(enum omapdss_version version); + +enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel); +enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel); + #endif diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/gpu/drm/omapdrm/dss/hdmi.h similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi.h rename to drivers/gpu/drm/omapdrm/dss/hdmi.h diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/hdmi4.c rename to drivers/gpu/drm/omapdrm/dss/hdmi4.c index 94c8d5549b4c..7103c659a534 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi4.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c @@ -343,7 +343,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev) mutex_lock(&hdmi.lock); - if (out == NULL || out->manager == NULL) { + if (out->manager == NULL) { DSSERR("failed to enable display: no output/manager\n"); r = -ENODEV; goto err0; diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi4_core.c rename to drivers/gpu/drm/omapdrm/dss/hdmi4_core.c diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.h b/drivers/gpu/drm/omapdrm/dss/hdmi4_core.h similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi4_core.h rename to drivers/gpu/drm/omapdrm/dss/hdmi4_core.h diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/hdmi5.c rename to drivers/gpu/drm/omapdrm/dss/hdmi5.c index b59ba7902be1..a955a2c4c061 100644 --- a/drivers/video/fbdev/omap2/dss/hdmi5.c +++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c @@ -373,7 +373,7 @@ static int hdmi_display_enable(struct omap_dss_device *dssdev) mutex_lock(&hdmi.lock); - if (out == NULL || out->manager == NULL) { + if (out->manager == NULL) { DSSERR("failed to enable display: no output/manager\n"); r = -ENODEV; goto err0; diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.c b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi5_core.c rename to drivers/gpu/drm/omapdrm/dss/hdmi5_core.c diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.h b/drivers/gpu/drm/omapdrm/dss/hdmi5_core.h similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi5_core.h rename to drivers/gpu/drm/omapdrm/dss/hdmi5_core.h diff --git a/drivers/video/fbdev/omap2/dss/hdmi_common.c b/drivers/gpu/drm/omapdrm/dss/hdmi_common.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi_common.c rename to drivers/gpu/drm/omapdrm/dss/hdmi_common.c diff --git a/drivers/video/fbdev/omap2/dss/hdmi_phy.c b/drivers/gpu/drm/omapdrm/dss/hdmi_phy.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi_phy.c rename to drivers/gpu/drm/omapdrm/dss/hdmi_phy.c diff --git a/drivers/video/fbdev/omap2/dss/hdmi_pll.c b/drivers/gpu/drm/omapdrm/dss/hdmi_pll.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi_pll.c rename to drivers/gpu/drm/omapdrm/dss/hdmi_pll.c diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/gpu/drm/omapdrm/dss/hdmi_wp.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/hdmi_wp.c rename to drivers/gpu/drm/omapdrm/dss/hdmi_wp.c diff --git a/drivers/video/fbdev/omap2/dss/manager-sysfs.c b/drivers/gpu/drm/omapdrm/dss/manager-sysfs.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/manager-sysfs.c rename to drivers/gpu/drm/omapdrm/dss/manager-sysfs.c diff --git a/drivers/video/fbdev/omap2/dss/manager.c b/drivers/gpu/drm/omapdrm/dss/manager.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/manager.c rename to drivers/gpu/drm/omapdrm/dss/manager.c index 1aac9b4191a9..08a67f4f6a20 100644 --- a/drivers/video/fbdev/omap2/dss/manager.c +++ b/drivers/gpu/drm/omapdrm/dss/manager.c @@ -210,7 +210,7 @@ static int dss_mgr_check_lcd_config(struct omap_overlay_manager *mgr, return -EINVAL; /* fifohandcheck should be used only with stallmode */ - if (stallmode == false && fifohandcheck == true) + if (!stallmode && fifohandcheck) return -EINVAL; /* diff --git a/drivers/video/fbdev/omap2/dss/omapdss-boot-init.c b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c similarity index 98% rename from drivers/video/fbdev/omap2/dss/omapdss-boot-init.c rename to drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c index 8b6f6d5fdd68..136d30484d02 100644 --- a/drivers/video/fbdev/omap2/dss/omapdss-boot-init.c +++ b/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c @@ -199,10 +199,8 @@ static int __init omapdss_boot_init(void) omapdss_walk_device(dss, true); for_each_available_child_of_node(dss, child) { - if (!of_find_property(child, "compatible", NULL)) { - of_node_put(child); + if (!of_find_property(child, "compatible", NULL)) continue; - } omapdss_walk_device(child, true); } diff --git a/drivers/video/fbdev/omap2/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/output.c rename to drivers/gpu/drm/omapdrm/dss/output.c diff --git a/drivers/video/fbdev/omap2/dss/overlay-sysfs.c b/drivers/gpu/drm/omapdrm/dss/overlay-sysfs.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/overlay-sysfs.c rename to drivers/gpu/drm/omapdrm/dss/overlay-sysfs.c diff --git a/drivers/video/fbdev/omap2/dss/overlay.c b/drivers/gpu/drm/omapdrm/dss/overlay.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/overlay.c rename to drivers/gpu/drm/omapdrm/dss/overlay.c diff --git a/drivers/video/fbdev/omap2/dss/pll.c b/drivers/gpu/drm/omapdrm/dss/pll.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/pll.c rename to drivers/gpu/drm/omapdrm/dss/pll.c diff --git a/drivers/video/fbdev/omap2/dss/rfbi.c b/drivers/gpu/drm/omapdrm/dss/rfbi.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/rfbi.c rename to drivers/gpu/drm/omapdrm/dss/rfbi.c index 1525a494d057..aea6a1d0fb20 100644 --- a/drivers/video/fbdev/omap2/dss/rfbi.c +++ b/drivers/gpu/drm/omapdrm/dss/rfbi.c @@ -880,7 +880,7 @@ static int rfbi_display_enable(struct omap_dss_device *dssdev) struct omap_dss_device *out = &rfbi.output; int r; - if (out == NULL || out->manager == NULL) { + if (out->manager == NULL) { DSSERR("failed to enable display: no output/manager\n"); return -ENODEV; } diff --git a/drivers/video/fbdev/omap2/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/sdi.c rename to drivers/gpu/drm/omapdrm/dss/sdi.c index 5843580a1deb..d747cc6b59e1 100644 --- a/drivers/video/fbdev/omap2/dss/sdi.c +++ b/drivers/gpu/drm/omapdrm/dss/sdi.c @@ -136,7 +136,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev) unsigned long pck; int r; - if (out == NULL || out->manager == NULL) { + if (out->manager == NULL) { DSSERR("failed to enable display: no output/manager\n"); return -ENODEV; } diff --git a/drivers/video/fbdev/omap2/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c similarity index 99% rename from drivers/video/fbdev/omap2/dss/venc.c rename to drivers/gpu/drm/omapdrm/dss/venc.c index d05a54922ba6..08f9def76e27 100644 --- a/drivers/video/fbdev/omap2/dss/venc.c +++ b/drivers/gpu/drm/omapdrm/dss/venc.c @@ -515,7 +515,7 @@ static int venc_display_enable(struct omap_dss_device *dssdev) mutex_lock(&venc.venc_lock); - if (out == NULL || out->manager == NULL) { + if (out->manager == NULL) { DSSERR("Failed to enable display: no output/manager\n"); r = -ENODEV; goto err0; diff --git a/drivers/video/fbdev/omap2/dss/video-pll.c b/drivers/gpu/drm/omapdrm/dss/video-pll.c similarity index 100% rename from drivers/video/fbdev/omap2/dss/video-pll.c rename to drivers/gpu/drm/omapdrm/dss/video-pll.c diff --git a/drivers/media/platform/omap/Kconfig b/drivers/media/platform/omap/Kconfig index 217d613b0fe7..e8e2db181a7a 100644 --- a/drivers/media/platform/omap/Kconfig +++ b/drivers/media/platform/omap/Kconfig @@ -5,9 +5,9 @@ config VIDEO_OMAP2_VOUT tristate "OMAP2/OMAP3 V4L2-Display driver" depends on MMU depends on ARCH_OMAP2 || ARCH_OMAP3 + depends on FB_OMAP2 select VIDEOBUF_GEN select VIDEOBUF_DMA_CONTIG - select OMAP2_DSS if HAS_IOMEM && ARCH_OMAP2PLUS select OMAP2_VRFB if ARCH_OMAP2 || ARCH_OMAP3 select VIDEO_OMAP2_VOUT_VRFB if VIDEO_OMAP2_VOUT && OMAP2_VRFB select FRAME_VECTOR diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index e6d16d65e4e6..8ea45a5cd806 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -5,6 +5,7 @@ menuconfig FB tristate "Support for frame buffer devices" select FB_CMDLINE + select FB_NOTIFY ---help--- The frame buffer device provides an abstraction for the graphics hardware. It represents the frame buffer of some video hardware and @@ -56,6 +57,9 @@ config FIRMWARE_EDID config FB_CMDLINE bool +config FB_NOTIFY + bool + config FB_DDC tristate depends on FB @@ -1506,6 +1510,7 @@ config FB_SIS select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT select FB_BOOT_VESA_SUPPORT if FB_SIS = y + select FB_SIS_300 if !FB_SIS_315 help This is the frame buffer device driver for the SiS 300, 315, 330 and 340 series as well as XGI V3XT, V5, V8, Z7 graphics chipsets. @@ -1880,6 +1885,8 @@ config FB_PXA select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select VIDEOMODE_HELPERS if OF + select FB_MODE_HELPERS if OF ---help--- Frame buffer driver for the built-in LCD controller in the Intel PXA2x0 processor. @@ -1990,16 +1997,6 @@ config FB_SH_MOBILE_LCDC ---help--- Frame buffer driver for the on-chip SH-Mobile LCD controller. -config FB_SH_MOBILE_HDMI - tristate "SuperH Mobile HDMI controller support" - depends on FB_SH_MOBILE_LCDC - select FB_MODE_HELPERS - select SOUND - select SND - select SND_SOC - ---help--- - Driver for the on-chip SH-Mobile HDMI controller. - config FB_TMIO tristate "Toshiba Mobile IO FrameBuffer support" depends on FB && (MFD_TMIO || COMPILE_TEST) diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index 50ed1b4fc2bf..65fb15075c8f 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile @@ -118,7 +118,6 @@ obj-$(CONFIG_FB_UDL) += udlfb.o obj-$(CONFIG_FB_SMSCUFX) += smscufx.o obj-$(CONFIG_FB_XILINX) += xilinxfb.o obj-$(CONFIG_SH_MIPI_DSI) += sh_mipi_dsi.o -obj-$(CONFIG_FB_SH_MOBILE_HDMI) += sh_mobile_hdmi.o obj-$(CONFIG_FB_SH_MOBILE_MERAM) += sh_mobile_meram.o obj-$(CONFIG_FB_SH_MOBILE_LCDC) += sh_mobile_lcdcfb.o obj-$(CONFIG_FB_OMAP) += omap/ diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c index 8d2499d1cafb..9580374667ba 100644 --- a/drivers/video/fbdev/auo_k190x.c +++ b/drivers/video/fbdev/auo_k190x.c @@ -773,9 +773,7 @@ static void auok190x_recover(struct auok190xfb_par *par) /* * Power-management */ - -#ifdef CONFIG_PM -static int auok190x_runtime_suspend(struct device *dev) +static int __maybe_unused auok190x_runtime_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct fb_info *info = platform_get_drvdata(pdev); @@ -822,7 +820,7 @@ finish: return 0; } -static int auok190x_runtime_resume(struct device *dev) +static int __maybe_unused auok190x_runtime_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct fb_info *info = platform_get_drvdata(pdev); @@ -856,7 +854,7 @@ static int auok190x_runtime_resume(struct device *dev) return 0; } -static int auok190x_suspend(struct device *dev) +static int __maybe_unused auok190x_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct fb_info *info = platform_get_drvdata(pdev); @@ -896,7 +894,7 @@ static int auok190x_suspend(struct device *dev) return 0; } -static int auok190x_resume(struct device *dev) +static int __maybe_unused auok190x_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct fb_info *info = platform_get_drvdata(pdev); @@ -933,7 +931,6 @@ static int auok190x_resume(struct device *dev) return 0; } -#endif const struct dev_pm_ops auok190x_pm = { SET_RUNTIME_PM_OPS(auok190x_runtime_suspend, auok190x_runtime_resume, diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile index 23d86a8b7d7b..9e3ddf225393 100644 --- a/drivers/video/fbdev/core/Makefile +++ b/drivers/video/fbdev/core/Makefile @@ -1,5 +1,5 @@ -obj-y += fb_notify.o obj-$(CONFIG_FB_CMDLINE) += fb_cmdline.o +obj-$(CONFIG_FB_NOTIFY) += fb_notify.o obj-$(CONFIG_FB) += fb.o fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \ modedb.o fbcvt.o diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 0705d8883ede..4e73b6f6b1c0 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -1608,6 +1608,11 @@ static int do_remove_conflicting_framebuffers(struct apertures_struct *a, return 0; } +static bool lockless_register_fb; +module_param_named_unsafe(lockless_register_fb, lockless_register_fb, bool, 0400); +MODULE_PARM_DESC(lockless_register_fb, + "Lockless framebuffer registration for debugging [default=off]"); + static int do_register_framebuffer(struct fb_info *fb_info) { int i, ret; @@ -1675,15 +1680,18 @@ static int do_register_framebuffer(struct fb_info *fb_info) registered_fb[i] = fb_info; event.info = fb_info; - console_lock(); + if (!lockless_register_fb) + console_lock(); if (!lock_fb_info(fb_info)) { - console_unlock(); + if (!lockless_register_fb) + console_unlock(); return -ENODEV; } fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event); unlock_fb_info(fb_info); - console_unlock(); + if (!lockless_register_fb) + console_unlock(); return 0; } diff --git a/drivers/video/fbdev/geode/display_gx1.c b/drivers/video/fbdev/geode/display_gx1.c index 926d53eeb549..b383eb9882bf 100644 --- a/drivers/video/fbdev/geode/display_gx1.c +++ b/drivers/video/fbdev/geode/display_gx1.c @@ -208,7 +208,7 @@ static void gx1_set_hw_palette_reg(struct fb_info *info, unsigned regno, writel(val, par->dc_regs + DC_PAL_DATA); } -struct geode_dc_ops gx1_dc_ops = { +const struct geode_dc_ops gx1_dc_ops = { .set_mode = gx1_set_mode, .set_palette_reg = gx1_set_hw_palette_reg, }; diff --git a/drivers/video/fbdev/geode/display_gx1.h b/drivers/video/fbdev/geode/display_gx1.h index 671c05558c79..e1cc41b343ca 100644 --- a/drivers/video/fbdev/geode/display_gx1.h +++ b/drivers/video/fbdev/geode/display_gx1.h @@ -18,7 +18,7 @@ unsigned gx1_gx_base(void); int gx1_frame_buffer_size(void); -extern struct geode_dc_ops gx1_dc_ops; +extern const struct geode_dc_ops gx1_dc_ops; /* GX1 configuration I/O registers */ diff --git a/drivers/video/fbdev/geode/geodefb.h b/drivers/video/fbdev/geode/geodefb.h index ae04820e0c57..e2e07934868f 100644 --- a/drivers/video/fbdev/geode/geodefb.h +++ b/drivers/video/fbdev/geode/geodefb.h @@ -31,8 +31,8 @@ struct geodefb_par { int panel_y; void __iomem *dc_regs; void __iomem *vid_regs; - struct geode_dc_ops *dc_ops; - struct geode_vid_ops *vid_ops; + const struct geode_dc_ops *dc_ops; + const struct geode_vid_ops *vid_ops; }; #endif /* !__GEODEFB_H__ */ diff --git a/drivers/video/fbdev/geode/video_cs5530.c b/drivers/video/fbdev/geode/video_cs5530.c index 649c3943d431..880613200ecf 100644 --- a/drivers/video/fbdev/geode/video_cs5530.c +++ b/drivers/video/fbdev/geode/video_cs5530.c @@ -186,7 +186,7 @@ static int cs5530_blank_display(struct fb_info *info, int blank_mode) return 0; } -struct geode_vid_ops cs5530_vid_ops = { +const struct geode_vid_ops cs5530_vid_ops = { .set_dclk = cs5530_set_dclk_frequency, .configure_display = cs5530_configure_display, .blank_display = cs5530_blank_display, diff --git a/drivers/video/fbdev/geode/video_cs5530.h b/drivers/video/fbdev/geode/video_cs5530.h index 56cecca7f1ce..c843348bfa20 100644 --- a/drivers/video/fbdev/geode/video_cs5530.h +++ b/drivers/video/fbdev/geode/video_cs5530.h @@ -15,7 +15,7 @@ #ifndef __VIDEO_CS5530_H__ #define __VIDEO_CS5530_H__ -extern struct geode_vid_ops cs5530_vid_ops; +extern const struct geode_vid_ops cs5530_vid_ops; /* CS5530 Video device registers */ diff --git a/drivers/video/fbdev/i740fb.c b/drivers/video/fbdev/i740fb.c index 452e1163ad02..cf5ccd0f2252 100644 --- a/drivers/video/fbdev/i740fb.c +++ b/drivers/video/fbdev/i740fb.c @@ -346,11 +346,10 @@ static void i740_calc_vclk(u32 freq, struct i740fb_par *par) const u32 err_target = freq / (1000 * I740_RFREQ / I740_FFIX); u32 err_best = 512 * I740_FFIX; u32 f_err, f_vco; - int m_best = 0, n_best = 0, p_best = 0, d_best = 0; + int m_best = 0, n_best = 0, p_best = 0; int m, n; p_best = min(15, ilog2(I740_MAX_VCO_FREQ / (freq / I740_RFREQ_FIX))); - d_best = 0; f_vco = (freq * (1 << p_best)) / I740_RFREQ_FIX; freq = freq / I740_RFREQ_FIX; @@ -363,7 +362,7 @@ static void i740_calc_vclk(u32 freq, struct i740fb_par *par) m = 3; { - u32 f_out = (((m * I740_REF_FREQ * (4 << 2 * d_best)) + u32 f_out = (((m * I740_REF_FREQ * 4) / n) + ((1 << p_best) / 2)) / (1 << p_best); f_err = (freq - f_out); @@ -386,8 +385,7 @@ static void i740_calc_vclk(u32 freq, struct i740fb_par *par) par->video_clk2_n = (n_best - 2) & 0xFF; par->video_clk2_mn_msbs = ((((n_best - 2) >> 4) & VCO_N_MSBS) | (((m_best - 2) >> 8) & VCO_M_MSBS)); - par->video_clk2_div_sel = - ((p_best << 4) | (d_best ? 4 : 0) | REF_DIV_1); + par->video_clk2_div_sel = ((p_best << 4) | REF_DIV_1); } static int i740fb_decode_var(const struct fb_var_screeninfo *var, diff --git a/drivers/video/fbdev/omap2/Kconfig b/drivers/video/fbdev/omap2/Kconfig index c22955d2de9a..0921c4de8407 100644 --- a/drivers/video/fbdev/omap2/Kconfig +++ b/drivers/video/fbdev/omap2/Kconfig @@ -1,10 +1,5 @@ -config OMAP2_VRFB - bool - if ARCH_OMAP2PLUS -source "drivers/video/fbdev/omap2/dss/Kconfig" source "drivers/video/fbdev/omap2/omapfb/Kconfig" -source "drivers/video/fbdev/omap2/displays-new/Kconfig" endif diff --git a/drivers/video/fbdev/omap2/Makefile b/drivers/video/fbdev/omap2/Makefile index f8745ec369cc..71ab5ac91106 100644 --- a/drivers/video/fbdev/omap2/Makefile +++ b/drivers/video/fbdev/omap2/Makefile @@ -1,5 +1 @@ -obj-$(CONFIG_OMAP2_VRFB) += vrfb.o - -obj-y += dss/ -obj-y += displays-new/ -obj-$(CONFIG_FB_OMAP2) += omapfb/ +obj-y += omapfb/ diff --git a/drivers/video/fbdev/omap2/omapfb/Kconfig b/drivers/video/fbdev/omap2/omapfb/Kconfig index 4cb12ce68855..e6226aeed17e 100644 --- a/drivers/video/fbdev/omap2/omapfb/Kconfig +++ b/drivers/video/fbdev/omap2/omapfb/Kconfig @@ -1,7 +1,12 @@ +config OMAP2_VRFB + bool + menuconfig FB_OMAP2 tristate "OMAP2+ frame buffer support" - depends on FB && OMAP2_DSS && !DRM_OMAP + depends on FB + depends on DRM_OMAP = n + select FB_OMAP2_DSS select OMAP2_VRFB if ARCH_OMAP2 || ARCH_OMAP3 select FB_CFB_FILLRECT select FB_CFB_COPYAREA @@ -9,6 +14,8 @@ menuconfig FB_OMAP2 help Frame buffer driver for OMAP2+ based boards. +if FB_OMAP2 + config FB_OMAP2_DEBUG_SUPPORT bool "Debug support for OMAP2+ FB" default y @@ -25,3 +32,8 @@ config FB_OMAP2_NUM_FBS help Select the number of framebuffers created. OMAP2/3 has 3 overlays so normally this would be 3. + +source "drivers/video/fbdev/omap2/omapfb/dss/Kconfig" +source "drivers/video/fbdev/omap2/omapfb/displays/Kconfig" + +endif diff --git a/drivers/video/fbdev/omap2/omapfb/Makefile b/drivers/video/fbdev/omap2/omapfb/Makefile index 51c2e00d9bf8..ad68ecf141af 100644 --- a/drivers/video/fbdev/omap2/omapfb/Makefile +++ b/drivers/video/fbdev/omap2/omapfb/Makefile @@ -1,2 +1,5 @@ +obj-$(CONFIG_OMAP2_VRFB) += vrfb.o +obj-y += dss/ +obj-y += displays/ obj-$(CONFIG_FB_OMAP2) += omapfb.o omapfb-y := omapfb-main.o omapfb-sysfs.o omapfb-ioctl.o diff --git a/drivers/video/fbdev/omap2/omapfb/displays/Kconfig b/drivers/video/fbdev/omap2/omapfb/displays/Kconfig new file mode 100644 index 000000000000..08f12039dd02 --- /dev/null +++ b/drivers/video/fbdev/omap2/omapfb/displays/Kconfig @@ -0,0 +1,86 @@ +menu "OMAPFB Panel and Encoder Drivers" + depends on FB_OMAP2_DSS + +config FB_OMAP2_ENCODER_OPA362 + tristate "OPA362 external analog amplifier" + help + Driver for OPA362 external analog TV amplifier controlled + through a GPIO. + +config FB_OMAP2_ENCODER_TFP410 + tristate "TFP410 DPI to DVI Encoder" + help + Driver for TFP410 DPI to DVI encoder. + +config FB_OMAP2_ENCODER_TPD12S015 + tristate "TPD12S015 HDMI ESD protection and level shifter" + help + Driver for TPD12S015, which offers HDMI ESD protection and level + shifting. + +config FB_OMAP2_CONNECTOR_DVI + tristate "DVI Connector" + depends on I2C + help + Driver for a generic DVI connector. + +config FB_OMAP2_CONNECTOR_HDMI + tristate "HDMI Connector" + help + Driver for a generic HDMI connector. + +config FB_OMAP2_CONNECTOR_ANALOG_TV + tristate "Analog TV Connector" + help + Driver for a generic analog TV connector. + +config FB_OMAP2_PANEL_DPI + tristate "Generic DPI panel" + help + Driver for generic DPI panels. + +config FB_OMAP2_PANEL_DSI_CM + tristate "Generic DSI Command Mode Panel" + depends on BACKLIGHT_CLASS_DEVICE + help + Driver for generic DSI command mode panels. + +config FB_OMAP2_PANEL_SONY_ACX565AKM + tristate "ACX565AKM Panel" + depends on SPI && BACKLIGHT_CLASS_DEVICE + help + This is the LCD panel used on Nokia N900 + +config FB_OMAP2_PANEL_LGPHILIPS_LB035Q02 + tristate "LG.Philips LB035Q02 LCD Panel" + depends on SPI + help + LCD Panel used on the Gumstix Overo Palo35 + +config FB_OMAP2_PANEL_SHARP_LS037V7DW01 + tristate "Sharp LS037V7DW01 LCD Panel" + depends on BACKLIGHT_CLASS_DEVICE + help + LCD Panel used in TI's SDP3430 and EVM boards + +config FB_OMAP2_PANEL_TPO_TD028TTEC1 + tristate "TPO TD028TTEC1 LCD Panel" + depends on SPI + help + LCD panel used in Openmoko. + +config FB_OMAP2_PANEL_TPO_TD043MTEA1 + tristate "TPO TD043MTEA1 LCD Panel" + depends on SPI + help + LCD Panel used in OMAP3 Pandora + +config FB_OMAP2_PANEL_NEC_NL8048HL11 + tristate "NEC NL8048HL11 Panel" + depends on SPI + depends on BACKLIGHT_CLASS_DEVICE + help + This NEC NL8048HL11 panel is TFT LCD used in the + Zoom2/3/3630 sdp boards. + +endmenu diff --git a/drivers/video/fbdev/omap2/omapfb/displays/Makefile b/drivers/video/fbdev/omap2/omapfb/displays/Makefile new file mode 100644 index 000000000000..4f7459272256 --- /dev/null +++ b/drivers/video/fbdev/omap2/omapfb/displays/Makefile @@ -0,0 +1,14 @@ +obj-$(CONFIG_FB_OMAP2_ENCODER_OPA362) += encoder-opa362.o +obj-$(CONFIG_FB_OMAP2_ENCODER_TFP410) += encoder-tfp410.o +obj-$(CONFIG_FB_OMAP2_ENCODER_TPD12S015) += encoder-tpd12s015.o +obj-$(CONFIG_FB_OMAP2_CONNECTOR_DVI) += connector-dvi.o +obj-$(CONFIG_FB_OMAP2_CONNECTOR_HDMI) += connector-hdmi.o +obj-$(CONFIG_FB_OMAP2_CONNECTOR_ANALOG_TV) += connector-analog-tv.o +obj-$(CONFIG_FB_OMAP2_PANEL_DPI) += panel-dpi.o +obj-$(CONFIG_FB_OMAP2_PANEL_DSI_CM) += panel-dsi-cm.o +obj-$(CONFIG_FB_OMAP2_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o +obj-$(CONFIG_FB_OMAP2_PANEL_LGPHILIPS_LB035Q02) += panel-lgphilips-lb035q02.o +obj-$(CONFIG_FB_OMAP2_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o +obj-$(CONFIG_FB_OMAP2_PANEL_TPO_TD028TTEC1) += panel-tpo-td028ttec1.o +obj-$(CONFIG_FB_OMAP2_PANEL_TPO_TD043MTEA1) += panel-tpo-td043mtea1.o +obj-$(CONFIG_FB_OMAP2_PANEL_NEC_NL8048HL11) += panel-nec-nl8048hl11.o diff --git a/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c b/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c new file mode 100644 index 000000000000..8511c648a15c --- /dev/null +++ b/drivers/video/fbdev/omap2/omapfb/displays/connector-analog-tv.c @@ -0,0 +1,320 @@ +/* + * Analog TV Connector driver + * + * Copyright (C) 2013 Texas Instruments + * Author: Tomi Valkeinen + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include +#include +#include +#include + +#include