aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bochs/bochs_kms.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-09-21 15:47:02 +0200
committerGerd Hoffmann <kraxel@redhat.com>2018-09-25 14:49:49 +0200
commit86351de023dd3607b1b519f58c11154b217ec031 (patch)
treedf5497c3c4f787e29a62bd0b1df7c1812311374c /drivers/gpu/drm/bochs/bochs_kms.c
parentdrm/bochs: fix DRM_FORMAT_* handling for big endian machines. (diff)
downloadlinux-dev-86351de023dd3607b1b519f58c11154b217ec031.tar.xz
linux-dev-86351de023dd3607b1b519f58c11154b217ec031.zip
drm/bochs: support changing byteorder at mode set time
Add bochs_hw_set_*_endian() helper functions, to set the framebuffer byteorder at mode set time. Support both DRM_FORMAT_XRGB8888 and DRM_FORMAT_BGRX8888 framebuffer formats, no matter what the native machine byte order is. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20180921134704.12826-5-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/bochs/bochs_kms.c')
-rw-r--r--drivers/gpu/drm/bochs/bochs_kms.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index f3fdaf945605..9bc5b438aefd 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -77,7 +77,10 @@ static int bochs_crtc_mode_set(struct drm_crtc *crtc,
struct bochs_device *bochs =
container_of(crtc, struct bochs_device, crtc);
- bochs_hw_setmode(bochs, mode);
+ if (WARN_ON(crtc->primary->fb == NULL))
+ return -EINVAL;
+
+ bochs_hw_setmode(bochs, mode, crtc->primary->fb->format);
bochs_crtc_mode_set_base(crtc, x, y, old_fb);
return 0;
}
@@ -127,7 +130,8 @@ static const struct drm_crtc_helper_funcs bochs_helper_funcs = {
};
static const uint32_t bochs_formats[] = {
- DRM_FORMAT_HOST_XRGB8888,
+ DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_BGRX8888,
};
static struct drm_plane *bochs_primary_plane(struct drm_device *dev)