From patchwork Tue Jan 23 23:16:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10181141 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 DDE556037F for ; Tue, 23 Jan 2018 23:17:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D01B9287E9 for ; Tue, 23 Jan 2018 23:17:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C538F2880D; Tue, 23 Jan 2018 23:17:00 +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 796ED287E9 for ; Tue, 23 Jan 2018 23:17:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B05876E4C0; Tue, 23 Jan 2018 23:16:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 584D96E4C0 for ; Tue, 23 Jan 2018 23:16:55 +0000 (UTC) Received: by mail-pf0-x242.google.com with SMTP id e76so1543220pfk.1 for ; Tue, 23 Jan 2018 15:16:55 -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=J3LvMpp+h6c2Vc1dAzfPT6lPUBTmMkcnAIuR4haQupY=; b=kDdyTQhfxXgTdRaVcMGkv146SbChTjKvmh+YOHa9r1ynohixTkUXKQ03hpRUPwXalP lNb6ewzOS24QGWxA1vTd9s1sWUMpzbEmdn1kAsxfN6TdgeED1/bDGptXpuT3J5Q/wNKS GdevWV0NTcOtcyXzMpk1FwjgiRPsH/rIBEMDE= 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=J3LvMpp+h6c2Vc1dAzfPT6lPUBTmMkcnAIuR4haQupY=; b=IjrzwJvhrj09/YpX3pldzO4ogxdjPc0uB5DWPzSQXY4s7TqfxjnNlsrySUp8UiNQbA xTjitgiecUm0KYDC9HNM+4VEC+JGrXoPd7M56cRZqA86cl0NuvlS96/KNtRnfX1FkUiz Pc/ZSyGVZaHvXOChzBa9gDpJ5DX9dGNootpwDX7BtFnYDSAlil9puMnrZiYla+VMkc4t VXmxcgp2zz76VjXAOnwgFr03WvScTFXL7mPHCeTqnz1ZbDco0gOX3s/DOeMjyNwLmDEN 7JQYzrUo/K6+Fa37jqjJylzJUp4rJnGERYQo73eXlYefbFmW552srDbr9cLTxb0bVWTi jS3Q== X-Gm-Message-State: AKwxytdOAcTx0JhLecfqq6BStmVvbZnhn2l8qn6ve9OMDKAqqNZyx3yT BH8l0Mh7TcDeo+ijKfDC92coSQfKq6Q= X-Google-Smtp-Source: AH8x2263INX9IS5Gep1Z0OrnuM7qLU6gELsDpII86+1kKSzuzy2yMFN/C+olsF9fO6etnLDRAnOYDg== X-Received: by 2002:a17:902:5a0b:: with SMTP id q11-v6mr6404295pli.207.1516749414490; Tue, 23 Jan 2018 15:16:54 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id c83sm6924811pfk.8.2018.01.23.15.16.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 15:16:53 -0800 (PST) From: John Stultz To: dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 4/4 v2] drm_hwcomposer: Try to fallback if GLCompisition fails Date: Tue, 23 Jan 2018 15:16:39 -0800 Message-Id: <1516749399-29504-5-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516749399-29504-1-git-send-email-john.stultz@linaro.org> References: <1516749399-29504-1-git-send-email-john.stultz@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Matt Szczesiak , Dmitry Shmidt , Sean Paul , Robert Foss , Liviu Dudau , Marissa Wall , David Hanna 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 board, the resulting display shows lots of tearing. This seems to be due to EGLcomposition not initializing properly, potentially due to I'm guessing limitations of what the utgard mali driver can do. I've noted that with the HiKey960 board, this patch is *not* necessary. Hacking around a bit, I found that since the glworker code isn't running properly, we never call glFinish(), which is required to fix the tearing. Ideas for a better way to implement this would be greatly appreciated! 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 --- v2: * Simplified, focusing on the key glFinsh() call --- drmdisplaycompositor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp index 3a20b31..eb0b77a 100644 --- a/drmdisplaycompositor.cpp +++ b/drmdisplaycompositor.cpp @@ -439,6 +439,10 @@ int DrmDisplayCompositor::PrepareFrame(DrmDisplayComposition *display_comp) { fb.set_release_fence_fd(ret); ret = 0; + } else { + /*If we're not doing anything, block to avoid tearing */ + glFinish(); + return 0; } }