From patchwork Thu Jun 13 07:30:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 10991331 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 8027614E5 for ; Thu, 13 Jun 2019 07:31:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ED9728A18 for ; Thu, 13 Jun 2019 07:31:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62CAF28B05; Thu, 13 Jun 2019 07:31:15 +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 1BC4328B04 for ; Thu, 13 Jun 2019 07:31:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E78A98970B; Thu, 13 Jun 2019 07:30:52 +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 2D63D8966B for ; Thu, 13 Jun 2019 07:30:51 +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 B2204AF0F; Thu, 13 Jun 2019 07:30:49 +0000 (UTC) From: Thomas Zimmermann To: kraxel@redhat.com, airlied@redhat.com, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, maxime.ripard@bootlin.com, sean@poorly.run, sam@ravnborg.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 0/9] Remove explicit locking and kmap arguments from GEM VRAM interface Date: Thu, 13 Jun 2019 09:30:32 +0200 Message-Id: <20190613073041.29350-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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Drivers should not have to care about internal locking of GEM VRAM objects and their memory-mapping structures. This patch set removes both from the GEM VRAM interface. This affects the ast and mgag200 drivers. In places where GEM objects are being locked by the driver, the patch converts the lock operation to a pin operation. The locking prevented the memory manager from moving the object, so pinning is more appropriate. For the memory mappings, all book-keeping is done by the implementation of GEM VRAM. Explicit kmap objects are removed from the module's public interfaces. This change mostly affects the cursor handling in ast and mgag200, which is being simplified by this patch set. Future directions: with these patches in place, more code in mode setting and fbdev emulation can be shared between ast and mgag200. The patches have been tested on ast and mgag200 hardware. v3: * document PRIME pin flags * pin cursor BOs at current location v2: * support pinning BOs at current location * pin PRIME buffers to current location Thomas Zimmermann (9): drm/gem-vram: Support pinning buffers to current location drm/ast: Unpin cursor BO during cleanup drm/ast: Remove obsolete or unused cursor state drm/ast: Pin and map cursor source BO during update drm/ast: Pin framebuffer BO during dirty update drm/mgag200: Pin framebuffer BO during dirty update drm/mgag200: Rewrite cursor handling drm: Remove lock interfaces from GEM VRAM helpers drm: Remove functions with kmap-object argument from GEM VRAM helpers drivers/gpu/drm/ast/ast_drv.h | 7 - drivers/gpu/drm/ast/ast_fb.c | 33 ++--- drivers/gpu/drm/ast/ast_mode.c | 65 ++++---- drivers/gpu/drm/drm_gem_vram_helper.c | 179 +++-------------------- drivers/gpu/drm/mgag200/mgag200_cursor.c | 165 +++++++++------------ drivers/gpu/drm/mgag200/mgag200_drv.h | 3 - drivers/gpu/drm/mgag200/mgag200_fb.c | 27 ++-- drivers/gpu/drm/mgag200/mgag200_main.c | 4 +- include/drm/drm_gem_vram_helper.h | 9 -- 9 files changed, 155 insertions(+), 337 deletions(-) Acked-by: Gerd Hoffmann --- 2.21.0