From mboxrd@z Thu Jan 1 00:00:00 1970 From: eric@anholt.net (Eric Anholt) Date: Thu, 07 Sep 2017 10:09:38 -0700 Subject: [PATCH 3/7 v3] drm/pl111: Replace custom connector with panel bridge In-Reply-To: <20170907124925.13805-3-linus.walleij@linaro.org> References: <20170907124925.13805-1-linus.walleij@linaro.org> <20170907124925.13805-3-linus.walleij@linaro.org> Message-ID: <87ingul9kd.fsf@anholt.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Linus Walleij writes: > This replaces the custom connector in the PL111 with the > panel bridge helper. > > This works nicely for all standard panels, but since there > are several PL11x-based systems that will need to use the dumb > VGA connector bridge we use drm_of_find_panel_or_bridge() > and make some headroom for dealing with bridges that are > not panels as well, and drop a TODO in the code. > > Signed-off-by: Linus Walleij > +out_bridge: > + if (panel) > + drm_panel_bridge_remove(bridge); > + else > + drm_bridge_remove(bridge); Drop the "else drm_bridge_remove(bridge)" here and in the hunk below -- that unregisters the bridge driver entirely, rather than unreferencing it from your driver (there's no refcounting to be done). With that change, Reviewed-by: Eric Anholt > out_config: > drm_mode_config_cleanup(dev); > finish: > @@ -236,6 +250,10 @@ static int pl111_amba_remove(struct amba_device *amba_dev) > drm_dev_unregister(drm); > if (priv->fbdev) > drm_fbdev_cma_fini(priv->fbdev); > + if (priv->panel) > + drm_panel_bridge_remove(priv->bridge); > + else > + drm_bridge_remove(priv->bridge); > drm_mode_config_cleanup(drm); > drm_dev_unref(drm); > > -- > 2.13.5 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 832 bytes Desc: not available URL: From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Anholt Subject: Re: [PATCH 3/7 v3] drm/pl111: Replace custom connector with panel bridge Date: Thu, 07 Sep 2017 10:09:38 -0700 Message-ID: <87ingul9kd.fsf@anholt.net> References: <20170907124925.13805-1-linus.walleij@linaro.org> <20170907124925.13805-3-linus.walleij@linaro.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1553510540==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id 863956E9BC for ; Thu, 7 Sep 2017 17:12:54 +0000 (UTC) In-Reply-To: <20170907124925.13805-3-linus.walleij@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Linus Walleij , Daniel Vetter , Jani Nikula , Sean Paul Cc: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1553510540== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Linus Walleij writes: > This replaces the custom connector in the PL111 with the > panel bridge helper. > > This works nicely for all standard panels, but since there > are several PL11x-based systems that will need to use the dumb > VGA connector bridge we use drm_of_find_panel_or_bridge() > and make some headroom for dealing with bridges that are > not panels as well, and drop a TODO in the code. > > Signed-off-by: Linus Walleij > +out_bridge: > + if (panel) > + drm_panel_bridge_remove(bridge); > + else > + drm_bridge_remove(bridge); Drop the "else drm_bridge_remove(bridge)" here and in the hunk below -- that unregisters the bridge driver entirely, rather than unreferencing it from your driver (there's no refcounting to be done). With that change, Reviewed-by: Eric Anholt > out_config: > drm_mode_config_cleanup(dev); > finish: > @@ -236,6 +250,10 @@ static int pl111_amba_remove(struct amba_device *amb= a_dev) > drm_dev_unregister(drm); > if (priv->fbdev) > drm_fbdev_cma_fini(priv->fbdev); > + if (priv->panel) > + drm_panel_bridge_remove(priv->bridge); > + else > + drm_bridge_remove(priv->bridge); > drm_mode_config_cleanup(drm); > drm_dev_unref(drm); >=20=20 > --=20 > 2.13.5 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlmxfVIACgkQtdYpNtH8 nuh8YQ//XgFjnIm7Qt9kuG2OXEkjhwIevVo+Ycg0pjOqekRvscTZWCFIzpStWZRh 7or56j+90obGXErenhcW9eNQD36yk7rVCBw7seY5knOmp7AjaMx1LmUNkdznDYAG KeChOrSiwwXw67YS9pZhQTsQb+zMYNho955R32r4DFRR1+hj/6sH+c4dTVx1QLtE jsyS11pXn4aYwkx2ULDlZhrwYIGqKvi0J7MOhyzIJeOuCYa49FjsWkKhqQDZPVeo 4sOx2DJGrOW1l3HKbDGvuUXxXC75PwixdplCDoC+errNiQjC/5i4kOe8eR+j/wiK ETXcKfwasTksTIOjasQIMeCoB+jHgDg2X0c5tgWGugiKVsdZ9pCCeX98clDo5ccw i6phiHdP/fjGXvcnP53wu9zfLCiPFQTHW/R6DGlQLlHpnrGnGE8EE3YontSAk4rm 5ZCu+Dp2QYvOA62S3fKiX4f9Z+RuTcvp5kg6FjLU52bbJG2/67dY4V9WHsFGXOYY H15nSDH9cnbkHdNFK6NgU2WmLe2j5rrlb+Ro6TN0yftcGiJvY7ZQ1dTH1TuUAdms hcsGyGCVe2si84vpsRTipJplEtMAlSQ6js0Y3lzyN81zeMNruYhOZEETTsHJ6RuI ud0I3kqV9iUgXFJQk/CqjMWSyoTUuxtnmG5w++ecKF4ozqARSHU= =t99O -----END PGP SIGNATURE----- --=-=-=-- --===============1553510540== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1553510540==--