From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Stuebner Subject: Re: [RFC/PATCH] drm/rockchip: don't wait for vblank if fb hasn't changed Date: Sun, 17 Jan 2016 16:21:08 +0100 Message-ID: <5745581.hZKD3MVpjF@phil> References: <1452689614-6570-1-git-send-email-john@metanate.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <1452689614-6570-1-git-send-email-john@metanate.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: John Keeping Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org List-Id: linux-rockchip.vger.kernel.org QW0gTWl0dHdvY2gsIDEzLiBKYW51YXIgMjAxNiwgMTI6NTM6MzQgc2NocmllYiBKb2huIEtlZXBp bmc6Cj4gQXMgY29tbWVudGVkIGluIGRybV9hdG9taWNfaGVscGVyX3dhaXRfZm9yX3ZibGFua3Mo KSwgdXNlcnNwYWNlIHJlbGllcwo+IG9uIGN1cnNvciBpb2N0bHMgYmVpbmcgdW5zeW5jZWQuICBD b252ZXJ0aW5nIHRoZSByb2NrY2hpcCBkcml2ZXIgdG8KPiBhdG9taWMgaGFzIHNpZ25pZmljYW50 bHkgaW1wYWN0ZWQgY3Vyc29yIHBlcmZvcm1hbmNlIGJ5IG1ha2luZyBldmVyeQo+IGN1cnNvciB1 cGRhdGUgd2FpdCBmb3IgdmJsYW5rLgo+IAo+IEJ5IHNraXBwaW5nIHRoZSB2Ymxhbmsgc3luYyB3 aGVuIHRoZSBmcmFtZWJ1ZmZlciBoYXMgbm90IGNoYW5nZWQgKGFzIGlzCj4gZG9uZSBpbiBkcm1f YXRvbWljX2hlbHBlcl93YWl0X2Zvcl92YmxhbmtzKCkpIHdlIGNhbiBhdm9pZCB0aGlzIGZvciB0 aGUKPiBjb21tb24gY2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NlZSBmbGlja2VyaW5n IG9uIGFuaW1hdGVkIGN1cnNvcnMgdGhvdWdoIChsaWtlIG9uZXMgdXNlZCAKYnkgS0RFKSwgdGhh dCB3YXNuJ3QgcHJlc2VudCBiZWZvcmUuCgoKSGVpa28KX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVsIG1haWxpbmcgbGlzdApkcmktZGV2ZWxA bGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHA6Ly9saXN0cy5mcmVlZGVza3RvcC5vcmcvbWFpbG1h bi9saXN0aW5mby9kcmktZGV2ZWwK From mboxrd@z Thu Jan 1 00:00:00 1970 From: heiko@sntech.de (Heiko Stuebner) Date: Sun, 17 Jan 2016 16:21:08 +0100 Subject: [RFC/PATCH] drm/rockchip: don't wait for vblank if fb hasn't changed In-Reply-To: <1452689614-6570-1-git-send-email-john@metanate.com> References: <1452689614-6570-1-git-send-email-john@metanate.com> Message-ID: <5745581.hZKD3MVpjF@phil> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Am Mittwoch, 13. Januar 2016, 12:53:34 schrieb John Keeping: > As commented in drm_atomic_helper_wait_for_vblanks(), userspace relies > on cursor ioctls being unsynced. Converting the rockchip driver to > atomic has significantly impacted cursor performance by making every > cursor update wait for vblank. > > By skipping the vblank sync when the framebuffer has not changed (as is > done in drm_atomic_helper_wait_for_vblanks()) we can avoid this for the > common case of moving the cursor and only need to delay the cursor ioctl > when the cursor icon changes. > > I originally inserted a check on legacy_cursor_update as well, but that > caused a storm of iommu page faults. I didn't investigate the cause of > those since this change gives enough of a performance improvement for my > use case. > > This is RFC because of that and because the framebuffer_changed() > function is copied from drm_atomic_helper.c as a quick way to test the > result. > > Signed-off-by: John Keeping I've seen the effects now as well after making the atomic parts work on in my devtree - i.e. sluggish cursor movements. This patch fixes that issue, so at least: Tested-by: Heiko Stuebner Right now I still see flickering on animated cursors though (like ones used by KDE), that wasn't present before. Heiko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752876AbcAQPVW (ORCPT ); Sun, 17 Jan 2016 10:21:22 -0500 Received: from gloria.sntech.de ([95.129.55.99]:33520 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752499AbcAQPVV (ORCPT ); Sun, 17 Jan 2016 10:21:21 -0500 From: Heiko Stuebner To: John Keeping Cc: Mark Yao , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFC/PATCH] drm/rockchip: don't wait for vblank if fb hasn't changed Date: Sun, 17 Jan 2016 16:21:08 +0100 Message-ID: <5745581.hZKD3MVpjF@phil> User-Agent: KMail/4.14.10 (Linux/4.3.0-1-amd64; KDE/4.14.14; x86_64; ; ) In-Reply-To: <1452689614-6570-1-git-send-email-john@metanate.com> References: <1452689614-6570-1-git-send-email-john@metanate.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, 13. Januar 2016, 12:53:34 schrieb John Keeping: > As commented in drm_atomic_helper_wait_for_vblanks(), userspace relies > on cursor ioctls being unsynced. Converting the rockchip driver to > atomic has significantly impacted cursor performance by making every > cursor update wait for vblank. > > By skipping the vblank sync when the framebuffer has not changed (as is > done in drm_atomic_helper_wait_for_vblanks()) we can avoid this for the > common case of moving the cursor and only need to delay the cursor ioctl > when the cursor icon changes. > > I originally inserted a check on legacy_cursor_update as well, but that > caused a storm of iommu page faults. I didn't investigate the cause of > those since this change gives enough of a performance improvement for my > use case. > > This is RFC because of that and because the framebuffer_changed() > function is copied from drm_atomic_helper.c as a quick way to test the > result. > > Signed-off-by: John Keeping I've seen the effects now as well after making the atomic parts work on in my devtree - i.e. sluggish cursor movements. This patch fixes that issue, so at least: Tested-by: Heiko Stuebner Right now I still see flickering on animated cursors though (like ones used by KDE), that wasn't present before. Heiko