From patchwork Mon Oct 2 09:34:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 114570 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp474870qgn; Mon, 2 Oct 2017 02:35:26 -0700 (PDT) X-Received: by 10.99.126.23 with SMTP id z23mr11960038pgc.4.1506936926832; Mon, 02 Oct 2017 02:35:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506936926; cv=none; d=google.com; s=arc-20160816; b=pYjeODduY+ReR/SATL8EgPFF6uyvSlkWOqDcn5fbC41dYuTS1HGeDlsMi81AICjZ/r UnYk/AMWFoWeW3R7OGtW1rwrl/7KuQlgWFZblnAjsw5Q5tf5smJVNpxzEBrBL7wUAT5V OAbGxFD2+xQYwKvCqPCSzlQj9SAVD/i26GDpoUzhk3qDARZmQ6T0czlYMZd1ycbyNrDB CPViQlHagrMQxT2RyPSZeOE7ABegI/TeT8ixGCn5NA2Hvl1HJv/SMU4LPC85ML0IvqrE YP/FNnx6rGppobleXGPdxorjb1jsvy6F8bN4M+LEZyzoNQDirBLnlp7Jf7s8NnVAsaMu EgNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eeoLJu7OPnkyTduxewysehyKuW5MGiUs9/lHFG+2VZ4=; b=rf/iwyVA+qP0UrOTg0XNBArqQ/9oPS9YaOUeW8TXZKz/wTPnATHqbYleysag7I1Wyj az6ETarEWlQXXjDZ3esDdbOWsEinQNwJisDSsbgMD1g6c4WwJYeXGbLan75bifMOoWMD 5GMEkrUgWRevK6lpk+0Ilrb915etcHyc487PqzdmR2eoZFFqOZC6k3uelqmUwvircRK0 Q2UGENZX00bs0iBhFZspDN71bJEbOEU7scEGGRYvh94/SrZGUC3M1iu+97wcMgKL8jdi 37YwRWOCNq8kMCrumkCIFb9EPjCDAYzrTmFeNIxOQ/a0z1/TwImKhoFImdUAdhg9MRU7 xJdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jg1n/xrN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m9si7963363plt.273.2017.10.02.02.35.26; Mon, 02 Oct 2017 02:35:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jg1n/xrN; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbdJBJfY (ORCPT + 26 others); Mon, 2 Oct 2017 05:35:24 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:50611 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751104AbdJBJfV (ORCPT ); Mon, 2 Oct 2017 05:35:21 -0400 Received: by mail-wr0-f180.google.com with SMTP id b21so3437274wrg.7 for ; Mon, 02 Oct 2017 02:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eeoLJu7OPnkyTduxewysehyKuW5MGiUs9/lHFG+2VZ4=; b=Jg1n/xrNd977cJ2SgxrxZuZQq3fV5N0sKUTTrSmnkffCbUHw/eP53CzNQ5shs2mpjD ahM5IQk7miQFFMbIkKq99lgBVp+QDyz+sJvWjwp/wKUNkF4Wa6c9Lm8pckNdAYrKjS7M ikpJ4R6FIa0GvxrJEEd8OL6ka9KsY9AAI7+Ss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eeoLJu7OPnkyTduxewysehyKuW5MGiUs9/lHFG+2VZ4=; b=bsn5wgqRbhKorZu3p04AgrwJUbe90DftOac88CnlE782dQtEyljWjCeVX9Ej6MXwza hJ4e4gQBzwPRr+Y9/Lp9JjvVW1njnnpHwAiDqco+wVQa8kktcThrDEvwYoLlsbRtjN+k Cj1xCFiYRGrtSMbiXL7xZ4WbEBITCsVb2xuJ4k6hKqyg27KLQPQaOCsF5QX/SvX0lrxl XVjWL7QvK8aICZQNRhyNyUnX0HKj7PE1nbo30c2ZkaWF5p50kZIO1mKgP9Mh44rvjQ64 jITgY1/sWtPgxquTGhZzbXkctlrc7Ph4yVS0o0lodKt7wZs1e3OX2B+BYyepvhM+MCDN x+7g== X-Gm-Message-State: AHPjjUjrdEPwkCsy7SJgQfShRMyhiB+LoXj9zYBrJuOvrp9IFTfUf1il 4RbGSxMoMbz7ZIScJENgjrygWA== X-Google-Smtp-Source: AOwi7QBC+c93CWcWdwmys91NWUweRpFw53nKfJEvQ1FX0CUvvQhcOuisKiID+Reb4FMs+iBFaWfakA== X-Received: by 10.223.161.23 with SMTP id o23mr15143662wro.103.1506936919935; Mon, 02 Oct 2017 02:35:19 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.199.139]) by smtp.gmail.com with ESMTPSA id l4sm6516856wrb.74.2017.10.02.02.35.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Oct 2017 02:35:19 -0700 (PDT) From: Benjamin Gaignard To: architt@codeaurora.org, a.hajda@samsung.com, Laurent.pinchart@ideasonboard.com, airlied@linux.ie, daniel.vetter@intel.com, jani.nikula@linux.intel.com, seanpaul@chromium.org, yannick.fertre@st.com, philippe.cornu@st.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Benjamin Gaignard Subject: [PATCH v2 3/5] drm/stm: ltdc: remove bridge from driver internal structure Date: Mon, 2 Oct 2017 11:34:46 +0200 Message-Id: <1506936888-23844-4-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506936888-23844-3-git-send-email-benjamin.gaignard@linaro.org> References: <1506936888-23844-3-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With a call to drm_of_panel_bridge_remove() we could remove the bridge without store it in ldtc internal driver structure. Signed-off-by: Benjamin Gaignard Reviewed-by: Philippe Cornu Tested-by: Philippe Cornu --- drivers/gpu/drm/stm/ltdc.c | 16 +++++----------- drivers/gpu/drm/stm/ltdc.h | 2 -- 2 files changed, 5 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c index d394a03..735c908 100644 --- a/drivers/gpu/drm/stm/ltdc.c +++ b/drivers/gpu/drm/stm/ltdc.c @@ -791,9 +791,8 @@ static const struct drm_encoder_funcs ltdc_encoder_funcs = { .destroy = drm_encoder_cleanup, }; -static int ltdc_encoder_init(struct drm_device *ddev) +static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge) { - struct ltdc_device *ldev = ddev->dev_private; struct drm_encoder *encoder; int ret; @@ -807,7 +806,7 @@ static int ltdc_encoder_init(struct drm_device *ddev) drm_encoder_init(ddev, encoder, <dc_encoder_funcs, DRM_MODE_ENCODER_DPI, NULL); - ret = drm_bridge_attach(encoder, ldev->bridge, NULL); + ret = drm_bridge_attach(encoder, bridge, NULL); if (ret) { drm_encoder_cleanup(encoder); return -EINVAL; @@ -936,12 +935,9 @@ int ltdc_load(struct drm_device *ddev) ret = PTR_ERR(bridge); goto err; } - ldev->is_panel_bridge = true; } - ldev->bridge = bridge; - - ret = ltdc_encoder_init(ddev); + ret = ltdc_encoder_init(ddev, bridge); if (ret) { DRM_ERROR("Failed to init encoder\n"); goto err; @@ -972,8 +968,7 @@ int ltdc_load(struct drm_device *ddev) return 0; err: - if (ldev->is_panel_bridge) - drm_panel_bridge_remove(bridge); + drm_panel_bridge_remove(bridge); clk_disable_unprepare(ldev->pixel_clk); @@ -986,8 +981,7 @@ void ltdc_unload(struct drm_device *ddev) DRM_DEBUG_DRIVER("\n"); - if (ldev->is_panel_bridge) - drm_panel_bridge_remove(ldev->bridge); + drm_of_panel_bridge_remove(ddev->dev->of_node, 0, 0); clk_disable_unprepare(ldev->pixel_clk); } diff --git a/drivers/gpu/drm/stm/ltdc.h b/drivers/gpu/drm/stm/ltdc.h index bc6d6f6..ae43755 100644 --- a/drivers/gpu/drm/stm/ltdc.h +++ b/drivers/gpu/drm/stm/ltdc.h @@ -24,8 +24,6 @@ struct ltdc_device { struct drm_fbdev_cma *fbdev; void __iomem *regs; struct clk *pixel_clk; /* lcd pixel clock */ - struct drm_bridge *bridge; - bool is_panel_bridge; struct mutex err_lock; /* protecting error_status */ struct ltdc_caps caps; u32 error_status;