mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-28 21:46:02 -04:00
Creating a new vkms_config structure will be more complex once we start adding more options. Extract the vkms_config structure to its own header and source files and add functions to create and delete a vkms_config and to initialize debugfs. Refactor, no functional changes. Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com> Co-developed-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com> Signed-off-by: José Expósito <jose.exposito89@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250218101214.5790-5-jose.exposito89@gmail.com Signed-off-by: Maxime Ripard <mripard@kernel.org>
48 lines
1.2 KiB
C
48 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
#ifndef _VKMS_CONFIG_H_
|
|
#define _VKMS_CONFIG_H_
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include "vkms_drv.h"
|
|
|
|
/**
|
|
* struct vkms_config - General configuration for VKMS driver
|
|
*
|
|
* @writeback: If true, a writeback buffer can be attached to the CRTC
|
|
* @cursor: If true, a cursor plane is created in the VKMS device
|
|
* @overlay: If true, NUM_OVERLAY_PLANES will be created for the VKMS device
|
|
* @dev: Used to store the current VKMS device. Only set when the device is instantiated.
|
|
*/
|
|
struct vkms_config {
|
|
bool writeback;
|
|
bool cursor;
|
|
bool overlay;
|
|
struct vkms_device *dev;
|
|
};
|
|
|
|
/**
|
|
* vkms_config_create() - Create a new VKMS configuration
|
|
*
|
|
* Returns:
|
|
* The new vkms_config or an error. Call vkms_config_destroy() to free the
|
|
* returned configuration.
|
|
*/
|
|
struct vkms_config *vkms_config_create(void);
|
|
|
|
/**
|
|
* vkms_config_destroy() - Free a VKMS configuration
|
|
* @config: vkms_config to free
|
|
*/
|
|
void vkms_config_destroy(struct vkms_config *config);
|
|
|
|
/**
|
|
* vkms_config_register_debugfs() - Register a debugfs file to show the device's
|
|
* configuration
|
|
* @vkms_device: Device to register
|
|
*/
|
|
void vkms_config_register_debugfs(struct vkms_device *vkms_device);
|
|
|
|
#endif /* _VKMS_CONFIG_H_ */
|