From patchwork Mon Jan 18 15:15:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kulkarni, Vandita" X-Patchwork-Id: 8053181 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9D1369F859 for ; Mon, 18 Jan 2016 07:32:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE56520260 for ; Mon, 18 Jan 2016 07:32:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CC8FA20259 for ; Mon, 18 Jan 2016 07:32:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B7EC6E403; Sun, 17 Jan 2016 23:32:29 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id 02ABE6E400 for ; Sun, 17 Jan 2016 23:32:27 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 17 Jan 2016 23:32:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,311,1449561600"; d="scan'208";a="883721879" Received: from vandita-desktop.iind.intel.com ([10.223.26.11]) by fmsmga001.fm.intel.com with ESMTP; 17 Jan 2016 23:32:26 -0800 From: Vandita Kulkarni To: intel-gfx@lists.freedesktop.org Date: Mon, 18 Jan 2016 20:45:43 +0530 Message-Id: <1453130143-7228-10-git-send-email-vandita.kulkarni@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453130143-7228-1-git-send-email-vandita.kulkarni@intel.com> References: <1453130143-7228-1-git-send-email-vandita.kulkarni@intel.com> Cc: vandita kulkarni Subject: [Intel-gfx] [PATCH 9/9] drm/i915/skl: Separate out disable plane alpha X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, DATE_IN_FUTURE_06_12, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: vandita kulkarni 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 --- 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;