Commit 42ac0321 authored by Rodrigo Siqueira's avatar Rodrigo Siqueira Committed by Daniel Vetter

drm/vkms: Add framebuffer and plane helpers

This patch appends the minimum helpers related to framebuffer and plane
to make vkms minimally usable.

Changes since V1:
- None
Changes since V2:
- Squash "Add plane helper struct" and "Add helper for framebuffer
  create"
Changes since V3:
 Daniel Vetter:
 - Remove atomic_check from plane helper
Signed-off-by: default avatarRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/d37807da7d3b39444b4c9abb149fe3c518d07c61.1531402095.git.rodrigosiqueiramelo@gmail.com
parent 58d4d298
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include <drm/drm_gem.h> #include <drm/drm_gem.h>
#include <drm/drm_crtc_helper.h> #include <drm/drm_crtc_helper.h>
#include <drm/drm_atomic_helper.h> #include <drm/drm_atomic_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_fb_helper.h>
#include "vkms_drv.h" #include "vkms_drv.h"
#define DRIVER_NAME "vkms" #define DRIVER_NAME "vkms"
...@@ -64,6 +66,7 @@ static struct drm_driver vkms_driver = { ...@@ -64,6 +66,7 @@ static struct drm_driver vkms_driver = {
}; };
static const struct drm_mode_config_funcs vkms_mode_funcs = { static const struct drm_mode_config_funcs vkms_mode_funcs = {
.fb_create = drm_gem_fb_create,
.atomic_check = drm_atomic_helper_check, .atomic_check = drm_atomic_helper_check,
.atomic_commit = drm_atomic_helper_commit, .atomic_commit = drm_atomic_helper_commit,
}; };
......
...@@ -19,6 +19,15 @@ static const struct drm_plane_funcs vkms_plane_funcs = { ...@@ -19,6 +19,15 @@ static const struct drm_plane_funcs vkms_plane_funcs = {
.atomic_destroy_state = drm_atomic_helper_plane_destroy_state, .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
}; };
static void vkms_primary_plane_update(struct drm_plane *plane,
struct drm_plane_state *old_state)
{
}
static const struct drm_plane_helper_funcs vkms_primary_helper_funcs = {
.atomic_update = vkms_primary_plane_update,
};
struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev) struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev)
{ {
struct drm_device *dev = &vkmsdev->drm; struct drm_device *dev = &vkmsdev->drm;
...@@ -42,5 +51,7 @@ struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev) ...@@ -42,5 +51,7 @@ struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev)
return ERR_PTR(ret); return ERR_PTR(ret);
} }
drm_plane_helper_add(plane, &vkms_primary_helper_funcs);
return plane; return plane;
} }
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