diff options
author | Kumar, Mahesh <[email protected]> | 2015-09-03 16:17:08 +0530 |
---|---|---|
committer | Daniel Vetter <[email protected]> | 2015-09-04 09:38:16 +0200 |
commit | 395ab7541a0e141ffbde127b534e44f28d39a050 (patch) | |
tree | 0a7889587ccd83d6241a211215565fc6b14cdb38 | |
parent | 58f2cf241fb98414e2e35fc3d4d0494eb30b3245 (diff) |
drm/i915/skl: Avoid using un-initialized bits_per_pixel
Don't rely on fb->bits_per_pixel as intel_framebuffer_init is not
filling bits_per_pixel field of fb-struct for YUV pixel format.
This leads to divide by zero error during watermark calculation.
Signed-off-by: Kumar, Mahesh <[email protected]>
Cc: Konduru, Chandra <[email protected]>
Reviewed-by: Sonika Jindal <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index ea4966144650..1b90f03f7025 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3170,7 +3170,8 @@ static void skl_compute_wm_pipe_parameters(struct drm_crtc *crtc, if (fb) { p->plane[0].enabled = true; p->plane[0].bytes_per_pixel = fb->pixel_format == DRM_FORMAT_NV12 ? - drm_format_plane_cpp(fb->pixel_format, 1) : fb->bits_per_pixel / 8; + drm_format_plane_cpp(fb->pixel_format, 1) : + drm_format_plane_cpp(fb->pixel_format, 0); p->plane[0].y_bytes_per_pixel = fb->pixel_format == DRM_FORMAT_NV12 ? drm_format_plane_cpp(fb->pixel_format, 0) : 0; p->plane[0].tiling = fb->modifier[0]; |