From: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 20/21] drm/i915: Check for unpin correctness.
Date: Thu, 19 May 2016 10:21:26 +0200 [thread overview]
Message-ID: <20160519082126.GA12913@patrik-desktop.isw.intel.com> (raw)
In-Reply-To: <1463490484-19540-21-git-send-email-maarten.lankhorst@linux.intel.com>
On Tue, May 17, 2016 at 03:08:03PM +0200, Maarten Lankhorst wrote:
> If planes are added to the state after the call to
> drm_atomic_helper_check_planes planes_changed may not be set
> and we will not unpin the old framebuffer. This results in a
> pin leak long after the framebuffer is destroyed, so to find
> this add some checks when it happens.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Patrik Jakobsson <patrik.jakobsson@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 9236407e9b13..330a6397f07c 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13373,11 +13373,20 @@ intel_prepare_plane_fb(struct drm_plane *plane,
> struct intel_plane *intel_plane = to_intel_plane(plane);
> struct drm_i915_gem_object *obj = intel_fb_obj(fb);
> struct drm_i915_gem_object *old_obj = intel_fb_obj(plane->state->fb);
> + struct drm_crtc *crtc = new_state->crtc ?: plane->state->crtc;
> int ret = 0;
>
> if (!obj && !old_obj)
> return 0;
>
> + if (WARN_ON(!new_state->state) || WARN_ON(!crtc) ||
> + WARN_ON(!to_intel_atomic_state(new_state->state)->work[to_intel_crtc(crtc)->pipe])) {
> + if (WARN_ON(old_obj != obj))
> + return -EINVAL;
> +
> + return 0;
> + }
> +
> if (old_obj) {
> struct drm_crtc_state *crtc_state =
> drm_atomic_get_existing_crtc_state(new_state->state, plane->state->crtc);
> --
> 2.5.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Intel Sweden AB Registered Office: Knarrarnasgatan 15, 164 40 Kista, Stockholm, Sweden Registration Number: 556189-6027
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-05-19 8:21 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 13:07 [PATCH v2 00/21] Rework page flip, remove cs flips, async unpin and unified pageflip Maarten Lankhorst
2016-05-17 13:07 ` [PATCH v2 01/21] drm/core: Add drm_accurate_vblank_count, v5 Maarten Lankhorst
2016-05-18 13:44 ` Mario Kleiner
2016-05-17 13:07 ` [PATCH v2 02/21] drm/i915: Remove stallcheck special handling, v3 Maarten Lankhorst
2016-05-18 9:21 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 03/21] drm/i915: Remove intel_finish_page_flip_plane Maarten Lankhorst
2016-05-18 9:29 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 04/21] drm/i915: Remove intel_prepare_page_flip, v3 Maarten Lankhorst
2016-05-18 11:06 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 05/21] drm/i915: Add support for detecting vblanks when hw frame counter is unavailable Maarten Lankhorst
2016-05-18 11:09 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 06/21] drm/i915: Unify unpin_work and mmio_work into flip_work, v2 Maarten Lankhorst
2016-05-18 11:50 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 07/21] Revert "drm/i915: Avoid stalling on pending flips for legacy cursor updates" Maarten Lankhorst
2016-05-18 11:51 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 08/21] drm/i915: Allow mmio updates on all platforms, v2 Maarten Lankhorst
2016-05-18 11:58 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 09/21] drm/i915: Convert flip_work to a list Maarten Lankhorst
2016-05-18 13:56 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 10/21] drm/i915: Add the exclusive fence to plane_state Maarten Lankhorst
2016-05-18 14:30 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 11/21] drm/i915: Rework intel_crtc_page_flip to be almost atomic, v3 Maarten Lankhorst
2016-05-19 11:24 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 12/21] drm/i915: Remove cs based page flip support Maarten Lankhorst
2016-05-18 20:31 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 13/21] drm/i915: Remove use_mmio_flip kernel parameter Maarten Lankhorst
2016-05-18 20:32 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 14/21] drm/i915: Remove queue_flip pointer Maarten Lankhorst
2016-05-18 20:34 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 15/21] drm/i915: Remove reset_counter from intel_crtc Maarten Lankhorst
2016-05-18 23:20 ` Patrik Jakobsson
2016-05-17 13:07 ` [PATCH v2 16/21] drm/i915: Pass atomic states to fbc update functions Maarten Lankhorst
2016-05-18 23:29 ` Patrik Jakobsson
2016-05-17 13:08 ` [PATCH v2 17/21] drm/i915: Prepare connectors for nonblocking checks Maarten Lankhorst
2016-05-19 11:26 ` Patrik Jakobsson
2016-05-17 13:08 ` [PATCH v2 18/21] drm/i915: Make unpin async Maarten Lankhorst
2016-05-19 11:55 ` Patrik Jakobsson
2016-05-24 14:00 ` Daniel Vetter
2016-05-25 7:03 ` Maarten Lankhorst
2016-05-17 13:08 ` [PATCH v2 19/21] Reapply "drm/i915: Avoid stalling on pending flips for legacy cursor updates" Maarten Lankhorst
2016-05-18 23:45 ` Patrik Jakobsson
2016-05-17 13:08 ` [PATCH v2 20/21] drm/i915: Check for unpin correctness Maarten Lankhorst
2016-05-19 8:21 ` Patrik Jakobsson [this message]
2016-05-17 13:08 ` [PATCH v2 21/21] drm/i915: Allow async update of pageflips Maarten Lankhorst
2016-05-19 12:10 ` Patrik Jakobsson
2016-05-19 15:36 ` Daniel Vetter
2016-05-17 13:49 ` ✗ Ro.CI.BAT: failure for Rework page flip, remove cs flips, async unpin and unified pageflip. (rev5) Patchwork
2016-05-19 12:16 ` [PATCH v2 00/21] Rework page flip, remove cs flips, async unpin and unified pageflip Patrik Jakobsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160519082126.GA12913@patrik-desktop.isw.intel.com \
--to=patrik.jakobsson@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox