From patchwork Thu Sep 6 22:18:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Wu X-Patchwork-Id: 10591139 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 0587C14BD for ; Thu, 6 Sep 2018 22:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6B682AD28 for ; Thu, 6 Sep 2018 22:18:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAFC92AD2E; Thu, 6 Sep 2018 22:18:26 +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 935582AD28 for ; Thu, 6 Sep 2018 22:18:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80FA76E788; Thu, 6 Sep 2018 22:18:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.lekensteyn.nl (mail.lekensteyn.nl [IPv6:2a02:2308::360:1:25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1E23C6E77E for ; Thu, 6 Sep 2018 22:18:18 +0000 (UTC) Received: by lekensteyn.nl with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fy2bK-0005Us-PS; Fri, 07 Sep 2018 00:18:12 +0200 From: Peter Wu To: Gerd Hoffmann Subject: [PATCH v2 0/4] bochs fixes and fb-helper documentation updates Date: Fri, 7 Sep 2018 00:18:06 +0200 Message-Id: <20180906221810.20170-1-peter@lekensteyn.nl> X-Mailer: git-send-email 2.18.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: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, These series tries to improve the bochs driver and update documentation based on my brief experience with the fb-helper API. Thank you Daniel and Gerd for your previous feedback and helpful suggestions. Patch 2 was previously posted and is unmodified except for acked-by + rebase on drm-misc-next (9a09a42369a4a37a959c051d8e1a1f948c1529a4). Patch 1 is a trivial (build) fix that was missing last time. Patch 3 converts from the legacy API to the modern drm_dev_register approach. This seems required for the "generic" fbdev API as suggested by Daniel, but as bochs does not implement the required "gem_prime_vmap" function, the conversion cannot be completed for now. Patch 4 includes some documentation updates that would have helped me during qxl/bochs development and a warning that made me realize that "a virtual address and that can be mmap'ed" in the documentation referred to "gem_prime_vmap". It is to my best of understanding, so please correct me if I am wrong. Side note: I originally tried to fix the unbind/remove crash in QXL and then turned to bochs as it seemed simpler to learn how to work on DRM drivers. Hopefully I manage to eventually figure out how to fix QXL. QXL is a bit strange, it advertises PRIME "support" but it only has stub functions (including a stub gem_prime_vmap). After my recent patch ("qxl: fix null-pointer crash during suspend") qxl can suspend/resume in the normal situation, but doing anything (suspend or unload) after unbinding just fails (suspend then fails with "failed to wait on release 23 after spincount 301", unload triggers a use-after-free according to KASAN). On the other hand, bochs passes these tests: # 1. s/r with unbound console modprobe bochs_drm echo 0 > /sys/class/vtconsole/vtcon1/bind rtcwake -s 1 -m mem # 2. s/r in normal sitation echo 1 > /sys/class/vtconsole/vtcon1/bind rtcwake -s 1 -m mem # 3. unload module (and s/r for good measure) echo 0 > /sys/class/vtconsole/vtcon1/bind rmmod bochs_drm rtcwake -s 1 -m mem Kind regards, Peter Peter Wu (4): bochs: use drm_fb_helper_set_suspend_unlocked in suspend/resume bochs: convert to drm_fb_helper_fbdev_setup/teardown bochs: convert to drm_dev_register drm/fb-helper: improve documentation and print warnings drivers/gpu/drm/bochs/bochs.h | 21 ++------ drivers/gpu/drm/bochs/bochs_drv.c | 46 +++++++++++------ drivers/gpu/drm/bochs/bochs_fbdev.c | 79 +++++++---------------------- drivers/gpu/drm/bochs/bochs_hw.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c | 7 +-- drivers/gpu/drm/bochs/bochs_mm.c | 74 --------------------------- drivers/gpu/drm/drm_fb_helper.c | 25 ++++++--- 7 files changed, 73 insertions(+), 181 deletions(-)