From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753420AbdEJPNE (ORCPT ); Wed, 10 May 2017 11:13:04 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33163 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbdEJPND (ORCPT ); Wed, 10 May 2017 11:13:03 -0400 Date: Wed, 10 May 2017 17:12:58 +0200 From: Daniel Vetter To: Jose Abreu Cc: Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Carlos Palminha , Alexey Brodkin , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Dave Airlie , Andrzej Hajda , Archit Taneja Subject: Re: [PATCH v2 2/8] drm: Add drm_crtc_mode_valid() Message-ID: <20170510151258.kial6crneucvd3kw@phenom.ffwll.local> Mail-Followup-To: Jose Abreu , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Carlos Palminha , Alexey Brodkin , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Dave Airlie , Andrzej Hajda , Archit Taneja References: <9fa7d9826e3793989fb52a2911d37b41ddfc0580.1494347165.git.joabreu@synopsys.com> <20170510075906.h67prtmveosrmgb2@phenom.ffwll.local> <8af70047-7ab8-9beb-5258-ebaec5a245d8@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8af70047-7ab8-9beb-5258-ebaec5a245d8@synopsys.com> X-Operating-System: Linux phenom 4.9.0-2-amd64 User-Agent: NeoMutt/20170306 (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 10, 2017 at 09:57:30AM +0100, Jose Abreu wrote: > Hi Daniel, > > > On 10-05-2017 08:59, Daniel Vetter wrote: > > On Tue, May 09, 2017 at 06:00:09PM +0100, Jose Abreu wrote: > >> Add a new helper to call crtc->mode_valid callback. > >> > >> Suggested-by: Ville Syrjälä > >> Signed-off-by: Jose Abreu > >> Cc: Carlos Palminha > >> Cc: Alexey Brodkin > >> Cc: Ville Syrjälä > >> Cc: Daniel Vetter > >> Cc: Dave Airlie > >> Cc: Andrzej Hajda > >> Cc: Archit Taneja > >> --- > >> drivers/gpu/drm/drm_crtc.c | 22 ++++++++++++++++++++++ > >> drivers/gpu/drm/drm_crtc_internal.h | 3 +++ > >> 2 files changed, 25 insertions(+) > >> > >> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > >> index 5af25ce..07ae705 100644 > >> --- a/drivers/gpu/drm/drm_crtc.c > >> +++ b/drivers/gpu/drm/drm_crtc.c > >> @@ -38,6 +38,7 @@ > >> #include > >> #include > >> #include > >> +#include > >> #include > >> #include > >> #include > >> @@ -741,3 +742,24 @@ int drm_mode_crtc_set_obj_prop(struct drm_mode_object *obj, > >> > >> return ret; > >> } > >> + > >> +/** > >> + * drm_crtc_mode_valid - call crtc->mode_valid callback, if any. > >> + * @crtc: crtc > >> + * @mode: mode to be validated > >> + * > >> + * If no mode_valid callback is available this will return MODE_OK. > >> + * > >> + * Returns: drm_mode_status Enum > >> + */ > >> +enum drm_mode_status drm_crtc_mode_valid(struct drm_crtc *crtc, > >> + const struct drm_display_mode *mode) > >> +{ > >> + const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; > > This is clearly a helper func, but you place it into the core and > > EXPORT_SYMBOL it. Imo this should be entirely internal to the helpers, > > perhaps just stuff them all into drm_probe_helpers.c? Header file would be > > drm_crtc_helper_internal.h. > > Yeah, at first I was not planning to export it but then I saw > that drm_bridge_mode_fixup() is exported (and is in drm_bridge.c) > so it kind of felt right to place this in drm_crtc.c. Anyway, I > will move them to drm_probe_helpers.c, indeed there is no point > in exporting this. Bridge is a bit special, since there's the bridge integration through atomic/legacy helpers, but drivers could also wire up a bridge on their own (i.e. without using the drm_encoder->bridge pointer). Not sure anyone is doing that right now, but that was the idea behind having the helpers all exported. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch