Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2814479imm; Mon, 13 Aug 2018 00:31:44 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwmWhSR0OLlqSDS78d79ePxvMxT/ntn35KrZ8P74lbfywqJiiGn6Ce6N+jsJiOXatyvPSMJ X-Received: by 2002:a62:89d8:: with SMTP id n85-v6mr17692234pfk.83.1534145504641; Mon, 13 Aug 2018 00:31:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534145504; cv=none; d=google.com; s=arc-20160816; b=UPZUcUefCi9OkdyVkIJBAD6s5TLHgsDFGX3QpyVkjWpPPLIzb7XMRjZ523RrR4T5pa mAq1PfUEoAfwSEr4F86Gx6667f2/Sf7TF0rYG7gRiO+kcNusSQPCAJDx87Ao8XDx+Wgn wr3ycrPB79WGKoS+QVtm7OpylvnBwfoL0fSQxhl3RAv5XvdiWH4huPQ6irDNluqXWQVy Jp6Mj0JD6H9BUyNMxkees31HhQztvwaHgQ3hazd5dBGYp1SYJSoZRvJTMPXaBe6P9SAw 15muw2YNWDjtey1Onn9rR+54R/7KpWlNULnHFiItNU0CF6f+JxUbZU7bDi89stAYDkQ8 4+1g== 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 :arc-authentication-results; bh=2krMhqTcFq6TjNIAKJyqgw/osdM2acvusCJDIlZzLiA=; b=jtyPWqptFp7MITbkUXa2gHrVoMMT6LGxNHcpFN7j8vLk+ndhlmUC3fRQpQvaDo4SrK EpnG1aCQNhgZhjFtJ/mPT8hne45mymVA71TDgm1n+u+86BRJF6/dkFDShKeCta8PSsNm RGujDdFe/X8vYDLt4kuMGSrv+faL31jSIIDr6MmFXg8RNDwujzfDd6HixOTY2RoQP+DL eXd+D7RWNPSkNW5IF9S8Qdwp49uDBUGG4NIM3XgLYggJcliWKiuaztzyRQC1DN5MHs03 ViHrVDrHaribSmMxgCoqAJez0HWpGiKONHt3E84cPuDh7iub7w8hoKesL8lOZq0fal6D 6w4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=WUmI6lVz; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o81-v6si17634408pfj.350.2018.08.13.00.31.29; Mon, 13 Aug 2018 00:31:44 -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=@chromium.org header.s=google header.b=WUmI6lVz; 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=REJECT sp=REJECT dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728575AbeHMKK1 (ORCPT + 99 others); Mon, 13 Aug 2018 06:10:27 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:41395 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726577AbeHMKK1 (ORCPT ); Mon, 13 Aug 2018 06:10:27 -0400 Received: by mail-yw1-f66.google.com with SMTP id q129-v6so12901244ywg.8 for ; Mon, 13 Aug 2018 00:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2krMhqTcFq6TjNIAKJyqgw/osdM2acvusCJDIlZzLiA=; b=WUmI6lVzBeU04zbhSVGAr9IJrECpc6caPnAzeImjProq9qeEhKJK2SeGtYA2S1VLAx Um5DxUhM+rdpRtz4R/LUrlLL9JszlhuijHxoJSWy18POSwjgENutpBtY5f4KCEUNzz0O KMQfAidJSnhnlWnD8WXW5j7JBvFzGQcwejyQk= 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=2krMhqTcFq6TjNIAKJyqgw/osdM2acvusCJDIlZzLiA=; b=RRXK1LmNO7J7IvgadkksW59qE5uNIE64q3QvL7Rk1egaJbGLznOfOucelOyV4b9MFt lCtnM41/ZBeUtrt+mEjyCrX/MgwAa8ItSaGENC0k1UKd3pjsDIQhQKasTREU1croA4cr RueOJcsgcCAukGHXgkTQk4hvrsp0T6w5Sj+PvPexLTmU1FQgdstL4T890TWyb4jlmcWP 7UdRiTPjo/GtU2chS84+rBTcpcSWT1XClYeMJ8UgLEKPT/eKd5efsiDBlHXm0AwuozK+ AVOArGD044gQVE6Kdo3nZZn1auuPM1lvNNX5Pq1z398JpD2A7LHOMsBO5YPyhxcAUKcI Zvew== X-Gm-Message-State: AOUpUlFVXRzVW21mhosutY4RYHVYGGyIbki5TRUsnYZ+7D6NmNG69LDC BUQxl2Am4Il837qNiYUoI7LCmD0Tfho= X-Received: by 2002:a81:c60c:: with SMTP id l12-v6mr8471830ywi.169.1534145365391; Mon, 13 Aug 2018 00:29:25 -0700 (PDT) Received: from mail-yw1-f49.google.com (mail-yw1-f49.google.com. [209.85.161.49]) by smtp.gmail.com with ESMTPSA id t4-v6sm8022329ywg.98.2018.08.13.00.29.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 00:29:24 -0700 (PDT) Received: by mail-yw1-f49.google.com with SMTP id s68-v6so12907706ywg.2 for ; Mon, 13 Aug 2018 00:29:24 -0700 (PDT) X-Received: by 2002:a0d:dcc3:: with SMTP id f186-v6mr8417000ywe.66.1534145363804; Mon, 13 Aug 2018 00:29:23 -0700 (PDT) MIME-Version: 1.0 References: <20180806155339.9473-1-enric.balletbo@collabora.com> <1889320.MtRaPYoaVN@phil> In-Reply-To: <1889320.MtRaPYoaVN@phil> From: Tomasz Figa Date: Mon, 13 Aug 2018 16:29:12 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/rockchip: update cursors asynchronously through atomic. To: =?UTF-8?Q?Heiko_St=C3=BCbner?= Cc: Enric Balletbo i Serra , Sandy Huang , David Airlie , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Kernel Mailing List , dri-devel , "open list:ARM/Rockchip SoC..." , Gustavo Padovan , Sean Paul , kernel@collabora.com, =?UTF-8?Q?St=C3=A9phane_Marchesin?= 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 Mon, Aug 13, 2018 at 4:26 PM Heiko Stuebner wrote: > > Am Montag, 13. August 2018, 09:11:07 CEST schrieb Tomasz Figa: > > Hi Enric, > > > > On Tue, Aug 7, 2018 at 12:53 AM Enric Balletbo i Serra > > wrote: > > > > > > Add support to async updates of cursors by using the new atomic > > > interface for that. > > > > > > Signed-off-by: Enric Balletbo i Serra > > > --- > > > Hi, > > > > > > This first version is slightly different from the RFC, note that I did > > > not maintain the Sean reviewed tag for that reason. With this version I > > > don't touch the atomic_update function and all is implemented in the > > > async_check/update functions. See the changelog for a list of changes. > > > > > > The patch was tested on a Samsung Chromebook Plus in two ways. > > > > > > 1. Running all igt kms_cursor_legacy and kms_atomic@plane_cursor_legacy > > > tests and see that there is no regression after the patch. > > > > > > 2. Running weston using the atomic API. > > > > Thanks for the patch. This feature might look like a really minor > > thing, but we really had hard time dealing with users complaints, so > > having this in upstream would be a really useful thing. > > > > Let me post some comments inline. > > > > > > > > Best regards, > > > Enric > > > > > > Changes in v1: > > > - Rebased on top of drm-misc > > > - In async_check call drm_atomic_helper_check_plane_state to check that > > > the desired plane is valid and update various bits of derived state > > > (clipped coordinates etc.) > > > - In async_check allow to configure new scaling in the fast path. > > > - In async_update force to flush all registered PSR encoders. > > > - In async_update call atomic_update directly. > > > - In async_update call vop_cfg_done needed to set the vop registers and take effect. > > > > > > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 53 +++++++++++++++++++++ > > > 1 file changed, 53 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > > > index e9f91278137d..dab70056ee73 100644 > > > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > > > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c > > > @@ -811,10 +811,63 @@ static void vop_plane_atomic_update(struct drm_plane *plane, > > > spin_unlock(&vop->reg_lock); > > > } > > > > > > +static int vop_plane_atomic_async_check(struct drm_plane *plane, > > > + struct drm_plane_state *state) > > > +{ > > > + struct vop_win *vop_win = to_vop_win(plane); > > > + const struct vop_win_data *win = vop_win->data; > > > + int min_scale = win->phy->scl ? FRAC_16_16(1, 8) : > > > + DRM_PLANE_HELPER_NO_SCALING; > > > + int max_scale = win->phy->scl ? FRAC_16_16(8, 1) : > > > + DRM_PLANE_HELPER_NO_SCALING; > > > + int ret; > > > + > > > + if (plane != state->crtc->cursor) > > > + return -EINVAL; > > > + > > > + if (!plane->state) > > > + return -EINVAL; > > > + > > > + if (!plane->state->fb || > > > + plane->state->fb != state->fb) > > > + return -EINVAL; > > > > While it covers for quite a big part of cursor movements, you may > > still expect jumpy cursor when hoovering text boxes or hyperlinks, > > since it changes the cursor image. Our downstream patch [1] actually > > took care of changing the framebuffer as well, although with the added > > complexity of referencing the old buffer at update time and releasing > > it in a flip work. > > > > [1] https://chromium.git.corp.google.com/chromiumos/third_party/kernel/+/1ad887e1a1349991c9e137b48cb32086e65347fc%5E%21/ > > [1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/394492 > for non-google people ;-) > Thanks, not sure how that internal link sneaked into my clipboard. Should have checked what I pasted. :P Best regards, Tomasz