Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753552AbcDYHBQ (ORCPT ); Mon, 25 Apr 2016 03:01:16 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37028 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752093AbcDYHBO (ORCPT ); Mon, 25 Apr 2016 03:01:14 -0400 Subject: Re: [PATCH 07/14] drm/nouveau: use drm_crtc_send_vblank_event() To: Gustavo Padovan , dri-devel@lists.freedesktop.org References: <1460656118-16766-1-git-send-email-gustavo@padovan.org> <1460656118-16766-7-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan , David Airlie , Ben Skeggs , Daniel Vetter , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Dave Airlie , Ilia Mirkin , Thierry Reding , open list From: Mario Kleiner Message-ID: <571DC0B6.90504@gmail.com> Date: Mon, 25 Apr 2016 09:01:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1460656118-16766-7-git-send-email-gustavo@padovan.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1682 Lines: 45 On 04/14/2016 07:48 PM, Gustavo Padovan wrote: > From: Gustavo Padovan > > Replace the legacy drm_send_vblank_event() with the new helper function. > > Signed-off-by: Gustavo Padovan > --- > drivers/gpu/drm/nouveau/nouveau_display.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c > index 7ce7fa5..973c2d9 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_display.c > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c > @@ -841,10 +841,12 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, > > s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); Hi Gustavo > if (s->event) { > + struct drm_crtc *crtc = drm_crtc_find(dev, s->crtc); > + I don't think this would work. s->crtc is a nouveau internal display pipe index, not a drm mode object id, so i don't think drm_crtc_find() will do what you need. Also it takes a mutex, which might_sleep() and i think nouveau_finish_page_flip gets called from irq context and holds a spin_lock_irqsave, so would end badly. You'd probably have to extend struct nouveau_page_flip_state to carry around a reference to the required drm_crtc, set up in nouveau_crtc_page_flip(). -mario > if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { > drm_arm_vblank_event(dev, s->crtc, s->event); > } else { > - drm_send_vblank_event(dev, s->crtc, s->event); > + drm_crtc_send_vblank_event(crtc, s->event); > > /* Give up ownership of vblank for page-flipped crtc */ > drm_vblank_put(dev, s->crtc); >