video: ARM CLCD: Fix calculation of bits-per-pixel
authorJon Medhurst (Tixy) <tixy@linaro.org>
Wed, 20 Aug 2014 12:41:04 +0000 (13:41 +0100)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 26 Aug 2014 09:50:27 +0000 (12:50 +0300)
If the device-tree specifies a max-memory-bandwidth property then the
CLCD driver uses that to calculate the bits-per-pixel supported,
however, this calculation is faulty for two reasons.

1. It doesn't ensure that the result is a sane value, i.e. a power of 2
   and <= 32 as the rest of the code assumes.

2. It uses the displayed resolution and calculates the average bandwidth
   across the whole frame. It should instead calculate the peak
   bandwidth based on the pixel clock.

This patch fixes both the above.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

No differences found