From patchwork Tue Jun 11 13:03:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 10986887 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 0682376 for ; Tue, 11 Jun 2019 13:03:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB66B28738 for ; Tue, 11 Jun 2019 13:03:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF91828821; Tue, 11 Jun 2019 13:03:53 +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 8A01728738 for ; Tue, 11 Jun 2019 13:03:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F3C88919F; Tue, 11 Jun 2019 13:03:51 +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 9988A89160 for ; Tue, 11 Jun 2019 13:03:49 +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 0562FAE87; Tue, 11 Jun 2019 13:03:48 +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 v2 0/9] Remove explicit locking and kmap arguments from GEM VRAM interface Date: Tue, 11 Jun 2019 15:03:35 +0200 Message-Id: <20190611130344.18988-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. 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 | 59 ++++---- drivers/gpu/drm/drm_gem_vram_helper.c | 171 +++-------------------- 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, 146 insertions(+), 332 deletions(-) --- 2.21.0