Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp441117ybi; Fri, 26 Jul 2019 12:23:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3CtL15jTXJ6xmNdG17CaW6t+tk2Sk6iLLwwjoPJeWmHO1/oQQDpcOZUg7TXJIxm2R+m7f X-Received: by 2002:a63:f926:: with SMTP id h38mr3471035pgi.80.1564169027199; Fri, 26 Jul 2019 12:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564169027; cv=none; d=google.com; s=arc-20160816; b=JYSVXDu/BnivySVwr3+fcIGJlXgSVOxSEYEl+aXm5fXqjZGcUOOKY1BPj/BFdz7s+h wdcH+9luvj+eZY1V3pMAep1GU5zTJKE0oLoJ7MoboDbqaLUlrM6vVnFMLz7KvWpK2/nZ FAQlGWMxj3c9hy0zd0PXGyMQaNDGIAVNkZhxN7hd7WxnvSXmLOhMzC8ga9RYPYzxcocj psNbKQ6ZWZ0ZXjzuQFxrrGbdaPlzEAiEN7zGGDS8YWZ1+i11oHpolIj1ZKnaWO1jNEut ZiZVX2RRCV4GTfl6MzhgKfLh6L8JndG2NoRrEg1yZEIF3lhEJUn+TDHmlRJ6bMbqcRnD BCFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zLjQMqPv69uzNsh3AaN/zI02lg0PspdBjxBwg/WuEPA=; b=u8jfKEgIbmR0/vPpdRIixjvam+hpauS6bpr2kB7W+Il8veyVKA0xlaXBes2CFUgQ2d 38UGK3C7JAh97i8oUXpE8pSsOAzRxy2UFNl4e+DzXHXZ7fFQ5obEeLqJEj1vI709iXR/ wmIsl+w5aIY0sH13S3sW5efTyfxPAa2LpyiDovyqva3ueizn9t+bRNNaOWl6o1qGWjdP +CMpxh8r1ndVs/tDm3wyFG2pt8xEq/iO0RE25s/yVTgD+rhE2TO/xpxaiIskcXAKLdnb KFeQq30T2JqUH0wp9PEh2SwP6XXY2UiCpSJDopG+tSC7OFwtvCEbUDJZ/nKZ0QnigHCK zd1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=cqkkQRWd; 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 s23si20025330pgm.345.2019.07.26.12.23.32; Fri, 26 Jul 2019 12:23:47 -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=@ffwll.ch header.s=google header.b=cqkkQRWd; 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 S1728419AbfGZQQA (ORCPT + 99 others); Fri, 26 Jul 2019 12:16:00 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:37482 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfGZQP7 (ORCPT ); Fri, 26 Jul 2019 12:15:59 -0400 Received: by mail-ot1-f65.google.com with SMTP id s20so55863879otp.4 for ; Fri, 26 Jul 2019 09:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=zLjQMqPv69uzNsh3AaN/zI02lg0PspdBjxBwg/WuEPA=; b=cqkkQRWdLVMNeGQZP4T91hRY0t9ARqP5neqG8r0967iy+XWfs+Q2+Ik53f4THz/+K3 Lm95ET9bRVMWGfD9mjRijvRm1aYB1/tm8+xHORTG6VmVDWZkl6VawBNflzXcTQ8C4U5j FLMxIDd2lpA+Jh3KnQo9PtvCLjXeR8yaXcn0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=zLjQMqPv69uzNsh3AaN/zI02lg0PspdBjxBwg/WuEPA=; b=sIdvjgV8ssQwNFT/vRE1mkktbkLXjFtG+HwtMVk4MeMhuWyy7eUMlFNOVPE++p6Ve2 qnQ6aKUorjeX306SCcMWfttPanRDa5IS6JUEEPvqZ2wtM7IOZJZHb2DQ/nvNOwp/9CPx Z9qGgVCgm6ncX4FSn1meWg5eJkGGIq6169d1ulGUio1TQJMiNncKUersa6PehAsZv7Lc hjherqsBTh/Qr0pnjOVXo/xZ7SgogzpIxFCYYBsHBML2XWallvwck3TWYp0RVnAKtb1v x7XfoiKmRP9BdJOcCpgmLEbwlt5LkGIB25+gq+azZ4EBWAt+dahDVwYxNVulpTIFthF0 H9QQ== X-Gm-Message-State: APjAAAXe4ENXBw8IF9BiUc/ZoHUV6NfP/bkmRTlD4iVD2ZgwoaRljvM0 GWiU8W+rCoU7NC66dR5wIDfS8bApFDemecr24/U= X-Received: by 2002:a9d:7451:: with SMTP id p17mr65268706otk.204.1564157758389; Fri, 26 Jul 2019 09:15:58 -0700 (PDT) MIME-Version: 1.0 References: <1564128758-23553-1-git-send-email-lowry.li@arm.com> <20190726142356.GI15868@phenom.ffwll.local> <20190726144428.tfwoaniidijchblt@DESKTOP-E1NTVVP.localdomain> In-Reply-To: <20190726144428.tfwoaniidijchblt@DESKTOP-E1NTVVP.localdomain> From: Daniel Vetter Date: Fri, 26 Jul 2019 18:15:46 +0200 Message-ID: Subject: Re: [PATCH] drm/komeda: Skips the invalid writeback job To: Brian Starkey Cc: "Lowry Li (Arm Technology China)" , Liviu Dudau , "james qian wang (Arm Technology China)" , "maarten.lankhorst@linux.intel.com" , "seanpaul@chromium.org" , "airlied@linux.ie" , Ayan Halder , "Jonathan Chai (Arm Technology China)" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Julien Yin (Arm Technology China)" , nd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 26, 2019 at 4:44 PM Brian Starkey wrote= : > > On Fri, Jul 26, 2019 at 04:23:56PM +0200, Daniel Vetter wrote: > > On Fri, Jul 26, 2019 at 08:13:00AM +0000, Lowry Li (Arm Technology Chin= a) wrote: > > > Current DRM-CORE accepts the writeback_job with a empty fb, but that > > > is an invalid job for HW, so need to skip it when commit it to HW. > > > > > > Signed-off-by: Lowry Li (Arm Technology China) > > > > Hm, this sounds a bit like an oversight in core writeback code? Not sur= e > > how this can even happen, setting up a writeback job without an fb soun= ds > > a bit like a bug to me at least ... > > > > If we don't have a good reason for why other hw needs to accept this, t= hen > > imo this needs to be rejected in shared code. For consistent behaviour > > across all writeback supporting drivers. > > -Daniel > > I think it's only this way to simplify the drm_writeback_set_fb() > implementation in the case where the property is set more than once in > the same commit (to something valid, and then 0). > > The core could indeed handle it - drm_writeback_set_fb() would check > fb. If it's NULL and there's no writeback job, then it can just early > return. If it's NULL and there's already a writeback job then it > should drop the reference on the existing fb and free that job. > > Could lead to the job getting alloc/freed multiple times if userspace > is insane, but meh. Generally these consistency checks need to be in in the atomic_check phase, not when we set properties. So either somewhere in the helpers, or in drm_atomic_connector_check() if we want it in core, enforced for everyone. -Daniel > > -Brian > > > > > > --- > > > drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 2 +- > > > drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c | 9 +++++++= +- > > > 2 files changed, 9 insertions(+), 2 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drive= rs/gpu/drm/arm/display/komeda/komeda_crtc.c > > > index 2fed1f6..372e99a 100644 > > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c > > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c > > > @@ -265,7 +265,7 @@ void komeda_crtc_handle_event(struct komeda_crtc = *kcrtc, > > > komeda_pipeline_update(slave, old->state); > > > > > > conn_st =3D wb_conn ? wb_conn->base.base.state : NULL; > > > -if (conn_st && conn_st->writeback_job) > > > +if (conn_st && conn_st->writeback_job && conn_st->writeback_job->fb) > > > drm_writeback_queue_job(&wb_conn->base, conn_st); > > > > > > /* step 2: notify the HW to kickoff the update */ > > > diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c= b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c > > > index 9787745..8e2ef63 100644 > > > --- a/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c > > > +++ b/drivers/gpu/drm/arm/display/komeda/komeda_wb_connector.c > > > @@ -52,9 +52,16 @@ > > > struct komeda_data_flow_cfg dflow; > > > int err; > > > > > > -if (!writeback_job || !writeback_job->fb) > > > +if (!writeback_job) > > > return 0; > > > > > > +if (!writeback_job->fb) { > > > +if (writeback_job->out_fence) > > > +DRM_DEBUG_ATOMIC("Out fence required on a invalid writeback job.\n")= ; > > > + > > > +return writeback_job->out_fence ? -EINVAL : 0; > > > +} > > > + > > > if (!crtc_st->active) { > > > DRM_DEBUG_ATOMIC("Cannot write the composition result out on a inact= ive CRTC.\n"); > > > return -EINVAL; > > > -- > > > 1.9.1 > > > > > > _______________________________________________ > > > dri-devel mailing list > > > dri-devel@lists.freedesktop.org > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > > > -- > > Daniel Vetter > > Software Engineer, Intel Corporation > > http://blog.ffwll.ch > IMPORTANT NOTICE: The contents of this email and any attachments are conf= idential and may also be privileged. If you are not the intended recipient,= please notify the sender immediately and do not disclose the contents to a= ny other person, use it for any purpose, or store or copy the information i= n any medium. Thank you. > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel --=20 Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch