diff options
author | Buddy Liong | 2016-12-18 16:38:24 -0600 |
---|---|---|
committer | Buddy Liong | 2017-02-07 16:06:39 -0600 |
commit | dbf5993af66fffc6809a1f2a78b5cc58cbaaa048 (patch) | |
tree | 2ae54a63516710a3c6a2e98fc225051b99f83990 | |
parent | 2f92a342ca9e3470e1b096d9d57081d05422e32f (diff) | |
download | kernel-omap-dbf5993af66fffc6809a1f2a78b5cc58cbaaa048.tar.gz kernel-omap-dbf5993af66fffc6809a1f2a78b5cc58cbaaa048.tar.xz kernel-omap-dbf5993af66fffc6809a1f2a78b5cc58cbaaa048.zip |
OMAPDSS: Add methods for skipping display initialization
Adds methods to handle skipping display initialization during
kernel bootup for cases where the display is pre-initialized by
either the remote core or u-boot.
This patch is ported from K3.14
http://review.omapzoom.org/36936
Change-Id: I66fbbe82f131f5e08fd07ea5d10df88f1531188b
Signed-off-by: Buddy Liong <a0270631@ti.com>
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/core.c | 22 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dispc.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/dpi.c | 6 | ||||
-rw-r--r-- | include/video/omapdss.h | 16 |
4 files changed, 51 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c index 6a3ebfcd7223..6b85c49947f3 100644 --- a/drivers/gpu/drm/omapdrm/dss/core.c +++ b/drivers/gpu/drm/omapdrm/dss/core.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/regulator/consumer.h> | 34 | #include <linux/regulator/consumer.h> |
35 | #include <linux/suspend.h> | 35 | #include <linux/suspend.h> |
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <video/omapdss.h> | ||
37 | 38 | ||
38 | #include "omapdss.h" | 39 | #include "omapdss.h" |
39 | #include "dss.h" | 40 | #include "dss.h" |
@@ -45,6 +46,9 @@ static struct { | |||
45 | const char *default_display_name; | 46 | const char *default_display_name; |
46 | } core; | 47 | } core; |
47 | 48 | ||
49 | static uint g_display_skip_init; | ||
50 | static uint g_display_share; | ||
51 | |||
48 | static char *def_disp_name; | 52 | static char *def_disp_name; |
49 | module_param_named(def_disp, def_disp_name, charp, 0); | 53 | module_param_named(def_disp, def_disp_name, charp, 0); |
50 | MODULE_PARM_DESC(def_disp, "default display name"); | 54 | MODULE_PARM_DESC(def_disp, "default display name"); |
@@ -62,6 +66,18 @@ enum omapdss_version omapdss_get_version(void) | |||
62 | } | 66 | } |
63 | EXPORT_SYMBOL(omapdss_get_version); | 67 | EXPORT_SYMBOL(omapdss_get_version); |
64 | 68 | ||
69 | int omapdss_skipinit(void) | ||
70 | { | ||
71 | return g_display_skip_init; | ||
72 | } | ||
73 | EXPORT_SYMBOL(omapdss_skipinit); | ||
74 | |||
75 | int omapdss_display_share(void) | ||
76 | { | ||
77 | return g_display_share; | ||
78 | } | ||
79 | EXPORT_SYMBOL(omapdss_display_share); | ||
80 | |||
65 | struct platform_device *dss_get_core_pdev(void) | 81 | struct platform_device *dss_get_core_pdev(void) |
66 | { | 82 | { |
67 | return core.pdev; | 83 | return core.pdev; |
@@ -181,10 +197,16 @@ static void dss_disable_all_devices(void) | |||
181 | static int __init omap_dss_probe(struct platform_device *pdev) | 197 | static int __init omap_dss_probe(struct platform_device *pdev) |
182 | { | 198 | { |
183 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 199 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
200 | struct device_node *node = pdev->dev.of_node; | ||
184 | int r; | 201 | int r; |
185 | 202 | ||
186 | core.pdev = pdev; | 203 | core.pdev = pdev; |
187 | 204 | ||
205 | of_property_read_u32(node, "skip_init", | ||
206 | &g_display_skip_init); | ||
207 | if (g_display_skip_init) | ||
208 | g_display_share = 1; | ||
209 | |||
188 | dss_features_init(omapdss_get_version()); | 210 | dss_features_init(omapdss_get_version()); |
189 | 211 | ||
190 | r = dss_initialize_debugfs(); | 212 | r = dss_initialize_debugfs(); |
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c index 02f2a34d4d1b..0e865984736e 100644 --- a/drivers/gpu/drm/omapdrm/dss/dispc.c +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <linux/regmap.h> | 40 | #include <linux/regmap.h> |
41 | #include <linux/of.h> | 41 | #include <linux/of.h> |
42 | #include <linux/component.h> | 42 | #include <linux/component.h> |
43 | #include <video/omapdss.h> | ||
43 | 44 | ||
44 | #include "omapdss.h" | 45 | #include "omapdss.h" |
45 | #include "dss.h" | 46 | #include "dss.h" |
@@ -2820,6 +2821,11 @@ static int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info | |||
2820 | enum omap_channel channel; | 2821 | enum omap_channel channel; |
2821 | const bool replication = true; | 2822 | const bool replication = true; |
2822 | 2823 | ||
2824 | if (omapdss_skipinit() && | ||
2825 | ((plane == OMAP_DSS_VIDEO2) || (plane == OMAP_DSS_VIDEO3))) { | ||
2826 | return 0; | ||
2827 | } | ||
2828 | |||
2823 | channel = dispc_ovl_get_channel_out(plane); | 2829 | channel = dispc_ovl_get_channel_out(plane); |
2824 | 2830 | ||
2825 | DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d ->" | 2831 | DSSDBG("dispc_ovl_setup %d, pa %pad, pa_uv %pad, sw %d, %d,%d, %dx%d ->" |
@@ -3990,6 +3996,9 @@ static void _omap_dispc_initial_config(void) | |||
3990 | dispc.core_clk_rate = dispc_fclk_rate(); | 3996 | dispc.core_clk_rate = dispc_fclk_rate(); |
3991 | } | 3997 | } |
3992 | 3998 | ||
3999 | if (omapdss_skipinit()) | ||
4000 | return; | ||
4001 | |||
3993 | /* Use gamma table mode, instead of palette mode */ | 4002 | /* Use gamma table mode, instead of palette mode */ |
3994 | if (dispc.feat->has_gamma_table) | 4003 | if (dispc.feat->has_gamma_table) |
3995 | REG_FLD_MOD(DISPC_CONFIG, 1, 3, 3); | 4004 | REG_FLD_MOD(DISPC_CONFIG, 1, 3, 3); |
diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c index a5209c951d2e..0d494a4327d7 100644 --- a/drivers/gpu/drm/omapdrm/dss/dpi.c +++ b/drivers/gpu/drm/omapdrm/dss/dpi.c | |||
@@ -376,7 +376,8 @@ static int dpi_set_mode(struct dpi_data *dpi) | |||
376 | t->pixelclock = pck; | 376 | t->pixelclock = pck; |
377 | } | 377 | } |
378 | 378 | ||
379 | dss_mgr_set_timings(channel, t); | 379 | if (!omapdss_skipinit()) |
380 | dss_mgr_set_timings(channel, t); | ||
380 | 381 | ||
381 | return 0; | 382 | return 0; |
382 | } | 383 | } |
@@ -395,7 +396,8 @@ static void dpi_config_lcd_manager(struct dpi_data *dpi) | |||
395 | 396 | ||
396 | dpi->mgr_config.lcden_sig_polarity = 0; | 397 | dpi->mgr_config.lcden_sig_polarity = 0; |
397 | 398 | ||
398 | dss_mgr_set_lcd_config(channel, &dpi->mgr_config); | 399 | if (!omapdss_skipinit()) |
400 | dss_mgr_set_lcd_config(channel, &dpi->mgr_config); | ||
399 | } | 401 | } |
400 | 402 | ||
401 | static int dpi_display_enable(struct omap_dss_device *dssdev) | 403 | static int dpi_display_enable(struct omap_dss_device *dssdev) |
diff --git a/include/video/omapdss.h b/include/video/omapdss.h new file mode 100644 index 000000000000..71543c47c0a2 --- /dev/null +++ b/include/video/omapdss.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2016 Texas Instruments, Inc. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #ifndef __OMAP_OMAPDSS_H | ||
11 | #define __OMAP_OMAPDSS_H | ||
12 | |||
13 | int omapdss_skipinit(void); | ||
14 | int omapdss_display_share(void); | ||
15 | |||
16 | #endif | ||