From patchwork Mon Jan 18 15:15:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Kulkarni, Vandita" X-Patchwork-Id: 8053151 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 D55399F1CC for ; Mon, 18 Jan 2016 07:32:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DED2C2025A for ; Mon, 18 Jan 2016 07:32:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E85DB20251 for ; Mon, 18 Jan 2016 07:32:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6623B6E3FC; Sun, 17 Jan 2016 23:32:25 -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 185AE6E3FF for ; Sun, 17 Jan 2016 23:32:20 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 17 Jan 2016 23:32:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,311,1449561600"; d="scan'208";a="883721822" Received: from vandita-desktop.iind.intel.com ([10.223.26.11]) by fmsmga001.fm.intel.com with ESMTP; 17 Jan 2016 23:32:18 -0800 From: Vandita Kulkarni To: intel-gfx@lists.freedesktop.org Date: Mon, 18 Jan 2016 20:45:38 +0530 Message-Id: <1453130143-7228-5-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> MIME-Version: 1.0 Cc: vandita kulkarni Subject: [Intel-gfx] [PATCH 4/9] drm: Add an blend_color property 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: , 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: Damien Lespiau Add blend color property and update the documentation for the same V2: Add blend color support in get property. Signed-off-by: Damien Lespiau Signed-off-by: vandita kulkarni --- Documentation/DocBook/gpu.tmpl | 11 +++++++++-- drivers/gpu/drm/drm_atomic.c | 4 ++++ drivers/gpu/drm/drm_crtc.c | 5 +++++ include/drm/drm_crtc.h | 6 ++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Documentation/DocBook/gpu.tmpl b/Documentation/DocBook/gpu.tmpl index 2017162..4ef3d7f 100644 --- a/Documentation/DocBook/gpu.tmpl +++ b/Documentation/DocBook/gpu.tmpl @@ -1816,7 +1816,7 @@ void intel_crt_init(struct drm_device *dev) Description/Restrictions - DRM + DRM Generic “rotation” BITMASK @@ -1868,7 +1868,7 @@ void intel_crt_init(struct drm_device *dev) CRTC that connector is attached to (atomic) - Plane + Plane “type” ENUM | IMMUTABLE { "Overlay", "Primary", "Cursor" } @@ -1953,6 +1953,13 @@ void intel_crt_init(struct drm_device *dev) Source and destination blending factors + “blend_color” + Color + DRM_MODE_COLOR() + Plane + Blend constant color + + DVI-I “subconnector” ENUM diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 0c165c6..13b237c 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -642,6 +642,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane, return -EINVAL; state->blend_mode.func = val & GENMASK(31, 0); + } else if (property == config->prop_blend_color) { + state->blend_mode.color = val; } else if (plane->funcs->atomic_set_property) { return plane->funcs->atomic_set_property(plane, state, property, val); @@ -700,6 +702,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, *val = state->rotation; } else if (property == config->prop_blend_func) { *val = state->blend_mode.func; + } else if (property == config->prop_blend_color) { + *val = state->blend_mode.color; } else if (plane->funcs->atomic_get_property) { return plane->funcs->atomic_get_property(plane, state, property, val); } else { diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index b8dde06..eb8dc2b 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1547,6 +1547,11 @@ static int drm_mode_create_standard_properties(struct drm_device *dev) return -ENOMEM; dev->mode_config.prop_blend_func = prop; + prop = drm_property_create_range(dev, 0, "blend_color", 0, U64_MAX); + if (!prop) + return -ENOMEM; + dev->mode_config.prop_blend_color = prop; + return 0; } diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 9cfe601..9c3563b 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -105,6 +105,10 @@ enum drm_blend_factor { DRM_BLEND_FACTOR_ONE, DRM_BLEND_FACTOR_SRC_ALPHA, DRM_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA, + DRM_BLEND_FACTOR_CONSTANT_ALPHA, + DRM_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA, + DRM_BLEND_FACTOR_CONSTANT_ALPHA_TIMES_SRC_ALPHA, + DRM_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA_TIMES_SRC_ALPHA, }; #define DRM_BLEND_FUNC(src_factor, dst_factor) \ @@ -113,6 +117,7 @@ enum drm_blend_factor { #define DRM_BLEND_FUNC_DST_FACTOR(val) ((val) & 0xffff) struct drm_blend_mode { + uint64_t color; uint64_t func; }; @@ -2119,6 +2124,7 @@ struct drm_mode_config { struct drm_property *prop_active; struct drm_property *prop_mode_id; struct drm_property *prop_blend_func; + struct drm_property *prop_blend_color; /* DVI-I properties */ struct drm_property *dvi_i_subconnector_property;