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/gmch: convert intel_gmch.c to struct intel_display

Convert intel_gmch.[ch] to struct intel_display. Remove the final
dependency on struct drm_i915_private and i915_drv.h. This is in
preparation of moving the code under display/.

intel_gmch_vga_set_state() is only used internally, make it static while
at it.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/a4b317656eef0781d4f53ae337083fb05ce602bc.1763578288.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+6 -9
+6 -7
drivers/gpu/drm/i915/soc/intel_gmch.c
··· 10 10 #include <drm/intel/i915_drm.h> 11 11 12 12 #include "../display/intel_display_core.h" /* FIXME */ 13 + #include "../display/intel_display_types.h" /* FIXME */ 13 14 14 - #include "i915_drv.h" 15 15 #include "intel_gmch.h" 16 16 #include "intel_pci_config.h" 17 17 18 - int intel_gmch_vga_set_state(struct drm_i915_private *i915, bool enable_decode) 18 + static int intel_gmch_vga_set_state(struct intel_display *display, bool enable_decode) 19 19 { 20 - struct intel_display *display = i915->display; 21 20 struct pci_dev *pdev = to_pci_dev(display->drm->dev); 22 21 unsigned int reg = DISPLAY_VER(display) >= 6 ? SNB_GMCH_CTRL : INTEL_GMCH_CTRL; 23 22 u16 gmch_ctrl; 24 23 25 24 if (pci_bus_read_config_word(pdev->bus, PCI_DEVFN(0, 0), reg, &gmch_ctrl)) { 26 - drm_err(&i915->drm, "failed to read control word\n"); 25 + drm_err(display->drm, "failed to read control word\n"); 27 26 return -EIO; 28 27 } 29 28 ··· 35 36 gmch_ctrl |= INTEL_GMCH_VGA_DISABLE; 36 37 37 38 if (pci_bus_write_config_word(pdev->bus, PCI_DEVFN(0, 0), reg, gmch_ctrl)) { 38 - drm_err(&i915->drm, "failed to write control word\n"); 39 + drm_err(display->drm, "failed to write control word\n"); 39 40 return -EIO; 40 41 } 41 42 ··· 44 45 45 46 unsigned int intel_gmch_vga_set_decode(struct pci_dev *pdev, bool enable_decode) 46 47 { 47 - struct drm_i915_private *i915 = pdev_to_i915(pdev); 48 + struct intel_display *display = to_intel_display(pdev); 48 49 49 - intel_gmch_vga_set_state(i915, enable_decode); 50 + intel_gmch_vga_set_state(display, enable_decode); 50 51 51 52 if (enable_decode) 52 53 return VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM |
-2
drivers/gpu/drm/i915/soc/intel_gmch.h
··· 9 9 #include <linux/types.h> 10 10 11 11 struct pci_dev; 12 - struct drm_i915_private; 13 12 14 - int intel_gmch_vga_set_state(struct drm_i915_private *i915, bool enable_decode); 15 13 unsigned int intel_gmch_vga_set_decode(struct pci_dev *pdev, bool enable_decode); 16 14 17 15 #endif /* __INTEL_GMCH_H__ */