From patchwork Fri Sep 27 09:03:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 11164115 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 49A8614DB for ; Fri, 27 Sep 2019 09:03:35 +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 32204217D7 for ; Fri, 27 Sep 2019 09:03:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 32204217D7 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 59D826EEBF; Fri, 27 Sep 2019 09:03:34 +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 A94346EEB9 for ; Fri, 27 Sep 2019 09:03:13 +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 148DEAFA9; Fri, 27 Sep 2019 09:03:12 +0000 (UTC) From: Thomas Zimmermann To: airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, sam@ravnborg.org, yc_chen@aspeedtech.com Subject: [PATCH v3 0/5] drm/ast: Place cursor BOs at VRAM high-end Date: Fri, 27 Sep 2019 11:03:04 +0200 Message-Id: <20190927090309.10254-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: drm/ast/mgag200: Place cursor BOs at VRAM high-end) This patchset cleans up the memory management of HW cursors in ast. It further moves the allocated cursor BOs to the of the video RAM to reduce memory fragmentation. The ast driver manages cursor memory in a dedicated GEM VRAM buffer object. It uses a double-buffering scheme of alternating between offsets within the GEM BO. The code is convoluted and can lead to memory fragmentation if the BO is stored the middle of VRAM. This is especially a problem as ast devices only have a small amount of video memory (e.g., 8 MiB). With this patchset, the cursor handling in ast is first split up into separate functions for copying cursor images, managing buffer objects, setting scanout addresses, and moving and hiding the cursor. Furthermore, the driver dedicates a few KiB at the high end of the device's video memory to storing the cursor's buffer objects. This prevents memory fragmentation. The patchset has been tested on ast hardware. v3: * split-off ast patches into separate series * move around ast_{show,hide}_cursor in a separate patch * fix space-before-tab error near AST_HWC_SIGNATURE_CHECKSUM v2: * remove VRAM buffers in favor of GEM BOs * manage BO placement with pin flag Thomas Zimmermann (5): drm/ast: Don't call ast_show_cursor() from ast_cursor_move() drm/ast: Move ast_{show,hide}_cursor() within source file drm/ast: Move cursor update code to ast_show_cursor() drm/ast: Move cursor offset swapping into ast_show_cursor() drm/ast: Allocate cursor BOs at high end of video memory drivers/gpu/drm/ast/ast_drv.h | 43 +++--- drivers/gpu/drm/ast/ast_mode.c | 235 +++++++++++++++++++-------------- 2 files changed, 158 insertions(+), 120 deletions(-) Acked-by: Gerd Hoffmann --- 2.23.0