summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2026-02-26 13:07:22 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2026-02-27 11:41:34 +0300
commit38d9a352c45e6d1d2a42ce173f04b43892d72eb2 (patch)
tree2cf91f737797e17cc0d35b43942929c940014a17
parent12cdd837b43bee31f4d0b6c4efc2ae06c93de64d (diff)
downloadlinux-38d9a352c45e6d1d2a42ce173f04b43892d72eb2.tar.xz
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
-rw-r--r--drivers/gpu/drm/i915/display/intel_overlay.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index 8bb1dcff35ea..5831af146b14 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -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);