From patchwork Fri Nov 19 14:53:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12629049 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5586BC433F5 for ; Fri, 19 Nov 2021 14:53:48 +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 775CE61288 for ; Fri, 19 Nov 2021 14:53:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 775CE61288 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FD5E6E9FA; Fri, 19 Nov 2021 14:53:46 +0000 (UTC) Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by gabe.freedesktop.org (Postfix) with ESMTPS id 552676EA01 for ; Fri, 19 Nov 2021 14:53:45 +0000 (UTC) Received: by mail-pf1-x430.google.com with SMTP id b68so9545858pfg.11 for ; Fri, 19 Nov 2021 06:53:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=arsVDpo4dPzPIVSn/FusO2EnJGazLue6DTu5xtQ1Wc4=; b=lNkIkhaudWzoVTvDSAd7hYU1vYlVCXfJBOEpw8KSbYIHHpWWgIuLKLUe5OZ+usaeh1 YLkjocXTH6IKtx2Zc729zsYoXlPgQJRF1ZdtJt1ibWtruAlEXsc7FUvhcxr+JE9GgG++ q7WNkwkirAUZsPcP3d4ECdrWwvY/xw7ewdXWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=arsVDpo4dPzPIVSn/FusO2EnJGazLue6DTu5xtQ1Wc4=; b=SpGnigiw8gGpRp1qK5/ClmwolXt75USL9SHDuy5ZPjAGz84rc72d0TzkNzcLELGIWy UJw7HsHLsYdndFfyROrxjzxKShL4b/+9uZwsG6CgWg6cURe5wc35VX7yPbDSEiIWolkj PEuSMNhx5bLgkzu/lEBD6SaiX44Nk34qnEMNO54axbqs8FeZG6+JXVIk+JWNssxZMKvG jElxYRWfTfJbO3SGiOeM0r1kcElus7iRm/KSDL3mkWiYVsXc4KWD2+cfXFNIRxu2cDXD 8GFr6I42qXq9plbyKFIUDd95XvNfgRW+yJb92zMYbzXcfyme8ONB+AnR/y3uduBfAj2E kQUw== X-Gm-Message-State: AOAM532rkWjo6popayEkAX0qc6L5zefXr5I7PnrgzAAgU/V5DO3exy4s Bpbm5u4brwl8In0XFcecG6JO6w== X-Google-Smtp-Source: ABdhPJzwwtqVfze6WdgU2WemIHw5txyx31AsLH10HrwpykM4M4h1k0i5TNtgBHIxbBwe5O+7JyHrCw== X-Received: by 2002:a63:1b22:: with SMTP id b34mr2609225pgb.331.1637333624888; Fri, 19 Nov 2021 06:53:44 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:35da:1c92:84b8:d096]) by smtp.gmail.com with ESMTPSA id q11sm3368033pfk.192.2021.11.19.06.53.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 06:53:44 -0800 (PST) From: Jagan Teki To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Sam Ravnborg Subject: [PATCH 1/2] drm/bridge: chipone-icn6211: Switch to atomic operations Date: Fri, 19 Nov 2021 20:23:24 +0530 Message-Id: <20211119145325.1775046-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 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: linux-amarula@amarulasolutions.com, Jagan Teki , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Replace atomic version of the pre_enable/enable/post_disable operations to continue the transition to the atomic API. Also added default drm atomic operations for duplicate, destroy and reset state API's in order to have smooth transition on atomic API's. Tested on Allwinner R16/R40 DSI. Signed-off-by: Jagan Teki Reviewed-by: Robert Foss --- drivers/gpu/drm/bridge/chipone-icn6211.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c index a6151db95586..77b3e2c29461 100644 --- a/drivers/gpu/drm/bridge/chipone-icn6211.c +++ b/drivers/gpu/drm/bridge/chipone-icn6211.c @@ -4,6 +4,7 @@ * Author: Jagan Teki */ +#include #include #include #include @@ -61,7 +62,8 @@ static inline int chipone_dsi_write(struct chipone *icn, const void *seq, chipone_dsi_write(icn, d, ARRAY_SIZE(d)); \ } -static void chipone_enable(struct drm_bridge *bridge) +static void chipone_atomic_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct chipone *icn = bridge_to_chipone(bridge); struct drm_display_mode *mode = bridge_to_mode(bridge); @@ -114,7 +116,8 @@ static void chipone_enable(struct drm_bridge *bridge) usleep_range(10000, 11000); } -static void chipone_pre_enable(struct drm_bridge *bridge) +static void chipone_atomic_pre_enable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct chipone *icn = bridge_to_chipone(bridge); int ret; @@ -145,7 +148,8 @@ static void chipone_pre_enable(struct drm_bridge *bridge) usleep_range(10000, 11000); } -static void chipone_post_disable(struct drm_bridge *bridge) +static void chipone_atomic_post_disable(struct drm_bridge *bridge, + struct drm_bridge_state *old_bridge_state) { struct chipone *icn = bridge_to_chipone(bridge); @@ -169,10 +173,13 @@ static int chipone_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flag } static const struct drm_bridge_funcs chipone_bridge_funcs = { - .attach = chipone_attach, - .post_disable = chipone_post_disable, - .pre_enable = chipone_pre_enable, - .enable = chipone_enable, + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_pre_enable = chipone_atomic_pre_enable, + .atomic_enable = chipone_atomic_enable, + .atomic_post_disable = chipone_atomic_post_disable, + .attach = chipone_attach, }; static int chipone_parse_dt(struct chipone *icn)