Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941313AbcKOHQP (ORCPT ); Tue, 15 Nov 2016 02:16:15 -0500 Received: from mail.acc.umu.se ([130.239.18.156]:35866 "EHLO mail.acc.umu.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941247AbcKOHQN (ORCPT ); Tue, 15 Nov 2016 02:16:13 -0500 Date: Tue, 15 Nov 2016 08:16:09 +0100 From: David Weinehall To: Jani Nikula Cc: Tomeu Vizoso , linux-kernel@vger.kernel.org, David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Thierry Reding , Daniel Vetter Subject: Re: [Intel-gfx] [PATCH v11 3/4] drm/i915: Use new CRC debugfs API Message-ID: <20161115071609.GI8202@suiko.acc.umu.se> Mail-Followup-To: Jani Nikula , Tomeu Vizoso , linux-kernel@vger.kernel.org, David Airlie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Thierry Reding , Daniel Vetter References: <1475767268-14379-1-git-send-email-tomeu.vizoso@collabora.com> <1475767268-14379-4-git-send-email-tomeu.vizoso@collabora.com> <87inrq2vee.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87inrq2vee.fsf@intel.com> X-Editor: Vi Improved X-Accept-Language: Swedish, English X-GPG-Fingerprint: ED69 8CF5 6102 21B9 AFD1 9DB7 0B27 96FD 15DA A404 X-GPG-Key: http://www.acc.umu.se/~tao/files/pub_15daa404.gpg.asc User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1812 Lines: 41 On Mon, Nov 14, 2016 at 12:44:25PM +0200, Jani Nikula wrote: > On Thu, 06 Oct 2016, Tomeu Vizoso wrote: > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c > > index 23a6c7213eca..7412a05fa5d9 100644 > > --- a/drivers/gpu/drm/i915/intel_display.c > > +++ b/drivers/gpu/drm/i915/intel_display.c > > @@ -14636,6 +14636,7 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { > > .page_flip = intel_crtc_page_flip, > > .atomic_duplicate_state = intel_crtc_duplicate_state, > > .atomic_destroy_state = intel_crtc_destroy_state, > > + .set_crc_source = intel_crtc_set_crc_source, > > }; > > > > /** > > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h > > index 737261b09110..31894b7c6517 100644 > > --- a/drivers/gpu/drm/i915/intel_drv.h > > +++ b/drivers/gpu/drm/i915/intel_drv.h > > @@ -1844,6 +1844,14 @@ void intel_color_load_luts(struct drm_crtc_state *crtc_state); > > /* intel_pipe_crc.c */ > > int intel_pipe_crc_create(struct drm_minor *minor); > > void intel_pipe_crc_cleanup(struct drm_minor *minor); > > +#ifdef CONFIG_DEBUG_FS > > +int intel_crtc_set_crc_source(struct drm_crtc *crtc, const char *source_name, > > + size_t *values_cnt); > > +#else > > +static inline int intel_crtc_set_crc_source(struct drm_crtc *crtc, > > + const char *source_name, > > + size_t *values_cnt) { return 0; } > > +#endif > > "inline" here doesn't work because it's used as a function pointer. > > Is it better to have a function that returns 0 for .set_crc_source, or > to set .set_crc_source to NULL when CONFIG_DEBUG_FS=n? I'd say that whenever we have a function pointer we should have a dummy function without side-effects for this kind of things. Kind regards, David