Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915: add .vgpu_active to parent interface

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>

+20 -25
+2 -4
drivers/gpu/drm/i915/display/intel_crtc.c
··· 13 13 #include <drm/drm_vblank.h> 14 14 #include <drm/drm_vblank_work.h> 15 15 16 - #include "i915_drv.h" 17 - #include "i915_vgpu.h" 18 16 #include "i9xx_plane.h" 19 17 #include "icl_dsi.h" 20 18 #include "intel_atomic.h" ··· 26 28 #include "intel_drrs.h" 27 29 #include "intel_dsi.h" 28 30 #include "intel_fifo_underrun.h" 31 + #include "intel_parent.h" 29 32 #include "intel_pipe_crc.h" 30 33 #include "intel_plane.h" 31 34 #include "intel_psr.h" ··· 670 671 int scanline_end = intel_get_crtc_scanline(crtc); 671 672 u32 end_vbl_count = intel_crtc_get_vblank_counter(crtc); 672 673 ktime_t end_vbl_time = ktime_get(); 673 - struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); 674 674 675 675 drm_WARN_ON(display->drm, new_crtc_state->use_dsb); 676 676 ··· 735 737 736 738 local_irq_enable(); 737 739 738 - if (intel_vgpu_active(dev_priv)) 740 + if (intel_parent_vgpu_active(display)) 739 741 goto out; 740 742 741 743 if (crtc->debug.start_vbl_count &&
+2 -3
drivers/gpu/drm/i915/display/intel_fbc.c
··· 50 50 #include "gt/intel_gt_types.h" 51 51 52 52 #include "i915_drv.h" 53 - #include "i915_vgpu.h" 54 53 #include "i915_vma.h" 55 54 #include "i9xx_plane_regs.h" 56 55 #include "intel_de.h" ··· 63 64 #include "intel_fbc.h" 64 65 #include "intel_fbc_regs.h" 65 66 #include "intel_frontbuffer.h" 67 + #include "intel_parent.h" 66 68 67 69 #define for_each_fbc_id(__display, __fbc_id) \ 68 70 for ((__fbc_id) = INTEL_FBC_A; (__fbc_id) < I915_MAX_FBCS; (__fbc_id)++) \ ··· 1485 1485 struct intel_plane *plane) 1486 1486 { 1487 1487 struct intel_display *display = to_intel_display(state->base.dev); 1488 - struct drm_i915_private *i915 = to_i915(display->drm); 1489 1488 struct intel_plane_state *plane_state = 1490 1489 intel_atomic_get_new_plane_state(state, plane); 1491 1490 const struct drm_framebuffer *fb = plane_state->hw.fb; ··· 1500 1501 return 0; 1501 1502 } 1502 1503 1503 - if (intel_vgpu_active(i915)) { 1504 + if (intel_parent_vgpu_active(display)) { 1504 1505 plane_state->no_fbc_reason = "VGPU active"; 1505 1506 return 0; 1506 1507 }
+5
drivers/gpu/drm/i915/display/intel_parent.c
··· 31 31 { 32 32 display->parent->irq->synchronize(display->drm); 33 33 } 34 + 35 + bool intel_parent_vgpu_active(struct intel_display *display) 36 + { 37 + return display->parent->vgpu_active && display->parent->vgpu_active(display->drm); 38 + }
+2
drivers/gpu/drm/i915/display/intel_parent.h
··· 11 11 bool intel_parent_irq_enabled(struct intel_display *display); 12 12 void intel_parent_irq_synchronize(struct intel_display *display); 13 13 14 + bool intel_parent_vgpu_active(struct intel_display *display); 15 + 14 16 #endif /* __INTEL_PARENT_H__ */
+6
drivers/gpu/drm/i915/i915_driver.c
··· 739 739 "DRM_I915_DEBUG_RUNTIME_PM enabled\n"); 740 740 } 741 741 742 + static bool vgpu_active(struct drm_device *drm) 743 + { 744 + return intel_vgpu_active(to_i915(drm)); 745 + } 746 + 742 747 static const struct intel_display_parent_interface parent = { 743 748 .rpm = &i915_display_rpm_interface, 744 749 .irq = &i915_display_irq_interface, 750 + .vgpu_active = vgpu_active, 745 751 }; 746 752 747 753 const struct intel_display_parent_interface *i915_driver_parent_interface(void)
-18
drivers/gpu/drm/xe/compat-i915-headers/i915_vgpu.h
··· 1 - /* SPDX-License-Identifier: MIT */ 2 - /* 3 - * Copyright © 2023 Intel Corporation 4 - */ 5 - 6 - #ifndef _I915_VGPU_H_ 7 - #define _I915_VGPU_H_ 8 - 9 - #include <linux/types.h> 10 - 11 - struct drm_i915_private; 12 - 13 - static inline bool intel_vgpu_active(struct drm_i915_private *i915) 14 - { 15 - return false; 16 - } 17 - 18 - #endif /* _I915_VGPU_H_ */
+3
include/drm/intel/display_parent_interface.h
··· 48 48 49 49 /** @irq: IRQ interface */ 50 50 const struct intel_display_irq_interface *irq; 51 + 52 + /** @vgpu_active: Is vGPU active? Optional. */ 53 + bool (*vgpu_active)(struct drm_device *drm); 51 54 }; 52 55 53 56 #endif