Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96d70542 authored by Narender Ankam's avatar Narender Ankam Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dp: add display-type support in dp



Add display-type in connector's capability blob for DP-SST.
This allows user to configure DP as primary display.

Change-Id: Ib5f6d9d72e8c42f88d38e06ed504848b8fc52029
Signed-off-by: default avatarXiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: default avatarNarender Ankam <nankam@codeaurora.org>
Signed-off-by: default avatarChirag Khurana <ckhurana@codeaurora.org>
parent b6e39e59
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -1435,6 +1435,28 @@ static int dp_display_config_hdr(struct dp_display *dp_display,
	return rc;
}

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;
	else
		dp_display->is_primary = false;

	return 0;
}

static int dp_display_create_workqueue(struct dp_display_private *dp)
{
	dp->wq = create_singlethread_workqueue("drm_dp");
@@ -1499,6 +1521,7 @@ static int dp_display_probe(struct platform_device *pdev)
	g_dp_display->post_open     = dp_display_post_open;
	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;

	rc = component_add(&pdev->dev, &dp_display_comp_ops);
	if (rc) {
+3 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ struct dp_display {
	struct dp_bridge *bridge;
	struct drm_connector *connector;
	bool is_connected;
	bool is_primary;
	u32 max_pclk_khz;
	bool yuv_support;

@@ -50,6 +51,8 @@ struct dp_display {
	int (*config_hdr)(struct dp_display *dp_display,
				struct drm_msm_ext_hdr_metadata *hdr_meta);
	void (*post_init)(struct dp_display *dp_display);
	int (*get_display_type)(struct dp_display *dp_display,
			const char **display_type);
};

int dp_display_get_num_of_displays(void);
+14 −0
Original line number Diff line number Diff line
@@ -439,6 +439,7 @@ int dp_connector_get_info(struct msm_display_info *info, void *data)
	info->num_of_h_tiles = 1;
	info->h_tile_instance[0] = 0;
	info->is_connected = display->is_connected;
	info->is_primary = display->is_primary;
	info->capabilities = MSM_DISPLAY_CAP_VID_MODE | MSM_DISPLAY_CAP_EDID |
		MSM_DISPLAY_CAP_HOT_PLUG;

@@ -597,6 +598,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;
+12 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -99,6 +99,17 @@ int dp_connector_get_info(struct msm_display_info *info, void *display);
 */
void dp_connector_post_open(void *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);

int dp_drm_bridge_init(void *display,
	struct drm_encoder *encoder);

+5 −0
Original line number Diff line number Diff line
@@ -160,6 +160,11 @@ static int dp_parser_misc(struct dp_parser *parser)
	parser->yuv_support = of_property_read_bool(of_node,
			"qcom,yuv-support");

	parser->display_type = of_get_property(of_node,
			"qcom,display-type", NULL);
	if (!parser->display_type)
		parser->display_type = "unknown";

	return 0;
}

Loading