Skip to content

Commit

Permalink
drm/vboxvideo: Switch to generic fbdev emulation
Browse files Browse the repository at this point in the history
There's nothing special about vboxvideo's fbdev emulation that is
not provided by the generic implementation. Switch over and remove
the driver's code.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191011134808.3955-2-tzimmermann@suse.de
  • Loading branch information
Thomas Zimmermann committed Oct 16, 2019
1 parent 1ccd541 commit 2695eae
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 169 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vboxvideo/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
vboxvideo-y := hgsmi_base.o modesetting.o vbva_base.o \
vbox_drv.o vbox_fb.o vbox_hgsmi.o vbox_irq.o vbox_main.o \
vbox_drv.o vbox_hgsmi.o vbox_irq.o vbox_main.o \
vbox_mode.o vbox_ttm.o

obj-$(CONFIG_DRM_VBOXVIDEO) += vboxvideo.o
14 changes: 3 additions & 11 deletions drivers/gpu/drm/vboxvideo/vbox_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <drm/drm_crtc_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_file.h>
#include <drm/drm_ioctl.h>

Expand All @@ -32,10 +33,6 @@ static const struct pci_device_id pciidlist[] = {
};
MODULE_DEVICE_TABLE(pci, pciidlist);

static const struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
.fb_probe = vboxfb_create,
};

static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct vbox_private *vbox;
Expand Down Expand Up @@ -79,20 +76,16 @@ static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ret)
goto err_mode_fini;

ret = drm_fb_helper_fbdev_setup(&vbox->ddev, &vbox->fb_helper,
&vbox_fb_helper_funcs, 32,
vbox->num_crtcs);
ret = drm_fbdev_generic_setup(&vbox->ddev, 32);
if (ret)
goto err_irq_fini;

ret = drm_dev_register(&vbox->ddev, 0);
if (ret)
goto err_fbdev_fini;
goto err_irq_fini;

return 0;

err_fbdev_fini:
vbox_fbdev_fini(vbox);
err_irq_fini:
vbox_irq_fini(vbox);
err_mode_fini:
Expand All @@ -113,7 +106,6 @@ static void vbox_pci_remove(struct pci_dev *pdev)
struct vbox_private *vbox = pci_get_drvdata(pdev);

drm_dev_unregister(&vbox->ddev);
vbox_fbdev_fini(vbox);
vbox_irq_fini(vbox);
vbox_mode_fini(vbox);
vbox_mm_fini(vbox);
Expand Down
7 changes: 0 additions & 7 deletions drivers/gpu/drm/vboxvideo/vbox_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/string.h>

#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_gem.h>
#include <drm/drm_gem_vram_helper.h>

Expand Down Expand Up @@ -54,8 +53,6 @@ struct vbox_framebuffer {
struct vbox_private {
/* Must be first; or we must define our own release callback */
struct drm_device ddev;
struct drm_fb_helper fb_helper;
struct vbox_framebuffer afb;

u8 __iomem *guest_heap;
u8 __iomem *vbva_buffers;
Expand Down Expand Up @@ -155,10 +152,6 @@ int vbox_framebuffer_init(struct vbox_private *vbox,
const struct drm_mode_fb_cmd2 *mode_cmd,
struct drm_gem_object *obj);

int vboxfb_create(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes);
void vbox_fbdev_fini(struct vbox_private *vbox);

int vbox_mm_init(struct vbox_private *vbox);
void vbox_mm_fini(struct vbox_private *vbox);

Expand Down
149 changes: 0 additions & 149 deletions drivers/gpu/drm/vboxvideo/vbox_fb.c

This file was deleted.

3 changes: 2 additions & 1 deletion drivers/gpu/drm/vboxvideo/vbox_mode.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_plane_helper.h>
#include <drm/drm_probe_helper.h>
Expand Down Expand Up @@ -133,7 +134,7 @@ static bool vbox_set_up_input_mapping(struct vbox_private *vbox)

if (!fb1) {
fb1 = fb;
if (to_vbox_framebuffer(fb1) == &vbox->afb)
if (fb1 == vbox->ddev.fb_helper->fb)
break;
} else if (fb != fb1) {
single_framebuffer = false;
Expand Down

0 comments on commit 2695eae

Please sign in to comment.