From mboxrd@z Thu Jan 1 00:00:00 1970 From: Damien Lespiau Subject: Re: [PATCH 0/4] Adding support for plane alpha/color blending through drm property Date: Thu, 20 Mar 2014 14:11:40 +0000 Message-ID: <20140320141140.GQ6912@strange.amr.corp.intel.com> References: <1394266879-20522-1-git-send-email-sagar.a.kamble@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 17F876E0A7 for ; Thu, 20 Mar 2014 07:11:49 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1394266879-20522-1-git-send-email-sagar.a.kamble@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: sagar.a.kamble@intel.com Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, Mar 08, 2014 at 01:51:15PM +0530, sagar.a.kamble@intel.com wrote: > From: Sagar Kamble > > This patch series introduces drm property modelled after glBlendFuc function. For i915 > constant alpha is exposed through this property to start with. Additional new property > value for controlling pre-multiplied alpha is added. > i-g-t test case is to be added. > > These patches are based on following patches which are already under review/reviewed: > > 4ae74f3 Documentation: drm: describing drm properties exposed by various drivers > 134bdfe Propagate the error from intel_update_plane() up through intel_plane_restore() to the caller. > a6ad21c Make drm_property_create_bitmask() a bit more generic by allowing the caller to specify which bits are in fact supported. > > Sagar Kamble (4): > drm: Added plane alpha and color blending property > drm/i915: Enabling constant alpha drm property > drm/i915: Enabling pre-multiplied alpha drm property > Documentation: drm: describing plane alpha and color blending property I'm not sure I follow what's being done with the GL blending equation here. If we want to support a global alpha on the source plane (ie the plane that is going to be blended into the "render target", what's already there), the blending equation looks like: (source is non-premultiplied, note the use of glBlendFuncSeparate()) RGB = ADD(SRC_COLOR*SRC_ALPHA, DST_COLOR*ONE_MINUS_SRC_ALPHA) A = ADD(SRC_COLOR, DST_COLOR*ONE_MINUS_SRC_ALPHA) (source is premultiplied) RGBA = ADD(SRC_COLOR*SRC_ALPHA, DST_COLOR*ONE_MINUS_SRC_ALPHA) The gl blending stuff doesn't know anything about the premultiplied nature of the incoming source color, it has to be programmed accordingly. -- Damien