dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
	patchwork-lst@pengutronix.de
Subject: Re: [PATCH 5/5] drm/imx: don't destroy mode objects manually on driver unbind
Date: Mon, 20 Jun 2016 14:00:09 +0200	[thread overview]
Message-ID: <1466424009.6070.34.camel@pengutronix.de> (raw)
In-Reply-To: <1466158422-12579-5-git-send-email-l.stach@pengutronix.de>

Am Freitag, den 17.06.2016, 12:13 +0200 schrieb Lucas Stach:
> Instead let drm_mode_config_cleanup() do the work when taking down
> the master device. This requires all cleanup functions to be
> properly hooked up to the mode object .destroy callback.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/gpu/drm/bridge/dw-hdmi.c       | 3 ---
>  drivers/gpu/drm/imx/imx-drm-core.c     | 4 ++--
>  drivers/gpu/drm/imx/imx-ldb.c          | 6 ------
>  drivers/gpu/drm/imx/imx-tve.c          | 3 ---
>  drivers/gpu/drm/imx/ipuv3-crtc.c       | 9 ++++++---
>  drivers/gpu/drm/imx/parallel-display.c | 3 ---
>  6 files changed, 8 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c
> index c9d941283d30..5f97977f7e5c 100644
> --- a/drivers/gpu/drm/bridge/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/dw-hdmi.c
> @@ -1834,9 +1834,6 @@ void dw_hdmi_unbind(struct device *dev, struct device *master, void *data)
>  	/* Disable all interrupts */
>  	hdmi_writeb(hdmi, ~0, HDMI_IH_MUTE_PHY_STAT0);
>  
> -	hdmi->connector.funcs->destroy(&hdmi->connector);
> -	hdmi->encoder->funcs->destroy(hdmi->encoder);
> -
>  	clk_disable_unprepare(hdmi->iahb_clk);
>  	clk_disable_unprepare(hdmi->isfr_clk);
>  	i2c_put_adapter(hdmi->ddc);

The rockchip driver already calls drm_mode_config_cleanup after
component_unbind_all, so I this change should work for the rockchip
driver as is?

> diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
> index 799a68976590..71e33666cae8 100644
> --- a/drivers/gpu/drm/imx/imx-drm-core.c
> +++ b/drivers/gpu/drm/imx/imx-drm-core.c
> @@ -466,11 +466,11 @@ static void imx_drm_unbind(struct device *dev)
>  	if (fbhelper)
>  		drm_fbdev_cma_fini(fbhelper);
>  
> +	drm_mode_config_cleanup(drm);
> +
>  	component_unbind_all(drm->dev, drm);
>  	dev_set_drvdata(dev, NULL);
>  
> -	drm_mode_config_cleanup(drm);
> -
>  	drm_dev_unref(drm);
>  }

regards
Philipp

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-06-20 12:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 10:13 [PATCH 1/5] drm/imx: disable outputs in lastclose when framebuffer emulation is disabled Lucas Stach
2016-06-17 10:13 ` [PATCH 2/5] drm/imx: imx-ldb: check return code on panel attach Lucas Stach
2016-07-11 10:25   ` Philipp Zabel
2016-06-17 10:13 ` [PATCH 3/5] drm/imx: imx-ldb: detach panel on unbind Lucas Stach
2016-06-20 12:03   ` Philipp Zabel
2016-06-17 10:13 ` [PATCH 4/5] drm/imx: drop deprecated load/unload drm_driver ops Lucas Stach
2016-06-17 12:48   ` Daniel Vetter
2016-06-24  7:46     ` Ying Liu
2016-06-17 10:13 ` [PATCH 5/5] drm/imx: don't destroy mode objects manually on driver unbind Lucas Stach
2016-06-20 12:00   ` Philipp Zabel [this message]
2016-06-17 12:45 ` [PATCH 1/5] drm/imx: disable outputs in lastclose when framebuffer emulation is disabled Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466424009.6070.34.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=patchwork-lst@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox