]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Use drm_rect_init()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 30 Sep 2019 13:42:14 +0000 (16:42 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 15 Oct 2019 14:46:06 +0000 (17:46 +0300)
Use the new drm_rect_init() helper where appropriate.

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

index 7cab9368e697736e3de20d6e5f0bdee4f892755f..7d7d1859775a2b0412b0c5dfb8724ca1029e457a 100644 (file)
@@ -2733,10 +2733,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
                                size++;
 
                        /* rotate the x/y offsets to match the GTT view */
-                       r.x1 = x;
-                       r.y1 = y;
-                       r.x2 = x + width;
-                       r.y2 = y + height;
+                       drm_rect_init(&r, x, y, width, height);
                        drm_rect_rotate(&r,
                                        rot_info->plane[i].width * tile_width,
                                        rot_info->plane[i].height * tile_height,
@@ -2858,10 +2855,7 @@ intel_plane_remap_gtt(struct intel_plane_state *plane_state)
                        struct drm_rect r;
 
                        /* rotate the x/y offsets to match the GTT view */
-                       r.x1 = x;
-                       r.y1 = y;
-                       r.x2 = x + width;
-                       r.y2 = y + height;
+                       drm_rect_init(&r, x, y, width, height);
                        drm_rect_rotate(&r,
                                        info->plane[i].width * tile_width,
                                        info->plane[i].height * tile_height,
index 633fa80693481ed87f1b56e455bdc91ad9b69e06..5ae12ab3c5b70df92f84021c072ddef9d8865995 100644 (file)
@@ -287,10 +287,8 @@ int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state)
        src_y = src->y1 >> 16;
        src_h = drm_rect_height(src) >> 16;
 
-       src->x1 = src_x << 16;
-       src->x2 = (src_x + src_w) << 16;
-       src->y1 = src_y << 16;
-       src->y2 = (src_y + src_h) << 16;
+       drm_rect_init(src, src_x << 16, src_y << 16,
+                     src_w << 16, src_h << 16);
 
        if (!fb->format->is_yuv)
                return 0;