diff options
author | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-11-09 05:26:33 -0500 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-11-09 09:30:45 -0500 |
commit | eb8dd3abeb4dffab6c373e87d09fc3b5858ac158 (patch) | |
tree | 6a11d8e5802173bc18f38fd296f8f85f97fafbc9 | |
parent | 0560054da5673b25d56bea6c57c8d069673af73b (diff) |
drm/vc4: Prefer PPF over TPZ when dst >= 2/3 src
The HVS spec recommends using PPF when the downscaling ratio is
between 2/3 and 1. Let's modify vc4_get_scaling_mode() to follow this
recommendation.
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20181109102633.32603-2-boris.brezillon@bootlin.com
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_plane.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 6caa678edcff..1728fb7d00ba 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c | |||
@@ -129,12 +129,12 @@ static const struct hvs_format *vc4_get_hvs_format(u32 drm_format) | |||
129 | 129 | ||
130 | static enum vc4_scaling_mode vc4_get_scaling_mode(u32 src, u32 dst) | 130 | static enum vc4_scaling_mode vc4_get_scaling_mode(u32 src, u32 dst) |
131 | { | 131 | { |
132 | if (dst > src) | 132 | if (dst == src) |
133 | return VC4_SCALING_NONE; | ||
134 | if (3 * dst >= 2 * src) | ||
133 | return VC4_SCALING_PPF; | 135 | return VC4_SCALING_PPF; |
134 | else if (dst < src) | ||
135 | return VC4_SCALING_TPZ; | ||
136 | else | 136 | else |
137 | return VC4_SCALING_NONE; | 137 | return VC4_SCALING_TPZ; |
138 | } | 138 | } |
139 | 139 | ||
140 | static bool plane_enabled(struct drm_plane_state *state) | 140 | static bool plane_enabled(struct drm_plane_state *state) |