From patchwork Fri Sep 6 08:52:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 11134809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 85DCC14ED for ; Fri, 6 Sep 2019 08:52:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FC5C20578 for ; Fri, 6 Sep 2019 08:52:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FC5C20578 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 737D76E1F7; Fri, 6 Sep 2019 08:52:27 +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 B43226E1F5 for ; Fri, 6 Sep 2019 08:52:19 +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 CED10AD14; Fri, 6 Sep 2019 08:52:17 +0000 (UTC) From: Thomas Zimmermann To: daniel@ffwll.ch, noralf@tronnes.org, airlied@linux.ie, rong.a.chen@intel.com, feng.tang@intel.com, ying.huang@intel.com, sean@poorly.run, maxime.ripard@bootlin.com, maarten.lankhorst@linux.intel.com, dave@stgolabs.net, kraxel@redhat.com Subject: [PATCH v3 0/3] Implement lazy unmapping for GEM VRAM buffers Date: Fri, 6 Sep 2019 10:52:11 +0200 Message-Id: <20190906085214.11677-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.23.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" (was: ast, mgag200: Map console BO while it's being displayed) Generic fbdev emulation maps and unmaps the console BO for updating it's content from the shadow buffer. If this involves an actual mapping operation (instead of reusing an existing mapping), lots of debug messages may be printed, such as x86/PAT: Overlap at 0xd0000000-0xd1000000 x86/PAT: reserve_memtype added [mem 0xd0000000-0xd02fffff], track write-combining, req write-combining, ret write-combining x86/PAT: free_memtype request [mem 0xd0000000-0xd02fffff] as reported at [1]. Drivers using VRAM helpers may also see reduced performance as the mapping operations can create overhead. In v3 of the patch set, this problem is being solved by lazyly unmapping the buffer as suggested by Gerd. Unmapping with drm_gem_vram_kunmap() only changes a reference counter. VRAM helpers only perform the unmapping operation when TTM evicts the buffer object from its current location. If the buffer is never evicted, the existing mapping is reused by later calls to drm_gem_vram_kmap(). v3: * implement lazy unmapping v2: * fixed comment typos [1] https://lists.freedesktop.org/archives/dri-devel/2019-September/234308.html Thomas Zimmermann (3): drm/vram: Add kmap ref-counting to GEM VRAM objects drm/vram: Add infrastructure for move_notify() drm/vram: Implement lazy unmapping for GEM VRAM buffers drivers/gpu/drm/drm_gem_vram_helper.c | 112 +++++++++++++++++++++----- drivers/gpu/drm/drm_vram_mm_helper.c | 12 +++ include/drm/drm_gem_vram_helper.h | 23 ++++++ include/drm/drm_vram_mm_helper.h | 4 + 4 files changed, 130 insertions(+), 21 deletions(-) --- 2.23.0