]> git.baikalelectronics.ru Git - kernel.git/commit
drm/gma500: Fixup fbdev stolen size usage evaluation
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 7 Nov 2019 15:30:48 +0000 (16:30 +0100)
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Tue, 19 Nov 2019 20:41:49 +0000 (21:41 +0100)
commit7346509e2fb0ee7925807d10b37dba3fcf31d5f1
tree398e69dcbf4bb616f378eb1399bec3559491425c
parente75c4fdffe458d7b06079d29c9bec965630321cd
drm/gma500: Fixup fbdev stolen size usage evaluation

psbfb_probe performs an evaluation of the required size from the stolen
GTT memory, but gets it wrong in two distinct ways:
- The resulting size must be page-size-aligned;
- The size to allocate is derived from the surface dimensions, not the fb
  dimensions.

When two connectors are connected with different modes, the smallest will
be stored in the fb dimensions, but the size that needs to be allocated must
match the largest (surface) dimensions. This is what is used in the actual
allocation code.

Fix this by correcting the evaluation to conform to the two points above.
It allows correctly switching to 16bpp when one connector is e.g. 1920x1080
and the other is 1024x768.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191107153048.843881-1-paul.kocialkowski@bootlin.com
drivers/gpu/drm/gma500/framebuffer.c