Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp985963ybi; Fri, 31 May 2019 11:51:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqycn/nUFtoiSEOYLt/CRJcUTnQENtkZ75ZExyBdtPrItJry+D/LuwbfgYrdQCnVEWOw10hj X-Received: by 2002:a17:902:4381:: with SMTP id j1mr11312709pld.286.1559328706231; Fri, 31 May 2019 11:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559328706; cv=none; d=google.com; s=arc-20160816; b=SfwIqJTGbqwS3zwFMtMdf4GNy6eLnoXx+eOm+L7lni4Xrs0wFTPilg31V/XSB8ih0r NNrpDFJqYV6/GR6iNeKOc+Ao/kyOKc/1NHVV/kyiSS54FcvYHKjKSNqCzcbJtpTxDu5a J4hM6+qmdtFVTvdXepsYgilJLkkdDpuwc4N1umKlCrJF/hTuj9EAprRIa/eHpitS8TZB L90oCa/Z/99DCAY7T6Ulm9cs4vIZbRkaTzOc9LMdQy9Wn31p9aeZhpduWHhBKWLnH+oz GhBkSu5xHvmu20zlIY/pbSlb7i5fFuioWC/1faE/TLU9yK23qojoiXTeeGisdrDfaGge CFOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9F1WuqVm5Nwgt2J2M3yybMSAaWZKrJwC/jdTGtkMibQ=; b=Y5XtFoxpKVGpYtUQNJ7xmwnM1DrBLDAXg3zIVjMVuoARUZOjtSik+FZ8nZObQV4Dbf ZVFALBruBNGnZQH2MaIzCUR/BJbUxeGcZmXyNY8qGZyAl1wnT3OwhN3gadhSPYi4kLTu r893po5th5Q5qohFxm8uGvcT+pFtWW9S1OTpQmY61NL//wHaN3RhcoaNJl6g99Gdq77F l8aLlW7M9gMfCp8Lp/kevbk9RZqQVTzphp9/3fBRo0MEoPLPGL+nQx/Zd1LRF73I9fQy 2w+FfcWHtt7L2np6Ur7VJ9qK/1Ivkel38wm6+N+4+ABS/lpvftRgprvaUAhE2nVrO5kp BK3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="i/FN5emt"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d39si7743587pla.316.2019.05.31.11.51.30; Fri, 31 May 2019 11:51:46 -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=@gmail.com header.s=20161025 header.b="i/FN5emt"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727137AbfEaSu0 (ORCPT + 99 others); Fri, 31 May 2019 14:50:26 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:39516 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726589AbfEaSuZ (ORCPT ); Fri, 31 May 2019 14:50:25 -0400 Received: by mail-ed1-f68.google.com with SMTP id e24so15950056edq.6; Fri, 31 May 2019 11:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9F1WuqVm5Nwgt2J2M3yybMSAaWZKrJwC/jdTGtkMibQ=; b=i/FN5emthvipoIzFp3zGS9/f6xBcQBDTkQ7GC/lmQe0TwDLTHCS3IgiVtCQRBB44uB 6WEp7SwcJyAqdjMEYkv19i0jR/gVwbKMEhj2oMHnhpkKRJZ5d0RmumzwB+qOHE1anNKc 0EoAj2WEuDVIMfXdkxJ3IGB25hWm23hdRd/FWTJFpXyho+ouicbkZl4TX2nNirMfcJ64 mai4mjwMYtQ6nXS7rThoZY8t1lc4IYhFlbouzCfip/E3hE+7kuTzGaxnhDM8chWESfLK 33z4dteGs8q9xfQWTk8CUAzFuf3deuNaSOza9pxhkogn2H2EOi/hLl8Wobn2pzywPjxr xrfA== 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; bh=9F1WuqVm5Nwgt2J2M3yybMSAaWZKrJwC/jdTGtkMibQ=; b=RJh9o9MV3rfUIu2h0nNdDOZO7JgeoBidWqeCXH2hBCsyCG4sT5Nzzp02lsTwg7foHL KMWkn4jflkC9Mr8bXkiAEpfXFMkEtuyZpxSKJFBlLIw42tXUsFD1kmSu5J7dh/pJ8+/o xdTS5Y5+xAsX7G6NkAQnrW5ZursvoJHYsoQQxZiOBu2uvev8WTC4aKU2+L5bO9UFulVF C8xK9fg64X0bH5uVNnYBH9Uo98aNcfaNZS5WcjNCM5YKuQyQl1aIdzrp//203hLrl+A1 nW2Lr/LZynjGC2leScEOfllBMCC0gl/714+Whrk2LLmIb5/wPr1JegbYfn/Y75XIMHP5 xBCw== X-Gm-Message-State: APjAAAV9qePpBsgcZ85CQrMQ3SRfxN4NdRgWVxN/wD9qBFo7kOdG9BmA xlVW3wpuWnjza1cZGn0IRtLQ/hNpCccKYzTwXQpyQhWp X-Received: by 2002:a50:bc15:: with SMTP id j21mr13082718edh.163.1559328623286; Fri, 31 May 2019 11:50:23 -0700 (PDT) MIME-Version: 1.0 References: <20190314002027.7833-1-helen.koike@collabora.com> <20190314002027.7833-4-helen.koike@collabora.com> In-Reply-To: From: Rob Clark Date: Fri, 31 May 2019 11:50:09 -0700 Message-ID: Subject: Re: [PATCH v3 3/5] drm/msm: fix fb references in async update To: Helen Koike Cc: Helen Koike , dri-devel , nicholas.kazlauskas@amd.com, "Grodzovsky, Andrey" , Daniel Vetter , Linux Kernel Mailing List , Tomasz Figa , Boris Brezillon , David Airlie , Sean Paul , kernel@collabora.com, Harry Wentland , =?UTF-8?Q?St=C3=A9phane_Marchesin?= , stable , Sean Paul , linux-arm-msm , =?UTF-8?B?VmlsbGUgU3lyasOkbMOk?= , Maarten Lankhorst , freedreno , Mamta Shukla , Daniel Vetter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 10:54 AM Helen Koike wrote: > > Hello, > > On 3/13/19 9:20 PM, Helen Koike wrote: > > Async update callbacks are expected to set the old_fb in the new_state > > so prepare/cleanup framebuffers are balanced. > > > > Cc: # v4.14+ > > Fixes: 224a4c970987 ("drm/msm: update cursors asynchronously through atomic") > > Suggested-by: Boris Brezillon > > Signed-off-by: Helen Koike Thanks, I'm not super happy about the refcnt'ing subtleness here (mostly because it makes it harder to page in how things work on kernel/display side after spending most of my time in userspace/mesa), but I don't want to hold this up.. Acked-by: Rob Clark > > > > --- > > Hello, > > > > As mentioned in the cover letter, > > But I couldn't test on MSM because I don't have the hardware and I would > > appreciate if anyone could test it. > > I got this tested on a dragonboard 410c, no regressions where found and > no extra warnings. > > These two tests where already failing for other reasons: > flip-vs-cursor-crc-atomic > flip-vs-cursor-crc-legacy > > If you want to see the full log: > > https://people.collabora.com/~koike/drm-fixes-results.zip > > Thanks > Helen > > > > > In other platforms (VC4, AMD, Rockchip), there is a hidden > > drm_framebuffer_get(new_fb)/drm_framebuffer_put(old_fb) in async_update > > that is wrong, but I couldn't identify those here, not sure if it is hidden > > somewhere else, but if tests fail this is probably the cause. > > > > Thanks! > > Helen > > > > Changes in v3: None > > Changes in v2: > > - update CC stable and Fixes tag > > > > drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c > > index be13140967b4..b854f471e9e5 100644 > > --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c > > +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c > > @@ -502,6 +502,8 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, > > static void mdp5_plane_atomic_async_update(struct drm_plane *plane, > > struct drm_plane_state *new_state) > > { > > + struct drm_framebuffer *old_fb = plane->state->fb; > > + > > plane->state->src_x = new_state->src_x; > > plane->state->src_y = new_state->src_y; > > plane->state->crtc_x = new_state->crtc_x; > > @@ -524,6 +526,8 @@ static void mdp5_plane_atomic_async_update(struct drm_plane *plane, > > > > *to_mdp5_plane_state(plane->state) = > > *to_mdp5_plane_state(new_state); > > + > > + new_state->fb = old_fb; > > } > > > > static const struct drm_plane_helper_funcs mdp5_plane_helper_funcs = { > >