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: Extract i915_overlay_is_active()

Pull the "is the overlay active?" check to a helper
(i915_overlay_is_active()). This will have to move to the
i915 side of the parent vs. display driver split.

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-4-ville.syrjala@linux.intel.com

+15 -7
+15 -7
drivers/gpu/drm/i915/display/intel_overlay.c
··· 255 255 return rq; 256 256 } 257 257 258 + static bool i915_overlay_is_active(struct drm_device *drm) 259 + { 260 + struct intel_display *display = to_intel_display(drm); 261 + struct intel_overlay *overlay = display->overlay; 262 + 263 + return overlay->active; 264 + } 265 + 258 266 /* overlay needs to be disable in OCMD reg */ 259 267 static int intel_overlay_on(struct intel_overlay *overlay, 260 268 u32 frontbuffer_bits) ··· 271 263 struct i915_request *rq; 272 264 u32 *cs; 273 265 274 - drm_WARN_ON(display->drm, overlay->active); 266 + drm_WARN_ON(display->drm, i915_overlay_is_active(display->drm)); 275 267 276 268 rq = alloc_request(overlay, NULL); 277 269 if (IS_ERR(rq)) ··· 335 327 u32 flip_addr = overlay->flip_addr; 336 328 u32 tmp, *cs; 337 329 338 - drm_WARN_ON(display->drm, !overlay->active); 330 + drm_WARN_ON(display->drm, !i915_overlay_is_active(display->drm)); 339 331 340 332 if (load_polyphase_filter) 341 333 flip_addr |= OFC_UPDATE; ··· 415 407 struct i915_request *rq; 416 408 u32 *cs, flip_addr = overlay->flip_addr; 417 409 418 - drm_WARN_ON(display->drm, !overlay->active); 410 + drm_WARN_ON(display->drm, !i915_overlay_is_active(display->drm)); 419 411 420 412 /* 421 413 * According to intel docs the overlay hw may hang (when switching ··· 830 822 goto out_pin_section; 831 823 } 832 824 833 - if (!overlay->active) { 825 + if (!i915_overlay_is_active(display->drm)) { 834 826 const struct intel_crtc_state *crtc_state = 835 827 overlay->crtc->config; 836 828 u32 oconfig = 0; ··· 925 917 if (ret != 0) 926 918 return ret; 927 919 928 - if (!overlay->active) 920 + if (!i915_overlay_is_active(display->drm)) 929 921 return 0; 930 922 931 923 ret = intel_overlay_release_old_vid(overlay); ··· 1341 1333 if (DISPLAY_VER(display) == 2) 1342 1334 goto out_unlock; 1343 1335 1344 - if (overlay->active) { 1336 + if (i915_overlay_is_active(display->drm)) { 1345 1337 ret = -EBUSY; 1346 1338 goto out_unlock; 1347 1339 } ··· 1470 1462 * Furthermore modesetting teardown happens beforehand so the 1471 1463 * hardware should be off already. 1472 1464 */ 1473 - drm_WARN_ON(display->drm, overlay->active); 1465 + drm_WARN_ON(display->drm, i915_overlay_is_active(display->drm)); 1474 1466 1475 1467 i915_gem_object_put(overlay->reg_bo); 1476 1468 i915_active_fini(&overlay->last_flip);