From patchwork Wed Aug 2 11:56:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9876679 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B9CA260360 for ; Wed, 2 Aug 2017 11:56:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAE3C286CC for ; Wed, 2 Aug 2017 11:56:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FB212878C; Wed, 2 Aug 2017 11:56:34 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable 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 55D3E286CC for ; Wed, 2 Aug 2017 11:56:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C1E566F0E1; Wed, 2 Aug 2017 11:56:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id E35ED6F0E1 for ; Wed, 2 Aug 2017 11:56:16 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id x64so6888627wmg.1 for ; Wed, 02 Aug 2017 04:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ETtFoR9oZ3t69s49wICks8T61XLHYr68rAmauIOaFTU=; b=Z6/tVO2ZRh+L6ZZtsHBsjozRPzytuvCEJjWghrxUq1PgSF1aJPNE+3G1WQE8TsjbYG jO03KJy6GmFO+Lg2xIx70d0UCc3bPTa5ml0UJ5vgk3zbAzEhhCMGih/DWteXhpOrPinH J1qNi/UrNiJZD3JwLzBJ1FwqhoybWaASFQDBg= 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=ETtFoR9oZ3t69s49wICks8T61XLHYr68rAmauIOaFTU=; b=XgUzCo6Melzm/ymxCGoG/0AWiuEWQe2ABBolF9GMvHDRUFteox/pS9lN5V4AODdfeF 8nsVPM+EEcZCtVE/0XRnvJM1XvDNX+5HXEAoAgs+Qm0bDrCiSNPt7Kwxq2F9RWmN6VQw 0z689NPsNnA0TE1v4tdugB3iPnJv7l1DtFRyXeQint1XkaSEDAncy1sYZ88/lAXD8KI/ BKqAqEPLXu/bH1Uylq5oCJ4adv7qO3TjqCShxyoetcZZUnKZO9qtI055ReBpPUw37xco 2tlOvwrkvnFRpcUZ91/GFxlmdu2IHNI2ZpKkwecjdwI8pZ21lP8O8Gh56QZt9ny4p/qw MHbQ== X-Gm-Message-State: AIVw113qmMRTKwotPaZtmxGjeaaI3qP90SQx9nJJ9BtuJIgY3IknfEEl 2lFEprZBja3cjKxb6bc= X-Received: by 10.80.161.69 with SMTP id 63mr20474200edj.148.1501674974791; Wed, 02 Aug 2017 04:56:14 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5640:0:960b:2678:e223:c1c6]) by smtp.gmail.com with ESMTPSA id f5sm7550257edj.78.2017.08.02.04.56.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2017 04:56:14 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 3/4] drm: Only lastclose on unload for legacy drivers Date: Wed, 2 Aug 2017 13:56:03 +0200 Message-Id: <20170802115604.12734-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170802115604.12734-1-daniel.vetter@ffwll.ch> References: <20170802115604.12734-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Intel Graphics Development , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The only thing modern drivers are supposed to do in lastclose is restore the fb emulation state. Which is entirely optional, and there's really no reason to do that. So restrict it to legacy drivers (where the driver cleanup essentially happens in lastclose). This will also allow us to share the unregister function with drm_dev_unplug(). Signed-off-by: Daniel Vetter Reviewed-by: Alex Deucher --- drivers/gpu/drm/drm_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 39191e5c240e..694040a240af 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -860,7 +860,8 @@ void drm_dev_unregister(struct drm_device *dev) { struct drm_map_list *r_list, *list_temp; - drm_lastclose(dev); + if (drm_core_check_feature(dev, DRIVER_LEGACY)) + drm_lastclose(dev); dev->registered = false;