From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vandita Kulkarni Subject: [PATCHv2 4/5] drm: Add an blend_color property Date: Tue, 26 Apr 2016 15:03:03 +0530 Message-ID: <1461663184-1155-5-git-send-email-vandita.kulkarni@intel.com> References: <20160125161943.GS11240@phenom.ffwll.local> <1461663184-1155-1-git-send-email-vandita.kulkarni@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0837563364==" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 4480E6E797 for ; Tue, 26 Apr 2016 09:33:49 +0000 (UTC) In-Reply-To: <1461663184-1155-1-git-send-email-vandita.kulkarni@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org Cc: vandita kulkarni List-Id: intel-gfx@lists.freedesktop.org --===============0837563364== Content-Type: text/plain; charset=a Content-Transfer-Encoding: quoted-printable 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.t= mpl index f673989..8572c9a 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 =E2=80=9Crotation=E2=80=9D BITMASK @@ -1868,7 +1868,7 @@ void intel_crt_init(struct drm_device *dev) CRTC that connector is attached to (atomic) - Plane + Plane =E2=80=9Ctype=E2=80=9D ENUM | IMMUTABLE { "Overlay", "Primary", "Cursor" } @@ -1953,6 +1953,13 @@ void intel_crt_init(struct drm_device *dev) Source and destination blending factors + =E2=80=9Cblend_color=E2=80=9D + Color + DRM_MODE_COLOR() + Plane + Blend constant color + + DVI-I =E2=80=9Csubconnector=E2=80=9D ENUM diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index c2ead2d..20340de 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -713,6 +713,8 @@ int drm_atomic_plane_set_property(struct drm_plane *p= lane, return -EINVAL; =20 state->blend_mode.func =3D val & GENMASK(31, 0); + } else if (property =3D=3D config->prop_blend_color) { + state->blend_mode.color =3D val; } else if (plane->funcs->atomic_set_property) { return plane->funcs->atomic_set_property(plane, state, property, val); @@ -771,6 +773,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane= , *val =3D state->rotation; } else if (property =3D=3D config->prop_blend_func) { *val =3D state->blend_mode.func; + } else if (property =3D=3D config->prop_blend_color) { + *val =3D 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 2cac5e1..65cbaea 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1592,6 +1592,11 @@ static int drm_mode_create_standard_properties(str= uct drm_device *dev) return -ENOMEM; dev->mode_config.prop_blend_func =3D prop; =20 + prop =3D drm_property_create_range(dev, 0, "blend_color", 0, U64_MAX); + if (!prop) + return -ENOMEM; + dev->mode_config.prop_blend_color =3D prop; + return 0; } =20 diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 269f660..33d5845 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -95,6 +95,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, }; =20 #define DRM_BLEND_FUNC(src_factor, dst_factor) \ @@ -103,6 +107,7 @@ enum drm_blend_factor { #define DRM_BLEND_FUNC_DST_FACTOR(val) ((val) & 0xffff) =20 struct drm_blend_mode { + uint64_t color; uint64_t func; }; =20 @@ -2145,6 +2150,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; =20 /* DVI-I properties */ struct drm_property *dvi_i_subconnector_property; --=20 1.9.1 --===============0837563364== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0837563364==--