Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp376744rdb; Thu, 15 Feb 2024 03:02:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUEHmCffideb8jvEV7nsiUBTFjIXcuYaOf1ILjZeCTIhOtfTh1e2QHPBsF3wbrEm32p6n0XOx2TKmZ2j1iQe5guAEp1ongAlrZQdCrGJA== X-Google-Smtp-Source: AGHT+IGtDN6O3UD9DQ+10G4wm8E5mNJVV4IM9CPO+ZbMKKjNjSjDgvatXpIuW4HIAYAju5jDocZ6 X-Received: by 2002:a05:6a20:37a9:b0:1a0:762c:7caa with SMTP id q41-20020a056a2037a900b001a0762c7caamr1190398pze.31.1707994966132; Thu, 15 Feb 2024 03:02:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707994966; cv=pass; d=google.com; s=arc-20160816; b=Ym/tR3/xbx7NJixbDF71UBCRTV/zry1JuhK0LWmYooqmzRTGA+c+UUkf0xbhZpFUMa NNSMpCvH5QmhN47wH33A1BCIi0Oc33cNVGpXewYuJJnNMG0CNAPW1nMm5p/02waLrWbh FtVoQe2yvE29FMN3h3ERQ/+ahQziwwY9PGANP+9HemI89Rs0+61K2xVYBTo35WUr92db 1Yc5fPCfi7ZCjfRtlXTk+8yDNVQurxiNG8RPM4FQii5k55dS+GMyuQZ/3j/G5AjyS8db 9G7PTxS6yJ32f82qXWvcIanpcbSyiV1hjfCBAKZjx3siMwBW28ESL5IQ+LI1OauQ4Qmz JhYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=rmTJrHbLSbdAGuiqOoS1WUCDbNnb8x5OUWK8pk/ji7E=; fh=LmLDmr7HHZXIYGUQlctxZZaSpALjeLZP/QSiiJ4DLqA=; b=olH/qEWv9alIzz0alOkM4fWC69VMTA+TmaZiBg/vcUnavuzb3awOHCmCtQ8Lcyrd1o Rza9dhcFccNdCjqJPnto/W1nA91HK6JW2s3WPtJw57ZpHQgNmZgCY2srvDG8NTLpQMoa D1SL2LacZJwwaaz6s9bPrGqJr1j0uE0EifbHrlisjwR+E1VTbDq/okq6SLXWaNjt8znh LDLXQ6l3P/m1tOGwBtt7d97fQvaEW+LvkbJmOvvI4Zbl+oYxQcTvdH+Q5veuYR8PdX29 2fWr5ccOn205kjPn+s4ZYUCEF780MwnZMTVA0tqC5jrj8PFIStaJ32vgclLSkHqI3YHg YgNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=3xpIKCTi; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-66706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p20-20020a056a000b5400b006e0fdf2106asi978115pfo.329.2024.02.15.03.02.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 03:02:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=3xpIKCTi; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-66706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3E6732819E2 for ; Thu, 15 Feb 2024 10:59:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0DFE12DDB9; Thu, 15 Feb 2024 10:46:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="3xpIKCTi" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 879A212DDA8 for ; Thu, 15 Feb 2024 10:46:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707993986; cv=none; b=QZrStholV5EqlCDjzhBdA9FGqEwxwvvoPDxw7HRdFqGi8xkH3Wojo4CmYE3G4W22EWrmFR1v95oC2tRi3iU0rtEpIUqc99u+XYHl0IeKKc+TeVEiJYZL5xPc4WXRet8BEIx3U2P/B/rbYvZHH0PHKa8gCmXytyoaCcZrnDu7lHk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707993986; c=relaxed/simple; bh=YbT37hERPMotSbqysWVXhccVGhmIL5NWBAzDOuVxwJo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ijlxUzo+5qBiFpu6GMAC4c+BtqU1qCD3+sVuzFcP3yG2g11HluIyXoLwJmO05DQdTwdFqKdcMIcaUl5FuXbn+h8qaKEaz4L5mVthGCsFd4iPhbfAfS74sr9ug5lvSN1Sj3Z4Pey5yoF/hXo4KXUGlYR/4ExERfTRacyOasbnAxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=3xpIKCTi; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707993983; bh=YbT37hERPMotSbqysWVXhccVGhmIL5NWBAzDOuVxwJo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=3xpIKCTiI4T2EIGKteQ1V5vk5Ykel3u0GclVdzPNz2BVTzI+JuiTpjFJ9OO8VrMQn Q7Z12jsjx/DJGyab5s9d0jv5M1DhUkaHD9hyLV4yn+5mnONLSWcXJ8ysyRtBQJXJEZ 3TzWRL2OpuvR3gZxxAZ1xkgqbwJoNEhlG5cmPL4b8uWp+/RZpR41s5Ys24593D9hUX SBiPR2kqz7O06TpoKA+buky6hJincltVxPygzHSYS8cjkSY/FxJgwkYJEGGafwqNWA 4xlA9DWhjyFSIV6DVNOgifAVu72GEMWw4gMQZzy+kQ+W28gal2MX2ddqJuVh2taRHY qXnHq6ptKefnw== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id D0DF83780FC7; Thu, 15 Feb 2024 10:46:21 +0000 (UTC) Message-ID: <96cbca68-052f-42dd-a410-da9061d54c06@collabora.com> Date: Thu, 15 Feb 2024 11:46:21 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 07/13] drm/mediatek: Support alpha blending in display driver Content-Language: en-US To: Hsiao Chien Sung , Chun-Kuang Hu Cc: Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , Bibby Hsieh , CK Hu , Sean Paul , Fei Shao , Jason Chen , "Nancy . Lin" , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240215101119.12629-1-shawn.sung@mediatek.com> <20240215101119.12629-8-shawn.sung@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20240215101119.12629-8-shawn.sung@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 15/02/24 11:11, Hsiao Chien Sung ha scritto: > Support "Pre-multiplied" and "None" blend mode on MediaTek's chips by > adding correct blend mode property when the planes init. > Before this patch, only the "Coverage" mode (default) is supported. > > For more information, there are three pixel blend modes in DRM driver: > "None", "Pre-multiplied", and "Coverage". > > To understand the difference between these modes, let's take a look at > the following two approaches to do alpha blending: > > 1. Straight: > dst.RGB = src.RGB * src.A + dst.RGB * (1 - src.A) > This is straightforward and easy to understand, when the source layer is > compositing with the destination layer, it's alpha will affect the > result. This is also known as "post-multiplied", or "Coverage" mode. > > 2. Pre-multiplied: > dst.RGB = src.RGB + dst.RGB * (1 - src.A) > Since the source RGB have already multiplied its alpha, only destination > RGB need to multiply it. This is the "Pre-multiplied" mode in DRM. > > For the "None" blend mode in DRM, it means the pixel alpha is ignored > when compositing the layers, only the constant alpha for the composited > layer will take effects. > > Signed-off-by: Hsiao Chien Sung > Reviewed-by: CK Hu Reviewed-by: AngeloGioacchino Del Regno