summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.h
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2018-11-20 11:23:25 +0200
committerImre Deak <imre.deak@intel.com>2018-11-21 13:38:27 +0200
commit8f78df90d84acd7a0b22c2b44a258421063a972f (patch)
treeb89370872b43af7a9c31a984ccea524028aa33db /drivers/gpu/drm/i915/intel_display.h
parentc0871805ce1c716889c02450e507b420cb5e6d26 (diff)
downloadlinux-stable-8f78df90d84acd7a0b22c2b44a258421063a972f.tar.gz
linux-stable-8f78df90d84acd7a0b22c2b44a258421063a972f.tar.bz2
linux-stable-8f78df90d84acd7a0b22c2b44a258421063a972f.zip
drm/i915: Add code comment on assumption of pipe==transcoder
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) v3: (Lucas) - s/->/ -> / so it looks less like pointer dereferencing. - Use pipe enums as initializers in the transcoder enum definition. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v2) Link: https://patchwork.freedesktop.org/patch/msgid/20181120092325.21249-3-imre.deak@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.h')
-rw-r--r--drivers/gpu/drm/i915/intel_display.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.h b/drivers/gpu/drm/i915/intel_display.h
index 43eb4ebbcc35..5f2955b944da 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 {
- TRANSCODER_A = 0,
- TRANSCODER_B,
- TRANSCODER_C,
+ /*
+ * 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 = PIPE_A,
+ TRANSCODER_B = PIPE_B,
+ TRANSCODER_C = PIPE_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,