Browse Source

disp: msm: dp: compile MST feature based on display config

Add a compile time flag for the MST feature that will allow
selectively enabling the feature.

Change-Id: I8bf288277c7af00c3cf254a8c757151559e0a010
Signed-off-by: Tatenda Chipeperekwa <[email protected]>
Tatenda Chipeperekwa 5 years ago
parent
commit
51805afe28
5 changed files with 70 additions and 47 deletions
  1. 2 1
      msm/Makefile
  2. 1 0
      msm/dp/dp_drm.c
  3. 1 46
      msm/dp/dp_drm.h
  4. 65 0
      msm/dp/dp_mst_drm.h
  5. 1 0
      msm/sde/sde_kms.c

+ 2 - 1
msm/Makefile

@@ -22,10 +22,11 @@ msm_drm-$(CONFIG_DRM_MSM_DP) += dp/dp_usbpd.o \
 	dp/dp_display.o \
 	dp/dp_drm.o \
 	dp/dp_hdcp2p2.o \
-	dp/dp_mst_drm.o \
 	sde_hdcp_1x.o \
 	sde_hdcp_2x.o \
 
+msm_drm-$(CONFIG_DRM_MSM_DP_MST) += dp/dp_mst_drm.o \
+
 msm_drm-$(CONFIG_DRM_MSM_SDE) += sde/sde_crtc.o \
 	sde/sde_encoder.o \
 	sde/sde_encoder_dce.o \

+ 1 - 0
msm/dp/dp_drm.c

@@ -11,6 +11,7 @@
 #include "msm_kms.h"
 #include "sde_connector.h"
 #include "dp_drm.h"
+#include "dp_mst_drm.h"
 #include "dp_debug.h"
 
 #define DP_MST_DEBUG(fmt, ...) DP_DEBUG(fmt, ##__VA_ARGS__)

+ 1 - 46
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-2020, The Linux Foundation. All rights reserved.
  */
 
 #ifndef _DP_DRM_H_
@@ -151,31 +151,6 @@ void convert_to_drm_mode(const struct dp_display_mode *dp_mode,
 int dp_connector_update_pps(struct drm_connector *connector,
 		char *pps_cmd, void *display);
 
-/**
- * dp_mst_drm_bridge_init - initialize mst bridge
- * @display: Pointer to private display structure
- * @encoder: Pointer to encoder for mst bridge mapping
- */
-int dp_mst_drm_bridge_init(void *display,
-	struct drm_encoder *encoder);
-
-/**
- * dp_mst_drm_bridge_deinit - de-initialize mst bridges
- * @display: Pointer to private display structure
- */
-void dp_mst_drm_bridge_deinit(void *display);
-
-/**
- * dp_mst_init - initialize mst objects for the given display
- * @display: Pointer to private display structure
- */
-int dp_mst_init(struct dp_display *dp_display);
-
-/**
- * dp_mst_deinit - de-initialize mst objects for the given display
- * @display: Pointer to private display structure
- */
-void dp_mst_deinit(struct dp_display *dp_display);
 #else
 static inline int dp_connector_config_hdr(struct drm_connector *connector,
 		void *display, struct sde_connector_state *c_state)
@@ -256,26 +231,6 @@ static inline void convert_to_drm_mode(const struct dp_display_mode *dp_mode,
 				struct drm_display_mode *drm_mode)
 {
 }
-
-static inline int dp_mst_drm_bridge_init(void *display,
-	struct drm_encoder *encoder)
-{
-	return 0;
-}
-
-static inline void dp_mst_drm_bridge_deinit(void *display)
-{
-}
-
-static inline int dp_mst_init(struct dp_display *dp_display)
-{
-	return 0;
-}
-
-static inline int dp_mst_deinit(struct dp_display *dp_display)
-{
-	return 0;
-}
 #endif
 
 #endif /* _DP_DRM_H_ */

+ 65 - 0
msm/dp/dp_mst_drm.h

@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _DP_MST_DRM_H_
+#define _DP_MST_DRM_H_
+
+#include <linux/types.h>
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
+
+#include "dp_display.h"
+
+#ifdef CONFIG_DRM_MSM_DP_MST
+
+/**
+ * dp_mst_drm_bridge_init - initialize mst bridge
+ * @display: Pointer to private display structure
+ * @encoder: Pointer to encoder for mst bridge mapping
+ */
+int dp_mst_drm_bridge_init(void *display,
+	struct drm_encoder *encoder);
+
+/**
+ * dp_mst_drm_bridge_deinit - de-initialize mst bridges
+ * @display: Pointer to private display structure
+ */
+void dp_mst_drm_bridge_deinit(void *display);
+
+/**
+ * dp_mst_init - initialize mst objects for the given display
+ * @display: Pointer to private display structure
+ */
+int dp_mst_init(struct dp_display *dp_display);
+
+/**
+ * dp_mst_deinit - de-initialize mst objects for the given display
+ * @display: Pointer to private display structure
+ */
+void dp_mst_deinit(struct dp_display *dp_display);
+#else
+
+static inline int dp_mst_drm_bridge_init(void *display,
+	struct drm_encoder *encoder)
+{
+	return 0;
+}
+
+static inline void dp_mst_drm_bridge_deinit(void *display)
+{
+}
+
+static inline int dp_mst_init(struct dp_display *dp_display)
+{
+	return 0;
+}
+
+static inline int dp_mst_deinit(struct dp_display *dp_display)
+{
+	return 0;
+}
+#endif
+
+#endif /* _DP_MST_DRM_H_ */

+ 1 - 0
msm/sde/sde_kms.c

@@ -37,6 +37,7 @@
 #include "sde_wb.h"
 #include "dp_display.h"
 #include "dp_drm.h"
+#include "dp_mst_drm.h"
 
 #include "sde_kms.h"
 #include "sde_core_irq.h"