From patchwork Sun Jun 5 09:40:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Stratiienko X-Patchwork-Id: 12869744 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E992BC43334 for ; Sun, 5 Jun 2022 09:42:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=vCgVYB4zcsGtE1GKRyOyUUy+JDkxuv6EiO3Ce67zJyg=; b=AqsMWNFTgq0ZDE B99nDg6I0iP7YBiluj7EDffD2dLF97CkXryNjv39fDqcTOCUthHqAhGA/KyftTvdXSm6mLEXZhcQe h0+1IjUXJH5vPYM2BUL0uV7dtLmJZNYvBUHzLHlLbNbUVjUjTAbE0OhtrGZsjBO2Jb6TyawxhFtId i6vSmX8X3am6MNK/PIbk33Ie57Js2fqI6FSfGhnBWXkCkHCPszMgXd59SRKGvy6i2DHqAv0EC+2A+ IAG1NY6kwkfEk+tT/LEfpE6T8GkoPV0j8qKh0ppnNwaEZP8TOmAczpQvJzqSCBFY2uZ1UjA29G8XI A4sKwNX1zw++K1ZCFioQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxmkr-00ECDq-SU; Sun, 05 Jun 2022 09:41:05 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nxmkp-00ECDL-AR for linux-arm-kernel@lists.infradead.org; Sun, 05 Jun 2022 09:41:04 +0000 Received: by mail-ej1-x633.google.com with SMTP id gl15so9856788ejb.4 for ; Sun, 05 Jun 2022 02:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DhfJ8Vbs3H5rmwl9R/OPOQbDlu4cgubnQOXlVvnJ8XM=; b=mOQkSwye820r1FKdsZutlM9eSUJKpNAnIeEW3h1hw3pJpNQkcIX7WmhcZ7L9p/yk1B G8OJN4NdgfFi1sixdvbKsmjP4yuJcurJFlpD3c1O8JNC7NHV8jWo337y7dm5+5p7NbAy xjjLdat36kRx29QbdBP7GfoRX0HyMy72rpam+ZNaVbBI0hdhdCTPTrm2YL2ZEcrKge8u fzQOpaL/JwnB59Sh+O5T6LMtd5hnptqEtG7fdJII0sfDioFtC7UUdBYgwvl2KwGbMe9l 81HZ05saCykmbY7k0z29JnhVz4cf5xyxvxMJZLe3P0sdBYyW9T5micD6xgbQp4NXZmfM otQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=DhfJ8Vbs3H5rmwl9R/OPOQbDlu4cgubnQOXlVvnJ8XM=; b=OXHAzWr2TJmmm3+06+0QYeg2SnoLEQBZDNVkw8dytdr+MhtsPa0a9wizvmz1KI5CVd L0XXu8fbTJY/P90kSDPd3kcot4cQU6CCiJ/u0kzagtjHDykCncAtZ/bd5dQPlio2DTiz MX8v8wEK07WDGyt/o9w06E4QnSqd+4z5uezDrX8wpqW0Lmuq+lfze8ZEk8AepLY/+Agd +1psVdVw6t2KYhSsmY/LK5MfsJL0O4WdfedhhDBjEphyNd/9F1KssJ/pKsuj0mdyvwyq o/Xx4AUbv9J7X8/BZZw1pTD9klwQh9lRzwIqXHmETEdt0+RmlbwlrWAllb6UgW1VuGTc uOGA== X-Gm-Message-State: AOAM531hFTGAYVSv2vVKazMFr9kAmWNExhqD/ZCpMg9cCvAzL2dfyipK 53hZkNpyQJ88hVngSpKCWn8= X-Google-Smtp-Source: ABdhPJxndU5trzyMzutaIfO7WYpzqjFkxUDj+CyOBND1p38sWX2rvYJITyUyDqp31HpwKS/1znQpzQ== X-Received: by 2002:a17:906:4fc4:b0:6da:b4c6:fadb with SMTP id i4-20020a1709064fc400b006dab4c6fadbmr17175123ejw.282.1654422060788; Sun, 05 Jun 2022 02:41:00 -0700 (PDT) Received: from orangepi3.mydomain.example ([195.234.74.2]) by smtp.gmail.com with ESMTPSA id kl10-20020a170907994a00b006fec69a3978sm4970837ejc.207.2022.06.05.02.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 02:41:00 -0700 (PDT) From: Roman Stratiienko To: mripard@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, samuel@sholland.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, megi@xff.cz Cc: Roman Stratiienko Subject: [PATCH v2] drm/sun4i: Enable output signal premultiplication for DE2/DE3 Date: Sun, 5 Jun 2022 09:40:18 +0000 Message-Id: <20220605094018.9782-1-r.stratiienko@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220605_024103_441938_73F2B304 X-CRM114-Status: GOOD ( 11.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Otherwise alpha value is discarded, resulting incorrect pixel apperance on the display. This also fixes missing transparency for the most bottom layer. Test applications and videos w/ w/o this patch are available at [1]. [1]: https://github.com/GloDroid/glodroid_tests/issues/1 Signed-off-by: Roman Stratiienko --- Changelog: V2: Added code hunk missing in v1 --- drivers/gpu/drm/sun4i/sun8i_mixer.c | 5 +++-- drivers/gpu/drm/sun4i/sun8i_mixer.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 6b1711a9a71f..ba2932aaed08 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -320,8 +320,9 @@ static void sun8i_mixer_mode_set(struct sunxi_engine *engine, else val = 0; - regmap_update_bits(engine->regs, SUN8I_MIXER_BLEND_OUTCTL(bld_base), - SUN8I_MIXER_BLEND_OUTCTL_INTERLACED, val); + val |= SUN8I_MIXER_BLEND_OUTCTL_PREMULTIPLY; + + regmap_write(engine->regs, SUN8I_MIXER_BLEND_OUTCTL(bld_base), val); DRM_DEBUG_DRIVER("Switching display mixer interlaced mode %s\n", interlaced ? "on" : "off"); diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.h b/drivers/gpu/drm/sun4i/sun8i_mixer.h index ebfc276b2464..bc12c95af6f3 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.h +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.h @@ -65,6 +65,7 @@ #define SUN8I_MIXER_BLEND_ROUTE_PIPE_MSK(n) (0xf << ((n) << 2)) #define SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT(n) ((n) << 2) +#define SUN8I_MIXER_BLEND_OUTCTL_PREMULTIPLY BIT(0) #define SUN8I_MIXER_BLEND_OUTCTL_INTERLACED BIT(1) #define SUN50I_MIXER_BLEND_CSC_CTL_EN(ch) BIT(ch)