Skip to content

Commit

Permalink
drm/i915/fb: Fix rounding error in subsampled plane size calculation
Browse files Browse the repository at this point in the history
For NV12 FBs with odd main surface tile-row height the CCS surface
height was incorrectly calculated 1 less than the actual value. Fix this
by rounding up the result of divison. For consistency do the same for
the CCS surface width calculation.

Fixes: b3e57bc ("drm/i915/tgl: Gen-12 render decompression")
Signed-off-by: Imre Deak <[email protected]>
Reviewed-by: Juha-Pekka Heikkila <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit 2ee5ef9)
Signed-off-by: Rodrigo Vivi <[email protected]>
  • Loading branch information
ideak authored and rodrigovivi committed Nov 9, 2021
1 parent cecbc0c commit 90ab96f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/display/intel_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,8 @@ static void intel_fb_plane_dims(const struct intel_framebuffer *fb, int color_pl
intel_fb_plane_get_subsampling(&main_hsub, &main_vsub, &fb->base, main_plane);
intel_fb_plane_get_subsampling(&hsub, &vsub, &fb->base, color_plane);

*w = main_width / main_hsub / hsub;
*h = main_height / main_vsub / vsub;
*w = DIV_ROUND_UP(main_width, main_hsub * hsub);
*h = DIV_ROUND_UP(main_height, main_vsub * vsub);
}

static u32 intel_adjust_tile_offset(int *x, int *y,
Expand Down

0 comments on commit 90ab96f

Please sign in to comment.