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=-4.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED autolearn=ham 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 1CEC5C282CE for ; Tue, 4 Jun 2019 08:34:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D7EEC2173E for ; Tue, 4 Jun 2019 08:34:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Dxvf2YqJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D7EEC2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3dR0Ilhp80pk3xDI10mB+V6PmcWkV5qqRNPm5zO8bgU=; b=Dxvf2YqJ25jJfb WGM2VsGQvd2AokV8mqgyLZn2tubRjZWRi9vEKi121AOze+gd7rHtFPdrY1RnzxChL1YL7Csy2jYxV NOr+/tW/afZwKZU6od9iQxHILAbApZkcXVaY6HdTzQ87FGkzwLZu750IprAGH2fETN1aLv/hvraLQ Hr8Hpn2rjcqKw++0JDuOEYYGp1roZK7r8iUTW6ypymMTZbOlFXalFEYkAe2s7uki++p57X4lHZjM8 RXd7tCLq9uPzGEmzjnoQ3XOtFmfFpNedDxycxqLPeq2CIZ6PEkbAio6mhEZ4NOb14LFNIsLnbAHPS sTshCSaMA11aqbGj64Lg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hY4tp-0002J0-85; Tue, 04 Jun 2019 08:34:29 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hY4tm-0002IV-BV; Tue, 04 Jun 2019 08:34:27 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190604_013426_521254_BC09531C X-CRM114-Status: GOOD ( 18.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrey.grodzovsky@amd.com, =?UTF-8?B?U3TDqXBoYW5l?= Marchesin , Heiko =?UTF-8?B?U3TDvGJuZXI=?= , Sean Paul , David Airlie , daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Tomasz Figa , linux-rockchip@lists.infradead.org, Sandy Huang , Daniel Vetter , kernel@collabora.com, harry.wentland@amd.com, nicholas.kazlauskas@amd.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel