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 13:44:29 +0300 Message-ID: <534D0D8D.3070100@ti.com> References: <534684E8.9000203@ti.com> <20140411115054.GC18465@intel.com> <534B9FC0.2020700@ti.com> <534CF904.1070105@ti.com> <534D09F9.2030608@samsung.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0139708796==" Return-path: Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by gabe.freedesktop.org (Postfix) with ESMTP id 301346E8BA for ; Tue, 15 Apr 2014 03:44:34 -0700 (PDT) In-Reply-To: <534D09F9.2030608@samsung.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Andrzej Hajda , Rob Clark , Tomi Valkeinen Cc: dri-devel List-Id: dri-devel@lists.freedesktop.org --===============0139708796== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QkBxGquAeGrEr6Fw9l2hiSBqNUOnkN7iQ" --QkBxGquAeGrEr6Fw9l2hiSBqNUOnkN7iQ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 15/04/14 13:29, Andrzej Hajda wrote: > I have experienced similar problem with exynos_drm. I have found that > in exynos_drm_crtc_mode_set there is line: >=20 > plane->fb =3D crtc->primary->fb; >=20 > without drm_framebuffer_reference. > In result drm_framebuffer_remove dereferences it twice: > - because of crtc->primary->fb =3D=3D fb, > - because of fb being on dev->mode_config.plane_list >=20 > I am not sure how it should be solved properly, but adding > drm_framebuffer_reference in exynos_drm_crtc_mode_set helps. >=20 > In omap_plane_mode_set there is also assignment: >=20 > plane->fb =3D fb >=20 > without drm_framebuffer_reference so maybe it can be solved the same wa= y. The omap_plane_mode_set() is called also when using non-primary planes. For those the refcounting goes right at the moment (I think), so adding drm_framebuffer_reference() at that func would break it. I guess I could check if the plane is primary, and add ref only then. Or add the ref in omap_crtc, before it calls omap_plane_mode_set(). Both feel a bit hacky... Tomi --QkBxGquAeGrEr6Fw9l2hiSBqNUOnkN7iQ 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) iQIcBAEBAgAGBQJTTQ2NAAoJEPo9qoy8lh710J4P/i8j0aJVKPhXjxLE1IweFQ3/ 3PM3LqJX5+u4ebmTZ9e40b1QHwPdVBDKJtvoPv/4mDpx2SJzMhT62RtA2vUjEdY/ 321KwsFOYgXIcV89MxL0iS5JElQZwwkamS7ezMl+mK/o9Cd908Q+a1bEkU2AWa4O rGE+PcBeFT+NW41rp7zMeYJBCtuyNeGV1uSDH/cQVJ8pfDM6Shh5dPcpoNyKxXj6 2s/Mq8Xh6EUGUSmN+jcB4KBWZAu0lq1H0jvmGvaXDZSQs0zAksGoeV0G384Bt21u jeu7+UeKKaQXRGW4rVG/YEWSQXrOe6JvSeUfsnzTAYCVkDoMRF2z2tRIdS0J/zu0 bwJdbtGZmaPts251hkikOWNUNCT+8OInq2jvD8R+teSEVTzyZ3FK4E2n4Oo4P1RH gpWOA0bGzhYLciQ3/MlgYDTTG9sxs+hqPBvxEwrxTfNtpYpbKoSJFSB/5GhZTHaV erAZ6adhVmlyXn3h41xoe2TnJA8qmIOZwJ3Lh4LEAwLOMKSfujKuV2S+C2mh7BiC wecntWWHYYN77As+wnqeT3YWKCiMWKa9PF9QnXuXjc3UL24YgNYqBYlvz1SwjnQq nePivCYY/Oo3P2plHb0fRS64rERHFIz21QrShA0KMM+eWomq/PRfzruRjyhKJQqD JAfcHmGIw9+IJ7+2rYkb =j4Vd -----END PGP SIGNATURE----- --QkBxGquAeGrEr6Fw9l2hiSBqNUOnkN7iQ-- --===============0139708796== 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 --===============0139708796==--