summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/bochs/bochs_kms.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-01-11 08:37:52 +0300
committerGerd Hoffmann <kraxel@redhat.com>2019-01-14 10:39:17 +0300
commit19b85cfabf5c78834c4374347846ca80784e9e42 (patch)
treeef1f23fad521e88ebd098f2831373bf56577f033 /drivers/gpu/drm/bochs/bochs_kms.c
parent60119b0ba0e783cb170d7748c0f12e5d45fa3f2c (diff)
downloadlinux-19b85cfabf5c78834c4374347846ca80784e9e42.tar.xz
drm/bochs: move remaining fb bits to kms
bochs_fbdev.c is almost empty now. Move the remaining framebuffer bits over to bochs_kms.c. Pure code motion. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20190111053752.4004-17-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/bochs/bochs_kms.c')
-rw-r--r--drivers/gpu/drm/bochs/bochs_kms.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index fc856a02a271..e9d5dbc34676 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -9,6 +9,7 @@
#include <drm/drm_atomic_helper.h>
#include <drm/drm_plane_helper.h>
#include <drm/drm_atomic_uapi.h>
+#include <drm/drm_gem_framebuffer_helper.h>
static int defx = 1024;
static int defy = 768;
@@ -256,6 +257,22 @@ static void bochs_connector_init(struct drm_device *dev)
}
}
+static struct drm_framebuffer *
+bochs_gem_fb_create(struct drm_device *dev, struct drm_file *file,
+ const struct drm_mode_fb_cmd2 *mode_cmd)
+{
+ if (mode_cmd->pixel_format != DRM_FORMAT_XRGB8888 &&
+ mode_cmd->pixel_format != DRM_FORMAT_BGRX8888)
+ return ERR_PTR(-EINVAL);
+
+ return drm_gem_fb_create(dev, file, mode_cmd);
+}
+
+const struct drm_mode_config_funcs bochs_mode_funcs = {
+ .fb_create = bochs_gem_fb_create,
+ .atomic_check = drm_atomic_helper_check,
+ .atomic_commit = drm_atomic_helper_commit,
+};
int bochs_kms_init(struct bochs_device *bochs)
{