From patchwork Wed Jul 27 16:07:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 12930526 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EEA62C04A68 for ; Wed, 27 Jul 2022 16:09:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AD4496846; Wed, 27 Jul 2022 16:08:58 +0000 (UTC) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 865509094B for ; Wed, 27 Jul 2022 16:08:28 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.93,195,1654527600"; d="scan'208";a="127555176" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 28 Jul 2022 01:08:28 +0900 Received: from localhost.localdomain (unknown [10.226.92.195]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 51BFE4018A35; Thu, 28 Jul 2022 01:08:25 +0900 (JST) From: Biju Das To: David Airlie , Daniel Vetter Subject: [PATCH v5 07/10] drm: rcar-du: Move rcar_du_properties_init() Date: Wed, 27 Jul 2022 17:07:50 +0100 Message-Id: <20220727160753.1774761-8-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220727160753.1774761-1-biju.das.jz@bp.renesas.com> References: <20220727160753.1774761-1-biju.das.jz@bp.renesas.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: Chris Paterson , Geert Uytterhoeven , Prabhakar Mahadev Lad , dri-devel@lists.freedesktop.org, Biju Das , linux-renesas-soc@vger.kernel.org, Kieran Bingham , Laurent Pinchart , Biju Das Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Move rcar_du_properties_init() to RCar DU kms lib, so that it can be shared by both RCar and RZ/G2L kms drivers. Signed-off-by: Biju Das --- v5: * New patch --- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 16 ---------------- drivers/gpu/drm/rcar-du/rcar_du_kms_lib.c | 16 ++++++++++++++++ drivers/gpu/drm/rcar-du/rcar_du_kms_lib.h | 2 ++ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 7586520e1871..b3ebe694be6e 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -74,22 +74,6 @@ static const struct drm_mode_config_funcs rcar_du_mode_config_funcs = { .atomic_commit = drm_atomic_helper_commit, }; -static int rcar_du_properties_init(struct rcar_du_device *rcdu) -{ - /* - * The color key is expressed as an RGB888 triplet stored in a 32-bit - * integer in XRGB8888 format. Bit 24 is used as a flag to disable (0) - * or enable source color keying (1). - */ - rcdu->props.colorkey = - drm_property_create_range(&rcdu->ddev, 0, "colorkey", - 0, 0x01ffffff); - if (rcdu->props.colorkey == NULL) - return -ENOMEM; - - return 0; -} - static int rcar_du_vsps_init(struct rcar_du_device *rcdu) { const struct device_node *np = rcdu->dev->of_node; diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.c b/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.c index d41fee590ee4..a56f3d6db321 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.c @@ -617,3 +617,19 @@ int rcar_du_encoders_init(struct rcar_du_device *rcdu, return num_encoders; } + +int rcar_du_properties_init(struct rcar_du_device *rcdu) +{ + /* + * The color key is expressed as an RGB888 triplet stored in a 32-bit + * integer in XRGB8888 format. Bit 24 is used as a flag to disable (0) + * or enable source color keying (1). + */ + rcdu->props.colorkey = + drm_property_create_range(&rcdu->ddev, 0, "colorkey", + 0, 0x01ffffff); + if (rcdu->props.colorkey == NULL) + return -ENOMEM; + + return 0; +} diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.h b/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.h index 02d6ed5aa154..b04c42bbae5c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.h +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms_lib.h @@ -52,4 +52,6 @@ int rcar_du_encoders_init(struct rcar_du_device *rcdu, enum rcar_du_output output, struct device_node *enc_node)); +int rcar_du_properties_init(struct rcar_du_device *rcdu); + #endif /* __RCAR_DU_KMS_LIB_H__ */