From: Sascha Hauer Subject: Re: [PATCH v2] DRM: Add DRM kms/fb cma helper Date: Thu, 31 May 2012 20:11:16 +0200 Message-ID: <20120531181116.GW30400@pengutronix.de> References: <1338391815-12050-1-git-send-email-lars@metafoo.de> <20120531081355.GP30400@pengutronix.de> <4FC73B2D.3020406@metafoo.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [92.198.50.35]) by gabe.freedesktop.org (Postfix) with ESMTP id 028589E8C3 for ; Thu, 31 May 2012 11:11:21 -0700 (PDT) Content-Disposition: inline In-Reply-To: <4FC73B2D.3020406@metafoo.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Lars-Peter Clausen Cc: kernel@pengutronix.de, Laurent Pinchart , dri-devel@lists.freedesktop.org, Rob Clark List-Id: dri-devel@lists.freedesktop.org On Thu, May 31, 2012 at 11:34:37AM +0200, Lars-Peter Clausen wrote: > >> + drm_helper_mode_fill_fb_struct(&fb_cma->fb, mode_cmd); > >> + > >> + for (i = 0; i < num_planes; i++) > >> + fb_cma->obj[i] = obj[i]; > > > > Check for valid num_planes before this loop? > > > > Hm, I think the callers already take care of this. drm_format_num_planes will > always return a valid number and the other caller passes 1 unconditionally. As long as the array always is big enough to hold the maximum number of planes I think it's fine. However, if there is some format with 5 planes (don't know if there is, I only know yuv with multiple planes) it's not obvious that this code does not support this. > > > > > Note I have renamed struct drm_gem_cma_obj to struct drm_gem_cma_object > > in the patch I just sent. > > > > Do you think it makes sense for you to carry this patch as part of your iMX DRM > series? I can carry this, but it could be that Laurent has his driver in an acceptable state earlier. Let's see. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |