All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Wu <peter@lekensteyn.nl>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org
Subject: [PATCH v2 0/4] bochs fixes and fb-helper documentation updates
Date: Fri,  7 Sep 2018 00:18:06 +0200	[thread overview]
Message-ID: <20180906221810.20170-1-peter@lekensteyn.nl> (raw)

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Peter Wu <peter@lekensteyn.nl>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Noralf Trønnes" <noralf@tronnes.org>
Subject: [PATCH v2 0/4] bochs fixes and fb-helper documentation updates
Date: Fri,  7 Sep 2018 00:18:06 +0200	[thread overview]
Message-ID: <20180906221810.20170-1-peter@lekensteyn.nl> (raw)

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


             reply	other threads:[~2018-09-06 22:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 22:18 Peter Wu [this message]
2018-09-06 22:18 ` [PATCH v2 0/4] bochs fixes and fb-helper documentation updates Peter Wu
2018-09-06 22:18 ` [PATCH v2 1/4] bochs: use drm_fb_helper_set_suspend_unlocked in suspend/resume Peter Wu
2018-09-06 22:18 ` [PATCH v2 2/4] bochs: convert to drm_fb_helper_fbdev_setup/teardown Peter Wu
2018-09-06 22:18   ` Peter Wu
2018-09-06 22:18 ` [PATCH v2 3/4] bochs: convert to drm_dev_register Peter Wu
2018-09-06 22:18   ` Peter Wu
2018-09-06 22:18 ` [PATCH v2 4/4] drm/fb-helper: improve documentation and print warnings Peter Wu
2018-09-06 22:18   ` Peter Wu
2018-09-07 19:46   ` Daniel Vetter
2018-09-07 19:46     ` Daniel Vetter
2018-09-10  6:22     ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180906221810.20170-1-peter@lekensteyn.nl \
    --to=peter@lekensteyn.nl \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.