diff options
author | Imre Deak <imre.deak@intel.com> | 2018-11-20 04:23:25 -0500 |
---|---|---|
committer | Imre Deak <imre.deak@intel.com> | 2018-11-21 06:38:27 -0500 |
commit | 8f78df90d84acd7a0b22c2b44a258421063a972f (patch) | |
tree | b89370872b43af7a9c31a984ccea524028aa33db /drivers | |
parent | c0871805ce1c716889c02450e507b420cb5e6d26 (diff) |
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')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.h | 22 |
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 { | |||
43 | GPIOM, | 43 | GPIOM, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | /* | ||
47 | * Keep the pipe enum values fixed: the code assumes that PIPE_A=0, the | ||
48 | * rest have consecutive values and match the enum values of transcoders | ||
49 | * with a 1:1 transcoder -> pipe mapping. | ||
50 | */ | ||
46 | enum pipe { | 51 | enum pipe { |
47 | INVALID_PIPE = -1, | 52 | INVALID_PIPE = -1, |
48 | 53 | ||
@@ -57,9 +62,20 @@ enum pipe { | |||
57 | #define pipe_name(p) ((p) + 'A') | 62 | #define pipe_name(p) ((p) + 'A') |
58 | 63 | ||
59 | enum transcoder { | 64 | enum transcoder { |
60 | TRANSCODER_A = 0, | 65 | /* |
61 | TRANSCODER_B, | 66 | * The following transcoders have a 1:1 transcoder -> pipe mapping, |
62 | TRANSCODER_C, | 67 | * keep their values fixed: the code assumes that TRANSCODER_A=0, the |
68 | * rest have consecutive values and match the enum values of the pipes | ||
69 | * they map to. | ||
70 | */ | ||
71 | TRANSCODER_A = PIPE_A, | ||
72 | TRANSCODER_B = PIPE_B, | ||
73 | TRANSCODER_C = PIPE_C, | ||
74 | |||
75 | /* | ||
76 | * The following transcoders can map to any pipe, their enum value | ||
77 | * doesn't need to stay fixed. | ||
78 | */ | ||
63 | TRANSCODER_EDP, | 79 | TRANSCODER_EDP, |
64 | TRANSCODER_DSI_0, | 80 | TRANSCODER_DSI_0, |
65 | TRANSCODER_DSI_1, | 81 | TRANSCODER_DSI_1, |