From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 717D6C433E1 for ; Wed, 24 Jun 2020 07:18:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4883E2084D for ; Wed, 24 Jun 2020 07:18:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="c4onjB4W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4883E2084D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3A5A6EA7F; Wed, 24 Jun 2020 07:18:07 +0000 (UTC) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A5376EAB9 for ; Wed, 24 Jun 2020 07:18:06 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id v3so1187316wrc.1 for ; Wed, 24 Jun 2020 00:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oL5SMm0ZGiw+7IqOBcYrZIkHYKsXsmYVUuSVlCwddhE=; b=c4onjB4WDxwMuApOMg9g14R4znxPeBll7P+AYRpkzDya5RX0asQXBnlEIr+i/wyK/D pTbexFmymVVPXxVf5y/26IlhL7U+BV6/7hj/ffRevC0cCuud6ssjjdu/b/Vy9365B0Ik MA3izHfQbChTir5Zyk4KnANS+L0FeXKzl9qFw= 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; bh=oL5SMm0ZGiw+7IqOBcYrZIkHYKsXsmYVUuSVlCwddhE=; b=RpoasHAxD+AoxCBOQFifU9aBoq1M0Ex7j6UPSh/ws0Z3waTGiEIV4/pHY2yDhOWxXU FieFYjmH0eeHIIHmqdNF6WxMkM/Yea7rQHHiFtjdBxRlfOQF4H0wzLh+uOvLt18t2qBS ZkQr909tkeuMLkwUAsH3gf1rEfLI6N+fvsjlaCBdaAy6puqWil69U6ENTaZ3k3mGhOTV /OsMNl3gTGZxmdfW6kK/gVOinSMnE6wIduIP5mnh7PtyoYWdgZVHeKKAYs0TsCGK+SXU bfb+RuCoOrtaEu0acxmDKdZWSx6fIXEKdVM/E+l1oA1sypS7IKtgXEYAnmAxLbF6O8iw Yedg== X-Gm-Message-State: AOAM5326IpxRYQc5q1o48b6CpnpRE/sFU8BMHAvLJgW2KMU+mTZA4h5Q NKkBorq7zi/5ayUh7jyACgNMYA== X-Google-Smtp-Source: ABdhPJyOUzI/TsP2QXvwl9/eNA4Hh5E8T5CruZbTkxmhTh6G68mXDQ2A/vEV2tyVIhb0I5ec3vR+rw== X-Received: by 2002:adf:c6c5:: with SMTP id c5mr28372863wrh.13.1592983084443; Wed, 24 Jun 2020 00:18:04 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z132sm979445wmb.21.2020.06.24.00.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 00:18:03 -0700 (PDT) Date: Wed, 24 Jun 2020 09:18:01 +0200 From: Daniel Vetter To: Emil Velikov Message-ID: <20200624071801.GR20149@phenom.ffwll.local> References: <20200612160056.2082681-1-daniel.vetter@ffwll.ch> <20200612160056.2082681-7-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.6.0-1-amd64 Subject: Re: [Intel-gfx] [PATCH 7/8] drm/mipi-dbi: Remove ->enabled X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Lechner , David Airlie , Intel Graphics Development , Maxime Ripard , DRI Development , Thomas Zimmermann , Daniel Vetter Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Tue, Jun 16, 2020 at 07:16:45PM +0200, Daniel Vetter wrote: > On Tue, Jun 16, 2020 at 3:57 PM Emil Velikov wrote: > > > > On Tue, 16 Jun 2020 at 07:50, Daniel Vetter wrote: > > > > > > On Mon, Jun 15, 2020 at 11:35 PM Emil Velikov wrote: > > > > > > > > Hi Daniel, > > > > > > > > On Fri, 12 Jun 2020 at 17:01, Daniel Vetter wrote: > > > > > > > > > > The atomic helpers try really hard to not lose track of things, > > > > > duplicating enabled tracking in the driver is at best confusing. > > > > > Double-enabling or disabling is a bug in atomic helpers. > > > > > > > > > > In the fb_dirty function we can just assume that the fb always exists, > > > > > simple display pipe helpers guarantee that the crtc is only enabled > > > > > together with the output, so we always have a primary plane around. > > > > > > > > > > Now in the update function we need to be a notch more careful, since > > > > > that can also get called when the crtc is off. And we don't want to > > > > > upload frames when that's the case, so filter that out too. > > > > > > > > > > Signed-off-by: Daniel Vetter > > > > > Cc: Maarten Lankhorst > > > > > Cc: Maxime Ripard > > > > > Cc: Thomas Zimmermann > > > > > Cc: David Airlie > > > > > Cc: Daniel Vetter > > > > > Cc: David Lechner > > > > > --- > > > > > drivers/gpu/drm/drm_mipi_dbi.c | 16 ++++++---------- > > > > > drivers/gpu/drm/tiny/ili9225.c | 12 +++--------- > > > > > drivers/gpu/drm/tiny/st7586.c | 11 +++-------- > > > > > include/drm/drm_mipi_dbi.h | 5 ----- > > > > > 4 files changed, 12 insertions(+), 32 deletions(-) > > > > > > > > > > diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c > > > > > index fd8d672972a9..79532b9a324a 100644 > > > > > --- a/drivers/gpu/drm/drm_mipi_dbi.c > > > > > +++ b/drivers/gpu/drm/drm_mipi_dbi.c > > > > > @@ -268,7 +268,7 @@ static void mipi_dbi_fb_dirty(struct drm_framebuffer *fb, struct drm_rect *rect) > > > > > bool full; > > > > > void *tr; > > > > > > > > > > - if (!dbidev->enabled) > > > > > + if (WARN_ON(!fb)) > > > > > return; > > > > > > > > > AFAICT no other driver has such WARN_ON. Let's drop that - it is > > > > pretty confusing and misleading as-is. > > > > > > Yeah, this is a helper library which might be used wrongly by drivers. > > > That's why I put it in - if you don't put all the various calls > > > together correctly, this should at least catch one case. So really > > > would like to keep this, can I convince you? > > > > There are plenty of similar places where a drm library/helper can be > > misused, lacking a WARN. Nevertheless - sure feel free to keep it. > > Yeah I agree, we can't check for everything. Personally I think a > check is warranted in two conditions: > - drivers got it wrong, and the WARNING helps catch driver-bugs we've > seen in the wild. Not really the case here > - drivers do check something as defensive programming, but it's an > invariant enforced by higher levels or helpers. Those I like to > convert to WARNING so that other driver authors learn that this should > never happen. This is such a case imo, I removed a bunch of fb checks > from drivers here. > > But yeah I think we should only add WARNING checks if this is actually > something people have gotten wrong, otherwise there's just too many of > them, distracting from the code. Merged this patch here too, thanks everyone for reviewing. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx