From patchwork Fri Sep 29 12:59:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 114519 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp798221edb; Fri, 29 Sep 2017 05:59:42 -0700 (PDT) X-Received: by 10.84.235.9 with SMTP id o9mr6679887plk.8.1506689982731; Fri, 29 Sep 2017 05:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506689982; cv=none; d=google.com; s=arc-20160816; b=EEFaMovCoJbfyTjVPvwW/RN1oaU2rXx7cGr7MLqWG3sMgPX0hsSyRHnpZLtuYbbh0Q NXQ4P2imuA+nJdftqLhDllEgHiAYgH+lSYdgUwkXZTHBvElJTbAtIJiwIhrelr+cWghZ Ysyc3ufo6mwjW/FHoN9ilVf9E8QrViF4yRGrMxGCWSgOcaZVx7utPptfdP9WdKdhG0ae FS/YJ2dJU1ZpObrVBnf1EuB8mjG4tO5T/nA+8mBmR+k3CDkRHQFeon2phgSDUh+hfu1m QqHJPSV3QhpE9s3pmIcMj4OvicsGcWR7V3i0xTAN9v7pZ4gWsJsTqzccITjdchhI7rx9 Nl0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=tmFF5rRaGONrOyUVQTnQ3OxyaVDl3vVtOIG0G2a/BMc=; b=OhWWSlz8PG1Lzl1EAeBC/WwoFg9repOrlwYUVORlTCPEcRUYGloOYkOIbGMgme1Bti qT61Hy4c9EvYhD3Am04HGxNvv2TcyeAuJJeByw/pnghfYhS2Ry1ado+1uwIF/9cvMhny gZQNyFDLWrELXHYH5zDfbamfSXGl80utV9llVmuoQMpFnFmQ4BU30NLFr1XN336vJDwF Ldusp74OSJrPmAyIsvZIa0Jzgr5Cbp0uFpz4wSY8hT++WEPzW4/nFtkfQZE8JzpypFAf HSZcd2A0cXxKruwW5sAvUVIUiWkHtsUWyq2IiovqKUrGxEEl0pIemGcsh5vxE34bCF3b J3Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OWrBqtsX; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 2si3341089pfd.177.2017.09.29.05.59.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Sep 2017 05:59:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OWrBqtsX; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0C126EB95; Fri, 29 Sep 2017 12:59:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1D42B6EB95 for ; Fri, 29 Sep 2017 12:59:39 +0000 (UTC) Received: by mail-wm0-x22e.google.com with SMTP id m127so3132931wmm.1 for ; Fri, 29 Sep 2017 05:59:39 -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=dRisnqR6Vv8O3wh1Keu06wxJsCpIypFE+ng8B0AGvME=; b=OWrBqtsX7AS1JTTrW9Idmd0mo2+9h1FRzWn2kQBecW+K6Cwq/aqXqNQ8uLHPRbvBcA CeiZAAyxCemYphps+skmXeKOtfa3JNtlaokYeUt+SUkdLakgg/F0I4vEx9Ren6yEv8jj xZW4zdgDG1aO36a/zJkDUNUqCnk0jXUiHjJMI= 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=dRisnqR6Vv8O3wh1Keu06wxJsCpIypFE+ng8B0AGvME=; b=uNgr2xzLI7vMHUdPYaeABGWw4O9XRmmJ3lVJ59526WwAm+9CNsi9tgDi4gU1/1Eb9n DQf4rVQan5BfpSp+Lg4+Bhg499N66EQRLxw7BC0Fy7JTZ89hFyUGWaBCuhYRYqqUHYI/ D1+H9Ldm+HmN3VfauQJCS1JRzyGRciCdv5YckcQml54t5DiHabVKp14EdGWdjldXKBFi BsC5jPWxLidf01JvRH68MwiZRPFMrB3tyOWCKQh37h+4vmNmWVKFt1VnyEM8cXFWp0da vohmXrMDzZiTjsK/vUOQoxQ8QB+XNqlwYBY7SUzmsZujIDv0ymnsdL+StZNlOIbQf0o1 LK7A== X-Gm-Message-State: AMCzsaXPZIKssCciS6MWNcawERmpP3Sa/KsahB9zsvtZekrjhxfNle4F NEmzX/XKEQAbV3DAAuxIS5+3OA== X-Google-Smtp-Source: AOwi7QDg57seE3FzEkwAj0Y/RoHZai8D6rYW+NLVzmCCJUwSPJN/mN4+3Ppd5lauWrVpWoCKk0Csfw== X-Received: by 10.28.132.141 with SMTP id g135mr3830755wmd.37.1506689978519; Fri, 29 Sep 2017 05:59:38 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.91.35]) by smtp.gmail.com with ESMTPSA id k11sm3269667wrc.90.2017.09.29.05.59.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Sep 2017 05:59:38 -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 Subject: [PATCH 3/3] drm/stm: ltdc: remove bridge from driver internal structure Date: Fri, 29 Sep 2017 14:59:19 +0200 Message-Id: <1506689959-7858-4-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506689959-7858-1-git-send-email-benjamin.gaignard@linaro.org> References: <1506689959-7858-1-git-send-email-benjamin.gaignard@linaro.org> Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- drivers/gpu/drm/stm/ltdc.c | 16 +++++----------- drivers/gpu/drm/stm/ltdc.h | 2 -- 2 files changed, 5 insertions(+), 13 deletions(-) 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;