All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rob Clark <rob.clark@linaro.org>
Cc: Chris Wilson <chris@chris-wilson.co.uk>, Greg KH <greg@kroah.com>,
	linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org,
	patches@linaro.org
Subject: Re: [PATCH] drm: refcnt drm_framebuffer
Date: Wed, 1 Aug 2012 14:36:50 +0300	[thread overview]
Message-ID: <20120801113650.GA8283@intel.com> (raw)
In-Reply-To: <CAF6AEGuY3-vF4DRmQrQVo_gwKgfKFczf7zXUZtUm4Ke__ewQwA@mail.gmail.com>

On Tue, Jul 31, 2012 at 02:28:29PM -0500, Rob Clark wrote:
> On Tue, Jul 31, 2012 at 12:47 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Tue, 31 Jul 2012 12:41:28 -0500, Rob Clark <rob.clark@linaro.org> wrote:
> >> On Tue, Jul 31, 2012 at 12:00 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >> > On Tue, 31 Jul 2012 11:20:21 -0500, Rob Clark <rob.clark@linaro.org> wrote:
> >> >> From: Rob Clark <rob@ti.com>
> >> >>
> >> >> This simplifies drm fb lifetime, and if the crtc/plane needs to hold
> >> >> a ref to the fb when disabling a pipe until the next vblank, this
> >> >> avoids the need to make disabling an overlay synchronous.  This is a
> >> >> problem that shows up when userspace is using a drm plane to
> >> >> implement a hw cursor.. making overlay disable synchronous causes
> >> >> a performance problem when x11 is rapidly enabling/disabling the
> >> >> hw cursor.  But not making it synchronous opens up a race condition
> >> >> for crashing if userspace turns around and immediately deletes the
> >> >> fb.  Refcnt'ing the fb makes it possible to solve this problem.
> >> >
> >> > Presumably you have a follow-on patch putting the new refcnt to use so
> >> > that we can judge whether you truly need refcnting on the fb itself in
> >> > addition to the refcnted object and the various hw bookkeeping that
> >> > needs to be performed?
> >>
> >> Yes, I do.. although it is a bit experimental at this point, so not
> >> really ready to be submitted as anything other than an RFC.. it is
> >> part of omapdrm kms re-write to use dispc directly rather than go thru
> >> omapdss.  (With omapdss we don't hit this issue because disabling
> >> overlays is forced to be synchronous.. so instead we have the
> >> performance problem I mentioned.)
> >>
> >> I *could* just rely on the GEM refcnt, but that gets messier when you
> >> take into account multi-planar formats.  I suppose I also could have
> >> my own internal refcnt'd object to hold the set of GEM objects
> >> associated w/ the fb, but, well, that seems a bit silly.  And
> >> refcnt'ing the fb had been mentioned previously as a good thing to do
> >> (I think it was danvet?)
> >
> > Sure, there are a few places in the code that have caused ordering
> > issues in the past due to lack of refcnting the fb... But since you
> > haven't fixed up those cases, I'm looking for justification for adding
> > that extra bit of complexity. Adding a new interface and no users is
> > just asking for trouble.
> 
> hmm, I did realize that drm_plane cleanup only happens as a result of
> drm_framebuffer_cleanup().. which doesn't work too well if the driver
> is holding a ref to the fb :-/
> 
> so I guess at a minimum I need to fix plane cleanup to be part of
> drm_fb_helper_restore_fbdev_mode()

Your patch would still significantly change the behavior of
drm_mode_rmfb(). Currently it disables all planes and crtcs which
currently use the fb, and it removes the fb id from the idr so that
no new users of the fb can appear afterwards.

Not that I really like the current behaviour of drm_mode_rmfb(), but
it's been like that always, so changing it doesn't seem acceptable.

-- 
Ville Syrjälä
Intel OTC
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-08-01 11:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 16:20 [PATCH] drm: refcnt drm_framebuffer Rob Clark
2012-07-31 17:00 ` Chris Wilson
2012-07-31 17:41   ` Rob Clark
2012-07-31 17:47     ` Chris Wilson
2012-07-31 17:59       ` Rob Clark
2012-07-31 19:28       ` Rob Clark
2012-08-01 11:36         ` Ville Syrjälä [this message]
2012-08-01 12:55           ` Rob Clark
  -- strict thread matches above, loose matches on Subject: below --
2012-09-04 23:10 Rob Clark
2012-09-05  9:13 ` Daniel Vetter
2012-09-05 18:17 Rob Clark
2012-09-05 20:59 ` Rob Clark
2012-09-05 21:48 Rob Clark

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=20120801113650.GA8283@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@kroah.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=rob.clark@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.