summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vboxvideo
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-28 20:39:58 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-28 20:39:58 -0800
commit02061181d3a9ccfe15ef6bc15fa56283acc47620 (patch)
treea1d2738c003f6358d9f98fa37c81233d7a10f172 /drivers/staging/vboxvideo
parent117eda8f71ff545cfdec8fe8073adbd173a1ceff (diff)
parent215852f4b8bbf7a8d6a534dfb367bb0f1a2d5011 (diff)
Merge tag 'staging-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO driver updates from Greg KH: "Here is the big staging and iio driver pull request for 4.21-rc1. Lots and lots of tiny patches here, nothing major at all. Which is good, tiny cleanups is nice to see. No new huge driver removal or addition, this release cycle, although there are lots of good IIO driver changes, addtions, and movement from staging into the "real" part of the kernel, which is always great. Full details are in the shortlog, and all of these have been in linux-next for a while with no reported issues" * tag 'staging-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (553 commits) staging: mt7621-mmc: Correct spelling mistakes in comments staging: wilc1000: fix missing read_write setting when reading data mt7621-mmc: char * array declaration might be better as static const mt7621-mmc: return statement in void function unnecessary mt7621-mmc: Alignment should match open parenthesis mt7621-mmc: Removed unnecessary blank lines mt7621-mmc: Fix some coding style issues staging: android: ashmem: doc: Fix spelling staging: rtl8188eu: cleanup brace coding style issues staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c staging: rtl8188eu: change return type of is_basicrate() to bool staging: rtl8188eu: simplify null array initializations staging: rtl8188eu: change order of declarations to improve readability staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c staging: rtl8188eu: constify some arrays staging: rtl8188eu: convert unsigned char arrays to u8 staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c ...
Diffstat (limited to 'drivers/staging/vboxvideo')
-rw-r--r--drivers/staging/vboxvideo/Makefile2
-rw-r--r--drivers/staging/vboxvideo/hgsmi_base.c99
-rw-r--r--drivers/staging/vboxvideo/hgsmi_ch_setup.h40
-rw-r--r--drivers/staging/vboxvideo/hgsmi_channels.h23
-rw-r--r--drivers/staging/vboxvideo/hgsmi_defs.h23
-rw-r--r--drivers/staging/vboxvideo/modesetting.c71
-rw-r--r--drivers/staging/vboxvideo/vbox_drv.c55
-rw-r--r--drivers/staging/vboxvideo/vbox_drv.h40
-rw-r--r--drivers/staging/vboxvideo/vbox_err.h50
-rw-r--r--drivers/staging/vboxvideo/vbox_fb.c33
-rw-r--r--drivers/staging/vboxvideo/vbox_hgsmi.c22
-rw-r--r--drivers/staging/vboxvideo/vbox_irq.c26
-rw-r--r--drivers/staging/vboxvideo/vbox_main.c101
-rw-r--r--drivers/staging/vboxvideo/vbox_mode.c56
-rw-r--r--drivers/staging/vboxvideo/vbox_prime.c20
-rw-r--r--drivers/staging/vboxvideo/vbox_ttm.c27
-rw-r--r--drivers/staging/vboxvideo/vboxvideo.h143
-rw-r--r--drivers/staging/vboxvideo/vboxvideo_guest.h50
-rw-r--r--drivers/staging/vboxvideo/vboxvideo_vbe.h34
-rw-r--r--drivers/staging/vboxvideo/vbva_base.c27
20 files changed, 196 insertions, 746 deletions
diff --git a/drivers/staging/vboxvideo/Makefile b/drivers/staging/vboxvideo/Makefile
index 3f6094aa9cdf..1224f313af0c 100644
--- a/drivers/staging/vboxvideo/Makefile
+++ b/drivers/staging/vboxvideo/Makefile
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
-ccflags-y := -Iinclude/drm
-
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_mode.o vbox_prime.o vbox_ttm.o
diff --git a/drivers/staging/vboxvideo/hgsmi_base.c b/drivers/staging/vboxvideo/hgsmi_base.c
index 15ff5f42e2cd..361d3193258e 100644
--- a/drivers/staging/vboxvideo/hgsmi_base.c
+++ b/drivers/staging/vboxvideo/hgsmi_base.c
@@ -1,27 +1,8 @@
-/*
- * Copyright (C) 2006-2017 Oracle Corporation
- *
- * 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, sublicense,
- * 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 above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- */
+// SPDX-License-Identifier: MIT
+/* Copyright (C) 2006-2017 Oracle Corporation */
+#include <linux/vbox_err.h>
#include "vbox_drv.h"
-#include "vbox_err.h"
#include "vboxvideo_guest.h"
#include "vboxvideo_vbe.h"
#include "hgsmi_channels.h"
@@ -29,9 +10,9 @@
/**
* Inform the host of the location of the host flags in VRAM via an HGSMI cmd.
- * @param ctx the context of the guest heap to use.
- * @param location the offset chosen for the flags within guest VRAM.
- * @returns 0 on success, -errno on failure
+ * Return: 0 or negative errno value.
+ * @ctx: The context of the guest heap to use.
+ * @location: The offset chosen for the flags within guest VRAM.
*/
int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location)
{
@@ -53,9 +34,9 @@ int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location)
/**
* Notify the host of HGSMI-related guest capabilities via an HGSMI command.
- * @param ctx the context of the guest heap to use.
- * @param caps the capabilities to report, see vbva_caps.
- * @returns 0 on success, -errno on failure
+ * Return: 0 or negative errno value.
+ * @ctx: The context of the guest heap to use.
+ * @caps: The capabilities to report, see vbva_caps.
*/
int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps)
{
@@ -70,7 +51,7 @@ int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps)
hgsmi_buffer_submit(ctx, p);
- WARN_ON_ONCE(RT_FAILURE(p->rc));
+ WARN_ON_ONCE(p->rc < 0);
hgsmi_buffer_free(ctx, p);
@@ -91,11 +72,10 @@ int hgsmi_test_query_conf(struct gen_pool *ctx)
/**
* Query the host for an HGSMI configuration parameter via an HGSMI command.
- * @param ctx the context containing the heap used
- * @param index the index of the parameter to query,
- * @see vbva_conf32::index
- * @param value_ret where to store the value of the parameter on success
- * @returns 0 on success, -errno on failure
+ * Return: 0 or negative errno value.
+ * @ctx: The context containing the heap used.
+ * @index: The index of the parameter to query.
+ * @value_ret: Where to store the value of the parameter on success.
*/
int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret)
{
@@ -120,16 +100,15 @@ int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret)
/**
* Pass the host a new mouse pointer shape via an HGSMI command.
- *
- * @param ctx the context containing the heap to be used
- * @param flags cursor flags, @see VMMDevReqMousePointer::flags
- * @param hot_x horizontal position of the hot spot
- * @param hot_y vertical position of the hot spot
- * @param width width in pixels of the cursor
- * @param height height in pixels of the cursor
- * @param pixels pixel data, @see VMMDevReqMousePointer for the format
- * @param len size in bytes of the pixel data
- * @returns 0 on success, -errno on failure
+ * Return: 0 or negative errno value.
+ * @ctx: The context containing the heap to be used.
+ * @flags: Cursor flags.
+ * @hot_x: Horizontal position of the hot spot.
+ * @hot_y: Vertical position of the hot spot.
+ * @width: Width in pixels of the cursor.
+ * @height: Height in pixels of the cursor.
+ * @pixels: Pixel data, @see VMMDevReqMousePointer for the format.
+ * @len: Size in bytes of the pixel data.
*/
int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
u32 hot_x, u32 hot_y, u32 width, u32 height,
@@ -195,13 +174,13 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
* Report the guest cursor position. The host may wish to use this information
* to re-position its own cursor (though this is currently unlikely). The
* current host cursor position is returned.
- * @param ctx The context containing the heap used.
- * @param report_position Are we reporting a position?
- * @param x Guest cursor X position.
- * @param y Guest cursor Y position.
- * @param x_host Host cursor X position is stored here. Optional.
- * @param y_host Host cursor Y position is stored here. Optional.
- * @returns 0 on success, -errno on failure
+ * Return: 0 or negative errno value.
+ * @ctx: The context containing the heap used.
+ * @report_position: Are we reporting a position?
+ * @x: Guest cursor X position.
+ * @y: Guest cursor Y position.
+ * @x_host: Host cursor X position is stored here. Optional.
+ * @y_host: Host cursor Y position is stored here. Optional.
*/
int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
u32 x, u32 y, u32 *x_host, u32 *y_host)
@@ -226,21 +205,3 @@ int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
return 0;
}
-
-/**
- * @todo Mouse pointer position to be read from VMMDev memory, address of the
- * memory region can be queried from VMMDev via an IOCTL. This VMMDev memory
- * region will contain host information which is needed by the guest.
- *
- * Reading will not cause a switch to the host.
- *
- * Have to take into account:
- * * synchronization: host must write to the memory only from EMT,
- * large structures must be read under flag, which tells the host
- * that the guest is currently reading the memory (OWNER flag?).
- * * guest writes: may be allocate a page for the host info and make
- * the page readonly for the guest.
- * * the information should be available only for additions drivers.
- * * VMMDev additions driver will inform the host which version of the info
- * it expects, host must support all versions.
- */
diff --git a/drivers/staging/vboxvideo/hgsmi_ch_setup.h b/drivers/staging/vboxvideo/hgsmi_ch_setup.h
index 8e6d9e11a69c..4e93418d6a13 100644
--- a/drivers/staging/vboxvideo/hgsmi_ch_setup.h
+++ b/drivers/staging/vboxvideo/hgsmi_ch_setup.h
@@ -1,24 +1,5 @@
-/*
- * Copyright (C) 2006-2017 Oracle Corporation
- *
- * 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, sublicense,
- * 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 above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- */
+/* SPDX-License-Identifier: MIT */
+/* Copyright (C) 2006-2017 Oracle Corporation */
#ifndef __HGSMI_CH_SETUP_H__
#define __HGSMI_CH_SETUP_H__
@@ -36,29 +17,14 @@ struct hgsmi_buffer_location {
} __packed;
/* HGSMI setup and configuration data structures. */
-/* host->guest commands pending, should be accessed under FIFO lock only */
+
#define HGSMIHOSTFLAGS_COMMANDS_PENDING 0x01u
-/* IRQ is fired, should be accessed under VGAState::lock only */
#define HGSMIHOSTFLAGS_IRQ 0x02u
-/* vsync interrupt flag, should be accessed under VGAState::lock only */
#define HGSMIHOSTFLAGS_VSYNC 0x10u
-/** monitor hotplug flag, should be accessed under VGAState::lock only */
#define HGSMIHOSTFLAGS_HOTPLUG 0x20u
-/**
- * Cursor capability state change flag, should be accessed under
- * VGAState::lock only. @see vbva_conf32.
- */
#define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES 0x40u
struct hgsmi_host_flags {
- /*
- * Host flags can be accessed and modified in multiple threads
- * concurrently, e.g. CrOpenGL HGCM and GUI threads when completing
- * HGSMI 3D and Video Accel respectively, EMT thread when dealing with
- * HGSMI command processing, etc.
- * Besides settings/cleaning flags atomically, some flags have their
- * own special sync restrictions, see comments for flags above.
- */
u32 host_flags;
u32 reserved[3];
} __packed;
diff --git a/drivers/staging/vboxvideo/hgsmi_channels.h b/drivers/staging/vboxvideo/hgsmi_channels.h
index a2a34b2167b4..9b83f4ff3faf 100644
--- a/drivers/staging/vboxvideo/hgsmi_channels.h
+++ b/drivers/staging/vboxvideo/hgsmi_channels.h
@@ -1,24 +1,5 @@
-/*
- * Copyright (C) 2006-2017 Oracle Corporation
- *
- * 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, sublicense,
- * 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 above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- */
+/* SPDX-License-Identifier: MIT */
+/* Copyright (C) 2006-2017 Oracle Corporation */
#ifndef __HGSMI_CHANNELS_H__
#define __HGSMI_CHANNELS_H__
diff --git a/drivers/staging/vboxvideo/hgsmi_defs.h b/drivers/staging/vboxvideo/hgsmi_defs.h
index 5b21fb974d20..6c8df1cdb087 100644
--- a/drivers/staging/vboxvideo/hgsmi_defs.h
+++ b/drivers/staging/vboxvideo/hgsmi_defs.h
@@ -1,24 +1,5 @@
-/*
- * Copyright (C) 2006-2017 Oracle Corporation
- *
- * 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, sublicense,
- * 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 above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- */
+/* SPDX-License-Identifier: MIT */
+/* Copyright (C) 2006-2017 Oracle Corporation */
#ifndef __HGSMI_DEFS_H__
#define __HGSMI_DEFS_H__
diff --git a/drivers/staging/vboxvideo/modesetting.c b/drivers/staging/vboxvideo/modesetting.c
index 7616b8aab23a..7580b9002379 100644
--- a/drivers/staging/vboxvideo/modesetting.c
+++ b/drivers/staging/vboxvideo/modesetting.c
@@ -1,27 +1,8 @@
-/*
- * Copyright (C) 2006-2017 Oracle Corporation
- *
- * 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, sublicense,
- * 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 above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- */
+// SPDX-License-Identifier: MIT
+/* Copyright (C) 2006-2017 Oracle Corporation */
+#include <linux/vbox_err.h>
#include "vbox_drv.h"
-#include "vbox_err.h"
#include "vboxvideo_guest.h"
#include "vboxvideo_vbe.h"
#include "hgsmi_channels.h"
@@ -30,18 +11,18 @@
* Set a video mode via an HGSMI request. The views must have been
* initialised first using @a VBoxHGSMISendViewInfo and if the mode is being
* set on the first display then it must be set first using registers.
- * @param ctx The context containing the heap to use
- * @param display The screen number
- * @param origin_x The horizontal displacement relative to the first scrn
- * @param origin_y The vertical displacement relative to the first screen
- * @param start_offset The offset of the visible area of the framebuffer
- * relative to the framebuffer start
- * @param pitch The offset in bytes between the starts of two adjecent
- * scan lines in video RAM
- * @param width The mode width
- * @param height The mode height
- * @param bpp The colour depth of the mode
- * @param flags Flags
+ * @ctx: The context containing the heap to use.
+ * @display: The screen number.
+ * @origin_x: The horizontal displacement relative to the first scrn.
+ * @origin_y: The vertical displacement relative to the first screen.
+ * @start_offset: The offset of the visible area of the framebuffer
+ * relative to the framebuffer start.
+ * @pitch: The offset in bytes between the starts of two adjecent
+ * scan lines in video RAM.
+ * @width: The mode width.
+ * @height: The mode height.
+ * @bpp: The colour depth of the mode.
+ * @flags: Flags.
*/
void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
s32 origin_x, s32 origin_y, u32 start_offset,
@@ -74,12 +55,12 @@ void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
* expressed. This information remains valid until the next VBVA resize event
* for any screen, at which time it is reset to the bounding rectangle of all
* virtual screens.
- * @param ctx The context containing the heap to use.
- * @param origin_x Upper left X co-ordinate relative to the first screen.
- * @param origin_y Upper left Y co-ordinate relative to the first screen.
- * @param width Rectangle width.
- * @param height Rectangle height.
- * @returns 0 on success, -errno on failure
+ * Return: 0 or negative errno value.
+ * @ctx: The context containing the heap to use.
+ * @origin_x: Upper left X co-ordinate relative to the first screen.
+ * @origin_y: Upper left Y co-ordinate relative to the first screen.
+ * @width: Rectangle width.
+ * @height: Rectangle height.
*/
int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
u32 width, u32 height)
@@ -104,10 +85,10 @@ int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
/**
* Get most recent video mode hints.
- * @param ctx The context containing the heap to use.
- * @param screens The number of screens to query hints for, starting at 0.
- * @param hints Array of vbva_modehint structures for receiving the hints.
- * @returns 0 on success, -errno on failure
+ * Return: 0 or negative errno value.
+ * @ctx: The context containing the heap to use.
+ * @screens: The number of screens to query hints for, starting at 0.
+ * @hints: Array of vbva_modehint structures for receiving the hints.
*/
int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
struct vbva_modehint *hints)
@@ -130,7 +111,7 @@ int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
hgsmi_buffer_submit(ctx, p);
- if (RT_FAILURE(p->rc)) {
+ if (p->rc < 0) {
hgsmi_buffer_free(ctx, p);
return -EIO;
}
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");
diff --git a/drivers/staging/vboxvideo/vbox_drv.h b/drivers/staging/vboxvideo/vbox_drv.h
index fa933d422951..aa40e5cc2861 100644
--- a/drivers/staging/vboxvideo/vbox_drv.h
+++ b/drivers/staging/vboxvideo/vbox_drv.h
@@ -1,28 +1,8 @@
+/* SPDX-License-Identifier: MIT */
/*
* Copyright (C) 2013-2017 Oracle Corporation
* This file is based on ast_drv.h
* 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>
@@ -32,10 +12,10 @@
#include <linux/genalloc.h>
#include <linux/io.h>
+#include <linux/irqreturn.h>
#include <linux/string.h>
#include <linux/version.h>
-#include <drm/drmP.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fb_helper.h>
#include <drm/drm_gem.h>
@@ -89,11 +69,11 @@ struct vbox_private {
struct vbva_buf_ctx *vbva_info;
bool any_pitch;
u32 num_crtcs;
- /** Amount of available VRAM, including space used for buffers. */
+ /* Amount of available VRAM, including space used for buffers. */
u32 full_vram_size;
- /** Amount of available VRAM, not including space used for buffers. */
+ /* Amount of available VRAM, not including space used for buffers. */
u32 available_vram_size;
- /** Array of structures for receiving mode hints. */
+ /* Array of structures for receiving mode hints. */
struct vbva_modehint *last_mode_hints;
int fb_mtrr;
@@ -103,7 +83,7 @@ struct vbox_private {
} ttm;
struct mutex hw_mutex; /* protects modeset and accel/vbva accesses */
- /**
+ /*
* We decide whether or not user-space supports display hot-plug
* depending on whether they react to a hot-plug event after the initial
* mode query.
@@ -112,7 +92,7 @@ struct vbox_private {
struct work_struct hotplug_work;
u32 input_mapping_width;
u32 input_mapping_height;
- /**
+ /*
* Is user-space using an X.Org-style layout of one large frame-buffer
* encompassing all screen ones or is the fbdev console active?
*/
@@ -182,10 +162,6 @@ void vbox_hw_fini(struct vbox_private *vbox);
int vbox_mode_init(struct vbox_private *vbox);
void vbox_mode_fini(struct vbox_private *vbox);
-#define DRM_MODE_FB_CMD drm_mode_fb_cmd2
-
-void vbox_enable_accel(struct vbox_private *vbox);
-void vbox_disable_accel(struct vbox_private *vbox);
void vbox_report_caps(struct vbox_private *vbox);
void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
@@ -194,7 +170,7 @@ void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
int vbox_framebuffer_init(struct vbox_private *vbox,
struct vbox_framebuffer *vbox_fb,
- const struct DRM_MODE_FB_CMD *mode_cmd,
+ const struct drm_mode_fb_cmd2 *mode_cmd,
struct drm_gem_object *obj);
int vboxfb_create(struct drm_fb_helper *helper,
diff --git a/drivers/staging/vboxvideo/vbox_err.h b/drivers/staging/vboxvideo/vbox_err.h
deleted file mode 100644
index 562db8630eb0..000000000000
--- a/drivers/staging/vboxvideo/vbox_err.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2017 Oracle Corporation
- *
- * 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, sublicense,
- * 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 above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * 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 NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
- */
-
-#ifndef __VBOX_ERR_H__
-#define __VBOX_ERR_H__
-
-/**
- * @name VirtualBox virtual-hardware error macros
- * @{
- */
-
-#define VINF_SUCCESS 0
-#define VERR_INVALID_PARAMETER (-2)
-#define VERR_INVALID_POINTER (-6)
-#define VERR_NO_MEMORY (-8)
-#define VERR_NOT_IMPLEMENTED (-12)
-#define VERR_INVALID_FUNCTION (-36)
-#define VERR_NOT_SUPPORTED (-37)
-#define VERR_TOO_MUCH_DATA (-42)
-#define VERR_INVALID_STATE (-79)
-#define VERR_OUT_OF_RESOURCES (-80)
-#define VERR_ALREADY_EXISTS (-105)
-#define VERR_INTERNAL_ERROR (-225)
-
-#define RT_SUCCESS_NP(rc) ((int)(rc) >= VINF_SUCCESS)
-#define RT_SUCCESS(rc) (likely(RT_SUCCESS_NP(rc)))
-#define RT_FAILURE(rc) (unlikely(!RT_SUCCESS_NP(rc)))
-
-/** @} */
-
-#endif
diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c
index d1a1f74c8de3..6b7aa23dfc0a 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -1,28 +1,8 @@
+// SPDX-License-Identifier: MIT
/*
* Copyright (C) 2013-2017 Oracle Corporation
* This file is based on ast_fb.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 t