drm/vkms: Add vkms_config type

Currently, data for the device instance is held by vkms_device.
Add a separate type, vkms_config to contain configuration details
for the device and various modes to be later used by configfs.
This config data stays constant once the device is created.

Accordingly, add vkms_create and vkms_destroy to initialize/destroy
device through configfs. Currently, they are being called from vkms_init
and vkms_exit, but will be evoked from configfs later on. When configfs
is added, device configuration will be tracked by configfs and only vkms
device lifetime will be handled by vkms_init and vkms_exit functions.

Modify usage of enable_cursor feature to reflect the changes in
relevant files.

Co-developed-by: Daniel Vetter <danvet.vetter@ffwl.ch>
Signed-off-by: Daniel Vetter <danvet.vetter@ffwl.ch>
Signed-off-by: Sumera Priyadarsini <sylphrenadin@gmail.com>
Reviewed-by: Melissa Wen <melissa.srw@gmail.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a090ad29b826185df30f80c66932dd2173d7b060.1610391685.git.sylphrenadin@gmail.com
This commit is contained in:
Sumera Priyadarsini
2021-01-12 00:36:34 +05:30
committed by Melissa Wen
parent cc3283f8f4
commit 2df7af93fd
3 changed files with 43 additions and 12 deletions

View File

@@ -19,8 +19,6 @@
#define XRES_MAX 8192
#define YRES_MAX 8192
extern bool enable_cursor;
struct vkms_composer {
struct drm_framebuffer fb;
struct drm_rect src, dst;
@@ -82,10 +80,19 @@ struct vkms_output {
spinlock_t composer_lock;
};
struct vkms_device;
struct vkms_config {
bool cursor;
/* only set when instantiated */
struct vkms_device *dev;
};
struct vkms_device {
struct drm_device drm;
struct platform_device *platform;
struct vkms_output output;
const struct vkms_config *config;
};
#define drm_crtc_to_vkms_output(target) \