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;