[Intel-gfx] [PATCH v2 3/3] drm/i915: Add code comment on assumption of pipe==transcoder

Imre Deak imre.deak at intel.com
Mon Nov 19 21:56:35 UTC 2018


Add a comment to the pipe and transcoder enum definitions about our
assumption in the code about enum values for pipes and transcoders
with a 1:1 transcoder->pipe mapping.

v2:
- Clarify more what are the assumptions about the enum values. (Ville)

Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Cc: Mika Kahola <mika.kahola at intel.com>
Signed-off-by: Imre Deak <imre.deak at intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_display.h b/drivers/gpu/drm/i915/intel_display.h
index 43eb4ebbcc35..846f63d056fb 100644
--- a/drivers/gpu/drm/i915/intel_display.h
+++ b/drivers/gpu/drm/i915/intel_display.h
@@ -43,6 +43,11 @@ enum i915_gpio {
 	GPIOM,
 };
 
+/*
+ * Keep the pipe enum values fixed: the code assumes that PIPE_A=0, the
+ * rest have consecutive values and match the enum values of transcoders
+ * with a 1:1 transcoder->pipe mapping.
+ */
 enum pipe {
 	INVALID_PIPE = -1,
 
@@ -57,9 +62,20 @@ enum pipe {
 #define pipe_name(p) ((p) + 'A')
 
 enum transcoder {
+	/*
+	 * The following transcoders have a 1:1 transcoder->pipe mapping, keep
+	 * their values fixed: the code assumes that TRANSCODER_A=0, the rest
+	 * have consecutive values and match the enum values of the pipes they
+	 * map to.
+	 */
 	TRANSCODER_A = 0,
 	TRANSCODER_B,
 	TRANSCODER_C,
+
+	/*
+	 * The following transcoders can map to any pipe, their enum value
+	 * doesn't need to stay fixed.
+	 */
 	TRANSCODER_EDP,
 	TRANSCODER_DSI_0,
 	TRANSCODER_DSI_1,
-- 
2.13.2



More information about the Intel-gfx mailing list