summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>2017-05-11 01:05:02 +0300
committerAlex Deucher <alexander.deucher@amd.com>2017-09-27 01:07:08 +0300
commitb71a061801cb431d23854e0b6a6b7c04fa1f4c83 (patch)
tree4f00b6e837e301d35506c5ef6ddd174c91505133
parent0e12c3f6a0a4e73c6b6d11b7aebf20b7026ef18f (diff)
downloadlinux-b71a061801cb431d23854e0b6a6b7c04fa1f4c83.tar.xz
drm/amd/display: fix scaling info based surface update type check
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c47
1 files changed, 13 insertions, 34 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index bc9808180346..6d56cb0c29cc 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1122,45 +1122,24 @@ static enum surface_update_type get_plane_info_update_type(
static enum surface_update_type get_scaling_info_update_type(
const struct dc_surface_update *u)
{
- struct dc_scaling_info temp_scaling_info = { { 0 } };
-
if (!u->scaling_info)
return UPDATE_TYPE_FAST;
- /* Copy all parameters that will cause a full update
- * from current surface, the rest of the parameters
- * from provided plane configuration.
- * Perform memory compare and special validation
- * for those that can cause fast/medium updates
- */
-
- /* Full Update Parameters */
- temp_scaling_info.dst_rect = u->surface->dst_rect;
- temp_scaling_info.src_rect = u->surface->src_rect;
- temp_scaling_info.scaling_quality = u->surface->scaling_quality;
-
- /* Special validation required */
- temp_scaling_info.clip_rect = u->scaling_info->clip_rect;
-
- if (memcmp(u->scaling_info, &temp_scaling_info,
- sizeof(struct dc_scaling_info)) != 0)
+ if (u->scaling_info->src_rect.width != u->surface->src_rect.width
+ || u->scaling_info->src_rect.height != u->surface->src_rect.height
+ || u->scaling_info->clip_rect.width != u->surface->clip_rect.width
+ || u->scaling_info->clip_rect.height != u->surface->clip_rect.height
+ || u->scaling_info->dst_rect.width != u->surface->dst_rect.width
+ || u->scaling_info->dst_rect.height != u->surface->dst_rect.height)
return UPDATE_TYPE_FULL;
- /* Check Clip rectangles if not equal
- * difference is in offsets == > UPDATE_TYPE_MED
- * difference is in dimensions == > UPDATE_TYPE_FULL
- */
- if (memcmp(&u->scaling_info->clip_rect,
- &u->surface->clip_rect, sizeof(struct rect)) != 0) {
- if ((u->scaling_info->clip_rect.height ==
- u->surface->clip_rect.height) &&
- (u->scaling_info->clip_rect.width ==
- u->surface->clip_rect.width)) {
- return UPDATE_TYPE_MED;
- } else {
- return UPDATE_TYPE_FULL;
- }
- }
+ if (u->scaling_info->src_rect.x != u->surface->src_rect.x
+ || u->scaling_info->src_rect.y != u->surface->src_rect.y
+ || u->scaling_info->clip_rect.x != u->surface->clip_rect.x
+ || u->scaling_info->clip_rect.y != u->surface->clip_rect.y
+ || u->scaling_info->dst_rect.x != u->surface->dst_rect.x
+ || u->scaling_info->dst_rect.y != u->surface->dst_rect.y)
+ return UPDATE_TYPE_MED;
return UPDATE_TYPE_FAST;
}