drm/tegra: dc: Initialize border color
authorThierry Reding <treding@nvidia.com>
Mon, 8 Dec 2014 14:45:39 +0000 (15:45 +0100)
committerThierry Reding <treding@nvidia.com>
Tue, 27 Jan 2015 09:14:36 +0000 (10:14 +0100)
Tegra114 and earlier support specifying the color of the border (i.e.
the active area of the screen that is not covered by any of the overlay
windows). By default this is set to a light blue, so set it to black to
comply with the requirements set by atomic modesetting.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/dc.c

index 5bab53e0f990e5c4812a9cc2f9b1201619670bf9..dbb2d00268b26fc2f2fc192fdafd3c6c9b62bdd9 100644 (file)
@@ -21,6 +21,7 @@
 #include <drm/drm_plane_helper.h>
 
 struct tegra_dc_soc_info {
+       bool supports_border_color;
        bool supports_interlacing;
        bool supports_cursor;
        bool supports_block_linear;
@@ -1036,6 +1037,9 @@ static int tegra_crtc_mode_set(struct drm_crtc *crtc,
        /* program display mode */
        tegra_dc_set_timings(dc, mode);
 
+       if (dc->soc->supports_border_color)
+               tegra_dc_writel(dc, 0, DC_DISP_BORDER_COLOR);
+
        /* interlacing isn't supported yet, so disable it */
        if (dc->soc->supports_interlacing) {
                value = tegra_dc_readl(dc, DC_DISP_INTERLACE_CONTROL);
@@ -1578,6 +1582,7 @@ static const struct host1x_client_ops dc_client_ops = {
 };
 
 static const struct tegra_dc_soc_info tegra20_dc_soc_info = {
+       .supports_border_color = true,
        .supports_interlacing = false,
        .supports_cursor = false,
        .supports_block_linear = false,
@@ -1586,6 +1591,7 @@ static const struct tegra_dc_soc_info tegra20_dc_soc_info = {
 };
 
 static const struct tegra_dc_soc_info tegra30_dc_soc_info = {
+       .supports_border_color = true,
        .supports_interlacing = false,
        .supports_cursor = false,
        .supports_block_linear = false,
@@ -1594,6 +1600,7 @@ static const struct tegra_dc_soc_info tegra30_dc_soc_info = {
 };
 
 static const struct tegra_dc_soc_info tegra114_dc_soc_info = {
+       .supports_border_color = true,
        .supports_interlacing = false,
        .supports_cursor = false,
        .supports_block_linear = false,
@@ -1602,6 +1609,7 @@ static const struct tegra_dc_soc_info tegra114_dc_soc_info = {
 };
 
 static const struct tegra_dc_soc_info tegra124_dc_soc_info = {
+       .supports_border_color = false,
        .supports_interlacing = true,
        .supports_cursor = true,
        .supports_block_linear = true,