hqd: Adjust resolution based on aspect ratio

When the MDP downscale path is enabled we assign the primary
resolution as the external display's dimensions. However, the
aspect ratios of the external and primary displays can be different.
As a result, directly assigning primary resolution could lead
to an incorrect final image.

We get around this by calculating a new resolution by
keeping aspect ratio intact.

Change-Id: I217718a5474862154fe60837fc6518408d2c32c7
2 files changed