Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1105104imm; Thu, 6 Sep 2018 15:41:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbTuQTAOm7kK1FhPyG/qdYXNDmSjJJnYMpJpsuwBWezQrm6jm4S2wZOSeEXcha6HniAi5Q9 X-Received: by 2002:a63:225f:: with SMTP id t31-v6mr5139693pgm.275.1536273661160; Thu, 06 Sep 2018 15:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536273661; cv=none; d=google.com; s=arc-20160816; b=fBVeaoYfhGK+qvjSnunGTPfUMDTJLNXzqofkTm38/N2Y/i6XrELIqZmgrV7/cOP1i6 k/R+7j8wsFmrY8KfcnfUF4jBY3PVHaYeo8WQ+PzACjbl82L0oz1tMoV/cj51G+KaQYL7 /HJRIos535KofqFMtYUgSrkaj0CgU8UocsMcBVPJ+A2FUUdsfqhXixz5A3f2vS3QfeHE izodvVdbQAsWtJ6W+lrUbYZojCkfQ9VTlCVlvt5cSiXjegKqq5BptF+W83gGPFJjZfYj Ul+AsfHcTkCcFAtOjbTE5Cdu1++aWdB63zFrM6/DBBW+RaFYSwCfI9uRpnnjlM1+UZBT tFPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Azoeh7ONZW4pASwk57naKlFdhZ4qoJqyNyxU05h63Qs=; b=zs3H0GRjvc/KLHEZPMVDN1IGm9dZ441juDfh07Tgb9Axyj98dDmOwSqlWGqI2FlH5z sGidsIqJZsX3HKKvfUMXhny1yAXNAyUNXyGfqgmhvoy2/yFhpjkQkDRGR47zNEEWFbzh SFRfX2okhuLDosQjBtBXcfxTKV/I/Nm4vrCxXPP+2JbdLDVPz9H+TT9Lz8FhNZjUoQ8J kLoHi6TXYYAwUN742vJ6a3dA0T8qKhDrogeKgfW1VJn1r2gX4xwEMQzpcl2x4JHhUiUV uZNlTNKSQqVhJ7SuJ7s/XaVhaufzevWakcDgdpvFTUyuHH/22pbhWFVTQDcqg4+Ie/01 rv/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lekensteyn.nl header.s=s2048-2015-q1 header.b=QdS5rn3W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10-v6si6883123pgk.672.2018.09.06.15.40.46; Thu, 06 Sep 2018 15:41:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lekensteyn.nl header.s=s2048-2015-q1 header.b=QdS5rn3W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728397AbeIGCzy (ORCPT + 99 others); Thu, 6 Sep 2018 22:55:54 -0400 Received: from lekensteyn.nl ([178.21.112.251]:37687 "EHLO lekensteyn.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727618AbeIGCzy (ORCPT ); Thu, 6 Sep 2018 22:55:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lekensteyn.nl; s=s2048-2015-q1; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From; bh=Azoeh7ONZW4pASwk57naKlFdhZ4qoJqyNyxU05h63Qs=; b=QdS5rn3WAdjRrNK+FdLw1R/4M1xbPIJVC6S/aWLm4RQ1zZUycM838XnLSP6GDRMy6UepFlSSjdzrVj8jjJzjLq9kDLn4HtPsDa0o48UIK4y1xHqxIwsPaBjX58+bfPxxRwaWa5VlNKidGuu9GtppkwmyVBSwYArDccTe3M94NyX0ue6klSKD+YV4Mp1gkkDneh/LfpKYJzB2Z4iHPOfCD1F6D2LzTIUHexRcpOnBxvHyKZJUoHVBvaZzc+ppwkDTyo9eCd8PCWzBHpt7V78Pyn36KJIcCWWI1LFMllcNUizomC2O0A3nR+7MnfMXvdRZuDUiT9VJo1aq+XxlbIwblA==; 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 Cc: virtualization@lists.linux-foundation.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Spam-Status: No, hits=-0.0 required=5.0 tests=NO_RELAYS=-0.001 autolearn=no autolearn_force=no Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.18.0