diff options
author | Daniel Solomon <daniels@nvidia.com> | 2015-11-13 23:40:37 -0500 |
---|---|---|
committer | Mitch Luban <mluban@nvidia.com> | 2016-06-24 18:38:06 -0400 |
commit | 58430eb374ca41db4e2725a6d365f4b857f825bf (patch) | |
tree | b6aad149345dbc2e5a8724f1281cdc0f870b5b58 /drivers/video/tegra/dc/dsi.c | |
parent | f870d253aa4af4f1522cec4deb630fd01653146a (diff) |
video: tegra: dc: tag vrr modes using vmode
HDMI VRR is supported only for some resolutions, and the kernel
driver is aware of these restrictions. For VRR monitors, the kernel
driver now duplicates and tags all compatible modes with the
FB_VMODE_VRR flag in the duplicate mode's fb_videomode vmode field.
The same behavior has been added to DSI as well for consistency.
The compatible modes are duplicated before being tagged so as to
not interfere with userspace configurations that do not support
the FB_VMODE_VRR flag.
** cherry-pick note **
The original change included files that are still located in the main
kernel repo. This change only includes changes to display repo files.
Bug 1637861
Change-Id: I7acd1f9aa52096b0158ee40a1492bda59eef2bea
Signed-off-by: Daniel Solomon <daniels@nvidia.com>
(cherry picked from commit 0dfabbdd9ba299e77730228f9c3077b542041b58)
Reviewed-on: http://git-master/r/1170658
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dsi.c')
-rw-r--r-- | drivers/video/tegra/dc/dsi.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index 17a4b818d..b727a87e3 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c | |||
@@ -5884,6 +5884,43 @@ static void tegra_dc_dsi_vrr_enable(struct tegra_dc *dc, bool enable) | |||
5884 | vrr->enable = enable; | 5884 | vrr->enable = enable; |
5885 | } | 5885 | } |
5886 | 5886 | ||
5887 | void tegra_dsi_vrr_update_monspecs(struct tegra_dc *dc, | ||
5888 | struct list_head *head) | ||
5889 | { | ||
5890 | struct tegra_vrr *vrr; | ||
5891 | struct list_head *pos; | ||
5892 | struct fb_modelist *modelist; | ||
5893 | struct fb_videomode *m; | ||
5894 | struct fb_videomode m_vrr; | ||
5895 | |||
5896 | if (!head || !head->next) | ||
5897 | return; | ||
5898 | |||
5899 | vrr = dc->out->vrr; | ||
5900 | |||
5901 | if (!vrr || !vrr->capability) | ||
5902 | return; | ||
5903 | |||
5904 | /* Check whether VRR modes were already added */ | ||
5905 | list_for_each(pos, head) { | ||
5906 | modelist = list_entry(pos, struct fb_modelist, list); | ||
5907 | m = &modelist->mode; | ||
5908 | |||
5909 | if (m->vmode & FB_VMODE_VRR) | ||
5910 | return; | ||
5911 | } | ||
5912 | |||
5913 | /* For DSI VRR, the runtime mode (as opposed to initialization | ||
5914 | * mode) is the first mode in the list. We mark that first mode | ||
5915 | * as VRR-compatible by adding FB_VMODE_VRR to a duplicated instance | ||
5916 | * of this mode. */ | ||
5917 | modelist = list_entry(head->next, struct fb_modelist, list); | ||
5918 | m = &modelist->mode; | ||
5919 | m_vrr = *m; | ||
5920 | m_vrr.vmode |= FB_VMODE_VRR; | ||
5921 | fb_add_videomode(&m_vrr, head); | ||
5922 | } | ||
5923 | |||
5887 | static void tegra_dc_dsi_modeset_notifier(struct tegra_dc *dc) | 5924 | static void tegra_dc_dsi_modeset_notifier(struct tegra_dc *dc) |
5888 | { | 5925 | { |
5889 | struct tegra_dc_dsi_data *dsi = tegra_dc_get_outdata(dc); | 5926 | struct tegra_dc_dsi_data *dsi = tegra_dc_get_outdata(dc); |
@@ -5909,5 +5946,6 @@ struct tegra_dc_out_ops tegra_dc_dsi_ops = { | |||
5909 | .setup_clk = tegra_dc_dsi_setup_clk, | 5946 | .setup_clk = tegra_dc_dsi_setup_clk, |
5910 | .osidle = tegra_dc_dsi_osidle, | 5947 | .osidle = tegra_dc_dsi_osidle, |
5911 | .vrr_enable = tegra_dc_dsi_vrr_enable, | 5948 | .vrr_enable = tegra_dc_dsi_vrr_enable, |
5949 | .vrr_update_monspecs = tegra_dsi_vrr_update_monspecs, | ||
5912 | .modeset_notifier = tegra_dc_dsi_modeset_notifier, | 5950 | .modeset_notifier = tegra_dc_dsi_modeset_notifier, |
5913 | }; | 5951 | }; |