]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/i915/gvt: Change for_each_pipe to use pipe_valid API
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Fri, 19 Dec 2025 06:02:57 +0000 (11:32 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 29 Dec 2025 12:13:38 +0000 (17:43 +0530)
commitd805e879e15a126a00da2fd02cef0ad353365c6a
tree8985f0de9fb6b0393311270962c817959a976c82
parentd6a3a678569431ed816ac490bf489541bc87b424
drm/i915/gvt: Change for_each_pipe to use pipe_valid API

Add a new API to check if a given pipe is valid using
DISPLAY_RUNTIME_INFO() for GVT.

Update GVT to use this API instead of accessing
`DISPLAY_RUNTIME_INFO->pipe_mask` directly in the `for_each_pipe` macro.

Since `for_each_pipe` is defined in i915/display/intel_display.h, which
also contains other macros used by gvt/display.c, we cannot drop the
intel_display.h header yet. This causes a build error because
`for_each_pipe` is included from both i915/display/intel_display.h and
gvt/display_helpers.h.

To resolve this, rename the GVT macro to `gvt_for_each_pipe` and make it
call the new API. This avoids exposing display internals and prepares for
display modularization.

v2:
 - Expose API to check if pipe is valid rather than the runtime info
   pipe mask. (Jani)
 - Rename the macro to `gvt_for_each_pipe` to resolve build error.
v3:
 - Use EXPORT_SYMBOL_NS_GPL(..., "I915_GVT"); (Jani)
 - Use enum pipe at call sites instead of casting in the macro. (Jani)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patch.msgid.link/20251219060302.2365123-5-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_gvt_api.c
drivers/gpu/drm/i915/display/intel_gvt_api.h
drivers/gpu/drm/i915/gvt/display.c
drivers/gpu/drm/i915/gvt/display_helpers.h