Refactor bytes-per-pixel computation

The computation of bytes-per-pixel was assuming that bpp was evenly
divisible by 8.

Also, since we actually use bytes per pixel very often and it is constant
for a given bo, let's just precompute it provide an accessor

BUG=chrome-os-partner:15240
TEST=manual, plug/unplug external monitor; xrandr --auto

Original-Change-Id: Ibdf089fb5e2ab89383c193eb5f0d9770b9dbd011
(cherry picked from commit f07ffb2fdb2992b64fec248eaf65a5e3a66136ec)
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>

Change-Id: I9cd9bb0bdd7307a1f80d8c0fae68909da9502306
Reviewed-on: https://gerrit.chromium.org/gerrit/36169
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
3 files changed