From patchwork Wed Mar 8 14:12:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9611265 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 410CD6046A for ; Wed, 8 Mar 2017 14:15:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AE2228543 for ; Wed, 8 Mar 2017 14:15:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D97B28574; Wed, 8 Mar 2017 14:15:27 +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=ham 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 141CD28543 for ; Wed, 8 Mar 2017 14:15:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 515306E99F; Wed, 8 Mar 2017 14:13:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id B89E76E990 for ; Wed, 8 Mar 2017 14:13:25 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id g10so4317713wrg.0 for ; Wed, 08 Mar 2017 06:13:25 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=iIy+TbJ6DfYgytWP5ePGUZglfVPcmMXWHQdOvpECM3g=; b=lM1HrnyXDUBGiFfeyNi7lLbe1DycWPJO4eJkrXz9ZdcqzTaLOGWG0PmQi0vATWp9yj RycU6z3Us1PLN4ViV/OcE1XovvDCSs4gSXVo4OZ5hrnimPs3yQ1emLJ0eYB4gsT1IS/Y KJPjYxYxsaC0MW+BxwrTHeBzpvJZoJKoYlnDg= 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:mime-version:content-transfer-encoding; bh=iIy+TbJ6DfYgytWP5ePGUZglfVPcmMXWHQdOvpECM3g=; b=rx2BInVw5Aa2waTOfS3amg62O9Gz1YuMTlk8v0a0fyCaowLSHCrY4R33fyOCXNeqTF P/ufFEdlBduz5m48vJHDAAbeeylonuoZkI2TttrrE/doBdQjvK1JSAYslzLC6arF6axp V8/o59J0V8cBu1+aApj2YR4I33ZGF59eMnf/Taielg/PrA2sKPxSJeDjwGxMZaIIJK+f KAuVG32L3PoBmxfevvDiNfowaQjAdEtSPlBYR9oiv6yL+pPS32JfAXwdZWCkxtEASefh bS5+zD386mJ6i7F+v1MIxAqBY+EgVOBvat3XB04kzkWRfgxNjGToQRbGhN859gpyiK7/ yR4A== X-Gm-Message-State: AMke39mzhWcRWcFuFYeVRXShYpg9RnDp4g4iE3nWice8sOdc2MPv1oyJ14rvRRHSZYTAzg== X-Received: by 10.223.154.50 with SMTP id z47mr5528177wrb.76.1488982404414; Wed, 08 Mar 2017 06:13:24 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:56c9:0:decc:6e78:7e96:b452]) by smtp.gmail.com with ESMTPSA id m186sm17012515wmd.21.2017.03.08.06.13.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 06:13:23 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 19/24] drm/amdgpu: Merge pre/postclose hooks Date: Wed, 8 Mar 2017 15:12:52 +0100 Message-Id: <20170308141257.12119-20-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170308141257.12119-1-daniel.vetter@ffwll.ch> References: <20170308141257.12119-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Cc: Daniel Vetter , Intel Graphics Development , amd-gfx@lists.freedesktop.org, Alex Deucher , Daniel Vetter , =?UTF-8?q?Christian=20K=C3=B6nig?= 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Again no apparent explanation for the split except hysterical raisins. Merging them also makes it a bit more obviuos what's going on wrt the runtime pm refdancing. Cc: Alex Deucher Cc: Christian König Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Daniel Vetter --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 -- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 17 ++--------------- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index c1b913541739..c8860f05bfb9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1762,8 +1762,6 @@ void amdgpu_driver_lastclose_kms(struct drm_device *dev); int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv); void amdgpu_driver_postclose_kms(struct drm_device *dev, struct drm_file *file_priv); -void amdgpu_driver_preclose_kms(struct drm_device *dev, - struct drm_file *file_priv); int amdgpu_suspend(struct amdgpu_device *adev); int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon); int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 75fc376ba735..09eb5026983c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -684,7 +684,6 @@ static struct drm_driver kms_driver = { DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET, .load = amdgpu_driver_load_kms, .open = amdgpu_driver_open_kms, - .preclose = amdgpu_driver_preclose_kms, .postclose = amdgpu_driver_postclose_kms, .lastclose = amdgpu_driver_lastclose_kms, .set_busid = drm_pci_set_busid, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 61d94c745672..55f951bcc91f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -694,6 +694,8 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, if (!fpriv) return; + pm_runtime_get_sync(dev->dev); + amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr); amdgpu_uvd_free_handles(adev, file_priv); @@ -722,21 +724,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, pm_runtime_put_autosuspend(dev->dev); } -/** - * amdgpu_driver_preclose_kms - drm callback for pre close - * - * @dev: drm dev pointer - * @file_priv: drm file - * - * On device pre close, tear down hyperz and cmask filps on r1xx-r5xx - * (all asics). - */ -void amdgpu_driver_preclose_kms(struct drm_device *dev, - struct drm_file *file_priv) -{ - pm_runtime_get_sync(dev->dev); -} - /* * VBlank related functions. */