From patchwork Wed Apr 27 10:29:05 2016
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Philipp Zabel
X-Patchwork-Id: 8954761
Return-Path:
X-Original-To: patchwork-linux-mediatek@patchwork.kernel.org
Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org
Received: from mail.kernel.org (mail.kernel.org [198.145.29.136])
by patchwork1.web.kernel.org (Postfix) with ESMTP id 6A0029F65D
for ;
Wed, 27 Apr 2016 10:29:59 +0000 (UTC)
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id 98D892022A
for ;
Wed, 27 Apr 2016 10:29:58 +0000 (UTC)
Received: from bombadil.infradead.org (bombadil.infradead.org
[198.137.202.9])
(using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by mail.kernel.org (Postfix) with ESMTPS id 1F72B20155
for ;
Wed, 27 Apr 2016 10:29:53 +0000 (UTC)
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux))
id 1avMjA-00056v-Ql; Wed, 27 Apr 2016 10:29:52 +0000
Received: from metis.ext.pengutronix.de
([2001:67c:670:201:290:27ff:fe1d:cc33])
by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat
Linux)) id 1avMj6-0004nQ-PE for linux-mediatek@lists.infradead.org;
Wed, 27 Apr 2016 10:29:50 +0000
Received: from paszta.hi.pengutronix.de
([2001:67c:670:100:96de:80ff:fec2:9969] helo=paszta)
by metis.ext.pengutronix.de with esmtp (Exim 4.80)
(envelope-from )
id 1avMiS-0005DU-Lu; Wed, 27 Apr 2016 12:29:08 +0200
Message-ID: <1461752945.4044.25.camel@pengutronix.de>
Subject: Re: [PATCH v14 2/8] drm/mediatek: Add DRM Driver for Mediatek SoC
MT8173.
From: Philipp Zabel
To: Daniel Vetter
Date: Wed, 27 Apr 2016 12:29:05 +0200
In-Reply-To: <20160426084800.GZ2510@phenom.ffwll.local>
References: <1460387376-11799-1-git-send-email-p.zabel@pengutronix.de>
<1460387376-11799-3-git-send-email-p.zabel@pengutronix.de>
<1461657922.3599.27.camel@pengutronix.de>
<20160426084800.GZ2510@phenom.ffwll.local>
X-Mailer: Evolution 3.12.9-1+b1
Mime-Version: 1.0
X-SA-Exim-Connect-IP: 2001:67c:670:100:96de:80ff:fec2:9969
X-SA-Exim-Mail-From: p.zabel@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de);
SAEximRunCond expanded to false
X-PTX-Original-Recipient: linux-mediatek@lists.infradead.org
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20160427_032949_106855_987919A0
X-CRM114-Status: GOOD ( 12.57 )
X-Spam-Score: -2.9 (--)
X-BeenThere: linux-mediatek@lists.infradead.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Cc: Mark Rutland ,
Emil Velikov ,
Michael Turquette ,
Dave Airlie ,
Jie Qiu , Cawa Cheng ,
Daniel Stone , Mao Huang ,
Bibby Hsieh , CK Hu ,
Yingjoe Chen , devicetree@vger.kernel.org,
Jitao Shi , Pawel Moll ,
Ian Campbell ,
YT Shen ,
Rob Herring , linux-mediatek@lists.infradead.org,
dri-devel@lists.freedesktop.org,
Matthias Brugger ,
Paul Bolle , Stephen Boyd ,
Tomasz Figa , kernel@pengutronix.de,
Kumar Gala
Sender: "Linux-mediatek"
Errors-To:
linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org
X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED,
RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
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:
--------8<--------
.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
--- 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,