Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Emil Velikov <emil.l.velikov@gmail.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Jie Qiu <jie.qiu@mediatek.com>,
	Cawa Cheng <cawa.cheng@mediatek.com>,
	Mao Huang <littlecvr@chromium.org>,
	Yingjoe Chen <yingjoe.chen@mediatek.com>,
	devicetree@vger.kernel.org, Jitao Shi <jitao.shi@mediatek.com>,
	kernel@pengutronix.de, Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	YT Shen <yt.shen@mediatek.com>, Rob Herring <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	dri-devel@lists.freedesktop.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Paul Bolle <pebolle@tiscali.nl>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Tomasz Figa <tfiga@chromium.org>,
	Kumar Gala <galak@codeaurora.org>
Subject: Re: [PATCH v14 2/8] drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.
Date: Wed, 27 Apr 2016 12:57:33 +0200	[thread overview]
Message-ID: <20160427105733.GZ2558@phenom.ffwll.local> (raw)
In-Reply-To: <1461752945.4044.25.camel@pengutronix.de>

On Wed, Apr 27, 2016 at 12:29:05PM +0200, Philipp Zabel wrote:
> Hi Daniel,
> 
> Am Dienstag, den 26.04.2016, 10:48 +0200 schrieb Daniel Vetter:
> [...]
> > > +static int mtk_drm_unload(struct drm_device *drm)
> > > +{
> > > +	mtk_drm_kms_deinit(drm);
> > > +	drm->dev_private = NULL;
> > > +
> > > +	return 0;
> > > +}
> > 
> > Like load, the unload hook is deprecated. And in drm-next we now have some
> > nice helpers to make not using an unload hook easier. Please refactor per
> > existing examples and get rid of your unload hook.
> 
> Thanks, does this change look about right:

yup, lgtm, ack.
-Daniel

> 
> --------8<--------
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -222,14 +222,6 @@ static void mtk_drm_kms_deinit(struct drm_device
> *drm)
>  	drm_mode_config_cleanup(drm);
>  }
>  
> -static int mtk_drm_unload(struct drm_device *drm)
> -{
> -	mtk_drm_kms_deinit(drm);
> -	drm->dev_private = NULL;
> -
> -	return 0;
> -}
> -
>  static const struct file_operations mtk_drm_fops = {
>  	.owner = THIS_MODULE,
>  	.open = drm_open,
> @@ -246,7 +238,6 @@ static const struct file_operations mtk_drm_fops = {
>  static struct drm_driver mtk_drm_driver = {
>  	.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
>  			   DRIVER_ATOMIC,
> -	.unload = mtk_drm_unload,
>  
>  	.get_vblank_counter = drm_vblank_count,
>  	.enable_vblank = mtk_drm_crtc_enable_vblank,
> @@ -455,8 +446,14 @@ err_node:
>  static int mtk_drm_remove(struct platform_device *pdev)
>  {
>  	struct mtk_drm_private *private = platform_get_drvdata(pdev);
> +	struct drm_device *drm = private->drm;
>  	int i;
>  
> +	drm_connector_unregister_all(drm);
> +	drm_dev_unregister(drm);
> +	mtk_drm_kms_deinit(drm);
> +	drm_dev_unref(drm);
> +
>  	component_master_del(&pdev->dev, &mtk_drm_ops);
>  	pm_runtime_disable(&pdev->dev);
>  	of_node_put(private->mutex_node);
> -------->8--------
> 
> > > +static const struct vm_operations_struct mtk_drm_gem_vm_ops = {
> > > +	.open = drm_gem_vm_open,
> > > +	.close = drm_gem_vm_close,
> > > +};
> > 
> > Drive-by review I just spotted: Please use drm_gem_cma_vm_ops instead of
> > rolling your own.
> 
> Good catch, will remove.
> 
> regards
> Philipp
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-04-27 10:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 15:09 [PATCH v14 0/8] MT8173 DRM support Philipp Zabel
2016-04-11 15:09 ` [PATCH v14 1/8] dt-bindings: drm/mediatek: Add Mediatek display subsystem dts binding Philipp Zabel
2016-04-11 15:09 ` [PATCH v14 2/8] drm/mediatek: Add DRM Driver for Mediatek SoC MT8173 Philipp Zabel
2016-04-26  8:05   ` Philipp Zabel
2016-04-26  8:48     ` Daniel Vetter
2016-04-27 10:29       ` Philipp Zabel
2016-04-27 10:57         ` Daniel Vetter [this message]
2016-04-11 15:09 ` [PATCH v14 3/8] drm/mediatek: Add DSI sub driver Philipp Zabel
2016-04-11 15:09 ` [PATCH v14 4/8] drm/mediatek: Add DPI " Philipp Zabel
2016-04-11 15:09 ` [PATCH v14 5/8] clk: mediatek: make dpi0_sel propagate rate changes Philipp Zabel
2016-04-11 15:09 ` [PATCH v14 6/8] clk: mediatek: Add hdmi_ref HDMI PHY PLL reference clock output Philipp Zabel
2016-04-11 15:09 ` [PATCH v14 7/8] clk: mediatek: remove hdmitx_dig_cts from TOP clocks Philipp Zabel
2016-04-11 15:09 ` [PATCH v14 8/8] arm64: dts: mt8173: Add display subsystem related nodes Philipp Zabel
     [not found]   ` <1460387376-11799-9-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-06-03 14:52     ` Philipp Zabel

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=20160427105733.GZ2558@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=cawa.cheng@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jie.qiu@mediatek.com \
    --cc=jitao.shi@mediatek.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=littlecvr@chromium.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pawel.moll@arm.com \
    --cc=pebolle@tiscali.nl \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@codeaurora.org \
    --cc=tfiga@chromium.org \
    --cc=yingjoe.chen@mediatek.com \
    --cc=yt.shen@mediatek.com \
    /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