On 12/15/2025 5:33 PM, Jani Nikula wrote:
On Mon, 15 Dec 2025, Ankit Nautiyal <[email protected]> wrote:
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.
Maybe the question to ask is if TRANSCONF() using _MMIO_PIPE2() is
correct or not?


Yeah I was wondering that, that's the reason I separated out this patch.

Hehe .. Just wanted to make sure with others, before going down that rabbit hole. :D

On the serious note,the suspected transcoder EDP usage in gvt is also highlighted in the commit that replaced PIPECONF with TRANSCONF:


3eb08ea58e57 ("drm/i915: s/PIPECONF/TRANSCONF/")

I guess we are supposed to use TRANSCODERS A - D which map to PIPES A - D.

For other transcoders like EDP/DSI we should perhaps find their pipes A-D(cast them to transcoder enum) and then call TRANSCONF.


Regards,

Ankit



BR,
Jani.

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 d11ebb03b946..fb75cc9f97cc 100644
--- a/drivers/gpu/drm/i915/gvt/display_helpers.h
+++ b/drivers/gpu/drm/i915/gvt/display_helpers.h
@@ -21,8 +21,8 @@ struct display;
  #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

Reply via email to