]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Use drm_rect_translate_to()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 30 Sep 2019 13:42:13 +0000 (16:42 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 15 Oct 2019 14:45:57 +0000 (17:45 +0300)
Use the newly introduced drm_rect_translate_to() instead
of hand rolling it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930134214.24702-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display.c

index 1dc98a2d0b032a4ec5089614af25f469e92ced47..7cab9368e697736e3de20d6e5f0bdee4f892755f 100644 (file)
@@ -3476,9 +3476,8 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
         * Put the final coordinates back so that the src
         * coordinate checks will see the right values.
         */
-       drm_rect_translate(&plane_state->base.src,
-                          (x << 16) - plane_state->base.src.x1,
-                          (y << 16) - plane_state->base.src.y1);
+       drm_rect_translate_to(&plane_state->base.src,
+                             x << 16, y << 16);
 
        return 0;
 }
@@ -3700,9 +3699,8 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
         * Put the final coordinates back so that the src
         * coordinate checks will see the right values.
         */
-       drm_rect_translate(&plane_state->base.src,
-                          (src_x << 16) - plane_state->base.src.x1,
-                          (src_y << 16) - plane_state->base.src.y1);
+       drm_rect_translate_to(&plane_state->base.src,
+                             src_x << 16, src_y << 16);
 
        /* HSW/BDW do this automagically in hardware */
        if (!IS_HASWELL(dev_priv) && !IS_BROADWELL(dev_priv)) {