From patchwork Fri Oct 12 09:46:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 10638229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8651014E2 for ; Fri, 12 Oct 2018 09:47:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75DB82BCB5 for ; Fri, 12 Oct 2018 09:47:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 690782BCBB; Fri, 12 Oct 2018 09:47:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 072962BCB5 for ; Fri, 12 Oct 2018 09:47:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A37116E00E; Fri, 12 Oct 2018 09:47:10 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 994256E00E for ; Fri, 12 Oct 2018 09:47:09 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id a8-v6so12252550wmf.1 for ; Fri, 12 Oct 2018 02:47:09 -0700 (PDT) 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=SvUgnSZ7UmEYGPl6h1IzPsk3T6xbJ7bdK2bxRgd9mMs=; b=VcxHxv/FGY6f8OG1HJKrkfyUtb45rtC7uxjqlXVJ/51P4lA4eIPQEHZ1V+eOLtxWZJ iq6kKAYZI2V1gM0qTuAq6qtxhdGy/ve5L4nu1OYp3xOKjqVZMXehDUER4enWItR+WCkE tnZ8LRgIKGgtfSA2s1SAjlSS8VniQ4A/pjcifTpmGdAv+9kLPOBvia7+xCvzN45PWPFF XHYDIrTslxqxTZkXU35+/gdH0L4ULiZ6sbGD7XrGs+G7waABrcL+jI57v0YRXOVCSScJ eAjsfNtqUEgZayL1fCOYpJzXEXHlYQoGG5PxvouLJ9dqeubCES5BjG7fH/fiKX8GX2WW 0xMw== X-Gm-Message-State: ABuFfoivAIe/BiVqKOxLwy2EoFiksIJAgvKzmErjBbiSi44jr3w83yG1 qXXtujjiI4IVaWtx9WlM8sy/Kw== X-Google-Smtp-Source: ACcGV60Ghw5kkvAKMC+BjoV3OpArd3LUxwzAYv7XXjFT0KVJy0BD/pu9kiW1hxxSaA5tNr67BJbTCw== X-Received: by 2002:a1c:ee0c:: with SMTP id m12-v6mr4860067wmh.112.1539337628088; Fri, 12 Oct 2018 02:47:08 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([2a04:cec0:1087:9ad4:c93a:12ce:b821:38d7]) by smtp.gmail.com with ESMTPSA id s7-v6sm8430203wmd.0.2018.10.12.02.47.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Oct 2018 02:47:07 -0700 (PDT) From: Benjamin Gaignard To: airlied@linux.ie, daniel@ffwll.ch Subject: [PATCH] drm/sti: clean up after drm_atomic_helper_shutdown rework Date: Fri, 12 Oct 2018 11:46:39 +0200 Message-Id: <20181012094639.1585-2-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20181012094639.1585-1-benjamin.gaignard@linaro.org> References: <20181012094639.1585-1-benjamin.gaignard@linaro.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Since drm_atomic_helper_shutdown() rework it is possible to do additional clean up in sti driver: custom plane destroy functions become useless and clean up encoder is no more needed. Signed-off-by: Benjamin Gaignard Reviewed-by: Daniel Vetter --- drivers/gpu/drm/sti/sti_cursor.c | 9 +-------- drivers/gpu/drm/sti/sti_gdp.c | 9 +-------- drivers/gpu/drm/sti/sti_hqvdp.c | 9 +-------- drivers/gpu/drm/sti/sti_tvout.c | 24 ------------------------ 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_cursor.c b/drivers/gpu/drm/sti/sti_cursor.c index bc908453ffb3..e1ba253055c7 100644 --- a/drivers/gpu/drm/sti/sti_cursor.c +++ b/drivers/gpu/drm/sti/sti_cursor.c @@ -328,13 +328,6 @@ static const struct drm_plane_helper_funcs sti_cursor_helpers_funcs = { .atomic_disable = sti_cursor_atomic_disable, }; -static void sti_cursor_destroy(struct drm_plane *drm_plane) -{ - DRM_DEBUG_DRIVER("\n"); - - drm_plane_cleanup(drm_plane); -} - static int sti_cursor_late_register(struct drm_plane *drm_plane) { struct sti_plane *plane = to_sti_plane(drm_plane); @@ -346,7 +339,7 @@ static int sti_cursor_late_register(struct drm_plane *drm_plane) static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = sti_cursor_destroy, + .destroy = drm_plane_cleanup, .reset = sti_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c index 3c19614d3f75..87b50451afd7 100644 --- a/drivers/gpu/drm/sti/sti_gdp.c +++ b/drivers/gpu/drm/sti/sti_gdp.c @@ -879,13 +879,6 @@ static const struct drm_plane_helper_funcs sti_gdp_helpers_funcs = { .atomic_disable = sti_gdp_atomic_disable, }; -static void sti_gdp_destroy(struct drm_plane *drm_plane) -{ - DRM_DEBUG_DRIVER("\n"); - - drm_plane_cleanup(drm_plane); -} - static int sti_gdp_late_register(struct drm_plane *drm_plane) { struct sti_plane *plane = to_sti_plane(drm_plane); @@ -897,7 +890,7 @@ static int sti_gdp_late_register(struct drm_plane *drm_plane) static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = sti_gdp_destroy, + .destroy = drm_plane_cleanup, .reset = sti_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, diff --git a/drivers/gpu/drm/sti/sti_hqvdp.c b/drivers/gpu/drm/sti/sti_hqvdp.c index 23565f52dd71..065a5b08a702 100644 --- a/drivers/gpu/drm/sti/sti_hqvdp.c +++ b/drivers/gpu/drm/sti/sti_hqvdp.c @@ -1256,13 +1256,6 @@ static const struct drm_plane_helper_funcs sti_hqvdp_helpers_funcs = { .atomic_disable = sti_hqvdp_atomic_disable, }; -static void sti_hqvdp_destroy(struct drm_plane *drm_plane) -{ - DRM_DEBUG_DRIVER("\n"); - - drm_plane_cleanup(drm_plane); -} - static int sti_hqvdp_late_register(struct drm_plane *drm_plane) { struct sti_plane *plane = to_sti_plane(drm_plane); @@ -1274,7 +1267,7 @@ static int sti_hqvdp_late_register(struct drm_plane *drm_plane) static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, - .destroy = sti_hqvdp_destroy, + .destroy = drm_plane_cleanup, .reset = sti_plane_reset, .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index ea4a3b87fa55..4dc3b2ec40eb 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c @@ -788,21 +788,6 @@ static void sti_tvout_create_encoders(struct drm_device *dev, tvout->dvo = sti_tvout_create_dvo_encoder(dev, tvout); } -static void sti_tvout_destroy_encoders(struct sti_tvout *tvout) -{ - if (tvout->hdmi) - drm_encoder_cleanup(tvout->hdmi); - tvout->hdmi = NULL; - - if (tvout->hda) - drm_encoder_cleanup(tvout->hda); - tvout->hda = NULL; - - if (tvout->dvo) - drm_encoder_cleanup(tvout->dvo); - tvout->dvo = NULL; -} - static int sti_tvout_bind(struct device *dev, struct device *master, void *data) { struct sti_tvout *tvout = dev_get_drvdata(dev); @@ -815,17 +800,8 @@ static int sti_tvout_bind(struct device *dev, struct device *master, void *data) return 0; } -static void sti_tvout_unbind(struct device *dev, struct device *master, - void *data) -{ - struct sti_tvout *tvout = dev_get_drvdata(dev); - - sti_tvout_destroy_encoders(tvout); -} - static const struct component_ops sti_tvout_ops = { .bind = sti_tvout_bind, - .unbind = sti_tvout_unbind, }; static int sti_tvout_probe(struct platform_device *pdev)