[PATCH 9/9] drm/i915/skl: Separate out disable plane alpha

Vandita Kulkarni
2016-01-18T07:32:27Z

From: vandita kulkarni <vandita.kulkarni@intel.com>

Separate out plane alpha disable functionality from per pixel
drop_alpha blend function and add another blend function case for
disabling plane alpha. Fix the state info ,so that premultiplied
alpha doesn't always become false when drop plane alpha is set.

Signed-off-by: vandita kulkarni <vandita.kulkarni@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 61d8562..42d5c6e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11913,9 +11913,7 @@ static int intel_plane_state_check_blend(struct drm_plane_state *plane_state)
fb->pixel_format == DRM_FORMAT_ARGB8888 ||
fb->pixel_format == DRM_FORMAT_BGRA8888;

- state->premultiplied_alpha = false;
state->drop_alpha = false;
- state->use_plane_alpha = false;

switch (mode->func) {
/*
@@ -11927,28 +11925,34 @@ static int intel_plane_state_check_blend(struct drm_plane_state *plane_state)
case DRM_BLEND_FUNC(AUTO, AUTO):
if (has_per_pixel_blending)
state->premultiplied_alpha = true;
+ state->use_plane_alpha = false;
break;
/* fbs without an alpha channel, or dropping the alpha channel */
case DRM_BLEND_FUNC(ONE, ZERO):
if (has_per_pixel_blending)
state->drop_alpha = true;
+ state->premultiplied_alpha = false;
break;
/* pre-multiplied alpha */
case DRM_BLEND_FUNC(ONE, ONE_MINUS_SRC_ALPHA):
if (!has_per_pixel_blending)
state->drop_alpha = true;
state->premultiplied_alpha = true;
+ state->use_plane_alpha = false;
break;
/* non pre-multiplied alpha */
case DRM_BLEND_FUNC(SRC_ALPHA, ONE_MINUS_SRC_ALPHA):
if (!has_per_pixel_blending)
state->drop_alpha = true;
+ state->use_plane_alpha = false;
+ state->premultiplied_alpha = false;
break;
/* plane alpha */
case DRM_BLEND_FUNC(CONSTANT_ALPHA, ONE_MINUS_CONSTANT_ALPHA):
if (has_per_pixel_blending)
state->drop_alpha = true;
state->use_plane_alpha = true;
+ state->premultiplied_alpha = false;
break;
/* plane alpha, pre-multiplied fb */
case DRM_BLEND_FUNC(CONSTANT_ALPHA,
@@ -11964,6 +11968,11 @@ static int intel_plane_state_check_blend(struct drm_plane_state *plane_state)
if (!has_per_pixel_blending)
state->drop_alpha = true;
state->use_plane_alpha = true;
+ state->premultiplied_alpha = false;
+ break;
+ /* drop plane alpha */
+ case DRM_BLEND_FUNC(ZERO, ONE):
+ state->use_plane_alpha = false;
break;
default:
return -EINVAL;