From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933746AbcGKM3n (ORCPT ); Mon, 11 Jul 2016 08:29:43 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:38464 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932201AbcGKM3l (ORCPT ); Mon, 11 Jul 2016 08:29:41 -0400 Date: Mon, 11 Jul 2016 14:29:37 +0200 From: Thierry Reding To: Emil Velikov Cc: Vinay Simha BN , open list , "open list:DRM PANEL DRIVERS" , Archit Taneja Subject: Re: [PATCH v5 2/2] drm/panel: Add JDI LT070ME05000 WUXGA DSI Panel Message-ID: <20160711122937.GB14709@ulmo.ba.sec> References: <1466046050-20588-1-git-send-email-simhavcs@gmail.com> <1466046050-20588-2-git-send-email-simhavcs@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IiVenqGWf+H9Y6IX" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 16, 2016 at 06:02:53PM +0100, Emil Velikov wrote: > On 16 June 2016 at 04:00, Vinay Simha BN wrote: [...] > > +static int jdi_panel_disable(struct drm_panel *panel) > > +{ > > + struct jdi_panel *jdi =3D to_jdi_panel(panel); > > + > > + if (!jdi->enabled) > > + return 0; > > + > Thinking out loud: >=20 > Thierry, > Shouldn't we fold 'enabled' and 'prepared' in struct drm_panel and > tweak the helpers respectively ? Is there any specific reason for > keeping these in the drivers ? Yes, I think that would make sense eventually. It's clearly a recurring pattern. Ideally nothing would be calling these functions more than once and thereby making the checks unnecessary. In practice that may mean that we need to put the variables and checks into the drm/panel core because display drivers (as opposed to a sane core implementation) call these. I suppose we could encourage proper usage by adding a couple of WARNs here and there if expectations aren't met. I don't think doing this is terribly urgent because it's easy to rip out of drivers once the drm/panel core supports it. And it's something that we could even leave within drivers when the core supports it, so trivial to remove one by one after the core patches have landed. Thierry --IiVenqGWf+H9Y6IX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXg5ExAAoJEN0jrNd/PrOh60QQALARoZNgY+0DkRp6gg6HV4bs 0cSRoGeyN28af7+tUU/EzacoYV3ux9uROVnoL0jZkQHO8SCcdJ/g5EXTRTvfvQeT mDyqXDha+01xlqS/DzOKcSL2d3SWqMPJzAjMu+uo4w1EOHcOyys9ps14MaLgcj8b XU9C17yk/HnN2uDVt4nc9P0RLDixpBrbIrOlw154ZYRWiuk0A59r20wLQuQsEX8m mycOG1OL1ZnhLmOus0561OuVGEE6b+ynDEvDLybZ6sarvYuQqy53X4HKYmsJY1oP Kw2+WGNuQCDkyJ3C4odPg5RgxZQezt8uZLgD/WWqezigvSQ13uwvEg7jIEaECAHF H/MnQcAB+BIwgOyXFxtgKfEXPOP1pVeuH4E3REOjMUKhMSS/xgPSaoW0aUr2v87e zSCm178jc3CbZjSxXvURObCFQWjFDukvnmCJsZzdzd7SEF4iERTjtImwBAf6c9Y+ qUjw7rhMuuiVqAKFoVHc6j0iNz6AP+PbMtDTVtJkn4Egz+tTWdhkjvfOMsa0CdeJ hDBuNWc59JTqVs9OHzTjK1sZ/L3XPTAfrrrK37gYbLuPDoYbNGuNYUScf2AnjrqG Asrmy2hieQHBbWbhgKSF/p/xy5W5vfx2PNg6AMjTU6sOWxkl5fx9ifLsey5gzqpI fZC8gp8tazHeMvNjrLis =AuGE -----END PGP SIGNATURE----- --IiVenqGWf+H9Y6IX--