All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Daniel Vetter" <daniel@ffwll.ch>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: Possible fb ref count issue with drm_plane_force_disable()
Date: Tue, 15 Apr 2014 12:16:52 +0300	[thread overview]
Message-ID: <534CF904.1070105@ti.com> (raw)
In-Reply-To: <534B9FC0.2020700@ti.com>


[-- Attachment #1.1: Type: text/plain, Size: 2379 bytes --]

On 14/04/14 11:43, Tomi Valkeinen wrote:
> On 11/04/14 14:50, Ville Syrjälä wrote:
> 
>>> So the explicit unref done by drm_plane_force_disable() seems a bit out
>>> of place. I can't figure out which drm_framebuffer_reference() would be
>>> the matching one for the unref done by drm_plane_force_disable().
>>>
>>> Any ideas what ref is that? Or is the __drm_framebuffer_unreference()
>>> extra in drm_plane_force_disable()?
>>
>> That's the reference that was taken by the drm_mode_setplane() when it
>> succesfully called the .update_plane() hook.
> 
> But drm_mode_setplane() is called via DRM_IOCTL_MODE_SETPLANE, which is
> only used for "proper" planes, not for crtc primary planes, right?
> 
> At least I don't see drm_mode_setplane() in my stack traces, and git
> grep doesn't show it called via any other means than ioctl.
> 
> I am not using any planes from my app, just the crtc and (indirectly)
> its primary plane.

So here's a summary of the fb refs and unrefs. It still seems to me that the
drm_plane_force_disable does an extra unref. Either that, or omapdrm is missing
something that takes the matching reference.

A line like this in the summary below:

2) ref36/3	drm_mode_setcrtc / drm_framebuffer_lookup

Means that "2" is the number I assigned to that ref, and there's a matching
unref with 2) prefix later. ref36/2 means that FB ID 36 was referenced, and ref
count is 3. And the rest of the line shows rough idea of the stack trace where
the ref/unref happens.


# DRM_IOCTL_MODE_ADDFB 2
0) 		kref_init
1) ref36/2	drm_mode_addfb2

# DRM_IOCTL_MODE_SETCRTC
2) ref36/3	drm_mode_setcrtc / drm_framebuffer_lookup
3) ref36/4	drm_mode_setcrtc / drm_mode_set_config_internal
2) unref36/3	drm_mode_setcrtc

# pin new fb
4) ref36/4	apply_worker / omap_plane_pre_apply


# BREAK


# RELEASE
1) unref36/3	drm_release / drm_fb_release / __drm_framebuffer_unregister
3) unref36/2	drm_release / drm_fb_release / drm_framebuffer_remove / drm_mode_set_config_internal
?) unref36/1	drm_release / drm_fb_release / drm_framebuffer_remove / drm_plane_force_disable
0) unref36/0	drm_release / drm_fb_release / drm_framebuffer_remove

# unpin old fb
4) unref36/-1	flip_worker / unpin_worker / drm_framebuffer_unreference


All the other unrefs I can explain, except the drm_plane_force_disable() one.

 Tomi



[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-04-15  9:17 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 11:47 Possible fb ref count issue with drm_plane_force_disable() Tomi Valkeinen
2014-04-11  6:31 ` Archit Taneja
2014-04-11  6:40   ` Tomi Valkeinen
2014-04-11  6:57     ` Archit Taneja
2014-04-11  7:03       ` Tomi Valkeinen
2014-04-11  7:19 ` Daniel Vetter
2014-04-11 11:50 ` Ville Syrjälä
2014-04-14  8:43   ` Tomi Valkeinen
2014-04-15  9:16     ` Tomi Valkeinen [this message]
2014-04-15 10:10       ` Rob Clark
2014-04-15 10:29         ` Andrzej Hajda
2014-04-15 10:44           ` Tomi Valkeinen
2014-04-15 12:24             ` Rob Clark
2014-04-15 13:30               ` Tomi Valkeinen
2014-04-15 22:01                 ` Daniel Vetter
2014-04-15 12:00         ` Tomi Valkeinen
2014-04-15 21:57         ` 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=534CF904.1070105@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ville.syrjala@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 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.