diff options
author | 2020-01-15 01:36:11 +0000 | |
---|---|---|
committer | 2020-01-15 01:36:11 +0000 | |
commit | daf7a9c36d28b739aaad75d1d12a3a2dd437b90b (patch) | |
tree | 05451daaf357fa22e1a77d04d45ca2b504e660ab | |
parent | Do not redirect already quiet stdout for IPv6 reject routes (diff) | |
download | wireguard-openbsd-daf7a9c36d28b739aaad75d1d12a3a2dd437b90b.tar.xz wireguard-openbsd-daf7a9c36d28b739aaad75d1d12a3a2dd437b90b.zip |
drm/fb-helper: Round up bits_per_pixel if possible
From Geert Uytterhoeven
779f5790fa47d8175b7346449a036f37f5717778 in linux 4.19.y/4.19.96
f30e27779d3031a092c2a177b7fb76adccc45241 in mainline linux
-rw-r--r-- | sys/dev/pci/drm/drm_fb_helper.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_fb_helper.c b/sys/dev/pci/drm/drm_fb_helper.c index d95b8acbebd..ec838933054 100644 --- a/sys/dev/pci/drm/drm_fb_helper.c +++ b/sys/dev/pci/drm/drm_fb_helper.c @@ -1742,7 +1742,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, * Changes struct fb_var_screeninfo are currently not pushed back * to KMS, hence fail if different settings are requested. */ - if (var->bits_per_pixel != fb->format->cpp[0] * 8 || + if (var->bits_per_pixel > fb->format->cpp[0] * 8 || var->xres > fb->width || var->yres > fb->height || var->xres_virtual > fb->width || var->yres_virtual > fb->height) { DRM_DEBUG("fb requested width/height/bpp can't fit in current fb " @@ -1768,6 +1768,11 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, } /* + * Likewise, bits_per_pixel should be rounded up to a supported value. + */ + var->bits_per_pixel = fb->format->cpp[0] * 8; + + /* * drm fbdev emulation doesn't support changing the pixel format at all, * so reject all pixel format changing requests. */ |