From patchwork Mon Apr 16 22:22:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Kristian_H=C3=B8gsberg?= X-Patchwork-Id: 10344007 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 5673660542 for ; Mon, 16 Apr 2018 22:31:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FFEF2884E for ; Mon, 16 Apr 2018 22:31:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31F5628896; Mon, 16 Apr 2018 22:31:41 +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=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, 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 D48E12884E for ; Mon, 16 Apr 2018 22:31:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 26D996E1E5; Mon, 16 Apr 2018 22:31:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 762826E176 for ; Mon, 16 Apr 2018 22:31:37 +0000 (UTC) Received: by mail-io0-x243.google.com with SMTP id y128so20016319iod.4 for ; Mon, 16 Apr 2018 15:31:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ZSEF89Xb0VvPxgLJW3LT5DtfnYgA40kNJeDglaFWjrE=; b=SYf7NSMBRx5xNuDpDvpRWs5XNfQHU7MxwCrldtU2OSYbD97Mv8WSDcQwfZvd1djBDr yYzqaQrAzYSizsitKOii+lnqidbTdOz+S0tEthJ2PH3XeRyd4UMOheMtEEZjzWsh4YhO AbrWiQNLKL6KoaR3daKipZmQt1EBguqdi0JUqOazXL6/RBW4CkBrIQ/jNpiIUDqQ8mnu BEL7Xq8xx0nOJYe9wMZ6jl9qnJnzFORNU034xq4iTfbIFkLtE2xMdGre9EgiChtukiWo qmGQnYBKeBVwXyUJ92h1jyraJ0DqSQpT015uJImzcJpcjl9RUiaqDmPOwtWHfjxKiJS1 8c1A== 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; bh=ZSEF89Xb0VvPxgLJW3LT5DtfnYgA40kNJeDglaFWjrE=; b=Zz7pDSGSmMbB7AVuefKMYwvyAiFopzX3zjkzCsrTMTIjhl5QbP2Cv2Ya6LYjHZnM2U 3DF+MDsKCvkbv9FVdO5L200PRZ4lmc3qa1qNxfCAf5R4bV2TbAMqsD8gRbfkJZCLe2lS jtwi7EqO+QbbG0VXmrpodwx43PG/mX/mcD5Nq8zhrQh7WPNk7SbjEAX0fsTA+Y7h8Z44 wI2vX9YuDRGJGHzkdb4MgT0SVSQTIPUS65rwt9+eL6vuIknqKI6+A+wvQxjJEeFYb//R YPTF/wT2sQ/YGabeEUeoH5mtv3LjRQA0+6TX7JRWndDsUNThdJlnvJIynoEWlDabMu5u 7muA== X-Gm-Message-State: ALQs6tAxj99bfBflBQeZ7dRrNYbu5tyNbCc3lDsz8XhYU+/sB7f5aFWz jKJrlLpCdkz/Ci2M6rtrD2D6sQZL X-Google-Smtp-Source: AIpwx49vPPO8wuksGNgRlFbhVlNpZzC0ZND9zXvroG8kaO9/ROfQz23BMOvu6xaC+BZBClKMWEk4Ww== X-Received: by 10.107.146.86 with SMTP id u83mr7791537iod.110.1523917341777; Mon, 16 Apr 2018 15:22:21 -0700 (PDT) Received: from hawkmoon.pdx.corp.google.com ([2620:15c:f:10:f576:f887:7d74:2d5f]) by smtp.gmail.com with ESMTPSA id r66-v6sm5016029itc.12.2018.04.16.15.22.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Apr 2018 15:22:20 -0700 (PDT) From: "Kristian H. Kristensen" X-Google-Original-From: "Kristian H. Kristensen" To: dri-devel@lists.freedesktop.org Subject: [PATCH] CHROMIUM: drm/rockchip: Disable blending for win0 Date: Mon, 16 Apr 2018 15:22:15 -0700 Message-Id: <20180416222215.167155-1-hoegsberg@chromium.org> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog 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: "Kristian H. Kristensen" MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Blending win0 with the background color doesn't seem to work correctly. We only get the background color, no matter the contents of the win0 framebuffer. However, blending pre-multiplied color with the default opaque black default background color is a no-op, so we can just disable blending to get the correct result. Signed-off-by: Kristian H. Kristensen Cc: Sandy Huang Cc: Sean Paul Reviewed-by: Sean Paul --- As per Eric's suggestion, we can just disable blending. This replaces the previous "Filter out alpha formats for primary plane" patch. drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index fae37b1cd691..1c1dd11d489a 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -961,7 +961,14 @@ static void vop_plane_atomic_update(struct drm_plane *plane, rb_swap = has_rb_swapped(fb->format->format); VOP_WIN_SET(vop, win, rb_swap, rb_swap); - if (is_alpha_support(fb->format->format)) { + /* + * Blending win0 with the background color doesn't seem to work + * correctly. We only get the background color, no matter the contents + * of the win0 framebuffer. However, blending pre-multiplied color + * with the default opaque black default background color is a no-op, + * so we can just disable blending to get the correct result. + */ + if (is_alpha_support(fb->format->format) && win_index > 0) { VOP_WIN_SET(vop, win, dst_alpha_ctl, DST_FACTOR_M0(ALPHA_SRC_INVERSE)); val = SRC_ALPHA_EN(1) | SRC_COLOR_M0(ALPHA_SRC_PRE_MUL) |