linux/drivers/gpu/drm/qxl
Peter Wu bf8744e40c qxl: refactor to use drm_fb_helper_fbdev_setup
Lots of code can be removed by relying on fb-helper:
- "struct drm_framebuffer" moves to fb_helper.fb.
- "struct drm_gem_object" moves to fb_helper.obj[0].
- "struct qxl_device" can be inferred as drm_fb_helper is embedded.
- qxl_user_framebuffer_create -> drm_gem_fb_create.
- qxl_user_framebuffer_destroy -> drm_gem_fb_destroy.
- qxl_fbdev_destroy -> drm_fb_helper_fbdev_teardown + vfree(shadow).

Remove unused code:
- qxl_fbdev_qobj_is_fb, qxl_fbdev_set_suspend.
- Unused fields of qxl_fbdev: delayed_ops, delayed_ops_lock, size.

Misc notes:
- The dirty callback is preserved as it is necessary to trigger update
  commands in the hw (the screen stays black otherwise).
- No idea when .create_handle in drm_framebuffer_funcs is used, but use
  the same drm_gem_fb_create_handle to match drm_gem_fb_funcs.
- I don't know why qxl_fb_find_or_create_single used to check for an
  existing framebuffer and removed that check to match other drivers.
- Use of drm_fb_helper_fbdev_teardown also requires "info->fbdefio" to
  be dynamically allocated. Replace the existing defio config by
  drm_fb_helper_defio_init to accomodate this.

Testing results: startx with fbdev, modesetting and qxl all seems to
work. Tested also with CONFIG_DRM_FBDEV_EMULATION=n, fbdev obviously
fails but others are fine. QEMU -spice and QEMU -spice with vdagent and
multiple (resized) displays (via remote-viewer) also works.
unbind vtconsole and rmmod has *not* regressed (i.e. it still trips on a
use-after-free in qxl_check_idle via qxl_ttm_fini).

Ideally setup/teardown is replaced by drm_fbdev_generic_setup as that
would result in further code reduction, improve error handling (like not
leaking shadow memory), but unfortunately QXL has no implementation for
qxl_gem_prime_vmap.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Link: http://patchwork.freedesktop.org/patch/msgid/20180910132156.23201-1-peter@lekensteyn.nl
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-09-12 09:01:18 +02:00
..
Kconfig drm: fix compilations issues introduced by "drm: allow to use mmuless SoC" 2017-01-09 11:30:30 +01:00
Makefile drm/qxl: fix include notation and remove -Iinclude/drm flag 2017-05-17 14:36:17 +02:00
qxl_cmd.c Merge remote-tracking branch 'drm/drm-next' into drm-misc-next 2018-05-11 18:08:10 +02:00
qxl_debugfs.c drm/qxl: fix include notation and remove -Iinclude/drm flag 2017-05-17 14:36:17 +02:00
qxl_dev.h
qxl_display.c qxl: refactor to use drm_fb_helper_fbdev_setup 2018-09-12 09:01:18 +02:00
qxl_draw.c qxl: refactor to use drm_fb_helper_fbdev_setup 2018-09-12 09:01:18 +02:00
qxl_drv.c qxl: fix null-pointer crash during suspend 2018-09-05 08:26:24 +02:00
qxl_drv.h qxl: refactor to use drm_fb_helper_fbdev_setup 2018-09-12 09:01:18 +02:00
qxl_dumb.c drm/qxl: Replace drm_gem_object_reference/unreference() with _get/put() 2018-03-21 09:19:56 +01:00
qxl_fb.c qxl: refactor to use drm_fb_helper_fbdev_setup 2018-09-12 09:01:18 +02:00
qxl_gem.c drm/qxl: Replace ttm_bo_unref with ttm_bo_put 2018-08-30 09:41:01 +02:00
qxl_image.c
qxl_ioctl.c qxl: fix qxl_release_{map,unmap} 2018-04-25 15:03:12 -04:00
qxl_irq.c qxl: remove qxl_io_log() 2018-04-27 08:58:04 +02:00
qxl_kms.c drm: qxl: Fix error handling at qxl_device_init 2018-08-10 07:57:48 +02:00
qxl_object.c Merge airlied/drm-next into drm-misc-next 2018-03-21 09:40:55 -04:00
qxl_object.h drm: qxl: Drop duplicated device pointer attribute 2017-02-02 10:02:34 +01:00
qxl_prime.c drm/qxl: fix erroneous return value 2016-02-17 15:39:35 +10:00
qxl_release.c drm/qxl: Remove unecessary dma_fence_ops 2018-07-03 13:13:56 +02:00
qxl_ttm.c gpu: drm: qxl: Adding new typedef vm_fault_t 2018-05-14 11:01:30 +02:00