History

drm/i915: Make sure plane dims are correct for UV CCS planes

As intel_fb_plane_get_subsampling() returns the subsampling factor wrt. its main plane, for a CCS plane we need to apply both the main and the CCS plane's subsampling factor on the FB's dimensions to get the CCS plane's dimensions.

Imre Deak committed 6 years ago

Commit 577687b1 parent 5cf15df1 file · +6 −2Browse files

Unified · Split

drivers/gpu/drm/i915/display/intel_display.c+6−2
@@ -2913,11 +2913,15 @@ intel_fb_check_ccs_xy(struct drm_framebuffer *fb, int ccs_plane, int x, int y) · 2912 unmodified lines
29132913 static void
29142914 intel_fb_plane_dims(int *w, int *h, struct drm_framebuffer *fb, int color_plane)
29152915 {
2916+ int main_plane = is_ccs_plane(fb, color_plane) ?
2917+ ccs_to_main_plane(fb, color_plane) : 0;
2918+ int main_hsub, main_vsub;
29162919 int hsub, vsub;
29172920
2921+ intel_fb_plane_get_subsampling(&main_hsub, &main_vsub, fb, main_plane);
29182922 intel_fb_plane_get_subsampling(&hsub, &vsub, fb, color_plane);
2919− *w = fb->width / hsub;
2920− *h = fb->height / vsub;
2923+ *w = fb->width / main_hsub / hsub;
2924+ *h = fb->height / main_vsub / vsub;
29212925 }
29222926
29232927 /*