From patchwork Thu Jun 2 10:10:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Stratiienko X-Patchwork-Id: 12867731 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 CF980C433EF for ; Thu, 2 Jun 2022 10:12:25 +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=FMfKIkqwSMFmwG8+uldYQnM6/wXq8PVCgdWsKXkjvkc=; b=jr+M/c8ULYQdFE j9eDnmhm+44X0v2BoKoPR7uUKPzI/G9KNIeHES078p10n7KTYlvA2YgEEvlKcr9qNuA81O2bZO1QC CwqtTCWvEuWHbAft/jEz275AcJ/1Uw3L6baKMJu4FuTLfSzQfRX8G5I7S0gsTWVWUAnpTI+TH5U/X DBcU/KSVbjgtFrOtLCWfZuSmZW1/dPKr/SLw3SymKENUqQvOXGm5cJV3YE1kwTfHygEk8nNZQtHqH 6DElXaqgaVi/ZKvlIPbeDrWzZKuNsnPCG6uwlZ1hEu6oFjgl68J3POBNHIWXyubibjZRch8fVXtxy w7vpwGa0cp4d2ZXr+q6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwhnX-002hi9-IB; Thu, 02 Jun 2022 10:11:23 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwhnT-002hbe-6y for linux-arm-kernel@lists.infradead.org; Thu, 02 Jun 2022 10:11:20 +0000 Received: by mail-ej1-x629.google.com with SMTP id rs12so8951908ejb.13 for ; Thu, 02 Jun 2022 03:11:15 -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=XP2MYhxOsKZps4QmlXxrybN7eWdufRzVMujwQeLYeiQ=; b=Y7onb5K2NewHqCE/PuGP/wM6SCeTA9lIvWKzv8jJhtUkxUOyaEHEvZiw4JImYrjs5s kN6M2jWBn/hQJ/gO0U4qlL+XEEZs8pBtfUQ7IuiVcWEY+wkFthPiLSsrRXsS3fAejXjf kvvCJdXMPDrXcvk9yeZZs+tpjZf5dJArjVjTut02jEijcVhq8rbRluqdP29ZKyXUlZ0F fJkhZe5RKIX9fdItmgPXHqlKhpZXFaipTO/Gruap1SOY4B/9/Ytjd2qjTb2u4T/Z7HIv oAhNBOBsbESgy+TS8gXxGpo9jSv+l6+EKeAQ+jf9dQdnk/13eCdBqS3ieLyeeOzv7xBB liEw== 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=XP2MYhxOsKZps4QmlXxrybN7eWdufRzVMujwQeLYeiQ=; b=mGcAY9pbt0RVK4uDEGk+Oo8h96UiOF+bcdgD7WGJEGuPq414qmyQFZIlIfVccF9aE4 nIhV2pG4kNuwDw0Bd7TgwU7IaNuxjejQ+sPTw8h5Is9jEBrTNh72ng2Ub/LxyyBFH/Ir i37UNTuXdlBJpQmYnpZQXg8vnmucO0izR9ZKDeo0RnvW3sQaJfgYuAbunYfXOnSHzwuN aVhk32vOxY3jOsaZEnte/SIBleOhCLsA8opn/nae1SsMi2peVwM9c8fjS6GFvYc7towh +Br9/NdBX+9K3RZv0PDNsaRNsGa5UTiz1AOrhFWSqySglUWCN6utbity1a7ioAkHkCkb 9yKA== X-Gm-Message-State: AOAM531omWdfGT5IXPJZlrJsIdNyXkp+jEsleZl4uFjUTn/pCMY3d3MC 2sF10CrEhfkBEuBWnktATlw0XRj5Hrw= X-Google-Smtp-Source: ABdhPJxDXM6X2WzIbpB2ecG4Bo1W47SYy6zSGtMFLhp5s1cFEX36s9yh+wV046gKroqLIrujwyPa2g== X-Received: by 2002:a17:907:3e8a:b0:6fe:fcb6:6d45 with SMTP id hs10-20020a1709073e8a00b006fefcb66d45mr3454512ejc.348.1654164674585; Thu, 02 Jun 2022 03:11:14 -0700 (PDT) Received: from orangepi3.mydomain.example ([195.234.74.2]) by smtp.gmail.com with ESMTPSA id kx16-20020a170907775000b00706e8ac43b8sm1599621ejc.199.2022.06.02.03.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 03:11:14 -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] drm/sun4i: Enable output signal premultiplication for DE2/DE3 Date: Thu, 2 Jun 2022 10:10:57 +0000 Message-Id: <20220602101057.48170-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-20220602_031119_292491_5BFAC3E1 X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. 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 --- drivers/gpu/drm/sun4i/sun8i_mixer.c | 2 ++ drivers/gpu/drm/sun4i/sun8i_mixer.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 6b1711a9a71f..71ab0a00b4de 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -320,6 +320,8 @@ static void sun8i_mixer_mode_set(struct sunxi_engine *engine, else val = 0; + val |= SUN8I_MIXER_BLEND_OUTCTL_PREMULTIPLY; + regmap_update_bits(engine->regs, SUN8I_MIXER_BLEND_OUTCTL(bld_base), SUN8I_MIXER_BLEND_OUTCTL_INTERLACED, val); 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)