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

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
Loading
Loading
Loading
Loading
+26 −46
Original line number Diff line number Diff line
@@ -29,9 +29,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 +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.
 * @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)
{
@@ -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.
 * @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 +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.
 *
 * @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 +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
 * 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 +224,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.
 */
+1 −16
Original line number Diff line number Diff line
@@ -36,29 +36,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;
+22 −22
Original line number Diff line number Diff line
@@ -30,18 +30,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 +74,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 +104,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)
+5 −5
Original line number Diff line number Diff line
@@ -89,11 +89,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;
@@ -105,7 +105,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.
@@ -114,7 +114,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?
	 */
+2 −4
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ irqreturn_t vbox_irq_handler(int irq, void *arg)
	return IRQ_HANDLED;
}

/**
/*
 * 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
 * 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)
		}
}

/**
 * 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)
{
	struct drm_device *dev = &vbox->ddev;
Loading