TRANSCONF() expands via _MMIO_PIPE2, i.e., it uses pipe-based addressing.
In GVT, some call sites pass an enum transcoder to TRANSCONF(), which now
routes through INTEL_DISPLAY_DEVICE_PIPE_OFFSET() and ultimately calls
intel_display_device_pipe_offset(), whose parameter type is enum pipe.
This results in -Werror=enum-conversion.
To address this, cast the index to enum pipe in the GVT-side macro
override.
This works for all cases as TRANSCODER_{A,B,C,D} all have 1:1 mapping to
PIPE_{A,B,C,D} except for TRANSCODER_EDP.
There is one place which uses TRANSCONF() with TRANSCODER_EDP, which
appears to be incorrect. In any case, the cast preserves the previous
behaviour.
Signed-off-by: Ankit Nautiyal <[email protected]>
---
drivers/gpu/drm/i915/gvt/display_helpers.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/gvt/display_helpers.h
b/drivers/gpu/drm/i915/gvt/display_helpers.h
index 97ebc92768fc..3af878e3d78e 100644
--- a/drivers/gpu/drm/i915/gvt/display_helpers.h
+++ b/drivers/gpu/drm/i915/gvt/display_helpers.h
@@ -17,8 +17,8 @@
#ifdef INTEL_DISPLAY_DEVICE_PIPE_OFFSET
#undef INTEL_DISPLAY_DEVICE_PIPE_OFFSET
#endif
-#define INTEL_DISPLAY_DEVICE_PIPE_OFFSET(display, pipe) \
- intel_display_device_pipe_offset((display), (pipe))
+#define INTEL_DISPLAY_DEVICE_PIPE_OFFSET(display, idx) \
+ intel_display_device_pipe_offset((display), (enum pipe)(idx))
#ifdef INTEL_DISPLAY_DEVICE_TRANS_OFFSET
#undef INTEL_DISPLAY_DEVICE_TRANS_OFFSET
--
2.45.2