All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vandita Kulkarni <vandita.kulkarni@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: vandita kulkarni <vandita.kulkarni@intel.com>
Subject: [PATCH 8/9] drm/i915/skl: Support blend color on primary
Date: Mon, 18 Jan 2016 20:45:42 +0530	[thread overview]
Message-ID: <1453130143-7228-9-git-send-email-vandita.kulkarni@intel.com> (raw)
In-Reply-To: <1453130143-7228-1-git-send-email-vandita.kulkarni@intel.com>

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

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 <vandita.kulkarni@intel.com>
---
 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,
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-01-18  7:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-18 15:15 [PATCH 0/9] Support blending modes of display planes Vandita Kulkarni
2016-01-18  8:01 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-01-18 15:15 ` [PATCH 1/9] drm: Introduce the blend-func property Vandita Kulkarni
2016-01-21  0:12   ` Matt Roper
2016-01-18 15:15 ` [PATCH 2/9] drm/i915/skl: Add blend_func to SKL/BXT sprite planes Vandita Kulkarni
2016-01-21  0:13   ` Matt Roper
2016-01-18 15:15 ` [PATCH 3/9] drm: Introduce DRM_MODE_COLOR() Vandita Kulkarni
2016-01-21  0:22   ` Matt Roper
2016-01-18 15:15 ` [PATCH 4/9] drm: Add an blend_color property Vandita Kulkarni
2016-01-21  0:29   ` Matt Roper
2016-01-18 15:15 ` [PATCH 5/9] drm/i915/skl: Add support for blending modes Vandita Kulkarni
2016-01-21 22:33   ` Matt Roper
2016-01-18 15:15 ` [PATCH 6/9] drm/i915/skl: Drop alpha in non ARGB formats Vandita Kulkarni
2016-01-18 15:15 ` [PATCH 7/9] drm/i915: Support blend func on primary Vandita Kulkarni
2016-01-18 15:15 ` Vandita Kulkarni [this message]
2016-01-18 15:15 ` [PATCH 9/9] drm/i915/skl: Separate out disable plane alpha Vandita Kulkarni
2016-01-22  0:31 ` [PATCH 0/9] Support blending modes of display planes Matt Roper
2016-01-25 16:19   ` Daniel Vetter
2016-04-26  9:32     ` [PATCHv2 0/5] " Vandita Kulkarni
2016-04-26  9:33       ` [PATCHv2 1/5] drm: Introduce the blend-func property Vandita Kulkarni
2016-04-26 12:46         ` Daniel Vetter
2016-04-27  8:17           ` Jani Nikula
2016-04-26 12:47         ` Daniel Vetter
2016-04-26  9:33       ` [PATCHv2 2/5] drm/i915/skl: Add blend_func to SKL/BXT sprite planes Vandita Kulkarni
2016-04-26  9:33       ` [PATCHv2 3/5] drm: Introduce DRM_MODE_COLOR() Vandita Kulkarni
2016-04-26  9:33       ` [PATCHv2 4/5] drm: Add an blend_color property Vandita Kulkarni
2016-04-26  9:33       ` [PATCHv2 5/5] drm/i915/skl: Add support for blending modes Vandita Kulkarni
2016-04-26 12:46       ` [PATCHv2 0/5] Support blending modes of display planes Daniel Vetter
2016-04-26 13:53     ` ✗ Fi.CI.BAT: warning for series starting with [PATCHv2,1/5] drm: Introduce the blend-func property Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453130143-7228-9-git-send-email-vandita.kulkarni@intel.com \
    --to=vandita.kulkarni@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.