From patchwork Sun Mar 7 04:06:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12120421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFC4DC433E6 for ; Sun, 7 Mar 2021 04:06:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CA4264DA3 for ; Sun, 7 Mar 2021 04:06:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CA4264DA3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 859DE6E0FE; Sun, 7 Mar 2021 04:06:53 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id E99566E0FE for ; Sun, 7 Mar 2021 04:06:51 +0000 (UTC) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6D491F84; Sun, 7 Mar 2021 05:06:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615090009; bh=zaLLCEAjsGewXKdNrSZ+hi955bgK9WDM8x7x/4FrcGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rLPx2cGj8uhIGi9ahJ80YgK2MTuvpKtVnB5S9bHV19dVa8mUNsfYVINP0o2vNC56p R/OZaAfgk9L0z/gnL/GbI5XvAcSiuSMAl0F0KOxUjpnStm2dV4UFKKfoobcKnu9mdK r80RXDGL7d7w58yaQ32NJzxgMAJ1UKGsJ2yyHNg8= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm: xlnx: zynqmp_dpsub: Add global alpha support Date: Sun, 7 Mar 2021 06:06:11 +0200 Message-Id: <20210307040611.29246-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210307040611.29246-1-laurent.pinchart@ideasonboard.com> References: <20210307040611.29246-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rohit Visavalia , Michal Simek , linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The top (graphics) plane has a global alpha setting. Expose it through the plane's alpha property. Signed-off-by: Laurent Pinchart --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 4c23ffc75343..991dd6bebdc7 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1173,7 +1173,7 @@ zynqmp_disp_plane_atomic_disable(struct drm_plane *plane, if (layer->id == ZYNQMP_DISP_LAYER_GFX) zynqmp_disp_blend_set_global_alpha(&layer->disp->blend, false, - 0); + plane->state->alpha >> 8); } static void @@ -1203,7 +1203,7 @@ zynqmp_disp_plane_atomic_update(struct drm_plane *plane, if (layer->id == ZYNQMP_DISP_LAYER_GFX) zynqmp_disp_blend_set_global_alpha(&layer->disp->blend, true, - 255); + plane->state->alpha >> 8); /* Enable or re-enable the plane is the format has changed. */ if (format_changed) @@ -1262,6 +1262,8 @@ static int zynqmp_disp_create_planes(struct zynqmp_disp *disp) &zynqmp_disp_plane_helper_funcs); drm_plane_create_zpos_immutable_property(&layer->plane, i); + if (type == DRM_PLANE_TYPE_OVERLAY) + drm_plane_create_alpha_property(&layer->plane); } return 0;