drm/amd/display: Add assert that chroma pitch is non zero
authorJulian Parkin <jparkin@amd.com>
Fri, 13 Apr 2018 17:23:02 +0000 (13:23 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:44:12 +0000 (13:44 -0500)
Signed-off-by: Julian Parkin <jparkin@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c

index 159bebcfd52176f2b71605a3f71c2cad2f1c2a9e..0cbc83edd37ff12708b65523eb6a076221a31e0d 100644 (file)
@@ -146,6 +146,9 @@ void hubp1_program_size_and_rotation(
         * 444 or 420 luma
         */
        if (format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN) {
+               ASSERT(plane_size->video.chroma_pitch != 0);
+               /* Chroma pitch zero can cause system hang! */
+
                pitch = plane_size->video.luma_pitch - 1;
                meta_pitch = dcc->video.meta_pitch_l - 1;
                pitch_c = plane_size->video.chroma_pitch - 1;