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/overlay: Adjust i915 specific interfaces

Adjust the names ("i915_overlay_" prefix) and calling
convention (pass the driver agnostic 'struct drm_device'()
of the functions that will provide the remainder of the
parent driver interface to be used by the overlay display
code.

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

+29 -22
+29 -22
drivers/gpu/drm/i915/display/intel_overlay.c
··· 263 263 } 264 264 265 265 /* overlay needs to be disable in OCMD reg */ 266 - static int intel_overlay_on(struct intel_overlay *overlay, 267 - u32 frontbuffer_bits) 266 + static int i915_overlay_on(struct drm_device *drm, 267 + u32 frontbuffer_bits) 268 268 { 269 - struct intel_display *display = overlay->display; 269 + struct intel_display *display = to_intel_display(drm); 270 + struct intel_overlay *overlay = display->overlay; 270 271 struct i915_request *rq; 271 272 u32 *cs; 272 273 273 - drm_WARN_ON(display->drm, i915_overlay_is_active(display->drm)); 274 + drm_WARN_ON(drm, i915_overlay_is_active(drm)); 274 275 275 276 rq = alloc_request(overlay, NULL); 276 277 if (IS_ERR(rq)) ··· 325 324 } 326 325 327 326 /* overlay needs to be enabled in OCMD reg */ 328 - static int intel_overlay_continue(struct intel_overlay *overlay, 329 - struct i915_vma *vma, 330 - bool load_polyphase_filter) 327 + static int i915_overlay_continue(struct drm_device *drm, 328 + struct i915_vma *vma, 329 + bool load_polyphase_filter) 331 330 { 332 - struct intel_display *display = overlay->display; 331 + struct intel_display *display = to_intel_display(drm); 332 + struct intel_overlay *overlay = display->overlay; 333 333 struct i915_request *rq; 334 334 u32 flip_addr = overlay->flip_addr; 335 335 u32 *cs; 336 336 337 - drm_WARN_ON(display->drm, !i915_overlay_is_active(display->drm)); 337 + drm_WARN_ON(drm, !i915_overlay_is_active(drm)); 338 338 339 339 if (load_polyphase_filter) 340 340 flip_addr |= OFC_UPDATE; ··· 402 400 } 403 401 404 402 /* overlay needs to be disabled in OCMD reg */ 405 - static int intel_overlay_off(struct intel_overlay *overlay) 403 + static int i915_overlay_off(struct drm_device *drm) 406 404 { 407 - struct intel_display *display = overlay->display; 405 + struct intel_display *display = to_intel_display(drm); 406 + struct intel_overlay *overlay = display->overlay; 408 407 struct i915_request *rq; 409 408 u32 *cs, flip_addr = overlay->flip_addr; 410 409 411 - drm_WARN_ON(display->drm, !i915_overlay_is_active(display->drm)); 410 + drm_WARN_ON(drm, !i915_overlay_is_active(drm)); 412 411 413 412 /* 414 413 * According to intel docs the overlay hw may hang (when switching ··· 451 448 * Recover from an interruption due to a signal. 452 449 * We have to be careful not to repeat work forever an make forward progress. 453 450 */ 454 - static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay) 451 + static int i915_overlay_recover_from_interrupt(struct drm_device *drm) 455 452 { 453 + struct intel_display *display = to_intel_display(drm); 454 + struct intel_overlay *overlay = display->overlay; 455 + 456 456 return i915_active_wait(&overlay->last_flip); 457 457 } 458 458 ··· 464 458 * Needs to be called before the overlay register are changed 465 459 * via intel_overlay_(un)map_regs. 466 460 */ 467 - static int intel_overlay_release_old_vid(struct intel_overlay *overlay) 461 + static int i915_overlay_release_old_vid(struct drm_device *drm) 468 462 { 469 - struct intel_display *display = overlay->display; 463 + struct intel_display *display = to_intel_display(drm); 464 + struct intel_overlay *overlay = display->overlay; 470 465 struct i915_request *rq; 471 466 u32 *cs; 472 467 ··· 839 832 drm_WARN_ON(display->drm, 840 833 !drm_modeset_is_locked(&display->drm->mode_config.connection_mutex)); 841 834 842 - ret = intel_overlay_release_old_vid(overlay); 835 + ret = i915_overlay_release_old_vid(display->drm); 843 836 if (ret != 0) 844 837 return ret; 845 838 ··· 867 860 OCONF_PIPE_A : OCONF_PIPE_B; 868 861 iowrite32(oconfig, &regs->OCONFIG); 869 862 870 - ret = intel_overlay_on(overlay, INTEL_FRONTBUFFER_OVERLAY(pipe)); 863 + ret = i915_overlay_on(display->drm, INTEL_FRONTBUFFER_OVERLAY(pipe)); 871 864 if (ret != 0) 872 865 goto out_unpin; 873 866 } ··· 925 918 if (tmp & (1 << 17)) 926 919 drm_dbg(display->drm, "overlay underrun, DOVSTA: %x\n", tmp); 927 920 928 - ret = intel_overlay_continue(overlay, vma, scale_changed); 921 + ret = i915_overlay_continue(display->drm, vma, scale_changed); 929 922 if (ret) 930 923 goto out_unpin; 931 924 ··· 947 940 drm_WARN_ON(display->drm, 948 941 !drm_modeset_is_locked(&display->drm->mode_config.connection_mutex)); 949 942 950 - ret = intel_overlay_recover_from_interrupt(overlay); 943 + ret = i915_overlay_recover_from_interrupt(display->drm); 951 944 if (ret != 0) 952 945 return ret; 953 946 954 947 if (!i915_overlay_is_active(display->drm)) 955 948 return 0; 956 949 957 - ret = intel_overlay_release_old_vid(overlay); 950 + ret = i915_overlay_release_old_vid(display->drm); 958 951 if (ret != 0) 959 952 return ret; 960 953 ··· 963 956 overlay->crtc->overlay = NULL; 964 957 overlay->crtc = NULL; 965 958 966 - return intel_overlay_off(overlay); 959 + return i915_overlay_off(display->drm); 967 960 } 968 961 969 962 static int check_overlay_possible_on_crtc(struct intel_overlay *overlay, ··· 1210 1203 1211 1204 drm_modeset_lock_all(dev); 1212 1205 1213 - ret = intel_overlay_recover_from_interrupt(overlay); 1206 + ret = i915_overlay_recover_from_interrupt(dev); 1214 1207 if (ret != 0) 1215 1208 goto out_unlock; 1216 1209