From patchwork Wed Jan 10 06:05:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10154037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 24907602D8 for ; Wed, 10 Jan 2018 06:06:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1799827FC0 for ; Wed, 10 Jan 2018 06:06:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B08428068; Wed, 10 Jan 2018 06:06:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7EAC927FC0 for ; Wed, 10 Jan 2018 06:06:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC3BB6E1B2; Wed, 10 Jan 2018 06:06:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E5A956E1B7 for ; Wed, 10 Jan 2018 06:06:02 +0000 (UTC) Received: by mail-pg0-x243.google.com with SMTP id z17so4122285pgc.4 for ; Tue, 09 Jan 2018 22:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R8Ll6R6hnLKcgo7Tb0n4MfoJzBeiSXPh0zGvbEWyXRE=; b=VdvzVJ4Y+962KMgD0anc19YlxbINGMN9bWRGqbXVUnIRsUawC1hVxP6lJyPGifaqbE JkcrCGYG8fCoew33Q+7gUXUC/vsp68epYilRbYA3xfLHtI7R8CynhTeY5AKrGUdPBUz0 lXDAZKOFo+bNdJBDzsJVmt0vSsfJ+aL3/AKCI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R8Ll6R6hnLKcgo7Tb0n4MfoJzBeiSXPh0zGvbEWyXRE=; b=SDH3z2ZQfNXWXskNddn3Hpoahr44YBX6RUuhdf9CQKJZXRhleq4PAj00uKUnDet8wq IzawGI5yb7pEpGwO1T6hmXwBxRVBBcToBTdrbsyh+rC8ydEPaQQ517pMf/SRoZ7G9yQa UBtNXYw0+lJsM43aAQ22NDaCs+hXUxy1ALLosvofQsLphO9kH83vxjskY1xt2rth2jRX 4JIRXo4j+Zr0uP5zahmDFVzD4svWesEiuvdJPz0t7wH0SOlT4q1vjs4ba6Iosmh4y76e /KxavWZ5TpTOoouU0Z/cTqYoesrf2rWcmqnicISBNQbc/2Rp4KQVYVMNQr+MnQB5YR1M HEMA== X-Gm-Message-State: AKwxyteVqZsm5NkGJRctPPGBJuEK4pNeP6LuTLIlJ+J4WjGa1cEAq/9j YeGG53CYX5TkWDdC192NjfrYwpXGUeg= X-Google-Smtp-Source: ACJfBou5Tv/Y3/gFYXv7lOVR8/bOBKcgoCloiwQLv5y0Pv+6hLuGbxsYWoSrAa5nUrlOP+NaJxzWvA== X-Received: by 10.101.99.129 with SMTP id h1mr386538pgv.101.1515564361923; Tue, 09 Jan 2018 22:06:01 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id g8sm25538595pgs.55.2018.01.09.22.06.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jan 2018 22:06:00 -0800 (PST) From: John Stultz To: dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 5/5] drm_hwcomposer: HACK: Fix tearing on hikey/hikey960 Date: Tue, 9 Jan 2018 22:05:45 -0800 Message-Id: <1515564345-1339-6-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515564345-1339-1-git-send-email-john.stultz@linaro.org> References: <1515564345-1339-1-git-send-email-john.stultz@linaro.org> Cc: Rob Herring , Matt Szczesiak , Dmitry Shmidt , Sean Paul , Robert Foss , Liviu Dudau , Marissa Wall , David Hanna X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When using drm_hwcomposer with the hikey/hikey960 boards, the resulting display shows lots of tearing. I'm not much of an expert in how this code should work, but it seems that we never call sync_wait(), and thus don't seem to be handling the fences properly? I'm not sure. Anyway, in a daze, I started cutting out code trying to make sure we call the CreateNextTimelineFence() and fb.set_release_fence_fd(). After doing so the tearing went away. I'm really not sure what is wrong that requires these hacks. It may be the hikey/hikey960 drm driver is incorrectly reporting or handling something? We do only have a single plane and no hardware compositing on the boards, so we are having to force the gpu to do all the compositing. Any ideas for what a proper fix here would be? Or even just hints on why this might make things work? Change-Id: Ifba58f6f1cb00e5271892c0241e4891abe211f22 Cc: Marissa Wall Cc: Sean Paul Cc: Dmitry Shmidt Cc: Robert Foss Cc: Matt Szczesiak Cc: Liviu Dudau Cc: David Hanna Cc: Rob Herring Signed-off-by: John Stultz --- drmdisplaycompositor.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp index acd13b8..6c391d6 100644 --- a/drmdisplaycompositor.cpp +++ b/drmdisplaycompositor.cpp @@ -299,10 +299,11 @@ int DrmDisplayCompositor::ApplySquash(DrmDisplayComposition *display_comp) { display_comp->importer()); pre_compositor_->Finish(); - if (ret) { +/* if (ret) { ALOGE("Failed to squash layers"); return ret; } +*/ ret = display_comp->CreateNextTimelineFence(); if (ret <= 0) { @@ -390,8 +391,8 @@ int DrmDisplayCompositor::PrepareFrame(DrmDisplayComposition *display_comp) { std::vector &layers = display_comp->layers(); std::vector &comp_planes = display_comp->composition_planes(); - std::vector &squash_regions = - display_comp->squash_regions(); +// std::vector &squash_regions = +// display_comp->squash_regions(); std::vector &pre_comp_regions = display_comp->pre_comp_regions(); @@ -405,7 +406,7 @@ int DrmDisplayCompositor::PrepareFrame(DrmDisplayComposition *display_comp) { } int squash_layer_index = -1; - if (squash_regions.size() > 0) { + if (1) { //squash_regions.size() > 0) { squash_framebuffer_index_ = (squash_framebuffer_index_ + 1) % 2; ret = ApplySquash(display_comp); if (ret)