From patchwork Wed Sep 19 15:56:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10606055 X-Patchwork-Delegate: geert@linux-m68k.org 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 1008A112B for ; Wed, 19 Sep 2018 15:57:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC9C12B120 for ; Wed, 19 Sep 2018 15:57:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0DCB2B289; Wed, 19 Sep 2018 15:57:08 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9731C2B120 for ; Wed, 19 Sep 2018 15:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732676AbeISVfk (ORCPT ); Wed, 19 Sep 2018 17:35:40 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:37230 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732545AbeISVfj (ORCPT ); Wed, 19 Sep 2018 17:35:39 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E5DC421A8; Wed, 19 Sep 2018 17:57:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1537372624; bh=2uI8uIDNLq2Qzm/PM6NUQ/Gtge+VHpW2lG+QaBnn9W4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zwko4mI38zlJTagmSLfzIU7hOlz9QM5JXRLeWjg/zuHE1cnSD/eaWpAl+Pnr18NAm WsuAnMKZrF0/62eG5qj6vgo7hFrGbeWQOWElF11WWA20nFKVEHTdHfok7pRhKwOc9L BLodIHigXd0wzfLgXPMtG2zyfJdr26mHa3b2PLd8= From: Kieran Bingham To: Laurent Pinchart , linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Alexandru-Cosmin Gheorghe , Kieran Bingham , Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/2] drm/atomic: Initialise planes with opaque alpha values Date: Wed, 19 Sep 2018 16:56:58 +0100 Message-Id: <20180919155700.10342-2-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180919155700.10342-1-kieran.bingham+renesas@ideasonboard.com> References: <20180919155700.10342-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Planes without an alpha property, using __drm_atomic_helper_plane_reset will have their plane state alpha initialised as zero, which represents a transparent alpha. If this value is then used for the plane, it may not be visible by default, and thus doesn't represent a good initialisation state. Update the default state->alpha value to DRM_BLEND_ALPHA_OPAQUE unconditionally when the plane is reset. Signed-off-by: Kieran Bingham Reviewed-by: Ville Syrjälä Reviewed-by: Alexandru Gheorghe Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/drm_atomic_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 3cf1aa132778..e49b22381048 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -3569,9 +3569,7 @@ void __drm_atomic_helper_plane_reset(struct drm_plane *plane, state->plane = plane; state->rotation = DRM_MODE_ROTATE_0; - /* Reset the alpha value to fully opaque if it matters */ - if (plane->alpha_property) - state->alpha = plane->alpha_property->values[1]; + state->alpha = DRM_BLEND_ALPHA_OPAQUE; state->pixel_blend_mode = DRM_MODE_BLEND_PREMULTI; plane->state = state; From patchwork Wed Sep 19 15:56:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10606051 X-Patchwork-Delegate: geert@linux-m68k.org 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 71C4B5A4 for ; Wed, 19 Sep 2018 15:57:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A6DC2B120 for ; Wed, 19 Sep 2018 15:57:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E6132B289; Wed, 19 Sep 2018 15:57:07 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5E932B120 for ; Wed, 19 Sep 2018 15:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732560AbeISVfj (ORCPT ); Wed, 19 Sep 2018 17:35:39 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:37242 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732513AbeISVfj (ORCPT ); Wed, 19 Sep 2018 17:35:39 -0400 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A053421A9; Wed, 19 Sep 2018 17:57:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1537372624; bh=uLeCUIDi1SzI5LeSNLUziacTEo1k1TFiXoSXc6wd164=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EVh5/8FdV3fzkfe4rCrP6PjI0O/g8ybsO181+5sUlGY0nfJzwogGaMdy4ngEYAJIj bUT2ptvX/XgkmSKST+9VLUCxkGeyeS4zPsTzEcfEFLDbn9AM3cyoh5+I9k7Eg/C8uZ hhxgjk6WleoBHBs0Sf2pTMRF8eQnqvdhn7yoILOI= From: Kieran Bingham To: Laurent Pinchart , linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Alexandru-Cosmin Gheorghe , Kieran Bingham , David Airlie , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/2] drm: rcar-du: Enable alpha property on primary planes Date: Wed, 19 Sep 2018 16:56:59 +0100 Message-Id: <20180919155700.10342-3-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180919155700.10342-1-kieran.bingham+renesas@ideasonboard.com> References: <20180919155700.10342-1-kieran.bingham+renesas@ideasonboard.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the alpha property is not added to a plane, a default value will be used, which can result in a non-visible layer if the alpha is initialised as 0. Provide an alpha blend property on all planes. Fixes: 161ad653d6c9 ("drm: rcar-du: Use __drm_atomic_helper_plane_reset instead of copying the logic") Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c index 9e07758a755c..72399a19d8a6 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c @@ -783,13 +783,18 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp) drm_plane_helper_add(&plane->plane, &rcar_du_plane_helper_funcs); + /* + * The alpha property needs to be initialised on all planes + * to ensure the correct setting at the output. + */ + drm_plane_create_alpha_property(&plane->plane); + if (type == DRM_PLANE_TYPE_PRIMARY) continue; drm_object_attach_property(&plane->plane.base, rcdu->props.colorkey, RCAR_DU_COLORKEY_NONE); - drm_plane_create_alpha_property(&plane->plane); drm_plane_create_zpos_property(&plane->plane, 1, 1, 7); }