qxl: refactor rounding up to a nearest power of 2