aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/i915/gvt/fb_decoder.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.c b/drivers/gpu/drm/i915/gvt/fb_decoder.c
index 72f42176f35c..6cc99543693f 100644
--- a/drivers/gpu/drm/i915/gvt/fb_decoder.c
+++ b/drivers/gpu/drm/i915/gvt/fb_decoder.c
@@ -222,6 +222,12 @@ int intel_vgpu_decode_primary_plane(struct intel_vgpu *vgpu,
222 val & PLANE_CTL_ORDER_RGBX, 222 val & PLANE_CTL_ORDER_RGBX,
223 val & PLANE_CTL_ALPHA_MASK, 223 val & PLANE_CTL_ALPHA_MASK,
224 val & PLANE_CTL_YUV422_ORDER_MASK); 224 val & PLANE_CTL_YUV422_ORDER_MASK);
225
226 if (fmt >= ARRAY_SIZE(skl_pixel_formats)) {
227 gvt_vgpu_err("Out-of-bounds pixel format index\n");
228 return -EINVAL;
229 }
230
225 plane->bpp = skl_pixel_formats[fmt].bpp; 231 plane->bpp = skl_pixel_formats[fmt].bpp;
226 plane->drm_format = skl_pixel_formats[fmt].drm_format; 232 plane->drm_format = skl_pixel_formats[fmt].drm_format;
227 } else { 233 } else {