浏览代码

disp: msm: dp: add debugfs node for bpp override

Add a debugfs node to set maximum bpp for the base panel which will
be used in both SST and MST use cases to limit the bpp.

Change-Id: I0ef7866e2b82a2078d6cdf97ee0d7226c2125b21
Signed-off-by: Nisarg Bhavsar <[email protected]>
Signed-off-by: Rajkumar Subbiah <[email protected]>
Rajkumar Subbiah 3 年之前
父节点
当前提交
0b72b0d810
共有 3 个文件被更改,包括 15 次插入4 次删除
  1. 3 1
      msm/dp/dp_debug.c
  2. 10 2
      msm/dp/dp_panel.c
  3. 2 1
      msm/dp/dp_panel.h

+ 3 - 1
msm/dp/dp_debug.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -2135,6 +2135,8 @@ static int dp_debug_init_link(struct dp_debug_private *debug,
 
 
 	debugfs_create_u32("link_bw_code", 0644, dir, &debug->panel->link_bw_code);
 	debugfs_create_u32("link_bw_code", 0644, dir, &debug->panel->link_bw_code);
 
 
+	debugfs_create_u32("max_bpp", 0644, dir, &debug->panel->max_supported_bpp);
+
 	file = debugfs_create_file("mmrm_clk_cb", 0644, dir, debug, &mmrm_clk_cb_fops);
 	file = debugfs_create_file("mmrm_clk_cb", 0644, dir, debug, &mmrm_clk_cb_fops);
 	if (IS_ERR_OR_NULL(file)) {
 	if (IS_ERR_OR_NULL(file)) {
 		rc = PTR_ERR(file);
 		rc = PTR_ERR(file);

+ 10 - 2
msm/dp/dp_panel.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 // SPDX-License-Identifier: GPL-2.0-only
 /*
 /*
- * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -19,6 +19,7 @@
 #define DP_KHZ_TO_HZ 1000
 #define DP_KHZ_TO_HZ 1000
 #define DP_PANEL_DEFAULT_BPP 24
 #define DP_PANEL_DEFAULT_BPP 24
 #define DP_MAX_DS_PORT_COUNT 1
 #define DP_MAX_DS_PORT_COUNT 1
+#define DP_PANEL_MAX_SUPPORTED_BPP 30
 
 
 #define DSC_TGT_BPP 8
 #define DSC_TGT_BPP 8
 #define DPRX_FEATURE_ENUMERATION_LIST 0x2210
 #define DPRX_FEATURE_ENUMERATION_LIST 0x2210
@@ -71,6 +72,7 @@ struct dp_panel_private {
 	struct dp_link *link;
 	struct dp_link *link;
 	struct dp_parser *parser;
 	struct dp_parser *parser;
 	struct dp_catalog_panel *catalog;
 	struct dp_catalog_panel *catalog;
+	struct dp_panel *base;
 	bool panel_on;
 	bool panel_on;
 	bool vsc_supported;
 	bool vsc_supported;
 	bool vscext_supported;
 	bool vscext_supported;
@@ -1921,13 +1923,16 @@ static u32 dp_panel_get_supported_bpp(struct dp_panel *dp_panel,
 {
 {
 	struct dp_link_params *link_params;
 	struct dp_link_params *link_params;
 	struct dp_panel_private *panel;
 	struct dp_panel_private *panel;
-	const u32 max_supported_bpp = 30;
+	u32 max_supported_bpp = dp_panel->max_supported_bpp;
 	u32 min_supported_bpp = 18;
 	u32 min_supported_bpp = 18;
 	u32 bpp = 0, link_bitrate = 0, mode_bitrate;
 	u32 bpp = 0, link_bitrate = 0, mode_bitrate;
 	s64 rate_fp = 0;
 	s64 rate_fp = 0;
 
 
 	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
 	panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
 
 
+	if (dp_panel->mst_state && panel->base)
+		max_supported_bpp = panel->base->max_supported_bpp;
+
 	if (dsc_en)
 	if (dsc_en)
 		min_supported_bpp = 24;
 		min_supported_bpp = 24;
 
 
@@ -3155,6 +3160,8 @@ struct dp_panel *dp_panel_get(struct dp_panel_in *in)
 	dp_panel->spd_enabled = true;
 	dp_panel->spd_enabled = true;
 	dp_panel->link_bw_code = 0;
 	dp_panel->link_bw_code = 0;
 	dp_panel->lane_count = 0;
 	dp_panel->lane_count = 0;
+	dp_panel->max_supported_bpp = DP_PANEL_MAX_SUPPORTED_BPP;
+
 	memcpy(panel->spd_vendor_name, vendor_name, (sizeof(u8) * 8));
 	memcpy(panel->spd_vendor_name, vendor_name, (sizeof(u8) * 8));
 	memcpy(panel->spd_product_description, product_desc, (sizeof(u8) * 16));
 	memcpy(panel->spd_product_description, product_desc, (sizeof(u8) * 16));
 	dp_panel->connector = in->connector;
 	dp_panel->connector = in->connector;
@@ -3164,6 +3171,7 @@ struct dp_panel *dp_panel_get(struct dp_panel_in *in)
 	dp_panel->dsc_continuous_pps = panel->parser->dsc_continuous_pps;
 	dp_panel->dsc_continuous_pps = panel->parser->dsc_continuous_pps;
 
 
 	if (in->base_panel) {
 	if (in->base_panel) {
+		panel->base = in->base_panel;
 		memcpy(dp_panel->dpcd, in->base_panel->dpcd,
 		memcpy(dp_panel->dpcd, in->base_panel->dpcd,
 				DP_RECEIVER_CAP_SIZE + 1);
 				DP_RECEIVER_CAP_SIZE + 1);
 		memcpy(dp_panel->dsc_dpcd, in->base_panel->dsc_dpcd,
 		memcpy(dp_panel->dsc_dpcd, in->base_panel->dsc_dpcd,

+ 2 - 1
msm/dp/dp_panel.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
 /*
- * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  */
  */
 
 
@@ -125,6 +125,7 @@ struct dp_panel {
 	u32 max_bw_code;
 	u32 max_bw_code;
 	u32 lane_count;
 	u32 lane_count;
 	u32 link_bw_code;
 	u32 link_bw_code;
+	u32 max_supported_bpp;
 
 
 	/* By default, stream_id is assigned to DP_INVALID_STREAM.
 	/* By default, stream_id is assigned to DP_INVALID_STREAM.
 	 * Client sets the stream id value using set_stream_id interface.
 	 * Client sets the stream id value using set_stream_id interface.