From patchwork Thu Apr 26 19:05:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 134531 Delivered-To: patches@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2720690lji; Thu, 26 Apr 2018 12:06:07 -0700 (PDT) X-Received: by 10.99.3.81 with SMTP id 78mr5387547pgd.355.1524769567782; Thu, 26 Apr 2018 12:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524769567; cv=none; d=google.com; s=arc-20160816; b=DVxK3lHbdqNqAQ2MsXcSHyeOdFeCHcrjhYZLB9jf3PSlOWx8RmEklO6N+CoeJSAH1F MArtHYWuCYBUBEByP6KbiPlqHYGkzG766LIAEm4L+NI7kiLQ4Vh92Bi23A6xLG0YbNMQ c5JtBzBSM26UuNhfeUtCLwKDmzyfwTip5XRvy6U8eHnmTKi8qg1sWrU/mwHe/M9nXimw NXO3keIzwykvlgtwB7W9I3ZkDMDyLkR9kPPLDcTDeyYOL5Qm/kmzVFLHC1klkJW9fAj0 2uR1Lb5ADzcHh/P4NdYrf5P/JUBOpUtr2YCtGsn2Z8xfoknMCBuzRMIVX/MWm4rFrBpG HNSg== 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=Vit1oxp8QlAgTv6JqI8NdkLpv+sLQA79ul3EUr67k7g=; b=yntlyFxGO9zzyWUlvkoRDtZQcPWwbjiQfLZ90t9mEL3Z8OT5tfobftEUKkzaQnqw1I lGm9FcrNtzhkeIYozUHX4awaiCpH8nY1a0kheg8dFBoFNa/oWRAV2F2CBhLiqJ63nRg7 qgJZlaSYFgd7MzLjTbwPQaDDBQGhNn/5I7sjayZVIYE0wyIlW2uzPHAHblB79jThiMs5 ahNCCx8kwj6QE06F1aNo5DP4+t/RKQosQWMFsbjD0Qn987iTJSZdSgDzg1HA+rW+qpiB e2bJHlMAo0Lh6IcS81Qmu+w6IGCrf40vSlzpP0BJ7HQ2bUPSiN2eUTmRQmGzbQK9hTBB BOCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fx8alPbT; 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 a63-v6sor7134518pla.2.2018.04.26.12.06.07 for (Google Transport Security); Thu, 26 Apr 2018 12:06:07 -0700 (PDT) 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=fx8alPbT; 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=Vit1oxp8QlAgTv6JqI8NdkLpv+sLQA79ul3EUr67k7g=; b=fx8alPbTxdqhONDih8Z8orNAtrlEoKrCGtGVJoEH3sZeqORpxXngrENe+55hJj3qgb t4dUCyl7hjOPLQCXN1ud6TR+s5GqG07HqkJfH7COmoqYJLVVQkzJP00hNXWom09Mo+1v BnkjBM9544ZKEH8NVUUiaXSzA449G05ADMocs= 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=Vit1oxp8QlAgTv6JqI8NdkLpv+sLQA79ul3EUr67k7g=; b=AUrzT/CcOHLwuWs02uXEoDP++WVXrnSV7/R6w5nt4xM7K5jPmX3pJksyepJAj5Dna/ rnBJZU4qiUVw0dI1bjyIi6ARe6Sy5J+xMqXeAqomVnxfRTzA30/WCjZCVFcgD0sWQOl7 8zhHIfvfdgzYiLhzaeUaIpduASHDpSujdbxuQJVNRMyPxwx09M8tXXLliGFI2CRK5VcN rKyK4cOUcabifZEO2kE3A03f8gqKGAR07tb0NWsHfAKTex7ZnUZmseOBeo8ARibfsUsP RVwjt2wDRohOArTba97ml/zDTE2X2QihteNvzbXdKV6y8Z58QaznlGAr5P99ks+alOFZ hI7w== X-Gm-Message-State: ALQs6tDEH1/bHJ4u9gW8G8jRwXl4FYRW0pakC7SW/FZ50DdpPg7ZPrmH 9c8W4SOOj/dCwbsaonbn9JsyQBEd X-Google-Smtp-Source: AB8JxZqHvpnClZbi5RLdt1HtNhNgIXjhwkXJG2A/B1yX3jXxJ9Ty8Q5hNEy0fRYiD7GnaIwbCThUmQ== X-Received: by 2002:a17:902:b286:: with SMTP id u6-v6mr12239991plr.68.1524769567295; Thu, 26 Apr 2018 12:06:07 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id a15sm33710956pfn.31.2018.04.26.12.06.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Apr 2018 12:06:06 -0700 (PDT) From: John Stultz To: dri-devel Cc: John Stultz , Marissa Wall , Sean Paul , Dmitry Shmidt , Robert Foss , Matt Szczesiak , Liviu Dudau , David Hanna , Rob Herring , Alexandru-Cosmin Gheorghe , Alistair Strachan Subject: [PATCH hwc 4/4] drm_hwcomposer: Fall back to client compositon if the gl precompostior fails Date: Thu, 26 Apr 2018 12:05:57 -0700 Message-Id: <1524769557-6108-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524769557-6108-1-git-send-email-john.stultz@linaro.org> References: <1524769557-6108-1-git-send-email-john.stultz@linaro.org> If the gl precompositor isn't being used, we cannot accept every layer as a device composited layer. Thus this patch adds some extra logic in the validate function to fall back to client side compositing if the gl precompositor did not initialize properly. This does force everything to a single plane even if we have a few available, but a deeper rework of the validate step planning is needed before we can reliably make use of them. Credit to Rob Herring, who's single plane patch was what this was originally based on. Cc: Marissa Wall Cc: Sean Paul Cc: Dmitry Shmidt Cc: Robert Foss Cc: Matt Szczesiak Cc: Liviu Dudau Cc: David Hanna Cc: Rob Herring Cc: Alexandru-Cosmin Gheorghe Cc: Alistair Strachan Reviewed-by: Rob Herring Signed-off-by: John Stultz --- v2: * Dropped misguided attempt to trivially allocate layers to planes --- drmhwctwo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 Acked-by: Robert Foss diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index 8e00d71..ede75e0 100644 --- a/drmhwctwo.cpp +++ b/drmhwctwo.cpp @@ -695,6 +695,13 @@ HWC2::Error DrmHwcTwo::HwcDisplay::ValidateDisplay(uint32_t *num_types, layer.set_validated_type(HWC2::Composition::Client); ++*num_types; break; + case HWC2::Composition::Device: + if (!compositor_.uses_GL()) { + layer.set_validated_type(HWC2::Composition::Client); + ++*num_types; + break; + } + /* fall through */ default: layer.set_validated_type(layer.sf_type()); break;