From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH v2 4/6] drm/fourcc: Pass the format_info pointer to drm_format_plane_cpp Date: Fri, 10 May 2019 19:00:31 +0300 Message-ID: <20190510160031.GM24299@intel.com> References: <27b0041c7977402df4a087c78d2849ffe51c9f1c.1557486447.git-series.maxime.ripard@bootlin.com> <32aa13e53dbc98a90207fd290aa8e79f785fb11e.1557486447.git-series.maxime.ripard@bootlin.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <32aa13e53dbc98a90207fd290aa8e79f785fb11e.1557486447.git-series.maxime.ripard@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org To: Maxime Ripard Cc: Daniel Vetter , David Airlie , Maarten Lankhorst , Sean Paul , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Emil Velikov List-Id: dri-devel@lists.freedesktop.org On Fri, May 10, 2019 at 01:08:49PM +0200, Maxime Ripard wrote: > So far, the drm_format_plane_cpp function was operating on the format's > fourcc and was doing a lookup to retrieve the drm_format_info structure and > return the cpp. > > However, this is inefficient since in most cases, we will have the > drm_format_info pointer already available so we shouldn't have to perform a > new lookup. Some drm_fourcc functions also already operate on the > drm_format_info pointer for that reason, so the API is quite inconsistent > there. > > Let's follow the latter pattern and remove the extra lookup while being a > bit more consistent. In order to be extra consistent, also rename that > function to drm_format_info_plane_cpp and to a static function in the > header to match the current policy. Is there any point keeping the function at all? It's just info->cpp[i] no? -- Ville Syrjälä Intel