Skip to content

Commit fc1a0fb

Browse files
committed
drm/i915: Use drm_rect_init()
Use the new drm_rect_init() helper where appropriate. 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 dcdef1a commit fc1a0fb

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,10 +2733,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
27332733
size++;
27342734

27352735
/* rotate the x/y offsets to match the GTT view */
2736-
r.x1 = x;
2737-
r.y1 = y;
2738-
r.x2 = x + width;
2739-
r.y2 = y + height;
2736+
drm_rect_init(&r, x, y, width, height);
27402737
drm_rect_rotate(&r,
27412738
rot_info->plane[i].width * tile_width,
27422739
rot_info->plane[i].height * tile_height,
@@ -2858,10 +2855,7 @@ intel_plane_remap_gtt(struct intel_plane_state *plane_state)
28582855
struct drm_rect r;
28592856

28602857
/* rotate the x/y offsets to match the GTT view */
2861-
r.x1 = x;
2862-
r.y1 = y;
2863-
r.x2 = x + width;
2864-
r.y2 = y + height;
2858+
drm_rect_init(&r, x, y, width, height);
28652859
drm_rect_rotate(&r,
28662860
info->plane[i].width * tile_width,
28672861
info->plane[i].height * tile_height,

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,8 @@ int intel_plane_check_src_coordinates(struct intel_plane_state *plane_state)
287287
src_y = src->y1 >> 16;
288288
src_h = drm_rect_height(src) >> 16;
289289

290-
src->x1 = src_x << 16;
291-
src->x2 = (src_x + src_w) << 16;
292-
src->y1 = src_y << 16;
293-
src->y2 = (src_y + src_h) << 16;
290+
drm_rect_init(src, src_x << 16, src_y << 16,
291+
src_w << 16, src_h << 16);
294292

295293
if (!fb->format->is_yuv)
296294
return 0;

0 commit comments

Comments
 (0)