diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 14b024becb91..98371eeac77c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -2982,6 +2982,30 @@ static bool intel_crtc_has_pending_flip(struct drm_crtc *crtc) | |||
2982 | return pending; | 2982 | return pending; |
2983 | } | 2983 | } |
2984 | 2984 | ||
2985 | bool intel_has_pending_fb_unpin(struct drm_device *dev) | ||
2986 | { | ||
2987 | struct intel_crtc *crtc; | ||
2988 | |||
2989 | /* Note that we don't need to be called with mode_config.lock here | ||
2990 | * as our list of CRTC objects is static for the lifetime of the | ||
2991 | * device and so cannot disappear as we iterate. Similarly, we can | ||
2992 | * happily treat the predicates as racy, atomic checks as userspace | ||
2993 | * cannot claim and pin a new fb without at least acquring the | ||
2994 | * struct_mutex and so serialising with us. | ||
2995 | */ | ||
2996 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) { | ||
2997 | if (atomic_read(&crtc->unpin_work_count) == 0) | ||
2998 | continue; | ||
2999 | |||
3000 | if (crtc->unpin_work) | ||
3001 | intel_wait_for_vblank(dev, crtc->pipe); | ||
3002 | |||
3003 | return true; | ||
3004 | } | ||
3005 | |||
3006 | return false; | ||
3007 | } | ||
3008 | |||
2985 | static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) | 3009 | static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) |
2986 | { | 3010 | { |
2987 | struct drm_device *dev = crtc->dev; | 3011 | struct drm_device *dev = crtc->dev; |