]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: add .vgpu_active to parent interface
authorJani Nikula <jani.nikula@intel.com>
Mon, 17 Nov 2025 09:16:11 +0000 (11:16 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 19 Nov 2025 17:33:43 +0000 (19:33 +0200)
Add .vgpu_active() to display parent interface, removing more
dependencies on struct drm_i915_private, i915_drv.h, and i915_vgpu.h.

This also allows us to remove the xe compat i915_vgpu.h.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/a2d4043ebaaf8f69bb738d5d1332afd2847550ad.1763370931.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_crtc.c
drivers/gpu/drm/i915/display/intel_fbc.c
drivers/gpu/drm/i915/display/intel_parent.c
drivers/gpu/drm/i915/display/intel_parent.h
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/xe/compat-i915-headers/i915_vgpu.h [deleted file]
include/drm/intel/display_parent_interface.h

index 9d2a23c96c61b93fce7ab9a7c8cae3c2e1776c11..153ff4b4b52c54a13b222a3b7973b7e975d42bd0 100644 (file)
@@ -13,8 +13,6 @@
 #include <drm/drm_vblank.h>
 #include <drm/drm_vblank_work.h>
 
-#include "i915_drv.h"
-#include "i915_vgpu.h"
 #include "i9xx_plane.h"
 #include "icl_dsi.h"
 #include "intel_atomic.h"
@@ -28,6 +26,7 @@
 #include "intel_drrs.h"
 #include "intel_dsi.h"
 #include "intel_fifo_underrun.h"
+#include "intel_parent.h"
 #include "intel_pipe_crc.h"
 #include "intel_plane.h"
 #include "intel_psr.h"
@@ -671,7 +670,6 @@ void intel_pipe_update_end(struct intel_atomic_state *state,
        int scanline_end = intel_get_crtc_scanline(crtc);
        u32 end_vbl_count = intel_crtc_get_vblank_counter(crtc);
        ktime_t end_vbl_time = ktime_get();
-       struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
 
        drm_WARN_ON(display->drm, new_crtc_state->use_dsb);
 
@@ -737,7 +735,7 @@ void intel_pipe_update_end(struct intel_atomic_state *state,
 
        local_irq_enable();
 
-       if (intel_vgpu_active(dev_priv))
+       if (intel_parent_vgpu_active(display))
                goto out;
 
        if (crtc->debug.start_vbl_count &&
index 205c7266af4354f4dc35fe3246c9d4868e0c05de..cfadc69010a46a480b20123a5fe2a34944ddbe66 100644 (file)
@@ -50,7 +50,6 @@
 #include "gt/intel_gt_types.h"
 
 #include "i915_drv.h"
-#include "i915_vgpu.h"
 #include "i915_vma.h"
 #include "i9xx_plane_regs.h"
 #include "intel_de.h"
@@ -64,6 +63,7 @@
 #include "intel_fbc.h"
 #include "intel_fbc_regs.h"
 #include "intel_frontbuffer.h"
+#include "intel_parent.h"
 
 #define for_each_fbc_id(__display, __fbc_id) \
        for ((__fbc_id) = INTEL_FBC_A; (__fbc_id) < I915_MAX_FBCS; (__fbc_id)++) \
@@ -1485,7 +1485,6 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
                                 struct intel_plane *plane)
 {
        struct intel_display *display = to_intel_display(state->base.dev);
-       struct drm_i915_private *i915 = to_i915(display->drm);
        struct intel_plane_state *plane_state =
                intel_atomic_get_new_plane_state(state, plane);
        const struct drm_framebuffer *fb = plane_state->hw.fb;
@@ -1501,7 +1500,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
                return 0;
        }
 
-       if (intel_vgpu_active(i915)) {
+       if (intel_parent_vgpu_active(display)) {
                plane_state->no_fbc_reason = "VGPU active";
                return 0;
        }
index 375713f6f411098262f21dc7e0c27935555b334b..3786fd42827d34f6919340bc50077560a7cdbf5d 100644 (file)
@@ -31,3 +31,8 @@ void intel_parent_irq_synchronize(struct intel_display *display)
 {
        display->parent->irq->synchronize(display->drm);
 }
+
+bool intel_parent_vgpu_active(struct intel_display *display)
+{
+       return display->parent->vgpu_active && display->parent->vgpu_active(display->drm);
+}
index 3ade493f100818ce4de246d41e9edea64c472985..222c95836d35ca09f8d3b00e650497560fc276ef 100644 (file)
@@ -11,4 +11,6 @@ struct intel_display;
 bool intel_parent_irq_enabled(struct intel_display *display);
 void intel_parent_irq_synchronize(struct intel_display *display);
 
+bool intel_parent_vgpu_active(struct intel_display *display);
+
 #endif /* __INTEL_PARENT_H__ */
index 07715aef62d39b56628f9252295bd62dc081ddc8..f21f1919a225a3df20c19d2dad54691ef90ece7a 100644 (file)
@@ -739,9 +739,15 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv)
                         "DRM_I915_DEBUG_RUNTIME_PM enabled\n");
 }
 
+static bool vgpu_active(struct drm_device *drm)
+{
+       return intel_vgpu_active(to_i915(drm));
+}
+
 static const struct intel_display_parent_interface parent = {
        .rpm = &i915_display_rpm_interface,
        .irq = &i915_display_irq_interface,
+       .vgpu_active = vgpu_active,
 };
 
 const struct intel_display_parent_interface *i915_driver_parent_interface(void)
diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_vgpu.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_vgpu.h
deleted file mode 100644 (file)
index 4931c71..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* SPDX-License-Identifier: MIT */
-/*
- * Copyright © 2023 Intel Corporation
- */
-
-#ifndef _I915_VGPU_H_
-#define _I915_VGPU_H_
-
-#include <linux/types.h>
-
-struct drm_i915_private;
-
-static inline bool intel_vgpu_active(struct drm_i915_private *i915)
-{
-       return false;
-}
-
-#endif /* _I915_VGPU_H_ */
index 3a008a18eb653774627a1b16e7967a3a3350e998..f3834f36ce74161fff9a37a7a6b1f491e8f340d5 100644 (file)
@@ -48,6 +48,9 @@ struct intel_display_parent_interface {
 
        /** @irq: IRQ interface */
        const struct intel_display_irq_interface *irq;
+
+       /** @vgpu_active: Is vGPU active? Optional. */
+       bool (*vgpu_active)(struct drm_device *drm);
 };
 
 #endif