drm: move native byte order quirk to new drm_driver_legacy_fb_format function
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 21 Sep 2018 13:46:59 +0000 (15:46 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 25 Sep 2018 12:49:49 +0000 (14:49 +0200)
commit059b5eb5d9554dea689430ad3872dcb37a35053d
tree72a9d8be21a6b1a1163f4ebd30d44f3d9ab2c2e7
parentaf334c5d41a9d3b9df3204d50a9a8f566ef64c66
drm: move native byte order quirk to new drm_driver_legacy_fb_format function

Turns out we need the pixel format fixup not only for the addfb ioctl,
but also for fbdev emulation code.

Ideally we would place it in drm_mode_legacy_fb_format().  That would
create alot of churn though, and most drivers don't care because they
never ever run on a big endian platform.  So add a new
drm_driver_legacy_fb_format() function instead which looks at the
mode_config->quirk_addfb_prefer_host_byte_order flag.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20180921134704.12826-2-kraxel@redhat.com
drivers/gpu/drm/drm_fourcc.c
drivers/gpu/drm/drm_framebuffer.c
include/drm/drm_fourcc.h