Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5129979ybi; Tue, 4 Jun 2019 01:35:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4e2zgTXB2JwcFFp1sZZQFsLiv5Kp8aELhSbjTI0rv3pxVMFlJGUU1YWpGeW7LWLVAkpio X-Received: by 2002:a63:5726:: with SMTP id l38mr34955971pgb.344.1559637357437; Tue, 04 Jun 2019 01:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559637357; cv=none; d=google.com; s=arc-20160816; b=Td2wqFfXD9sbNA+7/igSFlXRl2xbRoRuB00cXsBCIXg6dwit37A+LAZf+rit9P5nlD AHTmCk6Yd+zNUn0IWy8JznxiQ1NH47Ul45LMHYDKtXW6XfdqWexSx4nInUBwFCdMqN/R tnJ0VL7u42XIAYvQR2GKJ4rjdjCcdDYF09YNbn6T3LCqxnx95CyBSaN17heebsoy5oVW g1Nfe1ynBgsHMCn3+P+v4x3JBRo5MbPYh9+WvwcbJLdf5+kGU/s2uUdWhj5VvEvuUWiK F2kmq2DdyAyHingGU5euu+ooCHaKwcVIKXt//UftcrbsZIuM1V98mnBTIRb3rfeNWuKZ G8KA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=v05mCfCuxjTf7EI7K6vq9Ot9NljPIrtp0OlW9vArYTs=; b=EZ+bZWciaB6wF/hcbnM2VVGpJeMh2N2vmmcUfJG0mVGMIrNr56cFEY4AoB653EB31Y lmImXRYCaEvlYH1ssz5QMvIHERI9pUbKuuyt+BEw+gi7JqRQaq7C0EnHC7m0noHiwVru F2eRD5LZbRhCHhscE5o9qAlS5GYyaaRatdIez/fdW0qkDPGCMJrXMnsCo2go9wfMxTch MG3oefjt2cn0arLnQ00OzvEFl+4sOTPkuRyLT+sFhGGXVlbYZU3NGH2/njEPceVO8H+V 8br1y3W5uRB0ZNyXj/EJp1/PAfBioXjhKKk3iIHHgzey9Ci9w9T7Ons6pf3LRZBY+rC4 cjXw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si22732074pfb.1.2019.06.04.01.35.41; Tue, 04 Jun 2019 01:35:57 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfFDIe0 (ORCPT + 99 others); Tue, 4 Jun 2019 04:34:26 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:40682 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbfFDIe0 (ORCPT ); Tue, 4 Jun 2019 04:34:26 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 843A228527C; Tue, 4 Jun 2019 09:34:24 +0100 (BST) Date: Tue, 4 Jun 2019 10:34:22 +0200 From: Boris Brezillon To: Helen Koike Cc: dri-devel@lists.freedesktop.org, nicholas.kazlauskas@amd.com, andrey.grodzovsky@amd.com, daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, Tomasz Figa , David Airlie , Sean Paul , kernel@collabora.com, harry.wentland@amd.com, =?UTF-8?B?U3TDqXBoYW5l?= Marchesin , Sandy Huang , linux-rockchip@lists.infradead.org, Heiko =?UTF-8?B?U3TDvGJuZXI=?= , linux-arm-kernel@lists.infradead.org, Daniel Vetter Subject: Re: [PATCH v4 1/5] drm/rockchip: fix fb references in async update Message-ID: <20190604103422.63a61f46@collabora.com> In-Reply-To: References: <20190603165610.24614-1-helen.koike@collabora.com> <20190603165610.24614-2-helen.koike@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Jun 2019 17:13:34 -0300 Helen Koike wrote: > On 6/3/19 1:56 PM, Helen Koike wrote: > > In the case of async update, modifications are done in place, i.e. in the > > current plane state, so the new_state is prepared and the new_state is > > cleaned up (instead of the old_state, unlike what happens in a > > normal sync update). > > To cleanup the old_fb properly, it needs to be placed in the new_state > > in the end of async_update, so cleanup call will unreference the old_fb > > correctly. > > > > Also, the previous code had a: > > > > plane_state = plane->funcs->atomic_duplicate_state(plane); > > ... > > swap(plane_state, plane->state); > > > > if (plane->state->fb && plane->state->fb != new_state->fb) { > > ... > > } > > > > Which was wrong, as the fb were just assigned to be equal, so this if > > statement nevers evaluates to true. > > > > Another details is that the function drm_crtc_vblank_get() can only be > > called when vop->is_enabled is true, otherwise it has no effect and > > trows a WARN_ON(). > > > > Calling drm_atomic_set_fb_for_plane() (which get a referent of the new > > fb and pus the old fb) is not required, as it is taken care by > > drm_mode_cursor_universal() when calling > > drm_atomic_helper_update_plane(). > > > > Signed-off-by: Helen Koike > > Cc: # v4.20+ > Fixes: 15609559a834 ("drm/rockchip: update cursors asynchronously > through atomic.") One comment for next time you have to add such tags after the fact: please try to keep lines unwrapped, otherwise patchwork only gets what's on the first line.