]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/overlay: Extract i915_overlay_is_active()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 26 Feb 2026 10:07:22 +0000 (12:07 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 27 Feb 2026 08:41:34 +0000 (10:41 +0200)
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
drivers/gpu/drm/i915/display/intel_overlay.c

index 8bb1dcff35ea8373e3207768614c4a69da66ae7a..5831af146b14610b35e52432a70a5a863143e8b8 100644 (file)
@@ -255,6 +255,14 @@ alloc_request(struct intel_overlay *overlay, void (*fn)(struct intel_overlay *))
        return rq;
 }
 
+static bool i915_overlay_is_active(struct drm_device *drm)
+{
+       struct intel_display *display = to_intel_display(drm);
+       struct intel_overlay *overlay = display->overlay;
+
+       return overlay->active;
+}
+
 /* overlay needs to be disable in OCMD reg */
 static int intel_overlay_on(struct intel_overlay *overlay,
                            u32 frontbuffer_bits)
@@ -263,7 +271,7 @@ static int intel_overlay_on(struct intel_overlay *overlay,
        struct i915_request *rq;
        u32 *cs;
 
-       drm_WARN_ON(display->drm, overlay->active);
+       drm_WARN_ON(display->drm, i915_overlay_is_active(display->drm));
 
        rq = alloc_request(overlay, NULL);
        if (IS_ERR(rq))
@@ -327,7 +335,7 @@ static int intel_overlay_continue(struct intel_overlay *overlay,
        u32 flip_addr = overlay->flip_addr;
        u32 tmp, *cs;
 
-       drm_WARN_ON(display->drm, !overlay->active);
+       drm_WARN_ON(display->drm, !i915_overlay_is_active(display->drm));
 
        if (load_polyphase_filter)
                flip_addr |= OFC_UPDATE;
@@ -407,7 +415,7 @@ static int intel_overlay_off(struct intel_overlay *overlay)
        struct i915_request *rq;
        u32 *cs, flip_addr = overlay->flip_addr;
 
-       drm_WARN_ON(display->drm, !overlay->active);
+       drm_WARN_ON(display->drm, !i915_overlay_is_active(display->drm));
 
        /*
         * According to intel docs the overlay hw may hang (when switching
@@ -822,7 +830,7 @@ static int intel_overlay_do_put_image(struct intel_overlay *overlay,
                goto out_pin_section;
        }
 
-       if (!overlay->active) {
+       if (!i915_overlay_is_active(display->drm)) {
                const struct intel_crtc_state *crtc_state =
                        overlay->crtc->config;
                u32 oconfig = 0;
@@ -917,7 +925,7 @@ int intel_overlay_switch_off(struct intel_overlay *overlay)
        if (ret != 0)
                return ret;
 
-       if (!overlay->active)
+       if (!i915_overlay_is_active(display->drm))
                return 0;
 
        ret = intel_overlay_release_old_vid(overlay);
@@ -1333,7 +1341,7 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
                        if (DISPLAY_VER(display) == 2)
                                goto out_unlock;
 
-                       if (overlay->active) {
+                       if (i915_overlay_is_active(display->drm)) {
                                ret = -EBUSY;
                                goto out_unlock;
                        }
@@ -1462,7 +1470,7 @@ void intel_overlay_cleanup(struct intel_display *display)
         * Furthermore modesetting teardown happens beforehand so the
         * hardware should be off already.
         */
-       drm_WARN_ON(display->drm, overlay->active);
+       drm_WARN_ON(display->drm, i915_overlay_is_active(display->drm));
 
        i915_gem_object_put(overlay->reg_bo);
        i915_active_fini(&overlay->last_flip);