From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/bochs: Fix NULL dereference on atomic_disable helper Date: Mon, 11 Mar 2019 14:23:58 +0100 Message-ID: <20190311132358.GF2665@phenom.ffwll.local> References: <20190310212150.xhhb4abzm7j3ain2@smtp.gmail.com> <20190311062200.4mtel3j5fjxtxrcf@sirius.home.kraxel.org> <20190311101159.t6mbzm5sdwuh5muc@smtp.gmail.com> <20190311130716.6hjqci43clic5lxx@sirius.home.kraxel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190311130716.6hjqci43clic5lxx@sirius.home.kraxel.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Gerd Hoffmann Cc: Rodrigo Siqueira , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, Daniel Vetter List-Id: virtualization@lists.linuxfoundation.org On Mon, Mar 11, 2019 at 02:07:16PM +0100, Gerd Hoffmann wrote: > Hi, > > > > > static void bochs_crtc_atomic_flush(struct drm_crtc *crtc, > > > > struct drm_crtc_state *old_crtc_state) > > > > { > > > > @@ -66,6 +71,7 @@ static const struct drm_crtc_funcs bochs_crtc_funcs = { > > > > static const struct drm_crtc_helper_funcs bochs_helper_funcs = { > > > > .mode_set_nofb = bochs_crtc_mode_set_nofb, > > > > .atomic_enable = bochs_crtc_atomic_enable, > > > > + .atomic_disable = bochs_crtc_atomic_disable, > > > > > > Shouldn't we make the callback optional instead of adding empty dummy > > > functions to drivers? > > > > Hi Gerd, > > > > I agree, and I can work in this issue. > > Just one question, should we make atomic_enable optional as well? > > IIRC the drm code checks for the atomic_enable callback presence to > figure whenever it should take the atomic or legacy code paths. It should check for drm_driver->mode_config.funcs.atomic_commit for that, see drm_drv_uses_atomic_modeset(). Anything else should be a bug. Or do you mean the fallback to the old crtc helper prepare/commit callbacks? We'd need to make all of them optional ofc, with atomic_ variants being preferred ofc. -Daniel > > So, I think that will not work. > > cheers, > Gerd > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch