arm: tegra: eDP vs DP
Shu Zhong [Fri, 10 Apr 2015 20:01:59 +0000 (13:01 -0700)]
Added new TEGRA_DC_EXT_EDP type so that hwcomposer
can distinguish between internal and external
dp panels. TEGRA_DC_EXT_EDP is set based on
the 'nvidia,is_ext_dp_panel' prop.

Bug 200041308

Change-Id: Ie805d7eae6edd20542c81a16a279e1686309a047
Signed-off-by: Shu Zhong <shuz@nvidia.com>
Reviewed-on: http://git-master/r/731585
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mitch Luban <mluban@nvidia.com>
Tested-by: Mitch Luban <mluban@nvidia.com>

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/ext/control.c
drivers/video/tegra/dc/of_dc.c
include/video/tegra_dc_ext.h

index c9ac2aa..0f8f48c 100644 (file)
@@ -691,6 +691,8 @@ struct tegra_dc_out {
        int                     user_needs_vblank;
        struct completion       user_vblank_comp;
 
+       bool                            is_ext_dp_panel;
+
        int     (*enable)(struct device *);
        int     (*postpoweron)(struct device *);
        int     (*prepoweroff)(void);
@@ -1095,6 +1097,8 @@ void tegra_get_fb_resource(struct resource *fb_res);
 void tegra_get_fb2_resource(struct resource *fb2_res);
 unsigned tegra_dc_out_flags_from_dev(struct device *dev);
 
+bool tegra_dc_is_ext_dp_panel(const struct tegra_dc *dc);
+
 /* table of electrical settings, must be in acending order. */
 struct tmds_config {
        u32 version;    /* MAJOR, MINOR */
index a1b17e6..4151789 100644 (file)
@@ -2500,6 +2500,13 @@ int tegra_dc_get_out(const struct tegra_dc *dc)
        return -EINVAL;
 }
 
+bool tegra_dc_is_ext_dp_panel(const struct tegra_dc *dc)
+{
+       if (dc && dc->out)
+               return dc->out->is_ext_dp_panel;
+       return false;
+}
+
 unsigned tegra_dc_get_out_height(const struct tegra_dc *dc)
 {
        unsigned height = 0;
index 36057eb..4e4df39 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * drivers/video/tegra/dc/ext/control.c
  *
- * Copyright (c) 2011-2014, NVIDIA CORPORATION, All rights reserved.
+ * Copyright (c) 2011-2015, NVIDIA CORPORATION, All rights reserved.
  *
  * Author: Robert Morell <rmorell@nvidia.com>
  *
@@ -87,7 +87,8 @@ get_output_properties(struct tegra_dc_ext_control_output_properties *properties)
        case TEGRA_DC_OUT_DP:
        case TEGRA_DC_OUT_NVSR_DP:
        case TEGRA_DC_OUT_FAKE_DP:
-               properties->type = TEGRA_DC_EXT_DP;
+               properties->type = tegra_dc_is_ext_dp_panel(dc) ?
+                                       TEGRA_DC_EXT_DP : TEGRA_DC_EXT_EDP;
                break;
        case TEGRA_DC_OUT_NULL:
                properties->type = TEGRA_DC_EXT_NULL;
index 6e18409..3df3bac 100644 (file)
@@ -2308,6 +2308,10 @@ struct tegra_dc_platform_data
        }
 #endif
 
+       if (pdata->default_out->type == TEGRA_DC_OUT_DP)
+               pdata->default_out->is_ext_dp_panel = of_property_read_bool(
+                               np_target_disp, "nvidia,is_ext_dp_panel");
+
        dev_info(&ndev->dev, "DT parsed successfully\n");
        of_node_put(default_out_np);
        of_node_put(timings_np);
index cf2eeea..a59ff41 100644 (file)
@@ -543,6 +543,7 @@ enum tegra_dc_ext_control_output_type {
        TEGRA_DC_EXT_HDMI,
        TEGRA_DC_EXT_DVI,
        TEGRA_DC_EXT_DP,
+       TEGRA_DC_EXT_EDP,
        TEGRA_DC_EXT_NULL,
 };