diff mbox

[6/9] drm/i915/skl: Drop alpha in non ARGB formats

Message ID 1453130143-7228-7-git-send-email-vandita.kulkarni@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kulkarni, Vandita Jan. 18, 2016, 3:15 p.m. UTC
From: vandita kulkarni <vandita.kulkarni@intel.com>

This patch drops alpha by default if the selected
format is not ARG. This is to make sure that we drop alpha
on non-ARGB formats and not fail the ATOMIC IOCTL.

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

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 39e9db4..5fb281b 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11922,13 +11922,13 @@  static int intel_plane_state_check_blend(struct drm_plane_state *plane_state)
 	/* pre-multiplied alpha */
 	case DRM_BLEND_FUNC(ONE, ONE_MINUS_SRC_ALPHA):
 		if (!has_per_pixel_blending)
-			return -EINVAL;
+			state->drop_alpha = true;
 		state->premultiplied_alpha = true;
 		break;
 	/* non pre-multiplied alpha */
 	case DRM_BLEND_FUNC(SRC_ALPHA, ONE_MINUS_SRC_ALPHA):
 		if (!has_per_pixel_blending)
-			return -EINVAL;
+			state->drop_alpha = true;
 		break;
 	/* plane alpha */
 	case DRM_BLEND_FUNC(CONSTANT_ALPHA, ONE_MINUS_CONSTANT_ALPHA):
@@ -11940,7 +11940,7 @@  static int intel_plane_state_check_blend(struct drm_plane_state *plane_state)
 	case DRM_BLEND_FUNC(CONSTANT_ALPHA,
 			    ONE_MINUS_CONSTANT_ALPHA_TIMES_SRC_ALPHA):
 		if (!has_per_pixel_blending)
-			return -EINVAL;
+			state->drop_alpha = true;
 		state->premultiplied_alpha = true;
 		state->use_plane_alpha = true;
 		break;
@@ -11948,7 +11948,7 @@  static int intel_plane_state_check_blend(struct drm_plane_state *plane_state)
 	case DRM_BLEND_FUNC(CONSTANT_ALPHA_TIMES_SRC_ALPHA,
 			    ONE_MINUS_CONSTANT_ALPHA_TIMES_SRC_ALPHA):
 		if (!has_per_pixel_blending)
-			return -EINVAL;
+			state->drop_alpha = true;
 		state->use_plane_alpha = true;
 		break;
 	default: