From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vandana Kannan Subject: Re: [PATCH v3 1/4] drm/crtc: Add property for aspect ratio Date: Tue, 10 Jun 2014 14:00:37 +0530 Message-ID: <5396C22D.6070108@intel.com> References: <20140605064001.GB30845@ulmo> <1401959408-11140-1-git-send-email-vandana.kannan@intel.com> <20140605092819.GB23099@ulmo> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140605092819.GB23099@ulmo> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Thierry Reding Cc: "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org 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 property >> + * @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 = >> + drm_property_create_enum(dev, 0, "aspect ratio", >> + drm_aspect_ratio_enum_list, >> + ARRAY_SIZE(drm_aspect_ratio_enum_list)); >> + >> + return 0; > > 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. > > Thierry > 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. Please let me know your inputs on this.. - Vandana