From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: Possible fb ref count issue with drm_plane_force_disable() Date: Tue, 15 Apr 2014 12:16:52 +0300 Message-ID: <534CF904.1070105@ti.com> References: <534684E8.9000203@ti.com> <20140411115054.GC18465@intel.com> <534B9FC0.2020700@ti.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0787514678==" Return-path: Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by gabe.freedesktop.org (Postfix) with ESMTP id C70476E89C for ; Tue, 15 Apr 2014 02:17:03 -0700 (PDT) In-Reply-To: <534B9FC0.2020700@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: =?ISO-8859-1?Q?Ville_Syrj=E4l=E4?= , Daniel Vetter Cc: dri-devel List-Id: dri-devel@lists.freedesktop.org --===============0787514678== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bvoEgueOEj9JpjC9bEWKR1h6pmWEaFLep" --bvoEgueOEj9JpjC9bEWKR1h6pmWEaFLep Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 14/04/14 11:43, Tomi Valkeinen wrote: > On 11/04/14 14:50, Ville Syrj=E4l=E4 wrote: >=20 >>> So the explicit unref done by drm_plane_force_disable() seems a bit o= ut >>> 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. >=20 > But drm_mode_setplane() is called via DRM_IOCTL_MODE_SETPLANE, which is= > only used for "proper" planes, not for crtc primary planes, right? >=20 > 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. >=20 > 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 m= issing 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 matchi= ng unref with 2) prefix later. ref36/2 means that FB ID 36 was referenced, a= nd 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 --bvoEgueOEj9JpjC9bEWKR1h6pmWEaFLep Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQIcBAEBAgAGBQJTTPkKAAoJEPo9qoy8lh71W2wP/jBcYihzDO8EJ8b0dMLa88rt kNeiOFWu4jfQXFUkpHJhxXqfnSqDAMjlpGa2j8PUJ3Dwo19nGCPmhVQ32O85wO0P be+XqzddOSwsTPEBfIlPZWLbGUfjGXVpUKOikc8AqMY/J2bF+TqkzLxJuemdDPZ2 GrTDUAyMj68aih4luwxG/of0Wvu/Jhakc1CO5hTQOd6f3nmMYy6rnOeacoWcTlfX 8ghEfuBKweXgh8fyimnBmyoIWEaj0rFovWzRNYyx9qAUU3ZbTVE0ZPE1rWttY6f2 Uswh0MqZue6oJfUZJC11fI1cr24hyd4FmKsU0E8PF6sYVMpt3ycCDW8Vjfgp7/SV ompi4f7LEORZjlMC9DHNxB7s+zVMt6EGaQgGjlo5c9RctUY6UAJYGuzQ1Yu60meY P5goHmEPne7o4Y7iUtfRFmjNqGY5imlmmIBa3Q9vbe8arF4S9uASXk6v2ZrBcTPN GiM1kghRc+1NUCisnewSwwRBeJXGChaSJTGVmIUAaG1b5+cavFIxNMB+GY1LWIvR mEFJiTT13pmhTZLgNkmg/epklyYVK4n0jiA/TiJ4RiYADasus6uA98FpBN9DMrku lL5eIp3ZPH2F8nb4Xc4ZnuGZRgi7TMlRktc25al60C1VklRK2A/F/I4flA86IH86 /qQHIr0/6AnLrrfxCLyc =5rYO -----END PGP SIGNATURE----- --bvoEgueOEj9JpjC9bEWKR1h6pmWEaFLep-- --===============0787514678== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0787514678==--