aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vboxvideo/vbox_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/vboxvideo/vbox_drv.c')
-rw-r--r--drivers/staging/vboxvideo/vbox_drv.c55
1 files changed, 9 insertions, 46 deletions
diff --git a/drivers/staging/vboxvideo/vbox_drv.c b/drivers/staging/vboxvideo/vbox_drv.c
index d3e23dd70c1b..cc6532d8c2fa 100644
--- a/drivers/staging/vboxvideo/vbox_drv.c
+++ b/drivers/staging/vboxvideo/vbox_drv.c
@@ -1,28 +1,8 @@
+// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2013-2017 Oracle Corporation
* This file is based on ast_drv.c
* Copyright 2012 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
* Authors: Dave Airlie <airlied@redhat.com>
* Michael Thayer <michael.thayer@oracle.com,
* Hans de Goede <hdegoede@redhat.com>
@@ -31,7 +11,6 @@
#include <linux/console.h>
#include <linux/vt_kern.h>
-#include <drm/drmP.h>
#include <drm/drm_crtc_helper.h>
#include "vbox_drv.h"
@@ -44,8 +23,8 @@ module_param_named(modeset, vbox_modeset, int, 0400);
static struct drm_driver driver;
static const struct pci_device_id pciidlist[] = {
- { 0x80ee, 0xbeef, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
- { 0, 0, 0},
+ { PCI_DEVICE(0x80ee, 0xbeef) },
+ { }
};
MODULE_DEVICE_TABLE(pci, pciidlist);
@@ -138,6 +117,7 @@ static void vbox_pci_remove(struct pci_dev *pdev)
drm_dev_put(&vbox->ddev);
}
+#ifdef CONFIG_PM_SLEEP
static int vbox_pm_suspend(struct device *dev)
{
struct vbox_private *vbox = dev_get_drvdata(dev);
@@ -193,13 +173,16 @@ static const struct dev_pm_ops vbox_pm_ops = {
.poweroff = vbox_pm_poweroff,
.restore = vbox_pm_resume,
};
+#endif
static struct pci_driver vbox_pci_driver = {
.name = DRIVER_NAME,
.id_table = pciidlist,
.probe = vbox_pci_probe,
.remove = vbox_pci_remove,
+#ifdef CONFIG_PM_SLEEP
.driver.pm = &vbox_pm_ops,
+#endif
};
static const struct file_operations vbox_fops = {
@@ -207,11 +190,9 @@ static const struct file_operations vbox_fops = {
.open = drm_open,
.release = drm_release,
.unlocked_ioctl = drm_ioctl,
+ .compat_ioctl = drm_compat_ioctl,
.mmap = vbox_mmap,
.poll = drm_poll,
-#ifdef CONFIG_COMPAT
- .compat_ioctl = drm_compat_ioctl,
-#endif
.read = drm_read,
};
@@ -227,21 +208,6 @@ static int vbox_master_set(struct drm_device *dev,
*/
vbox->initial_mode_queried = false;
- mutex_lock(&vbox->hw_mutex);
- /*
- * Disable VBVA when someone releases master in case the next person
- * tries tries to do VESA.
- */
- /** @todo work out if anyone is likely to and whether it will work. */
- /*
- * Update: we also disable it because if the new master does not do
- * dirty rectangle reporting (e.g. old versions of Plymouth) then at
- * least the first screen will still be updated. We enable it as soon
- * as we receive a dirty rectangle report.
- */
- vbox_disable_accel(vbox);
- mutex_unlock(&vbox->hw_mutex);
-
return 0;
}
@@ -251,10 +217,6 @@ static void vbox_master_drop(struct drm_device *dev, struct drm_file *file_priv)
/* See vbox_master_set() */
vbox->initial_mode_queried = false;
-
- mutex_lock(&vbox->hw_mutex);
- vbox_disable_accel(vbox);
- mutex_unlock(&vbox->hw_mutex);
}
static struct drm_driver driver = {
@@ -314,5 +276,6 @@ module_init(vbox_init);
module_exit(vbox_exit);
MODULE_AUTHOR("Oracle Corporation");
+MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL and additional rights");