diff options
Diffstat (limited to 'drivers/gpu/drm/bochs/bochs_fbdev.c')
-rw-r--r-- | drivers/gpu/drm/bochs/bochs_fbdev.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_fbdev.c b/drivers/gpu/drm/bochs/bochs_fbdev.c index 8f4d6c052f7b..dd3c7df267da 100644 --- a/drivers/gpu/drm/bochs/bochs_fbdev.c +++ b/drivers/gpu/drm/bochs/bochs_fbdev.c | |||
@@ -63,9 +63,8 @@ static int bochsfb_create(struct drm_fb_helper *helper, | |||
63 | 63 | ||
64 | mode_cmd.width = sizes->surface_width; | 64 | mode_cmd.width = sizes->surface_width; |
65 | mode_cmd.height = sizes->surface_height; | 65 | mode_cmd.height = sizes->surface_height; |
66 | mode_cmd.pitches[0] = mode_cmd.width * ((sizes->surface_bpp + 7) / 8); | 66 | mode_cmd.pitches[0] = sizes->surface_width * 4; |
67 | mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, | 67 | mode_cmd.pixel_format = DRM_FORMAT_HOST_XRGB8888; |
68 | sizes->surface_depth); | ||
69 | size = mode_cmd.pitches[0] * mode_cmd.height; | 68 | size = mode_cmd.pitches[0] * mode_cmd.height; |
70 | 69 | ||
71 | /* alloc, pin & map bo */ | 70 | /* alloc, pin & map bo */ |
@@ -137,8 +136,19 @@ static const struct drm_fb_helper_funcs bochs_fb_helper_funcs = { | |||
137 | .fb_probe = bochsfb_create, | 136 | .fb_probe = bochsfb_create, |
138 | }; | 137 | }; |
139 | 138 | ||
139 | static struct drm_framebuffer * | ||
140 | bochs_gem_fb_create(struct drm_device *dev, struct drm_file *file, | ||
141 | const struct drm_mode_fb_cmd2 *mode_cmd) | ||
142 | { | ||
143 | if (mode_cmd->pixel_format != DRM_FORMAT_XRGB8888 && | ||
144 | mode_cmd->pixel_format != DRM_FORMAT_BGRX8888) | ||
145 | return ERR_PTR(-EINVAL); | ||
146 | |||
147 | return drm_gem_fb_create(dev, file, mode_cmd); | ||
148 | } | ||
149 | |||
140 | const struct drm_mode_config_funcs bochs_mode_funcs = { | 150 | const struct drm_mode_config_funcs bochs_mode_funcs = { |
141 | .fb_create = drm_gem_fb_create, | 151 | .fb_create = bochs_gem_fb_create, |
142 | }; | 152 | }; |
143 | 153 | ||
144 | int bochs_fbdev_init(struct bochs_device *bochs) | 154 | int bochs_fbdev_init(struct bochs_device *bochs) |