[Intel-gfx] [PATCH 0/4] Adding support for plane alpha/color blending through drm property

Damien Lespiau damien.lespiau at intel.com
Thu Mar 20 15:11:40 CET 2014


On Sat, Mar 08, 2014 at 01:51:15PM +0530, sagar.a.kamble at intel.com wrote:
> From: Sagar Kamble <sagar.a.kamble at intel.com>
> 
> 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



More information about the Intel-gfx mailing list