From patchwork Mon Jan 18 15:15:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kulkarni, Vandita" X-Patchwork-Id: 8053191 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 7F0CD9FCD9 for ; Mon, 18 Jan 2016 07:32:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9696220251 for ; Mon, 18 Jan 2016 07:32:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7E96B2025B for ; Mon, 18 Jan 2016 07:32:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FBBF6E401; Sun, 17 Jan 2016 23:32:30 -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 3FD166E400 for ; Sun, 17 Jan 2016 23:32:26 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 17 Jan 2016 23:32:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,311,1449561600"; d="scan'208";a="883721865" Received: from vandita-desktop.iind.intel.com ([10.223.26.11]) by fmsmga001.fm.intel.com with ESMTP; 17 Jan 2016 23:32:25 -0800 From: Vandita Kulkarni To: intel-gfx@lists.freedesktop.org Date: Mon, 18 Jan 2016 20:45:42 +0530 Message-Id: <1453130143-7228-9-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 8/9] drm/i915/skl: Support blend color on primary 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 Set the global alpha value for primary plane in the PLANE_KEYMAX register, to enable which set plane alpha enable bit in the PLANE_KEYMSK register. On bxt only 8 bit alpha will be considered from the PLANE_KEYMAX register. Signed-off-by: vandita kulkarni --- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ drivers/gpu/drm/i915/intel_display.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 0a98889..cc14f75 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -5483,6 +5483,10 @@ enum skl_disp_power_wells { #define PLANE_KEYMAX(pipe, plane) \ _MMIO_PLANE(plane, _PLANE_KEYMAX_1(pipe), _PLANE_KEYMAX_2(pipe)) +#define PLANE_KEYMAX_ALPHA_MASK 0x00ffffff +#define PLANE_KEY_MASK_ALPHA_EN 31 +#define PLANE_KEY_MAX_ALPHA_SHIFT 24 + #define _PLANE_BUF_CFG_1_B 0x7127c #define _PLANE_BUF_CFG_2_B 0x7137c #define _PLANE_BUF_CFG_1(pipe) \ diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index a2cc63e..61d8562 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3107,6 +3107,8 @@ static void skylake_update_primary_plane(struct drm_plane *plane, struct intel_crtc *intel_crtc = to_intel_crtc(crtc_state->base.crtc); struct drm_framebuffer *fb = plane_state->base.fb; struct drm_i915_gem_object *obj = intel_fb_obj(fb); + const struct drm_intel_sprite_colorkey *key = + &to_intel_plane_state(plane->state)->ckey; int pipe = intel_crtc->pipe; u32 plane_ctl, stride_div, stride; u32 tile_height, plane_offset, plane_size; @@ -3141,6 +3143,15 @@ static void skylake_update_primary_plane(struct drm_plane *plane, WARN_ON(drm_rect_width(&plane_state->src) == 0); + I915_WRITE(PLANE_KEYMAX(pipe, 0), (DRM_MODE_COLOR_ALPHA_8 + (plane_state->base.blend_mode.color) + << PLANE_KEY_MAX_ALPHA_SHIFT) | + (key->max_value & PLANE_KEYMAX_ALPHA_MASK)); + I915_WRITE(PLANE_KEYMSK(pipe, 0), + (plane_state->use_plane_alpha + << PLANE_KEY_MASK_ALPHA_EN) | + (key->channel_mask & GENMASK(0, 26))); + if (intel_rotation_90_or_270(rotation)) { /* stride = Surface height in tiles */ tile_height = intel_tile_height(dev, fb->pixel_format,