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: 148731 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp521972lji; Fri, 12 Oct 2018 02:47:13 -0700 (PDT) X-Google-Smtp-Source: ACcGV61sk17YQU1joP6Qd7kp680QGFLkB4vxmPn34U1cDJ7isKUTqwaRJwBrcXY6OTt9+QTYo4vx X-Received: by 2002:a17:902:2808:: with SMTP id e8-v6mr5033763plb.327.1539337633092; Fri, 12 Oct 2018 02:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539337633; cv=none; d=google.com; s=arc-20160816; b=j8snvn4qW4535ur5NdV7ljf6glozjJQzkPyat7dhpoOXh7Ivl/aAEsS9smcFd2twE8 Ez2bRZS/WhgZmlPinj3Ro+CYTiWcB7f8FHPDly4zHL6RKdhmh+UrMaCVqDC1zIf0F6Nr enauiybKOgLN/ycSecG6koDrcVnJhEPWzgE6xjPLRc4G1eiR1pAx2dowVzQGrd3j6wif syv5UJYFxomy9qce0O6Si/HQ0aGH/Lp8TwcKdBepK9aJDlvqisoO+pHbiX2V//6+L6iB lhJZG8ZEdUR5yum+DYTdo6VR/KjZpc7KcwtXAmambWbdmQtBF+sUfmG8Ww2TOFhXGzAe F2zA== 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; bh=SvUgnSZ7UmEYGPl6h1IzPsk3T6xbJ7bdK2bxRgd9mMs=; b=0pmFKk3Jdzu5Rh9LCyxPapPzeA7/GnxzFP8ixB5JwXulfPITr5JRBCZqIBIHO6ogRk qraAv8qJLRP1q2+aPOHKmXVqDn/j7itzwxWn09fzOrUZd0civNsqsz5/8O+uyWYWSg0j 0iQcgr91JpGsCiZATuLRb/Pyigzts/OJK5mU8UYZriogapIisW86E43TJLCb2nfu8Kbk AK8MATxmkR7mQV8MM/plmCrJFrqEtLxgq4hRRszkArP28HWDnI3k4Ra5P3fqeyq6Xk2u KJM5Iyt1j3ip8EEPuv78F4ToQ/LsOkiQ4ETdphdQ1HgXj6diANUlTyDxYscmF4hvsp0Q zPqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aWGYq7d5; 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 c89-v6si803723pfe.60.2018.10.12.02.47.12; Fri, 12 Oct 2018 02:47:13 -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=aWGYq7d5; 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 S1728461AbeJLRSp (ORCPT + 32 others); Fri, 12 Oct 2018 13:18:45 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38204 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728264AbeJLRSp (ORCPT ); Fri, 12 Oct 2018 13:18:45 -0400 Received: by mail-wm1-f66.google.com with SMTP id 193-v6so12255392wme.3 for ; Fri, 12 Oct 2018 02:47:08 -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=SvUgnSZ7UmEYGPl6h1IzPsk3T6xbJ7bdK2bxRgd9mMs=; b=aWGYq7d52D0la3UVdYBpxYsXc7BHle8jlhcuF1CXtpQNe6m+Mk6vGjFyegcgc8toUn aHusziHV41bfKd1ln48jqgMvCaH9jXCibi25CjQXLz2Tip2DJ9j5bsM+a/LafbfdTVOv SAIMuJN3jk2efKuSWFbE3mP5JMZiT+g4DDIQA= 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=sjfZ6xw5S/0rxnHjQ3YV9elEwBWq2Ahk5PXm/Rr4yM6dMSpq5aPdVKtAPXwePeIqna Ft00XTm+2sg/1wDv3Xad3WUZq5HL8Ulb9d80lWhCoTx2f+9oZsXG2MBE2D7vkZjfVpmD LdmhcGNAUu05sYtElJ7KZHA3X5vrNnWnLu+GclIQrFgWIbSyy49TTDZ2ONoq6y/nzFbY 8WzKOz31QGYs06wHk3x+Dsuj2a4EL9rKH4uL8lFEkpTaE3fQM6Rhrfw7gSM5Iq4acOwP RVxcPcFOqftp68zAm4Aeio5+Vvc2A84/nzHinmvhSOrlRt+RwUNQVvet5cjZeDgheIeg QXlw== X-Gm-Message-State: ABuFfoiXhloZNZVT9whPkQt5spFqI74ID2/X/ykiBFn3UIsKxIh1yzR6 ugcdJU6UrLvOHaIsOHx6MaR/pw== 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Benjamin Gaignard 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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(-) -- 2.15.0 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)