From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ayan Halder Subject: [PATCH] drm/selftest:- Adding a new format(whose cpp=0) to be tested by igt_check_drm_format_min_pitch Date: Fri, 15 Mar 2019 15:50:34 +0000 Message-ID: <1552665027-16457-1-git-send-email-ayan.halder@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Ayan Halder , Liviu Dudau , "airlied@linux.ie" , "daniel@ffwll.ch" , "dri-devel@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" Cc: nd List-Id: dri-devel@lists.freedesktop.org We have introduced some new formats DRM_FORMAT_VUY101010, DRM_FORMAT_YUV420= _8BIT, and DRM_FORMAT_YUV420_10BIT whose cpp is 0 (as they are defined in bits per= pixel). We need to ensure that the pitch returned by drm_format_info_min_pitch() fo= r such formats is always 0. Signed-off-by: Ayan Kumar halder Depends on:- https://patchwork.freedesktop.org/patch/msgid/1552414556-5756-= 1-git-send-email-ayan.halder@arm.com --- drivers/gpu/drm/selftests/test-drm_format.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/selftests/test-drm_format.c b/drivers/gpu/drm/= selftests/test-drm_format.c index c5e212a..155e4ce 100644 --- a/drivers/gpu/drm/selftests/test-drm_format.c +++ b/drivers/gpu/drm/selftests/test-drm_format.c @@ -276,5 +276,14 @@ int igt_check_drm_format_min_pitch(void *ignored) FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX - 1) !=3D (uint64_t)(UINT_MAX - 1) * 2); =20 + /* Test format with cpp/char_per_block 0 */ + info =3D drm_format_info(DRM_FORMAT_VUY101010); + FAIL_ON(!info); + FAIL_ON(drm_format_info_min_pitch(info, 0, 0) !=3D 0); + FAIL_ON(drm_format_info_min_pitch(info, -1, 0) !=3D 0); + FAIL_ON(drm_format_info_min_pitch(info, 1, 0) !=3D 0); + FAIL_ON(drm_format_info_min_pitch(info, 0, 1) !=3D 0); + FAIL_ON(drm_format_info_min_pitch(info, 0, UINT_MAX) !=3D 0); + return 0; } --=20 2.7.4