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: 124018 Delivered-To: patches@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4884486qgn; Tue, 9 Jan 2018 22:06:02 -0800 (PST) X-Received: by 10.98.186.25 with SMTP id k25mr15740568pff.28.1515564362329; Tue, 09 Jan 2018 22:06:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515564362; cv=none; d=google.com; s=arc-20160816; b=mh0f1HSuc1U7XZRW53pbrPLiOKTGpLcR7xTJBFv0cZDUpwQYZ/+7ieOGlEfjE3mEee qZLzAZ04m7eois76hkG5wVvUBbstU6pU31Y0LU3KKyJ7py0TyKVDFzuTO9rP4ccgel3Y LfpoohuxKrlvbNMia4Y9NrBIlyKY5kAg2PpTStusLec7lnBh/pRhsuSwd00C+jfFeH92 olomTXX5bE1MmhOMdZz2dk5m3Rw+q2YhYw57YNFe6H3peG/9j0VsDo6qOXLp4AadCP5e Oa4EN2QAYvJsiZfP93Qi0CtdYk+4bfSlYvdbOCB2h+63kNu4+Al+WotKk+Q3zlxk3k6t BA+A== 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=R8Ll6R6hnLKcgo7Tb0n4MfoJzBeiSXPh0zGvbEWyXRE=; b=0aUUdyWXKTFIQzv8CM4864H6eWAdMac8UDlRMIyq9oVZja0dxpzxW3q+EJNW0yV7AK bYgOieaQu+6zyB1seahnGseluj6+mxPZfGrnNWSI4rSl+/BYoKPqDuqkhuYW7biKplis xbH0Fa9ajkmOIjjGnlPygtz4NgSMPJjdHB/qvTtC7pCjDUpYcTEHOE2WYzutBC1paMl4 XtEJzSWAWiFrJUN/pvlC8mhg6dqt5zenCBtLLKFtCuUz9TtxT3+L0lQAViXPw41wGfgK tRa7LTYnFaf4ONz8Dh2QNpPcFw0QgotjHr6z9NbZ+8OznCieksMRKpiedGh0R3UFxmUW 6Vng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VdvzVJ4Y; 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 o7sor3589500pgq.113.2018.01.09.22.06.02 for (Google Transport Security); Tue, 09 Jan 2018 22:06:02 -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=VdvzVJ4Y; 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=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=XJhe3SMB5PDtEYWOXc1RnYPx5BjmGqOlzw0apu/dJfby/zBC9okc5n7TnBOSEFqIJy 7WAHgWLKP4kjiqvR97XPtYbNCEogpO/oRAXPFkhlBF6nmnx3Iab3yYd1OLKYBLQxduYi 7iCvKf4rz7kwzjAHSV4FO84iyI5vUoo+RQiHiexsb0RX6gawkijKcyYY0s0MaZFdqwWU wFD+8rmxYPb9FmqoBdcy3v5swyatAyb2tAWnPTujyfEKNbL/wMe/eGRA/t0z/fDbthG4 1yw0hwLy8tutHPLoyOuCCZq06yX9A4wHnKnYU4vKpDt8LvAWjAgnUNRJKB1DMOhgUxWN Iakw== X-Gm-Message-State: AKwxytcslttkIPcC8QIVeIJU6XbgnI7B9pcrJqXePFIelNVickUYO1VZ FZQeOhF/4KvMUbVF9NXDetaV6dtu 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) Return-Path: 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 Cc: John Stultz , Marissa Wall , Sean Paul , Dmitry Shmidt , Robert Foss , Matt Szczesiak , Liviu Dudau , David Hanna , Rob Herring 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> 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(-) -- 2.7.4 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)