summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNarender Ankam <nankam@codeaurora.org>2021-09-15 15:10:07 +0530
committerNarender Ankam <nankam@codeaurora.org>2021-09-29 15:29:50 +0530
commit5b6aedd27f558a420b9770c11e5c542335a1da21 (patch)
tree0cf24551c4a7fd6848610879a85a0ff9b239f04c
parent1ff0a561f09a033223408f459f8f8e0bf94141bf (diff)
downloaddisplay-drivers-5b6aedd27f558a420b9770c11e5c542335a1da21.tar.gz
disp: msm: dp: parse displayport label dt property
Add logic in DP driver to parse "label" dt property. This info will be useful to configure DP as primary or secondary. Change-Id: I708179c5940c82256034bc6c8338b01ee52f2f79 Signed-off-by: Narender Ankam <nankam@codeaurora.org>
-rw-r--r--msm/dp/dp_display.c24
-rw-r--r--msm/dp/dp_display.h5
-rw-r--r--msm/dp/dp_drm.c15
-rw-r--r--msm/dp/dp_drm.h21
-rw-r--r--msm/dp/dp_parser.c6
-rw-r--r--msm/dp/dp_parser.h5
-rw-r--r--msm/sde/sde_kms.c3
7 files changed, 72 insertions, 7 deletions
diff --git a/msm/dp/dp_display.c b/msm/dp/dp_display.c
index af3bc736..623b3022 100644
--- a/msm/dp/dp_display.c
+++ b/msm/dp/dp_display.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/module.h>
@@ -2570,6 +2570,27 @@ static int dp_display_config_hdr(struct dp_display *dp_display, void *panel,
core_clk_rate, flush_hdr);
}
+static int dp_display_get_display_type(struct dp_display *dp_display,
+ const char **display_type)
+{
+ struct dp_display_private *dp;
+
+ if (!dp_display || !display_type) {
+ pr_err("invalid input\n");
+ return -EINVAL;
+ }
+
+ dp = container_of(dp_display, struct dp_display_private, dp_display);
+
+ *display_type = dp->parser->display_type;
+
+ if (!strcmp(*display_type, "primary"))
+ dp_display->is_primary = true;
+
+ return 0;
+}
+
+
static int dp_display_setup_colospace(struct dp_display *dp_display,
void *panel,
u32 colorspace)
@@ -3100,6 +3121,7 @@ static int dp_display_probe(struct platform_device *pdev)
g_dp_display->post_open = NULL;
g_dp_display->post_init = dp_display_post_init;
g_dp_display->config_hdr = dp_display_config_hdr;
+ g_dp_display->get_display_type = dp_display_get_display_type;
g_dp_display->mst_install = dp_display_mst_install;
g_dp_display->mst_uninstall = dp_display_mst_uninstall;
g_dp_display->mst_connector_install = dp_display_mst_connector_install;
diff --git a/msm/dp/dp_display.h b/msm/dp/dp_display.h
index ebfeb1d6..3f4b8d9b 100644
--- a/msm/dp/dp_display.h
+++ b/msm/dp/dp_display.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
*/
#ifndef _DP_DISPLAY_H_
@@ -72,6 +72,7 @@ struct dp_display {
u32 max_pclk_khz;
u32 no_mst_encoder;
void *dp_mst_prv_info;
+ bool is_primary;
int (*enable)(struct dp_display *dp_display, void *panel);
int (*post_enable)(struct dp_display *dp_display, void *panel);
@@ -126,6 +127,8 @@ struct dp_display {
struct drm_connector *connector, char *pps_cmd);
void (*wakeup_phy_layer)(struct dp_display *dp_display,
bool wakeup);
+ int (*get_display_type)(struct dp_display *dp_display,
+ const char **display_type);
};
#ifdef CONFIG_DRM_MSM_DP
diff --git a/msm/dp/dp_drm.c b/msm/dp/dp_drm.c
index 976e0ebb..30446724 100644
--- a/msm/dp/dp_drm.c
+++ b/msm/dp/dp_drm.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved.
*/
#include <drm/drm_atomic_helper.h>
@@ -580,6 +580,19 @@ int dp_connector_get_modes(struct drm_connector *connector,
return rc;
}
+int dp_connnector_set_info_blob(struct drm_connector *connector,
+ void *info, void *display, struct msm_mode_info *mode_info)
+{
+ struct dp_display *dp_display = display;
+ const char *display_type = NULL;
+
+ dp_display->get_display_type(dp_display, &display_type);
+ sde_kms_info_add_keystr(info,
+ "display type", display_type);
+
+ return 0;
+}
+
int dp_drm_bridge_init(void *data, struct drm_encoder *encoder)
{
int rc = 0;
diff --git a/msm/dp/dp_drm.h b/msm/dp/dp_drm.h
index 07f606e8..930b3aa9 100644
--- a/msm/dp/dp_drm.h
+++ b/msm/dp/dp_drm.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019, 2021, The Linux Foundation. All rights reserved.
*/
#ifndef _DP_DRM_H_
@@ -177,6 +177,18 @@ int dp_mst_init(struct dp_display *dp_display);
* @display: Pointer to private display structure
*/
void dp_mst_deinit(struct dp_display *dp_display);
+
+/**
+ * dp_conn_set_info_blob - callback to perform info blob initialization
+ * @connector: Pointer to drm connector structure
+ * @info: Pointer to sde connector info structure
+ * @display: Pointer to private display handle
+ * @mode_info: Pointer to mode info structure
+ * Returns: Zero on success
+ */
+int dp_connnector_set_info_blob(struct drm_connector *connector,
+ void *info, void *display, struct msm_mode_info *mode_info);
+
#else
static inline int dp_connector_config_hdr(struct drm_connector *connector,
void *display, struct sde_connector_state *c_state)
@@ -278,6 +290,13 @@ static inline int dp_mst_deinit(struct dp_display *dp_display)
{
return 0;
}
+
+int dp_connnector_set_info_blob(struct drm_connector *connector,
+ void *info, void *display, struct msm_mode_info *mode_info)
+{
+ return 0;
+}
+
#endif
#endif /* _DP_DRM_H_ */
diff --git a/msm/dp/dp_parser.c b/msm/dp/dp_parser.c
index 40a2401b..4c37aa2c 100644
--- a/msm/dp/dp_parser.c
+++ b/msm/dp/dp_parser.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*/
#include <linux/of_gpio.h>
@@ -166,6 +166,10 @@ static int dp_parser_misc(struct dp_parser *parser)
if (rc)
parser->max_lclk_khz = DP_MAX_LINK_CLK_KHZ;
+ parser->display_type = of_get_property(of_node, "label", NULL);
+ if (!parser->display_type)
+ parser->display_type = "unknown";
+
return 0;
}
diff --git a/msm/dp/dp_parser.h b/msm/dp/dp_parser.h
index 0970dff7..5d937ca2 100644
--- a/msm/dp/dp_parser.h
+++ b/msm/dp/dp_parser.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
- * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
*/
#ifndef _DP_PARSER_H_
@@ -198,6 +198,7 @@ static inline char *dp_phy_aux_config_type_to_string(u32 cfg_type)
* @max_dp_dsc_input_width_pixs: Maximum input width for DSC block
* @has_widebus: widebus (2PPC) feature eanble status
*@mst_fixed_port: mst port_num reserved for fixed topology
+ * @display_type: display type as defined in device tree.
* @parse: function to be called by client to parse device tree.
* @get_io: function to be called by client to get io data.
* @get_io_buf: function to be called by client to get io buffers.
@@ -230,6 +231,8 @@ struct dp_parser {
bool lphw_hpd;
u32 mst_fixed_port[MAX_DP_MST_STREAMS];
+ const char *display_type;
+
int (*parse)(struct dp_parser *parser);
struct dp_io_data *(*get_io)(struct dp_parser *parser, char *name);
void (*get_io_buf)(struct dp_parser *parser, char *name);
diff --git a/msm/sde/sde_kms.c b/msm/sde/sde_kms.c
index f2f5f971..d5ac13a6 100644
--- a/msm/sde/sde_kms.c
+++ b/msm/sde/sde_kms.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2021, The Linux Foundation. All rights reserved.
* Copyright (C) 2013 Red Hat
* Author: Rob Clark <robdclark@gmail.com>
*
@@ -1450,6 +1450,7 @@ static int _sde_kms_setup_displays(struct drm_device *dev,
.get_panel_vfp = NULL,
};
static const struct sde_connector_ops dp_ops = {
+ .set_info_blob = dp_connnector_set_info_blob,
.post_init = dp_connector_post_init,
.detect = dp_connector_detect,
.get_modes = dp_connector_get_modes,