From patchwork Thu Aug 1 11:56:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 11070585 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 C2C11746 for ; Thu, 1 Aug 2019 11:56:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1F9228515 for ; Thu, 1 Aug 2019 11:56:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A68382858A; Thu, 1 Aug 2019 11:56:50 +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 3DC6228515 for ; Thu, 1 Aug 2019 11:56:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25B706E564; Thu, 1 Aug 2019 11:56:48 +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 1A84C6E564 for ; Thu, 1 Aug 2019 11:56:47 +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 A3799AD17; Thu, 1 Aug 2019 11:56:45 +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 Subject: [PATCH 0/3] drm/vram-helper: Fix performance regression in fbdev Date: Thu, 1 Aug 2019 13:56:39 +0200 Message-Id: <20190801115642.21231-1-tzimmermann@suse.de> X-Mailer: git-send-email 2.22.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 Generic fbdev emulation maps and unmaps the console BO for updating it's content from the shadow buffer. Drivers using VRAM helpers may see reduced performance as the mapping operations can create significant overhead. A report of this problem is at [1]. This patch set fixes the problem by adding a ref counter to the GEM VRAM buffers' kmap operation, and keeping the fbdev's console buffer mapped while the console is being displayed. These changes avoids the frequent mappings in the fbdev code. The drivers, ast and mgag200, maps the console's buffer when it becomes visible and the fbdev code reuses this mapping. The original fbdev code in ast and mgag200 used the same optimization. [1] https://lists.freedesktop.org/archives/dri-devel/2019-July/228663.html Thomas Zimmermann (3): drm/vram-helpers: Add kmap ref-counting to GEM VRAM objects drm/ast: Map fbdev framebuffer while it's being displayed drm/mgag200: Map fbdev framebuffer while it's being displayed drivers/gpu/drm/ast/ast_mode.c | 20 +++++++ drivers/gpu/drm/drm_gem_vram_helper.c | 74 +++++++++++++++++++------- drivers/gpu/drm/mgag200/mgag200_mode.c | 21 ++++++++ include/drm/drm_gem_vram_helper.h | 13 +++++ 4 files changed, 110 insertions(+), 18 deletions(-) --- 2.22.0