From patchwork Fri Jul 14 18:06:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Eduardo Gallo Filho X-Patchwork-Id: 13314136 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2FA94EB64DC for ; Fri, 14 Jul 2023 18:08:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 420DA10E8D0; Fri, 14 Jul 2023 18:08:48 +0000 (UTC) Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) by gabe.freedesktop.org (Postfix) with ESMTPS id AAA1410E8CF for ; Fri, 14 Jul 2023 18:08:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 6BCAB41619; Fri, 14 Jul 2023 20:08:43 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W4usPE5h62UI; Fri, 14 Jul 2023 20:08:42 +0200 (CEST) From: Carlos Eduardo Gallo Filho DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1689358122; bh=eNsFTZyfa6jXYsfPIjmOFdv9yK0UIKUp42WQf0szOjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CeWWvy+qKOSIZm0d1blt7ekEh1dNKxAhifeobOHgR2J6MI+ZWq+bxnh0WmT7faTbF qgvXwlIRm3VLo98NJpvOFTHLoOc22o/YiDgfhefTlluRMmR4ur48y8qrqsLXmq7O2y Zic1eaAzSOSN1DJOxok2S5DtTY2GMYq7qOSdH5aHuoJB3mj31RlnRHX3/IErVygzKn xuCDlet+bVK62QMoPaxKN5FJ/C6AEh4rwzysTiSEhy6PfTW6Nh4jZRF6SfuVNdqRj8 QFrihufTRGiiBbLBbhtp/VE5gnK+Xln0W23fRPifZjANu5qE6HsX6cTwRSMxXpigu9 qT7OsR/RtLajQ== To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/tests: Add parameters to the drm_test_framebuffer_create test Date: Fri, 14 Jul 2023 15:06:18 -0300 Message-ID: <20230714180619.15850-4-gcarlos@disroot.org> In-Reply-To: <20230714180619.15850-1-gcarlos@disroot.org> References: <20230714180619.15850-1-gcarlos@disroot.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andrealmeid@igalia.com, tzimmermann@suse.de, tales.aparecida@gmail.com, mripard@kernel.org, mairacanal@riseup.net, Carlos Eduardo Gallo Filho , davidgow@google.com, michal.winiarski@intel.com, arthurgrillo@riseup.net Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Extend the existing test case to cover: 1. Invalid flag atribute in the struct drm_mode_fb_cmd2. 2. Pixel format which requires non-linear modifier with DRM_FORMAT_MOD_LINEAR set. 3. Non-zero buffer offset for an unused plane Signed-off-by: Carlos Eduardo Gallo Filho --- drivers/gpu/drm/tests/drm_framebuffer_test.c | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/tests/drm_framebuffer_test.c b/drivers/gpu/drm/tests/drm_framebuffer_test.c index 175146f7ac9e..1fbb534b2e22 100644 --- a/drivers/gpu/drm/tests/drm_framebuffer_test.c +++ b/drivers/gpu/drm/tests/drm_framebuffer_test.c @@ -20,6 +20,8 @@ #define MIN_HEIGHT 4 #define MAX_HEIGHT 4096 +#define DRM_MODE_FB_INVALID BIT(2) + struct drm_framebuffer_test { int buffer_created; struct drm_mode_fb_cmd2 cmd; @@ -84,6 +86,18 @@ static const struct drm_framebuffer_test drm_framebuffer_create_cases[] = { .pitches = { 4 * MAX_WIDTH, 0, 0 }, } }, +{ .buffer_created = 0, .name = "ABGR8888 Non-zero buffer offset for unused plane", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, UINT_MAX / 2, 0 }, + .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + } +}, +{ .buffer_created = 0, .name = "ABGR8888 Invalid flag", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, + .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 }, + .pitches = { 4 * MAX_WIDTH, 0, 0 }, .flags = DRM_MODE_FB_INVALID, + } +}, { .buffer_created = 1, .name = "ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers", .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_ABGR8888, .handles = { 1, 0, 0 }, .offsets = { UINT_MAX / 2, 0, 0 }, @@ -263,6 +277,13 @@ static const struct drm_framebuffer_test drm_framebuffer_create_cases[] = { .pitches = { MAX_WIDTH, DIV_ROUND_UP(MAX_WIDTH, 2), DIV_ROUND_UP(MAX_WIDTH, 2) }, } }, +{ .buffer_created = 0, .name = "YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR)", + .cmd = { .width = MAX_WIDTH, .height = MAX_HEIGHT, .pixel_format = DRM_FORMAT_YUV420_10BIT, + .handles = { 1, 0, 0 }, .flags = DRM_MODE_FB_MODIFIERS, + .modifier = { DRM_FORMAT_MOD_LINEAR, 0, 0 }, + .pitches = { MAX_WIDTH, 0, 0 }, + } +}, { .buffer_created = 1, .name = "X0L2 Normal sizes", .cmd = { .width = 600, .height = 600, .pixel_format = DRM_FORMAT_X0L2, .handles = { 1, 0, 0 }, .pitches = { 1200, 0, 0 }