MMFMWK-7806: drm: imx: dcss: check up/down scale ratios
authorLaurentiu Palcu <laurentiu.palcu@nxp.com>
Wed, 6 Dec 2017 09:03:50 +0000 (11:03 +0200)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit8488a2f7ada04da9162a30f7c8e224d7f1b96415
tree21cd5aa8e9b3ce32b5a7a0a26fcd652f844af161
parent229fbcc6e16a65601a141f7e3fdb4b5584765199
MMFMWK-7806: drm: imx: dcss: check up/down scale ratios

When scaling up/down, DCSS has limits that cannot be exceeded. This
patch adds checks before the plane is updated and rejects those planes
that exceed the up/down scale limits.

Currently, the limit is 3:1 for downscaling and 1:3 for upscaling for
both video and graphics channels.

When support for WR_SCL/RD_SRC will be added, these limits will increase
to the following values:
 * video: 7:1 downscale, 1:7 upscale
 * graphics: 5:1 downscale, 1:5 upscale

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
drivers/gpu/drm/imx/dcss/dcss-plane.c
drivers/gpu/imx/dcss/dcss-scaler.c
include/video/imx-dcss.h