From patchwork Thu Aug 23 08:30:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lowry Li (Arm Technology China)" X-Patchwork-Id: 10573549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4259113B8 for ; Thu, 23 Aug 2018 08:31:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 207A32B8FC for ; Thu, 23 Aug 2018 08:31:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13B2A2B92B; Thu, 23 Aug 2018 08:31:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, FUZZY_AMBIEN,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A91972B8FC for ; Thu, 23 Aug 2018 08:31:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D846E6E4E1; Thu, 23 Aug 2018 08:30:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0604.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::604]) by gabe.freedesktop.org (Postfix) with ESMTPS id 90FAD6E4E1 for ; Thu, 23 Aug 2018 08:30:57 +0000 (UTC) Received: from lowry-ThinkStation-P300.shanghai.arm.com (113.29.88.7) by DB7PR08MB3530.eurprd08.prod.outlook.com (2603:10a6:10:49::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Thu, 23 Aug 2018 08:30:50 +0000 From: Lowry Li To: liviu.dudau@arm.com Subject: [PATCH v5 0/2] drm/blend: Add per-plane pixel blend mode property Date: Thu, 23 Aug 2018 16:30:18 +0800 Message-Id: <1535013020-23737-1-git-send-email-lowry.li@arm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [113.29.88.7] X-ClientProxiedBy: SG2PR06CA0129.apcprd06.prod.outlook.com (2603:1096:1:1d::31) To DB7PR08MB3530.eurprd08.prod.outlook.com (2603:10a6:10:49::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0e08896-5bba-4deb-3576-08d608d2be8f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR08MB3530; X-Microsoft-Exchange-Diagnostics: 1; DB7PR08MB3530; 3:jeWGHpeQ6jWDz2n5kPjSGtWu+Y/7UMb41M2xWZ5TQQGw5aVOR0QilCL9SmdQsiUc4Rgt+3UaRpPtoIk0lflPk5mrPcn8O/CLEv4JMOna5jsB5yqohD8uTjylF7T9PFjzmckQp52SnReLDXOD8GoBmEGWSuO7gKER4IJtktF4goZMzdpJenz9+9nlcq5tWqWAU9p37XH4Ze1Qo3P3flQFlJjVZDIkp1PsBYb8QKZLlXhArn0q6MtInuNu0PzmlIQ+; 25:r2+E37pAcijkpY3ZitqScrzgdA8UehrGCtK3+HUyhhZDiK7Tnc49lEBMmmKE12ZnrY6ExJ7sRCYJK/njNrN1mGYbA3cW+Nwp7bDZvqr07HuiyyxsI4K8Rp2dIibBv980BnE5v//+7bb1Pby/nyWaT9zWChJFSeE68HgRGhI0naa/58Z0TJO73wguM2gZBm8CMWKMRSy8O8NzMamk6E8VBcm2OLzg84rZO1TJTiZzRzZdGfsg+zAuzEZkJAJ3YVICQNRsubNPX7543GuroatCfK8tZbIxG8k6D5uI0EdH/D02fE8VL+mwBn0S2AyQ/6Dlv0HKDshBIM+mW5Cx+cjHDQ==; 31:0UU8XlZ/AwihllJCSHnNqWK2pd3F0km9MnJovBpdvbaoTvGGTczYpVSpHt0ywtt422ripIuXh4jUhJRrqnwumNeydU6le7YcvMAVlfQybEmd1Nr0yjM/Fi3ss6ORk9C+McjDxiqWvzhru/km8IcyHSXDl98NqKsXKLP67Gotbr8n5ZiLAbv5boPIE+HVGOsFGJSVb+YKr2T6/GpSf+N8OAdHpZKJbgJwvSP3SC2Y7uo= X-MS-TrafficTypeDiagnostic: DB7PR08MB3530: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; DB7PR08MB3530; 20:Y028bGak56Nb1j6nEvdBBzRJQRjykvignU4M803WWTrjnrjxZhuB48WwmdlnjeVWBP25oRp93HaZ1jFhX8AzoVlV+BB5egPmG0aaNLYFZyvTKy9w+d3yjH6du4hvrP/Ms+BL1ym2BP3E0g5slG4w+64xnL4bPkxJvSsxRixkEJegP2SRZvHH1gN6gLHalJ5Kql4G9uCfJL/IYt7WG/KS2mqwJNEChRlr4/fDYIXhyd1FeUk8YfDW0P06brrsBLWd6f8kZ/dgKnuoiUoNIX0dZ8naSPMsKJe9RnRURqfSAZyaS6demMGS8z1/ARuppCvtn/SXm6e26WOWvzvx4io/kw==; 4:CR9qtMxbajf0EXqSFNoBo8aM/A93AhpGIVWPaZaptUOnt8A/upcPxfTSpB1QMAIZ06/4FCRlzFu3OGedqZkWvxI66DWROHxEqcNinOLcGUoauarmgsJwoIOCnF4Uex17FKNh93vaajI8nN6yxF0uGX4mHSQN0FnKAg5loiWKIJcGgby0vN/GZ+0RlLKzunsXD+1CDYxpe+BdTqNsKYHbuVIt8ziNzY/sJu6chwnN72d8hwCi2Ta/adeFoxE8KuxAC9S4nJ/xnrMw/YwEy6vijA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(93006095)(93001095)(3002001)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR08MB3530; BCL:0; PCL:0; RULEID:; SRVR:DB7PR08MB3530; X-Forefront-PRVS: 0773BB46AC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(376002)(346002)(39860400002)(199004)(189003)(305945005)(16586007)(476003)(37006003)(8936002)(106356001)(14444005)(5660300001)(50226002)(2616005)(25786009)(956004)(72206003)(39060400002)(81166006)(36756003)(2351001)(4326008)(8676002)(48376002)(6486002)(34206002)(81156014)(486006)(105586002)(316002)(7736002)(51416003)(52116002)(2361001)(7696005)(53936002)(97736004)(16526019)(386003)(26005)(44832011)(68736007)(2906002)(6116002)(6666003)(6636002)(478600001)(86362001)(66066001)(3846002)(47776003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR08MB3530; H:lowry-ThinkStation-P300.shanghai.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB7PR08MB3530; 23:t3jC3YJGUcYcav46O0+FeteUf3W6Yd+jzIwWJ9inx?= PNQSAZMyQ9XvQjFXg8JMZJeZ/V7kvv3WUydPwOY32mlHz7QV3QRtE3X1wVTMkksJKOTAlpHv2bqvK8ZAW88XqKHarDKLgXHXD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ltFWjSYdz38qSJShzkRKzkWtXJ4m52OSD4juaj3ovQhSGc/gs= X-Microsoft-Antispam-Message-Info: gJ9wzkEj9GU9ZzQGWYLSAmt1gldVFHj1w44hs7Yo49q4aAmbkUM/dFj75141NqHkhnTVqI1jxEmDNnhHiionUNamP0D6hBggsHnjtlxwVIDc4sgwicqRiW/rcda5doe2JjAsULt05l7/gxfJap/jydN+Lyjik8sFeczskrtLsAdQsJSAqwCMkUN2x8vxmIJlZhsr2jiYIKeYk8QfRBC8KIh9h1BYBwVGIGYEOT4kbNiAXdAHFeC1HC0oF1estdTouujS6slOxbQPwAJ7/Uz06lEA83w2dQP6Xod5V2/LiPoB+bFdLumHobdSkCGu5qly9Z3k6fhRDGyeN9S1DopiQEGxmILY3W66k6ZskXQxvZI= X-Microsoft-Exchange-Diagnostics: 1; DB7PR08MB3530; 6:Kjv58I1E34bJe4OiCT52ILE6XPDL03SrS7J2nDQZdgI3JeQxRgR94mQ2YytgfhHNEmYyRYNWBAwTLp2NBa10KSLceRdejimV0i8WiOp7CfCselUqrcv5m8Uo15hwwRpLhg3LiQGZclkFqY1y1+uB5fmHS4oz/MMhS0fQtLrs0VD/VUwzmB519v3kfD8WOnrRXgNcfRPUspZpFepSoB3bP2/0AA74C+lAXd6jR5Wwy1gVwbLm+vJmy2osItkOWZvPBd3QnI8/TESmZNZuPPwD7b8ebsOEIasxwLgbA0YDc91ymjo0MFSropTU6/Itu0NL9gWVRNbnVptnX8chg91BzHA4Ss5FEK6LthmSieNWBAPxGtNcherjFVVrdAXpUDPktQGBp8oBvnxadKNp+IHTTg7UUeGWplzdQtQHaadwBbrWDsZbKbo9xuaplvt76agOPWiPThNvGnEvE3DK9/w05g==; 5:HHqx3UjMhes6k/0WIcMbThQGuZCJzQb5PfAriDnTB4a0bsOFvMaGGcR2fUJRoausCZhxyQ3c3SypNaeiqZoPmf0M+CH2mcw7wdC7PHdXAVpGg4k/dT1OFrn5Nfj9QLLbPCNrlPq5cRVgvxRPmoPY4NCByjLEaM4uQyGVrsyqlGg=; 7:q4r57MFsMuVsjy8xiHOZL3/SxD3aXMJEu+WTwk9ybMRyIB9jsL95TOKuNsEtkNsCgTAcd95vPZZ2k+WLXhUynW1k4mmjmmrcqX2SvzLzdIUYUZxHId/jzSfhyr0fcqKctGWqG3ZZwNdV6xB0xB8zjvRkofcW5by7d3dC+iHYLFwgS4XexRBlkS1y9Ln8Hog9PjhWWC9rQW1Da1nqavr+GjixhDzsEWQ9g0owRntP6WPGRE1xsCIaA/BgUZvqTt2I SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2018 08:30:50.1218 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0e08896-5bba-4deb-3576-08d608d2be8f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3530 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, emil.l.velikov@gmail.com, seanpaul@chromium.org, malidp@foss.arm.com, daniel.vetter@intel.com, nd@arm.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, This serie aims at adding the support for pixel blend modes represent the alpha blending equation selection in the driver. It also introduces to use it in the malidp driver. Let me know what you think, Lowry Changes for v5: - Adds comments in drm_blend.h. - Removes setting default value in drm_plane_create_blend_mode_property() as it is already in __drm_atomic_helper_plane_reset(). - Fixes to use state->pixel_blend_mode instead of using plane->state->pixel_blend_mode in reset function. - Rebases on drm-misc-next. Changes for v4: - Refines drm_plane_create_blend_mode_property(). drm_property_add_enum() can calculate the index itself just fine, so no point in having the caller pass it in. - Since the current DRM assumption is that alpha is premultiplied as default, define DRM_MODE_BLEND_PREMULTI as 0 will be better. - Refines some comments. - Updates on drm/malidp, hardware limitation check only when the format has alpha pixel. - Rebases on drm-misc-next and fixed the confilcts Changes for v3: - Refines the comments of drm_plane_create_blend_mode_property: 1) Puts the descriptions (after the ":") on a new line 2) Adds explaining why @supported_modes need PREMUL as default - Refines the comments of drm/mali-dp patchset - Rebased on drm-misc-next and fixed the confilcts with plane alpha patch Changes for v2: - Moves the blending equation into the DOC comment - Refines the comments of drm_plane_create_blend_mode_property to not enumerate the #defines, but instead the string values - Uses fg.* instead of pixel.* and plane_alpha instead of plane.alpha - Introduces to use it in the malidp driver, which depends on the plane alpha patch Changes from v1: - v1 is just the core changes to request for commments - Adds a pixel_blend_mode to drm_plane_state and a blend_mode_property to drm_plane, and related support functions - Defines three blend modes in drm_blend.h - Rebased on current drm-next Lowry Li (2): drm: Add per-plane pixel blend mode property drm/mali-dp: Implement plane alpha and pixel blend on malidp drivers/gpu/drm/arm/malidp_planes.c | 74 +++++++++++++--------- drivers/gpu/drm/drm_atomic.c | 4 ++ drivers/gpu/drm/drm_atomic_helper.c | 1 + drivers/gpu/drm/drm_blend.c | 123 ++++++++++++++++++++++++++++++++++++ include/drm/drm_blend.h | 6 ++ include/drm/drm_plane.h | 9 +++ 6 files changed, 186 insertions(+), 31 deletions(-)