From patchwork Fri Aug 31 11:35:30 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: 10583637 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 649A8112B for ; Fri, 31 Aug 2018 11:36:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B44A2B58A for ; Fri, 31 Aug 2018 11:36:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E1C02B904; Fri, 31 Aug 2018 11:36:22 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, 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 6A8D22B58A for ; Fri, 31 Aug 2018 11:36:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AD7C56E0D6; Fri, 31 Aug 2018 11:36:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20073.outbound.protection.outlook.com [40.107.2.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E13B6E0D6 for ; Fri, 31 Aug 2018 11:36:15 +0000 (UTC) Received: from lowry-ThinkStation-P300.shanghai.arm.com (113.29.88.7) by AM0PR08MB3522.eurprd08.prod.outlook.com (2603:10a6:208:dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.13; Fri, 31 Aug 2018 11:36:08 +0000 From: Lowry Li To: liviu.dudau@arm.com Subject: [PATCH v5 2/2] drm/mali-dp: Implement plane alpha and pixel blend on malidp Date: Fri, 31 Aug 2018 19:35:30 +0800 Message-Id: <1535715330-25859-1-git-send-email-lowry.li@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535013020-23737-3-git-send-email-lowry.li@arm.com> References: <1535013020-23737-3-git-send-email-lowry.li@arm.com> MIME-Version: 1.0 X-Originating-IP: [113.29.88.7] X-ClientProxiedBy: SG2PR06CA0131.apcprd06.prod.outlook.com (2603:1096:1:1d::33) To AM0PR08MB3522.eurprd08.prod.outlook.com (2603:10a6:208:dd::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6605109d-a4f9-4df8-3490-08d60f35f44e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3522; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3522; 3:+78MUBmaRf0pANbJo+SmsH229jaGUWJnl4DtbyiOjT9N1MHuE0aeIyunc7oapGn/SI/0vwiJelbMEO0tQHfMlod1Ex5htAOsTJrtgjq9HLlbO2eg2pd9W7oUKNOYtWb6cHFJtSIN1fabjXthWsk9gAWu/BjfKXq2EHD7ILyszXQwgHzB+Z5n4U1ebHeGibWuKXQ0vPizk4GwR60lmv2KDzz5dIUG/7EsWPDJHjaGqDwH1b/b6CPzNQ4JzfMTi0SZ; 25:W8qKnaKMtgPDWukjtLZlkyUUucCj3+qMhyOSQdumpx5TeJwOwV+e6wh3zApPumi1m0tJbfazqoeVEgKW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Sv7GGkBy4wtUfpYK30zqveQQZQbcFv0XNX+nLEnhkugApx0lKCewXsxXKW4enGN/TYPN0hFReyTzPpGBIMJMunbCkIUwf6M6jkQmI9h2pIUMv4/gbVOjteR5KqwqCjVudqw2d50rimwroFPM4KUvnARlUoX4kFYcaKTLWdIDhnIWrQYqALdy70FDyPsTbgF/cDn7MWuN2g8+ji5KzthlSkYHs53zmVuSdQoobWxku89OjA5YMllKRwsnNw/25cjX X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:AM0PR08MB3522; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3522; X-Forefront-PRVS: 07817FCC2D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39860400002)(366004)(136003)(199004)(189003)(486006)(2616005)(956004)(6636002)(6666003)(86362001)(68736007)(16586007)(316002)(44832011)(14444005)(53936002)(26005)(5024004)(37006003)(5660300001)(6116002)(476003)(51416003)(52116002)(7696005)(3846002)(6486002)(76176011)(97736004)(36756003)(81166006)(81156014)(386003)(2906002)(39060400002)(50466002)(11346002)(34206002)(8936002)(446003)(4326008)(72206003)(8676002)(305945005)(25786009)(45080400002)(47776003)(66066001)(478600001)(105586002)(2361001)(2351001)(106356001)(7736002)(16526019)(50226002)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3522; 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; AM0PR08MB3522; 23:0lWHURwm9lZnNmkEypBrJHgjxoAmRbeG14k/NBGYJ?= x7c30teEBKd5uqnAJd+1I/6pXDi273q4n8zGyWrXwUbdCMReZ5AncxoYzey/5a70uWHZ2zY7pFXVn6VIeiOef7WULsPVgplsKGRW83DHhPcfxTaMUKD3R9WTOxX+SC/hhJCkzKjcc4EFUg0qg9QcOen8+D1GBJOlyi6OvVW/O6FCXLlZQpqSG0lPfAa3z9sta9kNTdyV4gerThXWr4Ubj9ikePEJLS8gnsm58IgzMIKfDHI5kyL9E+9/O56J6HAfHeqrNspkZ1VoJFUFwtCfH4MAzi8XGYiyPiIPdPUI5xdTzCmhp7CN8aHqKExIabaYEy7Ym72d7CF3tR8/7OmT8RCk0NEXWrYh4gral+LcQ+9CYfnkEfUFNl+qDQUkDpFkMPv0qT/038zYyutJ+Y0qLVIrT7RZOiLg9a0zyd12U3C53dYltYmI/QbtKlxNy4yzZI8TyiTDBG50/WQdEfM2CyyJwqB/+TV2Ib0xkMtXiT7kuOjIrkTzog/6ir5Mn2ReFE/PsM4lzroyW7uZPTX99vugZHM0P8HorAETnvcE1pCxAfml+hxjjG69EDCXaVknlu/ZSQflnN/V0zKikbNJ80vBPBJlQ3gquVzC906fT8dAmSqA8fv4MgSmblWY8oDEqx1Nznc8/3z6MutByZ7QdE9pIG3Q4AwlPlayGtih87uH3iIVRQs9jPtwGIPZc2iLBDX/IQ+/LS+9nCalTtu8IOxL/YmfAVR3f3TK6nsyjM5/3r9r8vNG4ao25YrtXfGMMzqwFLmYeKsB00zog4E4+ppRw/kduYPKQkw9jUyUXgFvbRvQ5OwGw2+EUX+hacmGvEtb+OT9Xikjy+GII5qBrHVJ+hmvLJktBoxM01HyYlqAPXWbwH1O/o6OS4YiM64lPxtOVYq8qP9JGFGtHs1Fx8OeZmL5orLRSsPsTpdYH7QcCcoE9kHhYBEJignIl7m0/lzN86NxNyak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ux8Kb9wgIGpSofDOkKa4yXivN2N1GqaJGCapeJge0rrSi5tA8YvP8wpDWVlrgRT7uEvdbqUARTtDtlzRjIol94MJ4FFY1gyENyLSZkNK/Hj8KbZ+fCfWYphKkA6Sjdq6SvPzm+mkBOa6e05R+FXw48P9Ts5TTkX2xI2xlg==; 5:9wCAswYRfbY/vrgVl4bjUN6PbnNpGVpoAePjW1Wk8wUFpNv5E8rmZ2bywLRBeRZWGDTxPOTSMzKtlO01AG0wYy6V5X+1HNvt3gabJ+un7xTUrOIJA5LjbKKVvo5YGCYCDnGecC5R2ghn+8aTeIeDS/1L1s2oBzLj4jWiSOuS8ug=; 7:nACr6cZQMG00WbGVsg5S60/1dGkiGGM8PELZCShfz4hioIDCdExH+vv3hP6T56PjNEBMulY/PxP1MrVMgh3WsHQmBkhxTI2Z+f4oN5aAv4gioqyuq/Vre4OW/FgB2fbIhtlYO3SBSSeTYdNmqxLT2rGP+3CvexsfW8lHrZ+Cu/+gIlqM4HdrRMVb+X62KCzKvyUa3H0wAkmCvt9vijJmd4mj9bQkPFea8SjQekorGpwCM9XFBLVTE/0C7Si5Vbsr SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2018 11:36:08.4389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6605109d-a4f9-4df8-3490-08d60f35f44e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3522 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 Checks the pixel blending mode and plane alpha value when do the plane_check. Mali DP supports blending the current plane with the background either based on the pixel alpha blending mode or by using the layer's alpha value, but not both at the same time. If both case, plane_check will return failed. Sets the HW when doing plane_update accordingly. If plane alpha is the 0xffff, set the pixel blending bits accordingly. If not we'd set ALPHA bit as zero and layer alpha value. Changes since v1: - Introduces to use it in the malidp driver, which depends on the plane alpha patch Changes since v2: - Refines the comments of drm/mali-dp patchset Changes since v3: - Adds hardware limitation check Changes since v4: - Updates on drm/malidp, hardware limitation check only when the format has alpha pixel. - Rebases on drm-misc-next. Signed-off-by: Lowry Li Acked-by: Liviu Dudau --- drivers/gpu/drm/arm/malidp_planes.c | 75 ++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c index 49c37f6..96ee429 100644 --- a/drivers/gpu/drm/arm/malidp_planes.c +++ b/drivers/gpu/drm/arm/malidp_planes.c @@ -36,6 +36,7 @@ #define LAYER_COMP_MASK (0x3 << 12) #define LAYER_COMP_PIXEL (0x3 << 12) #define LAYER_COMP_PLANE (0x2 << 12) +#define LAYER_PMUL_ENABLE (0x1 << 14) #define LAYER_ALPHA_OFFSET (16) #define LAYER_ALPHA_MASK (0xff) #define LAYER_ALPHA(x) (((x) & LAYER_ALPHA_MASK) << LAYER_ALPHA_OFFSET) @@ -180,6 +181,7 @@ static int malidp_de_plane_check(struct drm_plane *plane, struct malidp_plane_state *ms = to_malidp_plane_state(state); bool rotated = state->rotation & MALIDP_ROTATED_MASK; struct drm_framebuffer *fb; + u16 pixel_alpha = state->pixel_blend_mode; int i, ret; if (!state->crtc || !state->fb) @@ -242,6 +244,12 @@ static int malidp_de_plane_check(struct drm_plane *plane, ms->rotmem_size = val; } + /* HW can't support plane + pixel blending */ + if ((state->alpha != DRM_BLEND_ALPHA_OPAQUE) && + (pixel_alpha != DRM_MODE_BLEND_PIXEL_NONE) && + fb->format->has_alpha) + return -EINVAL; + return 0; } @@ -323,17 +331,19 @@ static void malidp_de_plane_update(struct drm_plane *plane, { struct malidp_plane *mp; struct malidp_plane_state *ms = to_malidp_plane_state(plane->state); + struct drm_plane_state *state = plane->state; + u16 pixel_alpha = state->pixel_blend_mode; + u8 plane_alpha = state->alpha >> 8; u32 src_w, src_h, dest_w, dest_h, val; int i; - bool format_has_alpha = plane->state->fb->format->has_alpha; mp = to_malidp_plane(plane); /* convert src values from Q16 fixed point to integer */ - src_w = plane->state->src_w >> 16; - src_h = plane->state->src_h >> 16; - dest_w = plane->state->crtc_w; - dest_h = plane->state->crtc_h; + src_w = state->src_w >> 16; + src_h = state->src_h >> 16; + dest_w = state->crtc_w; + dest_h = state->crtc_h; val = malidp_hw_read(mp->hwdev, mp->layer->base); val = (val & ~LAYER_FORMAT_MASK) | ms->format; @@ -342,14 +352,14 @@ static void malidp_de_plane_update(struct drm_plane *plane, for (i = 0; i < ms->n_planes; i++) { /* calculate the offset for the layer's plane registers */ u16 ptr = mp->layer->ptr + (i << 4); - dma_addr_t fb_addr = drm_fb_cma_get_gem_addr(plane->state->fb, - plane->state, i); + dma_addr_t fb_addr = drm_fb_cma_get_gem_addr(state->fb, + state, i); malidp_hw_write(mp->hwdev, lower_32_bits(fb_addr), ptr); malidp_hw_write(mp->hwdev, upper_32_bits(fb_addr), ptr + 4); } malidp_de_set_plane_pitches(mp, ms->n_planes, - plane->state->fb->pitches); + state->fb->pitches); if ((plane->state->color_encoding != old_state->color_encoding) || (plane->state->color_range != old_state->color_range)) @@ -362,8 +372,8 @@ static void malidp_de_plane_update(struct drm_plane *plane, malidp_hw_write(mp->hwdev, LAYER_H_VAL(dest_w) | LAYER_V_VAL(dest_h), mp->layer->base + MALIDP_LAYER_COMP_SIZE); - malidp_hw_write(mp->hwdev, LAYER_H_VAL(plane->state->crtc_x) | - LAYER_V_VAL(plane->state->crtc_y), + malidp_hw_write(mp->hwdev, LAYER_H_VAL(state->crtc_x) | + LAYER_V_VAL(state->crtc_y), mp->layer->base + MALIDP_LAYER_OFFSET); if (mp->layer->id == DE_SMART) @@ -376,38 +386,35 @@ static void malidp_de_plane_update(struct drm_plane *plane, val &= ~LAYER_ROT_MASK; /* setup the rotation and axis flip bits */ - if (plane->state->rotation & DRM_MODE_ROTATE_MASK) + if (state->rotation & DRM_MODE_ROTATE_MASK) val |= ilog2(plane->state->rotation & DRM_MODE_ROTATE_MASK) << LAYER_ROT_OFFSET; - if (plane->state->rotation & DRM_MODE_REFLECT_X) + if (state->rotation & DRM_MODE_REFLECT_X) val |= LAYER_H_FLIP; - if (plane->state->rotation & DRM_MODE_REFLECT_Y) + if (state->rotation & DRM_MODE_REFLECT_Y) val |= LAYER_V_FLIP; - val &= ~LAYER_COMP_MASK; - if (format_has_alpha) { - - /* - * always enable pixel alpha blending until we have a way - * to change blend modes - */ - val |= LAYER_COMP_PIXEL; - } else { + val &= ~(LAYER_COMP_MASK | LAYER_PMUL_ENABLE | LAYER_ALPHA(0xff)); - /* - * do not enable pixel alpha blending as the color channel - * does not have any alpha information - */ + if (state->alpha != DRM_BLEND_ALPHA_OPAQUE) { val |= LAYER_COMP_PLANE; - - /* Set layer alpha coefficient to 0xff ie fully opaque */ - val |= LAYER_ALPHA(0xff); + } else if (state->fb->format->has_alpha) { + /* We only care about blend mode if the format has alpha */ + switch (pixel_alpha) { + case DRM_MODE_BLEND_PREMULTI: + val |= LAYER_COMP_PIXEL | LAYER_PMUL_ENABLE; + break; + case DRM_MODE_BLEND_COVERAGE: + val |= LAYER_COMP_PIXEL; + break; + } } + val |= LAYER_ALPHA(plane_alpha); val &= ~LAYER_FLOWCFG(LAYER_FLOWCFG_MASK); - if (plane->state->crtc) { + if (state->crtc) { struct malidp_crtc_state *m = - to_malidp_crtc_state(plane->state->crtc->state); + to_malidp_crtc_state(state->crtc->state); if (m->scaler_config.scale_enable && m->scaler_config.plane_src_id == mp->layer->id) @@ -446,6 +453,9 @@ int malidp_de_planes_init(struct drm_device *drm) unsigned long crtcs = 1 << drm->mode_config.num_crtc; unsigned long flags = DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270 | DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y; + unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) | + BIT(DRM_MODE_BLEND_PREMULTI) | + BIT(DRM_MODE_BLEND_COVERAGE); u32 *formats; int ret, i, j, n; @@ -498,6 +508,9 @@ int malidp_de_planes_init(struct drm_device *drm) malidp_hw_write(malidp->dev, MALIDP_ALPHA_LUT, plane->layer->base + MALIDP_LAYER_COMPOSE); + drm_plane_create_alpha_property(&plane->base); + drm_plane_create_blend_mode_property(&plane->base, blend_caps); + /* Attach the YUV->RGB property only to video layers */ if (id & (DE_VIDEO1 | DE_VIDEO2)) { /* default encoding for YUV->RGB is BT601 NARROW */