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

drm/i915/dpt: convert intel_dpt.[ch] interfaces to struct intel_display

Going forward, struct intel_display is the main display device data
pointer. Convert the intel_dpt.[ch] interfaces to struct intel_display,
though the file being very i915 specific, it's hard to convert the
implementation.

Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/df2bf715639caeb662f08b776ba81bfe3c9288b9.1740502116.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+17 -18
+12 -12
drivers/gpu/drm/i915/display/intel_dpt.c
··· 183 183 184 184 /** 185 185 * intel_dpt_resume - restore the memory mapping for all DPT FBs during system resume 186 - * @i915: device instance 186 + * @display: display device instance 187 187 * 188 188 * Restore the memory mapping during system resume for all framebuffers which 189 189 * are mapped to HW via a GGTT->DPT page table. The content of these page ··· 193 193 * This function must be called after the mappings in GGTT have been restored calling 194 194 * i915_ggtt_resume(). 195 195 */ 196 - void intel_dpt_resume(struct drm_i915_private *i915) 196 + void intel_dpt_resume(struct intel_display *display) 197 197 { 198 198 struct drm_framebuffer *drm_fb; 199 199 200 - if (!HAS_DISPLAY(i915)) 200 + if (!HAS_DISPLAY(display)) 201 201 return; 202 202 203 - mutex_lock(&i915->drm.mode_config.fb_lock); 204 - drm_for_each_fb(drm_fb, &i915->drm) { 203 + mutex_lock(&display->drm->mode_config.fb_lock); 204 + drm_for_each_fb(drm_fb, display->drm) { 205 205 struct intel_framebuffer *fb = to_intel_framebuffer(drm_fb); 206 206 207 207 if (fb->dpt_vm) 208 208 i915_ggtt_resume_vm(fb->dpt_vm, true); 209 209 } 210 - mutex_unlock(&i915->drm.mode_config.fb_lock); 210 + mutex_unlock(&display->drm->mode_config.fb_lock); 211 211 } 212 212 213 213 /** 214 214 * intel_dpt_suspend - suspend the memory mapping for all DPT FBs during system suspend 215 - * @i915: device instance 215 + * @display: display device instance 216 216 * 217 217 * Suspend the memory mapping during system suspend for all framebuffers which 218 218 * are mapped to HW via a GGTT->DPT page table. ··· 220 220 * This function must be called before the mappings in GGTT are suspended calling 221 221 * i915_ggtt_suspend(). 222 222 */ 223 - void intel_dpt_suspend(struct drm_i915_private *i915) 223 + void intel_dpt_suspend(struct intel_display *display) 224 224 { 225 225 struct drm_framebuffer *drm_fb; 226 226 227 - if (!HAS_DISPLAY(i915)) 227 + if (!HAS_DISPLAY(display)) 228 228 return; 229 229 230 - mutex_lock(&i915->drm.mode_config.fb_lock); 230 + mutex_lock(&display->drm->mode_config.fb_lock); 231 231 232 - drm_for_each_fb(drm_fb, &i915->drm) { 232 + drm_for_each_fb(drm_fb, display->drm) { 233 233 struct intel_framebuffer *fb = to_intel_framebuffer(drm_fb); 234 234 235 235 if (fb->dpt_vm) 236 236 i915_ggtt_suspend_vm(fb->dpt_vm, true); 237 237 } 238 238 239 - mutex_unlock(&i915->drm.mode_config.fb_lock); 239 + mutex_unlock(&display->drm->mode_config.fb_lock); 240 240 } 241 241 242 242 struct i915_address_space *
+3 -4
drivers/gpu/drm/i915/display/intel_dpt.h
··· 8 8 9 9 #include <linux/types.h> 10 10 11 - struct drm_i915_private; 12 - 13 11 struct i915_address_space; 14 12 struct i915_vma; 13 + struct intel_display; 15 14 struct intel_framebuffer; 16 15 17 16 void intel_dpt_destroy(struct i915_address_space *vm); 18 17 struct i915_vma *intel_dpt_pin_to_ggtt(struct i915_address_space *vm, 19 18 unsigned int alignment); 20 19 void intel_dpt_unpin_from_ggtt(struct i915_address_space *vm); 21 - void intel_dpt_suspend(struct drm_i915_private *i915); 22 - void intel_dpt_resume(struct drm_i915_private *i915); 20 + void intel_dpt_suspend(struct intel_display *display); 21 + void intel_dpt_resume(struct intel_display *display); 23 22 struct i915_address_space * 24 23 intel_dpt_create(struct intel_framebuffer *fb); 25 24 u64 intel_dpt_offset(struct i915_vma *dpt_vma);
+2 -2
drivers/gpu/drm/i915/i915_driver.c
··· 1075 1075 intel_encoder_suspend_all(&dev_priv->display); 1076 1076 1077 1077 /* Must be called before GGTT is suspended. */ 1078 - intel_dpt_suspend(dev_priv); 1078 + intel_dpt_suspend(display); 1079 1079 i915_ggtt_suspend(to_gt(dev_priv)->ggtt); 1080 1080 1081 1081 i9xx_display_sr_save(display); ··· 1192 1192 setup_private_pat(gt); 1193 1193 1194 1194 /* Must be called after GGTT is resumed. */ 1195 - intel_dpt_resume(dev_priv); 1195 + intel_dpt_resume(display); 1196 1196 1197 1197 intel_dmc_resume(display); 1198 1198