Commit cd76c287 authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

staging: vboxvideo: Cleanup the comments

Some comments where still using docbook style comments, move these
either over to kerneldoc, or just make them regular comments.

Also remove a bunch of obsolete comments.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 685bb884
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
/** /**
* Inform the host of the location of the host flags in VRAM via an HGSMI cmd. * 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. * Return: 0 or negative errno value.
* @param location the offset chosen for the flags within guest VRAM. * @ctx: The context of the guest heap to use.
* @returns 0 on success, -errno on failure * @location: The offset chosen for the flags within guest VRAM.
*/ */
int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location) int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location)
{ {
...@@ -53,9 +53,9 @@ int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location) ...@@ -53,9 +53,9 @@ int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location)
/** /**
* Notify the host of HGSMI-related guest capabilities via an HGSMI command. * Notify the host of HGSMI-related guest capabilities via an HGSMI command.
* @param ctx the context of the guest heap to use. * Return: 0 or negative errno value.
* @param caps the capabilities to report, see vbva_caps. * @ctx: The context of the guest heap to use.
* @returns 0 on success, -errno on failure * @caps: The capabilities to report, see vbva_caps.
*/ */
int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps) int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps)
{ {
...@@ -91,11 +91,10 @@ int hgsmi_test_query_conf(struct gen_pool *ctx) ...@@ -91,11 +91,10 @@ int hgsmi_test_query_conf(struct gen_pool *ctx)
/** /**
* Query the host for an HGSMI configuration parameter via an HGSMI command. * Query the host for an HGSMI configuration parameter via an HGSMI command.
* @param ctx the context containing the heap used * Return: 0 or negative errno value.
* @param index the index of the parameter to query, * @ctx: The context containing the heap used.
* @see vbva_conf32::index * @index: The index of the parameter to query.
* @param value_ret where to store the value of the parameter on success * @value_ret: Where to store the value of the parameter on success.
* @returns 0 on success, -errno on failure
*/ */
int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret) int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret)
{ {
...@@ -120,16 +119,15 @@ int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret) ...@@ -120,16 +119,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. * Pass the host a new mouse pointer shape via an HGSMI command.
* * Return: 0 or negative errno value.
* @param ctx the context containing the heap to be used * @ctx: The context containing the heap to be used.
* @param flags cursor flags, @see VMMDevReqMousePointer::flags * @flags: Cursor flags.
* @param hot_x horizontal position of the hot spot * @hot_x: Horizontal position of the hot spot.
* @param hot_y vertical position of the hot spot * @hot_y: Vertical position of the hot spot.
* @param width width in pixels of the cursor * @width: Width in pixels of the cursor.
* @param height height in pixels of the cursor * @height: Height in pixels of the cursor.
* @param pixels pixel data, @see VMMDevReqMousePointer for the format * @pixels: Pixel data, @see VMMDevReqMousePointer for the format.
* @param len size in bytes of the pixel data * @len: Size in bytes of the pixel data.
* @returns 0 on success, -errno on failure
*/ */
int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags, int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
u32 hot_x, u32 hot_y, u32 width, u32 height, u32 hot_x, u32 hot_y, u32 width, u32 height,
...@@ -195,13 +193,13 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags, ...@@ -195,13 +193,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 * 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 * to re-position its own cursor (though this is currently unlikely). The
* current host cursor position is returned. * current host cursor position is returned.
* @param ctx The context containing the heap used. * Return: 0 or negative errno value.
* @param report_position Are we reporting a position? * @ctx: The context containing the heap used.
* @param x Guest cursor X position. * @report_position: Are we reporting a position?
* @param y Guest cursor Y position. * @x: Guest cursor X position.
* @param x_host Host cursor X position is stored here. Optional. * @y: Guest cursor Y position.
* @param y_host Host cursor Y position is stored here. Optional. * @x_host: Host cursor X position is stored here. Optional.
* @returns 0 on success, -errno on failure * @y_host: Host cursor Y position is stored here. Optional.
*/ */
int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position, int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
u32 x, u32 y, u32 *x_host, u32 *y_host) u32 x, u32 y, u32 *x_host, u32 *y_host)
...@@ -226,21 +224,3 @@ int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position, ...@@ -226,21 +224,3 @@ int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
return 0; 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.
*/
...@@ -36,29 +36,14 @@ struct hgsmi_buffer_location { ...@@ -36,29 +36,14 @@ struct hgsmi_buffer_location {
} __packed; } __packed;
/* HGSMI setup and configuration data structures. */ /* HGSMI setup and configuration data structures. */
/* host->guest commands pending, should be accessed under FIFO lock only */
#define HGSMIHOSTFLAGS_COMMANDS_PENDING 0x01u #define HGSMIHOSTFLAGS_COMMANDS_PENDING 0x01u
/* IRQ is fired, should be accessed under VGAState::lock only */
#define HGSMIHOSTFLAGS_IRQ 0x02u #define HGSMIHOSTFLAGS_IRQ 0x02u
/* vsync interrupt flag, should be accessed under VGAState::lock only */
#define HGSMIHOSTFLAGS_VSYNC 0x10u #define HGSMIHOSTFLAGS_VSYNC 0x10u
/** monitor hotplug flag, should be accessed under VGAState::lock only */
#define HGSMIHOSTFLAGS_HOTPLUG 0x20u #define HGSMIHOSTFLAGS_HOTPLUG 0x20u
/**
* Cursor capability state change flag, should be accessed under
* VGAState::lock only. @see vbva_conf32.
*/
#define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES 0x40u #define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES 0x40u
struct hgsmi_host_flags { 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 host_flags;
u32 reserved[3]; u32 reserved[3];
} __packed; } __packed;
......
...@@ -30,18 +30,18 @@ ...@@ -30,18 +30,18 @@
* Set a video mode via an HGSMI request. The views must have been * Set a video mode via an HGSMI request. The views must have been
* initialised first using @a VBoxHGSMISendViewInfo and if the mode is being * initialised first using @a VBoxHGSMISendViewInfo and if the mode is being
* set on the first display then it must be set first using registers. * set on the first display then it must be set first using registers.
* @param ctx The context containing the heap to use * @ctx: The context containing the heap to use.
* @param display The screen number * @display: The screen number.
* @param origin_x The horizontal displacement relative to the first scrn * @origin_x: The horizontal displacement relative to the first scrn.
* @param origin_y The vertical displacement relative to the first screen * @origin_y: The vertical displacement relative to the first screen.
* @param start_offset The offset of the visible area of the framebuffer * @start_offset: The offset of the visible area of the framebuffer
* relative to the framebuffer start * relative to the framebuffer start.
* @param pitch The offset in bytes between the starts of two adjecent * @pitch: The offset in bytes between the starts of two adjecent
* scan lines in video RAM * scan lines in video RAM.
* @param width The mode width * @width: The mode width.
* @param height The mode height * @height: The mode height.
* @param bpp The colour depth of the mode * @bpp: The colour depth of the mode.
* @param flags Flags * @flags: Flags.
*/ */
void hgsmi_process_display_info(struct gen_pool *ctx, u32 display, void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
s32 origin_x, s32 origin_y, u32 start_offset, s32 origin_x, s32 origin_y, u32 start_offset,
...@@ -74,12 +74,12 @@ void hgsmi_process_display_info(struct gen_pool *ctx, u32 display, ...@@ -74,12 +74,12 @@ void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
* expressed. This information remains valid until the next VBVA resize event * 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 * for any screen, at which time it is reset to the bounding rectangle of all
* virtual screens. * virtual screens.
* @param ctx The context containing the heap to use. * Return: 0 or negative errno value.
* @param origin_x Upper left X co-ordinate relative to the first screen. * @ctx: The context containing the heap to use.
* @param origin_y Upper left Y co-ordinate relative to the first screen. * @origin_x: Upper left X co-ordinate relative to the first screen.
* @param width Rectangle width. * @origin_y: Upper left Y co-ordinate relative to the first screen.
* @param height Rectangle height. * @width: Rectangle width.
* @returns 0 on success, -errno on failure * @height: Rectangle height.
*/ */
int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y, int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
u32 width, u32 height) u32 width, u32 height)
...@@ -104,10 +104,10 @@ int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y, ...@@ -104,10 +104,10 @@ int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
/** /**
* Get most recent video mode hints. * Get most recent video mode hints.
* @param ctx The context containing the heap to use. * Return: 0 or negative errno value.
* @param screens The number of screens to query hints for, starting at 0. * @ctx: The context containing the heap to use.
* @param hints Array of vbva_modehint structures for receiving the hints. * @screens: The number of screens to query hints for, starting at 0.
* @returns 0 on success, -errno on failure * @hints: Array of vbva_modehint structures for receiving the hints.
*/ */
int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens, int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
struct vbva_modehint *hints) struct vbva_modehint *hints)
......
...@@ -89,11 +89,11 @@ struct vbox_private { ...@@ -89,11 +89,11 @@ struct vbox_private {
struct vbva_buf_ctx *vbva_info; struct vbva_buf_ctx *vbva_info;
bool any_pitch; bool any_pitch;
u32 num_crtcs; 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; 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; u32 available_vram_size;
/** Array of structures for receiving mode hints. */ /* Array of structures for receiving mode hints. */
struct vbva_modehint *last_mode_hints; struct vbva_modehint *last_mode_hints;
int fb_mtrr; int fb_mtrr;
...@@ -105,7 +105,7 @@ struct vbox_private { ...@@ -105,7 +105,7 @@ struct vbox_private {
} ttm; } ttm;
struct mutex hw_mutex; /* protects modeset and accel/vbva accesses */ struct mutex hw_mutex; /* protects modeset and accel/vbva accesses */
/** /*
* We decide whether or not user-space supports display hot-plug * We decide whether or not user-space supports display hot-plug
* depending on whether they react to a hot-plug event after the initial * depending on whether they react to a hot-plug event after the initial
* mode query. * mode query.
...@@ -114,7 +114,7 @@ struct vbox_private { ...@@ -114,7 +114,7 @@ struct vbox_private {
struct work_struct hotplug_work; struct work_struct hotplug_work;
u32 input_mapping_width; u32 input_mapping_width;
u32 input_mapping_height; u32 input_mapping_height;
/** /*
* Is user-space using an X.Org-style layout of one large frame-buffer * Is user-space using an X.Org-style layout of one large frame-buffer
* encompassing all screen ones or is the fbdev console active? * encompassing all screen ones or is the fbdev console active?
*/ */
......
...@@ -72,7 +72,7 @@ irqreturn_t vbox_irq_handler(int irq, void *arg) ...@@ -72,7 +72,7 @@ irqreturn_t vbox_irq_handler(int irq, void *arg)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/** /*
* Check that the position hints provided by the host are suitable for GNOME * Check that the position hints provided by the host are suitable for GNOME
* shell (i.e. all screens disjoint and hints for all enabled screens) and if * shell (i.e. all screens disjoint and hints for all enabled screens) and if
* not replace them with default ones. Providing valid hints improves the * not replace them with default ones. Providing valid hints improves the
...@@ -118,9 +118,7 @@ static void validate_or_set_position_hints(struct vbox_private *vbox) ...@@ -118,9 +118,7 @@ static void validate_or_set_position_hints(struct vbox_private *vbox)
} }
} }
/** /* Query the host for the most recent video mode hints. */
* Query the host for the most recent video mode hints.
*/
static void vbox_update_mode_hints(struct vbox_private *vbox) static void vbox_update_mode_hints(struct vbox_private *vbox)
{ {
struct drm_device *dev = &vbox->ddev; struct drm_device *dev = &vbox->ddev;
......
...@@ -92,7 +92,7 @@ void vbox_report_caps(struct vbox_private *vbox) ...@@ -92,7 +92,7 @@ void vbox_report_caps(struct vbox_private *vbox)
hgsmi_send_caps_info(vbox->guest_pool, caps); hgsmi_send_caps_info(vbox->guest_pool, caps);
} }
/** /*
* Send information about dirty rectangles to VBVA. If necessary we enable * Send information about dirty rectangles to VBVA. If necessary we enable
* VBVA first, as this is normally disabled after a change of master in case * VBVA first, as this is normally disabled after a change of master in case
* the new master does not send dirty rectangle information (is this even * the new master does not send dirty rectangle information (is this even
...@@ -214,7 +214,7 @@ static void vbox_accel_fini(struct vbox_private *vbox) ...@@ -214,7 +214,7 @@ static void vbox_accel_fini(struct vbox_private *vbox)
pci_iounmap(vbox->ddev.pdev, vbox->vbva_buffers); pci_iounmap(vbox->ddev.pdev, vbox->vbva_buffers);
} }
/** Do we support the 4.3 plus mode hint reporting interface? */ /* Do we support the 4.3 plus mode hint reporting interface? */
static bool have_hgsmi_mode_hints(struct vbox_private *vbox) static bool have_hgsmi_mode_hints(struct vbox_private *vbox)
{ {
u32 have_hints, have_cursor; u32 have_hints, have_cursor;
...@@ -245,10 +245,6 @@ bool vbox_check_supported(u16 id) ...@@ -245,10 +245,6 @@ bool vbox_check_supported(u16 id)
return dispi_id == id; return dispi_id == id;
} }
/**
* Set up our heaps and data exchange buffers in VRAM before handing the rest
* to the memory manager.
*/
int vbox_hw_init(struct vbox_private *vbox) int vbox_hw_init(struct vbox_private *vbox)
{ {
int ret = -ENOMEM; int ret = -ENOMEM;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "vboxvideo.h" #include "vboxvideo.h"
#include "hgsmi_channels.h" #include "hgsmi_channels.h"
/** /*
* Set a graphics mode. Poke any required values into registers, do an HGSMI * Set a graphics mode. Poke any required values into registers, do an HGSMI
* mode set and tell the host we support advanced graphics functions. * mode set and tell the host we support advanced graphics functions.
*/ */
...@@ -380,7 +380,7 @@ static int vbox_cursor_atomic_check(struct drm_plane *plane, ...@@ -380,7 +380,7 @@ static int vbox_cursor_atomic_check(struct drm_plane *plane,
return 0; return 0;
} }
/** /*
* Copy the ARGB image and generate the mask, which is needed in case the host * Copy the ARGB image and generate the mask, which is needed in case the host
* does not support ARGB cursors. The mask is a 1BPP bitmap with the bit set * does not support ARGB cursors. The mask is a 1BPP bitmap with the bit set
* if the corresponding alpha value in the ARGB image is greater than 0xF0. * if the corresponding alpha value in the ARGB image is greater than 0xF0.
...@@ -674,11 +674,11 @@ static struct drm_encoder *vbox_encoder_init(struct drm_device *dev, ...@@ -674,11 +674,11 @@ static struct drm_encoder *vbox_encoder_init(struct drm_device *dev,
return &vbox_encoder->base; return &vbox_encoder->base;
} }
/** /*
* Generate EDID data with a mode-unique serial number for the virtual * Generate EDID data with a mode-unique serial number for the virtual
* monitor to try to persuade Unity that different modes correspond to * monitor to try to persuade Unity that different modes correspond to
* different monitors and it should not try to force the same resolution on * different monitors and it should not try to force the same resolution on
* them. * them.
*/ */
static void vbox_set_edid(struct drm_connector *connector, int width, static void vbox_set_edid(struct drm_connector *connector, int width,
int height) int height)
......
...@@ -45,9 +45,7 @@ static void vbox_ttm_mem_global_release(struct drm_global_reference *ref) ...@@ -45,9 +45,7 @@ static void vbox_ttm_mem_global_release(struct drm_global_reference *ref)
ttm_mem_global_release(ref->object); ttm_mem_global_release(ref->object);
} }
/** /* Add the vbox memory manager object/structures to the global memory manager */
* Adds the vbox memory manager object/structures to the global memory manager.
*/
static int vbox_ttm_global_init(struct vbox_private *vbox) static int vbox_ttm_global_init(struct vbox_private *vbox)
{ {
struct drm_global_reference *global_ref; struct drm_global_reference *global_ref;
...@@ -81,9 +79,7 @@ static int vbox_ttm_global_init(struct vbox_private *vbox) ...@@ -81,9 +79,7 @@ static int vbox_ttm_global_init(struct vbox_private *vbox)
return 0; return 0;
} }
/** /* Remove the vbox memory manager object from the global memory manager */
* Removes the vbox memory manager object from the global memory manager.
*/
static void vbox_ttm_global_release(struct vbox_private *vbox) static void vbox_ttm_global_release(struct vbox_private *vbox)
{ {
drm_global_item_unref(&vbox->ttm.bo_global_ref.ref); drm_global_item_unref(&vbox->ttm.bo_global_ref.ref);
......
...@@ -24,10 +24,6 @@ ...@@ -24,10 +24,6 @@
#ifndef __VBOXVIDEO_H__ #ifndef __VBOXVIDEO_H__
#define __VBOXVIDEO_H__ #define __VBOXVIDEO_H__
/*
* This should be in sync with monitorCount <xsd:maxInclusive value="64"/> in
* src/VBox/Main/xml/VirtualBox-settings-common.xsd
*/
#define VBOX_VIDEO_MAX_SCREENS 64 #define VBOX_VIDEO_MAX_SCREENS 64
/* /*
...@@ -77,21 +73,14 @@ ...@@ -77,21 +73,14 @@
* read 32 bit value result of the last vbox command is returned * read 32 bit value result of the last vbox command is returned
*/ */
/**
* VBVA command header.
*
* @todo Where does this fit in?
*/
struct vbva_cmd_hdr { struct vbva_cmd_hdr {
/** Coordinates of affected rectangle. */
s16 x; s16 x;
s16 y; s16 y;
u16 w; u16 w;
u16 h; u16 h;
} __packed; } __packed;
/** @name VBVA ring defines. /*
*
* The VBVA ring buffer is suitable for transferring large (< 2GB) amount of * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
* data. For example big bitmaps which do not fit to the buffer. * data. For example big bitmaps which do not fit to the buffer.
* *
...@@ -106,8 +95,8 @@ struct vbva_cmd_hdr { ...@@ -106,8 +95,8 @@ struct vbva_cmd_hdr {
* VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
* data_offset. After that on each flush the host continues fetching the data * data_offset. After that on each flush the host continues fetching the data
* until the record is completed. * until the record is completed.
*
*/ */
#define VBVA_RING_BUFFER_SIZE (4194304 - 1024) #define VBVA_RING_BUFFER_SIZE (4194304 - 1024)
#define VBVA_RING_BUFFER_THRESHOLD (4096) #define VBVA_RING_BUFFER_THRESHOLD (4096)
...@@ -122,11 +111,7 @@ struct vbva_cmd_hdr { ...@@ -122,11 +111,7 @@ struct vbva_cmd_hdr {
#define VBVA_F_RECORD_PARTIAL 0x80000000u #define VBVA_F_RECORD_PARTIAL 0x80000000u
/**
* VBVA record.
*/
struct vbva_record { struct vbva_record {
/** The length of the record. Changed by guest. */
u32 len_and_flags; u32 len_and_flags;
} __packed; } __packed;
...@@ -144,7 +129,8 @@ struct vbva_record { ...@@ -144,7 +129,8 @@ struct vbva_record {
/* The value for port IO to let the adapter to interpret the adapter memory. */ /* The value for port IO to let the adapter to interpret the adapter memory. */
#define VBOX_VIDEO_INTERPRET_ADAPTER_MEMORY 0x00000000 #define VBOX_VIDEO_INTERPRET_ADAPTER_MEMORY 0x00000000
/* The value for port IO to let the adapter to interpret the display memory. /*
* The value for port IO to let the adapter to interpret the display memory.
* The display number is encoded in low 16 bits. * The display number is encoded in low 16 bits.
*/ */
#define VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE 0x00010000 #define VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE 0x00010000
...@@ -200,12 +186,12 @@ struct vbva_buffer { ...@@ -200,12 +186,12 @@ struct vbva_buffer {
#define VBVA_CMDVBVA_CTL 18 #define VBVA_CMDVBVA_CTL 18
/* Query most recent mode hints sent */ /* Query most recent mode hints sent */
#define VBVA_QUERY_MODE_HINTS 19 #define VBVA_QUERY_MODE_HINTS 19
/** /*
* Report the guest virtual desktop position and size for mapping host and * Report the guest virtual desktop position and size for mapping host and
* guest pointer positions. * guest pointer positions.
*/ */
#define VBVA_REPORT_INPUT_MAPPING 20 #define VBVA_REPORT_INPUT_MAPPING 20
/** Report the guest cursor position and query the host position. */ /* Report the guest cursor position and query the host position. */
#define VBVA_CURSOR_POSITION 21 #define VBVA_CURSOR_POSITION 21
/* host->guest commands */ /* host->guest commands */
...@@ -215,25 +201,24 @@ struct vbva_buffer { ...@@ -215,25 +201,24 @@ struct vbva_buffer {
/* vbva_conf32::index */ /* vbva_conf32::index */
#define VBOX_VBVA_CONF32_MONITOR_COUNT 0 #define VBOX_VBVA_CONF32_MONITOR_COUNT 0
#define VBOX_VBVA_CONF32_HOST_HEAP_SIZE 1 #define VBOX_VBVA_CONF32_HOST_HEAP_SIZE 1
/** /*
* Returns VINF_SUCCESS if the host can report mode hints via VBVA. * Returns VINF_SUCCESS if the host can report mode hints via VBVA.
* Set value to VERR_NOT_SUPPORTED before calling. * Set value to VERR_NOT_SUPPORTED before calling.
*/ */
#define VBOX_VBVA_CONF32_MODE_HINT_REPORTING 2 #define VBOX_VBVA_CONF32_MODE_HINT_REPORTING 2
/** /*
* Returns VINF_SUCCESS if the host can report guest cursor enabled status via * Returns VINF_SUCCESS if the host can report guest cursor enabled status via
* VBVA. Set value to VERR_NOT_SUPPORTED before calling. * VBVA. Set value to VERR_NOT_SUPPORTED before calling.
*/ */
#define VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING 3 #define VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING 3
/** /*
* Returns the currently available host cursor capabilities. Available if * Returns the currently available host cursor capabilities. Available if
* vbva_conf32::VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING returns success. * VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING returns success.
* @see VMMDevReqMouseStatus::mouseFeatures.
*/ */
#define VBOX_VBVA_CONF32_CURSOR_CAPABILITIES 4 #define VBOX_VBVA_CONF32_CURSOR_CAPABILITIES 4
/** Returns the supported flags in vbva_infoscreen::flags. */ /* Returns the supported flags in vbva_infoscreen.flags. */
#define VBOX_VBVA_CONF32_SCREEN_FLAGS 5 #define VBOX_VBVA_CONF32_SCREEN_FLAGS 5
/** Returns the max size of VBVA record. */ /* Returns the max size of VBVA record. */
#define VBOX_VBVA_CONF32_MAX_RECORD_SIZE 6 #define VBOX_VBVA_CONF32_MAX_RECORD_SIZE 6
struct vbva_conf32 { struct vbva_conf32 {
...@@ -241,20 +226,20 @@ struct vbva_conf32 { ...@@ -241,20 +226,20 @@ struct vbva_conf32 {
u32 value; u32 value;
} __packed; } __packed;
/** Reserved for historical reasons. */ /* Reserved for historical reasons. */
#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED0 BIT(0) #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED0 BIT(0)
/** /*
* Guest cursor capability: can the host show a hardware cursor at the host * Guest cursor capability: can the host show a hardware cursor at the host
* pointer location? * pointer location?
*/ */
#define VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE BIT(1) #define VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE BIT(1)
/** Reserved for historical reasons. */ /* Reserved for historical reasons. */
#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED2 BIT(2) #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED2 BIT(2)
/** Reserved for historical reasons. Must always be unset. */ /* Reserved for historical reasons. Must always be unset. */
#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED3 BIT(3) #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED3 BIT(3)
/** Reserved for historical reasons. */ /* Reserved for historical reasons. */
#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED4 BIT(4) #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED4 BIT(4)
/** Reserved for historical reasons. */ /* Reserved for historical reasons. */
#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED5 BIT(5) #define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED5 BIT(5)
struct vbva_infoview { struct vbva_infoview {
...@@ -275,21 +260,21 @@ struct vbva_flush { ...@@ -275,21 +260,21 @@ struct vbva_flush {
u32 reserved; u32 reserved;
} __packed; } __packed;
/* vbva_infoscreen::flags */ /* vbva_infoscreen.flags */
#define VBVA_SCREEN_F_NONE 0x0000 #define VBVA_SCREEN_F_NONE 0x0000
#define VBVA_SCREEN_F_ACTIVE 0x0001 #define VBVA_SCREEN_F_ACTIVE 0x0001
/** /*
* The virtual monitor has been disabled by the guest and should be removed * The virtual monitor has been disabled by the guest and should be removed
* by the host and ignored for purposes of pointer position calculation. * by the host and ignored for purposes of pointer position calculation.
*/ */
#define VBVA_SCREEN_F_DISABLED 0x0002 #define VBVA_SCREEN_F_DISABLED 0x0002
/** /*
* The virtual monitor has been blanked by the guest and should be blacked * The virtual monitor has been blanked by the guest and should be blacked
* out by the host using width, height, etc values from the vbva_infoscreen * out by the host using width, height, etc values from the vbva_infoscreen
* request. * request.
*/ */
#define VBVA_SCREEN_F_BLANK 0x0004 #define VBVA_SCREEN_F_BLANK 0x0004
/** /*
* The virtual monitor has been blanked by the guest and should be blacked * The virtual monitor has been blanked by the guest and should be blacked
* out by the host using the previous mode values for width. height, etc. * out by the host using the previous mode values for width. height, etc.
*/ */
...@@ -324,7 +309,7 @@ struct vbva_infoscreen { ...@@ -324,7 +309,7 @@ struct vbva_infoscreen {
u16 flags; u16 flags;
} __packed; } __packed;
/* vbva_enable::flags */ /* vbva_enable.flags */
#define VBVA_F_NONE 0x00000000 #define VBVA_F_NONE 0x00000000
#define VBVA_F_ENABLE 0x00000001 #define VBVA_F_ENABLE 0x00000001
#define VBVA_F_DISABLE 0x00000002 #define VBVA_F_DISABLE 0x00000002
...@@ -365,7 +350,6 @@ struct vbva_mouse_pointer_shape { ...@@ -365,7 +350,6 @@ struct vbva_mouse_pointer_shape {
/* Pointer data. /* Pointer data.
* *
****
* The data consists of 1 bpp AND mask followed by 32 bpp XOR (color) * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color)
* mask. * mask.
* *
...@@ -387,30 +371,19 @@ struct vbva_mouse_pointer_shape { ...@@ -387,30 +371,19 @@ struct vbva_mouse_pointer_shape {
* Bytes in the gap between the AND and the XOR mask are undefined. * Bytes in the gap between the AND and the XOR mask are undefined.
* XOR mask scanlines have no gap between them and size of XOR mask is: * XOR mask scanlines have no gap between them and size of XOR mask is:
* xor_len = width * 4 * height. * xor_len = width * 4 * height.
****
* *
* Preallocate 4 bytes for accessing actual data as p->data. * Preallocate 4 bytes for accessing actual data as p->data.
*/ */
u8 data[4]; u8 data[4];
} __packed; } __packed;
/** /* pointer is visible */
* @name vbva_mouse_pointer_shape::flags
* @note The VBOX_MOUSE_POINTER_* flags are used in the guest video driver,
* values must be <= 0x8000 and must not be changed. (try make more sense
* of this, please).
* @{
*/
/** pointer is visible */
#define VBOX_MOUSE_POINTER_VISIBLE 0x0001 #define VBOX_MOUSE_POINTER_VISIBLE 0x0001
/** pointer has alpha channel */ /* pointer has alpha channel */
#define VBOX_MOUSE_POINTER_ALPHA 0x0002 #define VBOX_MOUSE_POINTER_ALPHA 0x0002
/** pointerData contains new pointer shape */ /* pointerData contains new pointer shape */
#define VBOX_MOUSE_POINTER_SHAPE 0x0004 #define VBOX_MOUSE_POINTER_SHAPE 0x0004
/** @} */
/* /*
* The guest driver can handle asynch guest cmd completion by reading the * The guest driver can handle asynch guest cmd completion by reading the
* command offset from io port. * command offset from io port.
...@@ -418,11 +391,11 @@ struct vbva_mouse_pointer_shape { ...@@ -418,11 +391,11 @@ struct vbva_mouse_pointer_shape {
#define VBVACAPS_COMPLETEGCMD_BY_IOREAD 0x00000001 #define VBVACAPS_COMPLETEGCMD_BY_IOREAD 0x00000001
/* the guest driver can handle video adapter IRQs */ /* the guest driver can handle video adapter IRQs */
#define VBVACAPS_IRQ 0x00000002 #define VBVACAPS_IRQ 0x00000002
/** The guest can read video mode hints sent via VBVA. */ /* The guest can read video mode hints sent via VBVA. */
#define VBVACAPS_VIDEO_MODE_HINTS 0x00000004 #define VBVACAPS_VIDEO_MODE_HINTS 0x00000004
/** The guest can switch to a software cursor on demand. */ /* The guest can switch to a software cursor on demand. */
#define VBVACAPS_DISABLE_CURSOR_INTEGRATION 0x00000008 #define VBVACAPS_DISABLE_CURSOR_INTEGRATION 0x00000008
/** The guest does not depend on host handling the VBE registers. */ /* The guest does not depend on host handling the VBE registers. */
#define VBVACAPS_USE_VBVA_ONLY 0x00000010 #define VBVACAPS_USE_VBVA_ONLY 0x00000010
struct vbva_caps { struct vbva_caps {
...@@ -430,17 +403,17 @@ struct vbva_caps { ...@@ -430,17 +403,17 @@ struct vbva_caps {
u32 caps; u32 caps;
} __packed; } __packed;
/** Query the most recent mode hints received from the host. */ /* Query the most recent mode hints received from the host. */
struct vbva_query_mode_hints { struct vbva_query_mode_hints {
/** The maximum number of screens to return hints for. */ /* The maximum number of screens to return hints for. */
u16 hints_queried_count; u16 hints_queried_count;
/** The size of the mode hint structures directly following this one. */ /* The size of the mode hint structures directly following this one. */
u16 hint_structure_guest_size; u16 hint_structure_guest_size;
/** Return code for the operation. Initialise to VERR_NOT_SUPPORTED. */ /* Return code for the operation. Initialise to VERR_NOT_SUPPORTED. */
s32 rc; s32 rc;
} __packed; } __packed;
/** /*
* Structure in which a mode hint is returned. The guest allocates an array * Structure in which a mode hint is returned. The guest allocates an array
* of these immediately after the vbva_query_mode_hints structure. * of these immediately after the vbva_query_mode_hints structure.
* To accommodate future extensions, the vbva_query_mode_hints structure * To accommodate future extensions, the vbva_query_mode_hints structure
...@@ -455,37 +428,35 @@ struct vbva_modehint { ...@@ -455,37 +428,35 @@ struct vbva_modehint {
u32 cy; u32 cy;
u32 bpp; /* Which has never been used... */ u32 bpp; /* Which has never been used... */
u32 display; u32 display;
u32 dx; /**< X offset into the virtual frame-buffer. */ u32 dx; /* X offset into the virtual frame-buffer. */
u32 dy; /**< Y offset into the virtual frame-buffer. */ u32 dy; /* Y offset into the virtual frame-buffer. */
u32 enabled; /* Not flags. Add new members for new flags. */ u32 enabled; /* Not flags. Add new members for new flags. */
} __packed; } __packed;
#define VBVAMODEHINT_MAGIC 0x0801add9u #define VBVAMODEHINT_MAGIC 0x0801add9u
/** /*
* Report the rectangle relative to which absolute pointer events should be * Report the rectangle relative to which absolute pointer events should be
* expressed. This information remains valid until the next VBVA resize event * 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 * for any screen, at which time it is reset to the bounding rectangle of all
* virtual screens and must be re-set. * virtual screens and must be re-set.
* @see VBVA_REPORT_INPUT_MAPPING.
*/ */
struct vbva_report_input_mapping { struct vbva_report_input_mapping {
s32 x; /**< Upper left X co-ordinate relative to the first screen. */ s32 x; /* Upper left X co-ordinate relative to the first screen. */
s32 y; /**< Upper left Y co-ordinate relative to the first screen. */ s32 y; /* Upper left Y co-ordinate relative to the first screen. */
u32 cx; /**< Rectangle width. */ u32 cx; /* Rectangle width. */
u32 cy; /**< Rectangle height. */ u32 cy; /* Rectangle height. */
} __packed; } __packed;
/** /*
* Report the guest cursor position and query the host one. The host may wish * Report the guest cursor position and query the host one. The host may wish
* to use the guest information to re-position its own cursor (though this is * to use the guest information to re-position its own cursor (though this is
* currently unlikely). * currently unlikely).
* @see VBVA_CURSOR_POSITION
*/ */
struct vbva_cursor_position { struct vbva_cursor_position {
u32 report_position; /**< Are we reporting a position? */ u32 report_position; /* Are we reporting a position? */
u32 x; /**< Guest cursor X position */ u32 x; /* Guest cursor X position */
u32 y; /**< Guest cursor Y position */ u32 y; /* Guest cursor Y position */
} __packed; } __packed;
#endif #endif
...@@ -26,30 +26,26 @@ ...@@ -26,30 +26,26 @@
#include <linux/genalloc.h> #include <linux/genalloc.h>
#include "vboxvideo.h" #include "vboxvideo.h"
/** /*
* Structure grouping the context needed for sending graphics acceleration * Structure grouping the context needed for sending graphics acceleration
* information to the host via VBVA. Each screen has its own VBVA buffer. * information to the host via VBVA. Each screen has its own VBVA buffer.
*/ */
struct vbva_buf_ctx { struct vbva_buf_ctx {
/** Offset of the buffer in the VRAM section for the screen */ /* Offset of the buffer in the VRAM section for the screen */
u32 buffer_offset; u32 buffer_offset;
/** Length of the buffer in bytes */ /* Length of the buffer in bytes */
u32 buffer_length; u32 buffer_length;
/** Set if we wrote to the buffer faster than the host could read it */ /* Set if we wrote to the buffer faster than the host could read it */
bool buffer_overflow; bool buffer_overflow;
/** VBVA record that we are currently preparing for the host, or NULL */ /* VBVA record that we are currently preparing for the host, or NULL */
struct vbva_record *record; struct vbva_record *record;
/** /*
* Pointer to the VBVA buffer mapped into the current address space. * Pointer to the VBVA buffer mapped into the current address space.
* Will be NULL if VBVA is not enabled. * Will be NULL if VBVA is not enabled.
*/ */
struct vbva_buffer *vbva; struct vbva_buffer *vbva;
}; };
/**
* @name Base HGSMI APIs
* @{
*/
int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location); int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location);
int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps); int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps);
int hgsmi_test_query_conf(struct gen_pool *ctx); int hgsmi_test_query_conf(struct gen_pool *ctx);
...@@ -59,12 +55,7 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags, ...@@ -59,12 +55,7 @@ int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
u8 *pixels, u32 len); u8 *pixels, u32 len);
int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position, int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
u32 x, u32 y, u32 *x_host, u32 *y_host); u32 x, u32 y, u32 *x_host, u32 *y_host);
/** @} */
/**
* @name VBVA APIs
* @{
*/
bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
struct vbva_buffer *vbva, s32 screen); struct vbva_buffer *vbva, s32 screen);
void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
...@@ -76,12 +67,7 @@ bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx, ...@@ -76,12 +67,7 @@ bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
const void *p, u32 len); const void *p, u32 len);
void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx, void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx,
u32 buffer_offset, u32 buffer_length); u32 buffer_offset, u32 buffer_length);
/** @} */
/**
* @name Modesetting APIs
* @{
*/
void hgsmi_process_display_info(struct gen_pool *ctx, u32 display, void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
s32 origin_x, s32 origin_y, u32 start_offset, s32 origin_x, s32 origin_y, u32 start_offset,
u32 pitch, u32 width, u32 height, u32 pitch, u32 width, u32 height,
...@@ -90,6 +76,5 @@ int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y, ...@@ -90,6 +76,5 @@ int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
u32 width, u32 height); u32 width, u32 height);
int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens, int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
struct vbva_modehint *hints); struct vbva_modehint *hints);
/** @} */
#endif #endif
...@@ -25,11 +25,6 @@ ...@@ -25,11 +25,6 @@
/* GUEST <-> HOST Communication API */ /* GUEST <-> HOST Communication API */
/**
* @todo FIXME: Either dynamicly ask host for this or put somewhere high in
* physical memory like 0xE0000000.
*/
#define VBE_DISPI_BANK_ADDRESS 0xA0000 #define VBE_DISPI_BANK_ADDRESS 0xA0000
#define VBE_DISPI_BANK_SIZE_KB 64 #define VBE_DISPI_BANK_SIZE_KB 64
...@@ -71,12 +66,6 @@ ...@@ -71,12 +66,6 @@
#define VBE_DISPI_ENABLED 0x01 #define VBE_DISPI_ENABLED 0x01
#define VBE_DISPI_GETCAPS 0x02 #define VBE_DISPI_GETCAPS 0x02
#define VBE_DISPI_8BIT_DAC 0x20 #define VBE_DISPI_8BIT_DAC 0x20
/**
* @note this definition is a BOCHS legacy, used only in the video BIOS
* code and ignored by the emulated hardware.
*/
#define VBE_DISPI_LFB_ENABLED 0x40
#define VBE_DISPI_NOCLEARMEM 0x80
#define VGA_PORT_HGSMI_HOST 0x3b0 #define VGA_PORT_HGSMI_HOST 0x3b0
#define VGA_PORT_HGSMI_GUEST 0x3d0 #define VGA_PORT_HGSMI_GUEST 0x3d0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment