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: 125606 Delivered-To: patches@linaro.org Received: by 10.46.66.141 with SMTP id h13csp50468ljf; Tue, 23 Jan 2018 15:16:55 -0800 (PST) X-Received: by 10.99.168.76 with SMTP id i12mr9589542pgp.119.1516749414944; Tue, 23 Jan 2018 15:16:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516749414; cv=none; d=google.com; s=arc-20160816; b=Njr6zEsCHl8GebZpT6jOkFP8gtdlku/wCEopu5pHfQEOQWaUCHpRmtJH3Hi8O6UTbi 8hZxRqxmP6dmt1u+w6+FEwuCjETy/ofPYpIDVKhRXcI+jhRjb3hMx9AOstC/L6EMrWnk TkbUb/yCenOB9GpsMajctNyX+QBfRtRFaPFD51ak1Cerqrm8TAvjCW2hwvLnyZwuHkGy ztuoboC3eQcr0MqyFGHWnYrXimbgVvs0BbJ7k8wU9o6VrVzGsSIjLaTNqQ1kTe1F10tB 2T5RdWYgeX+t8tgT1+TcnvCGx1VG7wh2I3XUrqpFZDSu0jdUdfJeJ2rP0t+HD3OfhUcp xU5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=J3LvMpp+h6c2Vc1dAzfPT6lPUBTmMkcnAIuR4haQupY=; b=bboZd/uf+YUojP6DjqbiyDJ0lRTEgHYwqWd1ZhpPm6+Ieefeidr7VRB3nKw38L2/8Y 1UZCiAgX7hpr8d/4EAaOT4hkCylZ0G82BqUqLApgclAP/b36pMH7NTNtcRtdy1IZbVPT FA3Wtnzqnto5G6QmaarcB1gnQnO6VxGXarDdjY6XzfMYgz4zpV/OR/Ue7HOw+wVCR/lq DF016DopqMgwJ11httPl++C3wphOZYTAnrlcdph94rMTDiHU18PHEjwoDKDg/dRta03b wN4hEYEI6/936ExT8jaM5EIwAX1h2qwAFalmtFk+EcjpWzgjxlvIEWLUQoeAkfwdgHXs R3hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kDdyTQhf; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b96-v6sor361921pli.126.2018.01.23.15.16.54 for (Google Transport Security); Tue, 23 Jan 2018 15:16:54 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kDdyTQhf; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=VSaYLKyqpO/ehTEpDv/ljDo0FJ5AKJ1xarPfsNW4VbpHzKyMXGMsTburrWkJU8YA7/ W6/UQ5/x5JRjczNRoimg5MIzm8osnSDq/fmmLriEta75Cbc01AA4yrpOre6GIxeMzVqS q6vdOa6xjE1qUCpXhbX6YBjpvWVzIqnn/XzNx4dHW0RaBMH2mo4FaMZgnGRzNwit0UQ8 loBUn+KWgFyAEufemww9FK7RiaeorRQ/RVSzzIX7cY17IpAG3/CAzIIV76DyQUUG5Qak DFFE456K5q88KbByZR+OwQwYjR5OyN2r3DdcaDIvlDfDwKATSZTTO6wwr0/hSSl6Ewwd +VSQ== X-Gm-Message-State: AKwxytfH8slPhYWASeCH1mnNEDA0t1lsCbKsLVxOA12hc7OBtxK50Cxn iFP29EKKx+cnBstjoFQ75u5jp2Z0 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) Return-Path: 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 Cc: John Stultz , Marissa Wall , Sean Paul , Dmitry Shmidt , Robert Foss , Matt Szczesiak , Liviu Dudau , David Hanna , Rob Herring 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> 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(+) -- 2.7.4 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; } }