From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH v3 1/4] drm/crtc: Add property for aspect ratio Date: Tue, 10 Jun 2014 13:15:58 +0200 Message-ID: <20140610111557.GA10797@ulmo> References: <20140605064001.GB30845@ulmo> <1401959408-11140-1-git-send-email-vandana.kannan@intel.com> <20140605092819.GB23099@ulmo> <5396C22D.6070108@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0838977333==" Return-path: In-Reply-To: <5396C22D.6070108@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Vandana Kannan Cc: "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org --===============0838977333== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 10, 2014 at 02:00:37PM +0530, Vandana Kannan wrote: > On Jun-05-2014 2:58 PM, Thierry Reding wrote: > > On Thu, Jun 05, 2014 at 02:40:08PM +0530, Vandana Kannan wrote: > > [...] > >> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > > [...] > >> /** > >> + * drm_mode_create_aspect_ratio_property - create aspect ratio proper= ty > >> + * @dev: DRM device > >> + * > >> + * Called by a driver the first time it's needed, must be attached to= desired > >> + * connectors. > >> + */ > >> +int drm_mode_create_aspect_ratio_property(struct drm_device *dev) > >> +{ > >> + if (dev->mode_config.aspect_ratio_property) > >> + return 0; > >> + > >> + dev->mode_config.aspect_ratio_property =3D > >> + drm_property_create_enum(dev, 0, "aspect ratio", > >> + drm_aspect_ratio_enum_list, > >> + ARRAY_SIZE(drm_aspect_ratio_enum_list)); > >> + > >> + return 0; > >=20 > > Sorry for not noticing this before: what if drm_propert_create_enum() > > fails? Should that return an error? This function will currently > > silently ignore failure to create the property. > >=20 > > Thierry > >=20 > Yes.. > I can > 1. modify this to return the property (which would be NULL if create > fails) and have a NULL check at the calling end or > 2. have a NULL check for the property at the calling end keeping the > existing implementation or > 3. return a non-zero value in case of failure. I prefer 3. -ENOMEM sounds like a good candidate here. Thierry --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTlujtAAoJEN0jrNd/PrOh6JcP/0oh3/cBxQnrbVBn++0Q2Os5 6KiSev4GnzyMqMXudwJ55gy9Ynb3hI7pKAcK+3pUXIJszA1rS5pR78Hp8i2UTxtA 2RQDBzzA2Tqe6N9zn8EOv1sIpQldZnvYE8PXydlYsOPUR21YNFLA5XY58/5rEpBx i29Od+cTSImZc2WsK5l2MUSPY9NZnmHeKpzl3ydp5QjwDtYTK8xsp1/gwH0p9r5M S7+/Lj/1j9Sp7+NgM8xHO4yUoZBDNAsZFKXB+no6k9zDm3+fhLJbCAQQq6M/p7be SFdoZwwSUCHcZb29OGqrH+YcUwvJtGq+iMFPMU524AT6Jv+kOuToOLzd/fA2MZ7q Yi7q6mcSs1B4fUnI8YkMebACTXLxIpuAipH6t2D33Y9auqocM/n+MIRANDNDd7lA RRqpulxZDVRTQ83t8si7r2ns/6hQx7O1/WQ4gyrXM81sU/ZEFGVoKIg3iU+jDMtX mkhCmD3MccrsNuaNAOzxIejHqKz/rB5sgLgFyYsIzSRPCVhyCKTx51sASjuGi40N Nw6FGHXmNoIcOV6Y6lpILwd7DbHfzSipYnFkhZ4wOKaAsofa16QZNMNs4fe7ocbz oc8JORAv3zkpIR9/X+Z15CZB7mrUERZeKICnO2vFjoQ02aC3MFQ0MDNFLUrp2cJw m8bHlRVfl0rO73DhpGQ2 =6Du4 -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn-- --===============0838977333== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0838977333==--