From patchwork Tue May 21 11:08:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 10953449 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3814D912 for ; Tue, 21 May 2019 11:08:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28931289C0 for ; Tue, 21 May 2019 11:08:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C9B5289C4; Tue, 21 May 2019 11:08:42 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 D7EE7289C0 for ; Tue, 21 May 2019 11:08:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF74C892FA; Tue, 21 May 2019 11:08:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 460D0892FA for ; Tue, 21 May 2019 11:08:37 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D02C8AE14; Tue, 21 May 2019 11:08:35 +0000 (UTC) From: Thomas Zimmermann To: daniel@ffwll.ch, airlied@linux.ie, kraxel@redhat.com, christian.koenig@amd.com, ray.huang@amd.com, sam@ravnborg.org Subject: [PATCH 0/3] Various clean-up patches for GEM VRAM Date: Tue, 21 May 2019 13:08:28 +0200 Message-Id: <20190521110831.20200-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Replacing drm_gem_vram_push_to_system() moves policy from drivers back to the memory manager. Now, unused BOs are only evicted when the space is required. The lock/unlock-renaming patch aligns the interface with other names in DRM. No functional changes are done. Finally, there's now a lockdep assert that ensures we don't call the GEM VRAM _locked() functions with an unlocked BO. Patches are against a recent drm-tip and tested on mgag200 and ast HW. Thomas Zimmermann (3): drm: Replace drm_gem_vram_push_to_system() with kunmap + unpin drm: Rename reserve/unreserve to lock/unlock in GEM VRAM helpers drm: Assert that BO is locked in drm_gem_vram_{pin,unpin}_locked() drivers/gpu/drm/ast/ast_fb.c | 11 ++- drivers/gpu/drm/ast/ast_mode.c | 26 ++++--- drivers/gpu/drm/drm_gem_vram_helper.c | 86 ++++++------------------ drivers/gpu/drm/drm_vram_helper_common.c | 2 - drivers/gpu/drm/mgag200/mgag200_cursor.c | 40 +++++------ drivers/gpu/drm/mgag200/mgag200_fb.c | 11 ++- drivers/gpu/drm/mgag200/mgag200_mode.c | 15 +++-- include/drm/drm_gem_vram_helper.h | 9 ++- 8 files changed, 80 insertions(+), 120 deletions(-) Acked-by: Daniel Vetter --- 2.21.0