Skip to content

Commit dcdef1a

Browse files
committed
drm/i915: Use drm_rect_translate_to()
Use the newly introduced drm_rect_translate_to() instead of hand rolling it. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Jani Nikula <[email protected]>
1 parent 3e30d70 commit dcdef1a

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/gpu/drm/i915/display/intel_display.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,9 +3476,8 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
34763476
* Put the final coordinates back so that the src
34773477
* coordinate checks will see the right values.
34783478
*/
3479-
drm_rect_translate(&plane_state->base.src,
3480-
(x << 16) - plane_state->base.src.x1,
3481-
(y << 16) - plane_state->base.src.y1);
3479+
drm_rect_translate_to(&plane_state->base.src,
3480+
x << 16, y << 16);
34823481

34833482
return 0;
34843483
}
@@ -3700,9 +3699,8 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
37003699
* Put the final coordinates back so that the src
37013700
* coordinate checks will see the right values.
37023701
*/
3703-
drm_rect_translate(&plane_state->base.src,
3704-
(src_x << 16) - plane_state->base.src.x1,
3705-
(src_y << 16) - plane_state->base.src.y1);
3702+
drm_rect_translate_to(&plane_state->base.src,
3703+
src_x << 16, src_y << 16);
37063704

37073705
/* HSW/BDW do this automagically in hardware */
37083706
if (!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv)) {

0 commit comments

Comments
 (0)