From patchwork Mon Nov 22 06:52:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 12693268 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D18E8C433EF for ; Mon, 22 Nov 2021 06:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HWK35VRkEWgGMVkL1qeY8aoL6SfTM5GSZ2MtNCO0Fqs=; b=QUD+AYo5jMoGTc 8nkPFTfSFx4IFWClFrk+LNEJVFYQJeAFQeEaTXHia9MsCRm6jqMBLnuwoNWMa/c0IObG5ZIYIEzja aq5+tiRlNHd+rKiK+kSN6lJ/A5RBmbZiGWRNVqMbjVfskJFchooYnNia4JHnQI+n8f8JWUzxOQVkU x73icYqZYE/mQTsmoRUGH1ECtUsRBeKatvZ+rJvhvZRxZKGui8weqmLFIKuJ0VURVMOfB0A5OxRoI wsPuCjPtIwFqadHwk7/deh+sbJLsTO15s4GNFdl1Cktemrkt2pDjmM3OpauiQ5NtnXRnfCHiPXPFb MftZl8IE6r9IMg7RM3Zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mp3DV-00EzXU-6k; Mon, 22 Nov 2021 06:54:17 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mp3Ct-00EzKJ-5i for linux-arm-kernel@lists.infradead.org; Mon, 22 Nov 2021 06:53:40 +0000 Received: by mail-pj1-x1029.google.com with SMTP id j5-20020a17090a318500b001a6c749e697so12828338pjb.1 for ; Sun, 21 Nov 2021 22:53:38 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=wJ/t6jM/jyN5QXpQAEFQjSGSqfZWlxA85S7ihcjleN4=; b=bIadhJCzrMKxm03cp/PIBhXn18NNYdZ2YoYDS8LJ/ac/RvjLiQ2Sp7Svd4BZxnoS3g dCiCRuOmctLguhmGiwM9i1tchv8uBY0rw6O+FT0rAt5WiRTILdKeXUHxgqZhsdaGr60A Wvydha/B6xL9nEYr8dbrsNK2YwmuNWXOYj5RM= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=wJ/t6jM/jyN5QXpQAEFQjSGSqfZWlxA85S7ihcjleN4=; b=145K3SSv0ruwZmvhE+BrJ6nPtvMAm4P71iJ0IPXqQOMfv8cOTc6q4AlgM/ZAHP37Xb 7BVwGKvW9YxLDq9Agv3qK6pFICZX+tiBAQGGIA3MP7WYRYrQJGO1hxOLHlo8Q1Q7xhuf hkcXgjW+nKKwFqhm0Xi3UFL/0/fTuR/oEiDvFqbhwXohiQfi0ZPJUVr3w7ZVSV3MuTQp 0zH6AHmkaWwMxUOUJvtLepaKtj8aNtjaFIcIPjQ2WlOXz4Flvt54QEt4WN6gO4g4S3Qu MYh3lC7IGQgxfeWXnZ+Lt5pEhkEkLxAsE+rVtUkwtcZJc+RoIG7Kk/zvcgIaKbYE1AkE NpdA== X-Gm-Message-State: AOAM531Zn9YuLnrM1qRnqdFZbp7/wwP9Nxia/hcUsC/0haT3T8WmTVbT VAc693BEZB7/xoMzag86w+riCA== X-Google-Smtp-Source: ABdhPJz8UMA5qnotn8CuvwokGv9kesn6itqP05ipiuNNTbry3iobK0F9ZSHrkk/BBXvJzlIi9pSklQ== X-Received: by 2002:a17:90a:e7ca:: with SMTP id kb10mr28171937pjb.8.1637564018014; Sun, 21 Nov 2021 22:53:38 -0800 (PST) Received: from localhost.localdomain ([2405:201:c00a:a0a9:eed6:c913:819a:3850]) by smtp.gmail.com with ESMTPSA id a8sm7935904pfv.176.2021.11.21.22.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Nov 2021 22:53:37 -0800 (PST) From: Jagan Teki To: Maxime Ripard , Chen-Yu Tsai , Laurent Pinchart , Neil Armstrong , Robert Foss , Sam Ravnborg Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v5 4/7] drm: sun4i: dsi: Add mode_set function Date: Mon, 22 Nov 2021 12:22:20 +0530 Message-Id: <20211122065223.88059-5-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211122065223.88059-1-jagan@amarulasolutions.com> References: <20211122065223.88059-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211121_225339_253046_8CE2A97D X-CRM114-Status: GOOD ( 16.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Get the display mode settings via mode_set bridge function instead of explicitly de-reference. Signed-off-by: Jagan Teki --- Changes for v5: - new patch drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 12 +++++++++++- drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c index a6a272b55f77..731af31e2bde 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c @@ -718,7 +718,7 @@ static void sun6i_dsi_bridge_atomic_enable(struct drm_bridge *bridge, struct drm_bridge_state *old_bridge_state) { struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); - struct drm_display_mode *mode = &bridge->encoder->crtc->state->adjusted_mode; + struct drm_display_mode *mode = &dsi->mode; struct mipi_dsi_device *device = dsi->device; union phy_configure_opts opts = { }; struct phy_configure_opts_mipi_dphy *cfg = &opts.mipi_dphy; @@ -854,6 +854,15 @@ static const struct drm_connector_funcs sun6i_dsi_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; +static void sun6i_dsi_bridge_mode_set(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + const struct drm_display_mode *adjusted_mode) +{ + struct sun6i_dsi *dsi = bridge_to_sun6i_dsi(bridge); + + drm_mode_copy(&dsi->mode, adjusted_mode); +} + static int sun6i_dsi_bridge_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags) { @@ -872,6 +881,7 @@ static const struct drm_bridge_funcs sun6i_dsi_bridge_funcs = { .atomic_reset = drm_atomic_helper_bridge_reset, .atomic_enable = sun6i_dsi_bridge_atomic_enable, .atomic_disable = sun6i_dsi_bridge_atomic_disable, + .mode_set = sun6i_dsi_bridge_mode_set, .attach = sun6i_dsi_bridge_attach, }; diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h index d269304691c9..acdd586a4157 100644 --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.h @@ -20,6 +20,7 @@ struct sun6i_dsi { struct drm_connector connector; struct drm_encoder encoder; struct mipi_dsi_host host; + struct drm_display_mode mode; struct clk *bus_clk; struct clk *mod_clk;