From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Move drm_framebuffer_unreference out of struct_mutex for takeover
Date: Tue, 10 Mar 2015 12:02:28 +0000 [thread overview]
Message-ID: <54FEDD54.8090207@linux.intel.com> (raw)
In-Reply-To: <1424097110-31656-2-git-send-email-chris@chris-wilson.co.uk>
Hi,
On 02/16/2015 02:31 PM, Chris Wilson wrote:
> intel_user_framebuffer_destroy() requires the struct_mutex for its
> object bookkeeping, so this means that all calls to
> drm_framebuffer_reference must be held without that lock.
Same comment on the commit message as 1/2.
> References: https://bugs.freedesktop.org/show_bug.cgi?id=89166
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/intel_display.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 6e1da7da5cca..aba36662d511 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13672,6 +13672,8 @@ void intel_modeset_gem_init(struct drm_device *dev)
> struct drm_i915_private *dev_priv = dev->dev_private;
> struct drm_crtc *c;
> struct drm_i915_gem_object *obj;
> + struct drm_plane *unused[I915_MAX_PIPES];
> + int n_unused = 0;
>
> mutex_lock(&dev->struct_mutex);
> intel_init_gt_powersave(dev);
> @@ -13707,13 +13709,18 @@ void intel_modeset_gem_init(struct drm_device *dev)
> NULL)) {
> DRM_ERROR("failed to pin boot fb on pipe %d\n",
> to_intel_crtc(c)->pipe);
> - drm_framebuffer_unreference(c->primary->fb);
> - c->primary->fb = NULL;
> - update_state_fb(c->primary);
> + unused[n_unused++] = c->primary;
> }
> }
> mutex_unlock(&dev->struct_mutex);
>
> + while (n_unused--) {
> + struct drm_plane *p = unused[n_unused];
> + drm_framebuffer_unreference(p->fb);
> + p->fb = NULL;
> + update_state_fb(p);
> + }
> +
For this one I am not sure. Should c->primary->fb = NULL remain under
the locked loop? If not what is the the mutex protecting then?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-03-10 12:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-16 14:31 [PATCH 1/2] drm/i915: Move drm_framebuffer_unreference out of struct_mutex for flips Chris Wilson
2015-02-16 14:31 ` [PATCH 2/2] drm/i915: Move drm_framebuffer_unreference out of struct_mutex for takeover Chris Wilson
2015-02-16 21:59 ` shuang.he
2015-03-10 12:02 ` Tvrtko Ursulin [this message]
2015-03-10 12:19 ` Chris Wilson
2015-03-10 12:32 ` Tvrtko Ursulin
2015-03-11 15:46 ` Ville Syrjälä
2015-02-23 23:10 ` [PATCH 1/2] drm/i915: Move drm_framebuffer_unreference out of struct_mutex for flips Daniel Vetter
2015-03-10 11:43 ` Tvrtko Ursulin
2015-03-10 12:56 ` Daniel Vetter
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=54FEDD54.8090207@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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