Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191231233756.18753-5-imre.deak@intel.com

+6 -2
+6 -2
drivers/gpu/drm/i915/display/intel_display.c
··· 2913 2913 static void 2914 2914 intel_fb_plane_dims(int *w, int *h, struct drm_framebuffer *fb, int color_plane) 2915 2915 { 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; 2916 2919 int hsub, vsub; 2917 2920 2921 + intel_fb_plane_get_subsampling(&main_hsub, &main_vsub, fb, main_plane); 2918 2922 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; 2921 2925 } 2922 2926 2923 2927 /*