bochs_fbdev.c 950 字节
Newer Older
G
Gerd Hoffmann 已提交
1 2 3 4 5 6 7 8
/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include "bochs.h"
9
#include <drm/drm_atomic_helper.h>
10
#include <drm/drm_gem_framebuffer_helper.h>
G
Gerd Hoffmann 已提交
11 12 13

/* ---------------------------------------------------------------------- */

14 15 16 17
static struct drm_framebuffer *
bochs_gem_fb_create(struct drm_device *dev, struct drm_file *file,
		    const struct drm_mode_fb_cmd2 *mode_cmd)
{
18 19
	if (mode_cmd->pixel_format != DRM_FORMAT_XRGB8888 &&
	    mode_cmd->pixel_format != DRM_FORMAT_BGRX8888)
20 21 22 23 24
		return ERR_PTR(-EINVAL);

	return drm_gem_fb_create(dev, file, mode_cmd);
}

25
const struct drm_mode_config_funcs bochs_mode_funcs = {
26
	.fb_create = bochs_gem_fb_create,
27 28
	.atomic_check = drm_atomic_helper_check,
	.atomic_commit = drm_atomic_helper_commit,
29
};