From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 3/6] drm/i915: Implement LRI based FBC tracking
Date: Wed, 6 Nov 2013 19:51:14 +0200 [thread overview]
Message-ID: <20131106175114.GH5986@intel.com> (raw)
In-Reply-To: <20131106173601.GB26123@nuc-i3427.alporthouse.com>
On Wed, Nov 06, 2013 at 05:36:01PM +0000, Chris Wilson wrote:
> On Wed, Nov 06, 2013 at 07:23:25PM +0200, ville.syrjala@linux.intel.com wrote:
> > +bool intel_fb_obj_has_fbc(struct drm_i915_gem_object *obj)
> > +{
> > + struct drm_device *dev = obj->base.dev;
> > + struct drm_i915_private *dev_priv = dev->dev_private;
> > + struct drm_crtc *crtc;
> > +
> > + /* check for potential scanout */
> > + if (!obj->pin_display)
> > + return false;
>
> if (dev_oriv->fbc.plane == -1)
> return false;
>
> crtc = dev_priv->plane_to_crtc[dev_priv->fbc.plane];
>
> mutex_lock(&crtc->mutex);
> has_fbc = crtc->fb && to_intel_framebuffer(crtc->fb)->obj == obj;
> mutex_unlock(&crtc->mutex);
>
> return has_fbc
> }
>
> Perhaps?
Oh yeah, much nicer. Except now the locking I came up here sucks. Need
to rethink that part somehow. Maybe I'll just slap an
ACCESS_ONCE(crtc->fb) there. Hmm, but I guess I'd also need to grab a
reference to the fb to avoid it disappearing while were looking at it.
This is starting to be a bit hairy. So maybe I should just stick our
current fbc scanout object to dev_priv->fbc.obj, and update it when
doing page flips/modeset. I really didn't want to start messing about
with fbc locking but looks like there's no way around it.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2013-11-06 17:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 15:39 [PATCH 1/6] drm/i915: Limit FBC flush to post batch flush ville.syrjala
2013-11-06 15:39 ` [PATCH 2/6] drm/i915: Emit SRM after the MSG_FBC_REND_STATE LRI ville.syrjala
2013-11-06 15:39 ` [PATCH 3/6] drm/i915: Implement LRI based FBC tracking ville.syrjala
2013-11-06 16:06 ` Chris Wilson
2013-11-06 16:24 ` Ville Syrjälä
2013-11-06 17:23 ` [PATCH v2 " ville.syrjala
2013-11-06 17:36 ` Chris Wilson
2013-11-06 17:51 ` Ville Syrjälä [this message]
2013-11-06 15:39 ` [PATCH 4/6] drm/i915: Kill sandybridge_blit_fbc_update() ville.syrjala
2013-11-06 17:24 ` [PATCH v2 " ville.syrjala
2013-11-06 15:39 ` [PATCH 5/6] drm/i915: Don't write ILK_FBC_RT_BASE directly on SNB ville.syrjala
2013-11-06 17:24 ` [PATCH v2 5/6] drm/i915: Don't write ILK/IVB_FBC_RT_BASE directly ville.syrjala
2013-11-06 15:39 ` [PATCH 6/6] drm/i915: Set has_fbc=true for all SNB+, except VLV ville.syrjala
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=20131106175114.GH5986@intel.com \
--to=ville.syrjala@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