From patchwork Tue Jan 23 23:16:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 10181143 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 9E04B6037F for ; Tue, 23 Jan 2018 23:17:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FABC287E9 for ; Tue, 23 Jan 2018 23:17:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 848AF2880D; Tue, 23 Jan 2018 23:17:03 +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 14C7A287E9 for ; Tue, 23 Jan 2018 23:17:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41A9C6E4C3; Tue, 23 Jan 2018 23:17:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B88D6E4BC for ; Tue, 23 Jan 2018 23:16:53 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id m26so1525262pfj.11 for ; Tue, 23 Jan 2018 15:16:53 -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=pTWYiRkH2mM0CNy2+RkIp5kty9IjdWlQq0uGmTTU4Fs=; b=KyZQAL0oHqQR1y91fmTddUk3lfIyW437sxG4kEoT5m4ndFN73m6NRvWXqTfv4hibbo ks/bH3OOtFRtU4pTkUot23FykKiUin+ZZ3wbotTDC0VkueAw5SeeAy2/D0JISJ60ofsE w7dbROHQhUJ0zXhAmR7MFUax76vbw7lsG882I= 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=pTWYiRkH2mM0CNy2+RkIp5kty9IjdWlQq0uGmTTU4Fs=; b=EGxURs2Axu/O7I7RfxuJ2Ri9hs2MXLi2KwJkv6Ev6th7ZrOWuqHVcg0MUH+Ck+9j/O P5xQjw9D2yapnGSHzZvNHyBLicmzjB6OMFZ9NVSl3qxVkX+BTxCnQywuRYj88giYT0DR jF25RZFpfbOisMMpvbcpiFFRSEC/22QQwUCrb37lDiLduvVxPwgXEDgFxtv+aHanQ5eJ wPKSIjHbzmxa+h5leCs4ujMNib1+s9joFIvlyY2HYzWy67IJx81jmF5wYLpfivv5DSmA pqhKj+kha5Q4K7yPzZSwecLJvtEnGo5awnjAmQn5NOmfZoUDVSvW61SHOa1Y/gfbDyB6 NsPQ== X-Gm-Message-State: AKwxyte+601jFnmhldnNsQky1PpiV4h45CoBxwHrG5tHj7cS0zlTorqH e9rGEksQ7qnBhqK9T5Y6woGGOzk9rWg= X-Google-Smtp-Source: AH8x227Fg8stBSrlfMjwrZN0c4bSkhNtZ1FkB1GQF72GU3sImvkVkQIHH+Z1/0kVRM9OD35B0XIMMw== X-Received: by 10.98.141.199 with SMTP id p68mr10810151pfk.25.1516749412757; Tue, 23 Jan 2018 15:16:52 -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.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 15:16:51 -0800 (PST) From: John Stultz To: dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 3/4 v2] drm_hwcomposer: Use client compositing if there is only one plane Date: Tue, 23 Jan 2018 15:16:38 -0800 Message-Id: <1516749399-29504-4-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 Originally based on work by Rob Herring, this patch changes ValidateDisplay() so that if there is only one plane, we modify Device composited layers to be Client composited. Without this, on devices with just one plane, nothing gets displayed on the screen. Suggestions for alternative solutions here 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: * Rework Rob's change to check planes --- drmhwctwo.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp index dfca1a6..6d88c5c 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 we only have one plane, always do Client composition */ + if (primary_planes_.size() + overlay_planes_.size() == 1) { + layer.set_validated_type(HWC2::Composition::Client); + ++*num_types; + break; + } default: layer.set_validated_type(layer.sf_type()); break;