Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2272258ybl; Thu, 29 Aug 2019 06:08:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqykUna9SYJpxz/j2EcM6fUw7Dv1uZdd55FQtvaNMgxgzbrUT3IzkBkEghRy9ZFuaCK6QuaX X-Received: by 2002:a65:448a:: with SMTP id l10mr8076258pgq.327.1567084085671; Thu, 29 Aug 2019 06:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567084085; cv=none; d=google.com; s=arc-20160816; b=zfHku4xRrmTpCd6E9YxhfN6sPrhE4Ix/Hzje1f6aDQresKtQARjXEs14h6mrwDgxBU IPWCiEYm3pwmN5P8NqPHONesKwgQx3s09M4xfYYnva/kbCMoKqgAccOdwOiKB1E6dAed uf0Zit+fWAOQRkH2TJoZ8e9/7cOgnX+sdW9+nrhDvIR5DEkYNDMniJKXGq+ibRbjCZLt hqRtb+xXRhQVkxIJHj5hNz4zfZfb0BIqnEH+/NPSnFpRiBGHTvX0mBHno3lTi7HXsanx qVjhe01AE+wFnpvRLflqaxcvVfprtp1TFJDj0pgGJP86sW2nc9OYTJVYWk+e0c0LCSVj WFzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oB2V2oDizn+bNjnsA+L5QLEbTNlVkIvvrIN1uWftWrg=; b=kqwb1hikExlohOoauCZSDpKnQq34TPPDma/7d73jXvlagZhnG7SvdcvOeSpucB7zvM ry6o5Iv8dvieuxB9DCSQfACDPnApZ7a1F3IG4cU41zzazJFeFx/4MnyWQ8LsnMGPI6qU vCW+IrBKWd7EX78MR/kLWZfOQmY7MDBkG9WQela/faxku57PAAk71oSwmR55mlQmWLWD L1+JvesAGdMJ62EbXULOhZQnlVXjcOhVqe4vcxNthcAbdeyYdttcISiuTQz57xqfZ3Mb NfMky2j92SYuKilwBS2cVLRMNzr42A/DxTy+ZikZz7ofRS3t/MTpTXWsT7gkHKcsMAsW kZ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=U9H25fzz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si1889695plr.195.2019.08.29.06.07.47; Thu, 29 Aug 2019 06:08:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=U9H25fzz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727794AbfH2NFT (ORCPT + 99 others); Thu, 29 Aug 2019 09:05:19 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:34289 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727061AbfH2NFT (ORCPT ); Thu, 29 Aug 2019 09:05:19 -0400 Received: by mail-yb1-f195.google.com with SMTP id u68so1166356ybg.1 for ; Thu, 29 Aug 2019 06:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oB2V2oDizn+bNjnsA+L5QLEbTNlVkIvvrIN1uWftWrg=; b=U9H25fzzLjdZoYhtHqFGUY3b98H0cDFO731+o/hSSZ0eioY2hFRWZdjBuvMpRQ0xHv AMOD3Cyc9cIexJAtUUv1IbVzWyPJe2IDpPBoxBnxIcEMqrqkDvtw9xwOmYk9gBKR4SR6 LH9WXux5/7elAEqCOdhP2eyfgpXTFTxz2g1yV02yPQOhdKwhPu+EhJ3GGZCTdMCeSUYX 7ZC8Nh5RF20p7Byg5crPUB8WY6iBT1V0FGX7z7dqHG30MEdC6in/EhKUfGQXiHZzr/dF f2wk95GvwBeR5gLJ4JrucKTdwQ1oo55H1lWzJNpnHTvkzMSgADu+PLyedpto83ree3JT 7XnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oB2V2oDizn+bNjnsA+L5QLEbTNlVkIvvrIN1uWftWrg=; b=RPQ9M6EuEQiUpNGg0ce/A0Pc1220HddL8ydYlrh1qQ85X3fUwbYtArh3d6yi5a7QE+ Fc7xTQKJj0G+FeDTmOmkPPFoc2yj74FHUapbEMBDc2llGmyV2LnFwxDUTfsDKMzr93D/ guWmOZE1ZycYTCzEEm1rKpyQ2Sp74gmbLDX3OvC3F8WS+IfgeD8boKRHZbODo4X429fH ywGwhoNVjVEGpDkN7puXmAU06R+8hlexhoJIaTCvz+z7032pm/boWeAAj2wm4lwnmD59 UC2T+aEngN/7gj5zjgb1dmQNrioWqMSpUnSnn0G3e7kBOxY+t0XMt4EUGixiokZW2DcF t8sw== X-Gm-Message-State: APjAAAW2LU7REQ5/3SjnZ4ySTsrOnhArw5nkvfzQ8f2m/w9zq2SmHAhA Uui4I910VZY4DKOFGVgFmkAoFw== X-Received: by 2002:a25:747:: with SMTP id 68mr7097126ybh.41.1567083917958; Thu, 29 Aug 2019 06:05:17 -0700 (PDT) Received: from localhost ([2620:0:1013:11:89c6:2139:5435:371d]) by smtp.gmail.com with ESMTPSA id l4sm467267ywd.0.2019.08.29.06.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2019 06:05:17 -0700 (PDT) Date: Thu, 29 Aug 2019 09:05:17 -0400 From: Sean Paul To: Rob Clark Cc: dri-devel@lists.freedesktop.org, Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jeykumar Sankaran , Bruce Wang , Jordan Crouse , Sravanthi Kollukuduru , Thomas Gleixner , "open list:DRM DRIVER FOR MSM ADRENO GPU" , "open list:DRM DRIVER FOR MSM ADRENO GPU" , open list Subject: Re: [PATCH 3/9] drm/msm/dpu: handle_frame_done() from vblank irq Message-ID: <20190829130517.GH218215@art_vandelay> References: <20190827213421.21917-1-robdclark@gmail.com> <20190827213421.21917-4-robdclark@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190827213421.21917-4-robdclark@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 27, 2019 at 02:33:33PM -0700, Rob Clark wrote: > From: Rob Clark > > Previously the callback was called from whoever called wait_for_vblank(), > but that isn't a great plan when wait_for_vblank() stops getting called, > and results in frame_done_timer expiring. > > Signed-off-by: Rob Clark Reviewed-by: Sean Paul > --- > drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 7 +----- > .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 25 ++++++------------- > 2 files changed, 9 insertions(+), 23 deletions(-) > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > index c3f7154017c4..e7354aef9805 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c > @@ -311,12 +311,7 @@ static void dpu_crtc_frame_event_work(struct kthread_work *work) > | DPU_ENCODER_FRAME_EVENT_PANEL_DEAD)) { > > if (atomic_read(&dpu_crtc->frame_pending) < 1) { > - /* this should not happen */ > - DRM_ERROR("crtc%d ev:%u ts:%lld frame_pending:%d\n", > - crtc->base.id, > - fevent->event, > - ktime_to_ns(fevent->ts), > - atomic_read(&dpu_crtc->frame_pending)); > + /* ignore vblank when not pending */ > } else if (atomic_dec_return(&dpu_crtc->frame_pending) == 0) { > /* release bandwidth and other resources */ > trace_dpu_crtc_frame_event_done(DRMID(crtc), > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > index 7c73b09894f0..b9c84fb4d4a1 100644 > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c > @@ -324,6 +324,10 @@ static void dpu_encoder_phys_vid_vblank_irq(void *arg, int irq_idx) > > /* Signal any waiting atomic commit thread */ > wake_up_all(&phys_enc->pending_kickoff_wq); > + > + phys_enc->parent_ops->handle_frame_done(phys_enc->parent, phys_enc, > + DPU_ENCODER_FRAME_EVENT_DONE); > + > DPU_ATRACE_END("vblank_irq"); > } > > @@ -483,8 +487,8 @@ static void dpu_encoder_phys_vid_get_hw_resources( > hw_res->intfs[phys_enc->intf_idx - INTF_0] = INTF_MODE_VIDEO; > } > > -static int _dpu_encoder_phys_vid_wait_for_vblank( > - struct dpu_encoder_phys *phys_enc, bool notify) > +static int dpu_encoder_phys_vid_wait_for_vblank( > + struct dpu_encoder_phys *phys_enc) > { > struct dpu_encoder_wait_info wait_info; > int ret; > @@ -499,10 +503,6 @@ static int _dpu_encoder_phys_vid_wait_for_vblank( > wait_info.timeout_ms = KICKOFF_TIMEOUT_MS; > > if (!dpu_encoder_phys_vid_is_master(phys_enc)) { > - if (notify && phys_enc->parent_ops->handle_frame_done) > - phys_enc->parent_ops->handle_frame_done( > - phys_enc->parent, phys_enc, > - DPU_ENCODER_FRAME_EVENT_DONE); > return 0; > } > > @@ -512,20 +512,11 @@ static int _dpu_encoder_phys_vid_wait_for_vblank( > > if (ret == -ETIMEDOUT) { > dpu_encoder_helper_report_irq_timeout(phys_enc, INTR_IDX_VSYNC); > - } else if (!ret && notify && phys_enc->parent_ops->handle_frame_done) > - phys_enc->parent_ops->handle_frame_done( > - phys_enc->parent, phys_enc, > - DPU_ENCODER_FRAME_EVENT_DONE); > + } > > return ret; > } > > -static int dpu_encoder_phys_vid_wait_for_vblank( > - struct dpu_encoder_phys *phys_enc) > -{ > - return _dpu_encoder_phys_vid_wait_for_vblank(phys_enc, true); > -} > - > static int dpu_encoder_phys_vid_wait_for_commit_done( > struct dpu_encoder_phys *phys_enc) > { > @@ -615,7 +606,7 @@ static void dpu_encoder_phys_vid_disable(struct dpu_encoder_phys *phys_enc) > * scanout buffer) don't latch properly.. > */ > if (dpu_encoder_phys_vid_is_master(phys_enc)) { > - ret = _dpu_encoder_phys_vid_wait_for_vblank(phys_enc, false); > + ret = dpu_encoder_phys_vid_wait_for_vblank(phys_enc); > if (ret) { > atomic_set(&phys_enc->pending_kickoff_cnt, 0); > DRM_ERROR("wait disable failed: id:%u intf:%d ret:%d\n", > -- > 2.21.0 > -- Sean Paul, Software Engineer, Google / Chromium OS