From patchwork Thu Apr 6 11:53:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Grillo X-Patchwork-Id: 13203229 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 D0062C76196 for ; Thu, 6 Apr 2023 11:54:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F7CD10E0F3; Thu, 6 Apr 2023 11:54:04 +0000 (UTC) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by gabe.freedesktop.org (Postfix) with ESMTPS id C198E10E0F3 for ; Thu, 6 Apr 2023 11:54:01 +0000 (UTC) Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4PsfzY0WGzzDqT0; Thu, 6 Apr 2023 11:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1680782041; bh=kd3CsBc+oDe96DQJYr6v0/y5ofANxR1YpVaEnnPaE8c=; h=From:To:Cc:Subject:Date:From; b=MZIzXOJ/inOJbgo9u6uHu+cwugiGkHcdXL6cunHTjp2EzbaNua/o/ufv52iVk4I7l kZuocM+N2aZh5V8TGNP8wQfWhh62ZO/dbWYfhcGjKKsHlK+D9NDBCIR53y3EQg86K0 bKnNpGMC/aFXmaarGQB+e3qS+f1o3Oo9nizwYyLw= X-Riseup-User-ID: E3C609D3AB9849FC759BF5E9A4C35C677F22F579ACFC604C2720051C0ADD5A45 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4PsfzR263zz1yTd; Thu, 6 Apr 2023 11:53:54 +0000 (UTC) From: Arthur Grillo To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 0/5] Create tests for the drm_rect functions Date: Thu, 6 Apr 2023 08:53:33 -0300 Message-Id: <20230406115338.36228-1-arthurgrillo@riseup.net> 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: carlos.craveiro@usp.br, tales.aparecida@gmail.com, dlatypov@google.com, javierm@redhat.com, mairacanal@riseup.net, maxime@cerno.tech, andrealmeid@riseup.net, Arthur Grillo , matheus.vieira.g@usp.br Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This patchset seeks to add unit tests for the rest of the functions on the drm_rect.c. The test coverage report generated by the gcov[1] tool states that this set reaches 100% of coverage on the drm_rect.c file. This would be very good for future development on the file. If you want to see the coverage report, I uploaded on the link below: https://grillo-0.github.io/coverage-reports/more-rect-tests/drivers/gpu/drm/drm_rect.c.gcov.html Thanks for reviewing! Best regards, ~Arthur Grillo --- v1->v2: https://lore.kernel.org/all/20230322140701.69852-1-arthurgrillo@riseup.net/ - Create parameterized tests for drm_rect_intersect(). - Use .16 binary fixed point values on the drm_rect_calc_hscale() and drm_rect_calc_vscale() tests. - Replace INT_MIN for 0 on the on the drm_rect_calc_hscale() and drm_rect_calc_vscale() tests. - Assign nonzero values to the width and height parameters of the drm_rect_rotate() and drm_rect_rotate_inv() tests. - Switch memcpy to a simple variable assignment on the drm_rect_rotate() and drm_rect_rotate_inv() tests. v2->v3: https://lore.kernel.org/all/20230327133848.5250-1-arthurgrillo@riseup.net/ - Change "x" to lowercase on the drm_rect_intersect() cases. - Remove the option for no description on the drm_rect_intersect() cases. - Add a test for rects with zero height and width on the drm_rect_intersect(). - Switch to parameterized tests for drm_rect_calc_hscale() and drm_rect_calc_vscale(). - Add a test for a dst drm_rect with zero width for drm_rect_calc_hscale() and zero height for drm_rect_calc_vscale(). - Place an "-" on the drm_rect_rotate case names to match the userspace. - s/drm_rect_case_desc/drm_rect_rotate_case_desc/ - Improve the commit messages. v3->v4: https://lore.kernel.org/all/20230404184158.26290-1-arthurgrillo@riseup.net/ - Place parenthesis around .16 fixed point values before making it negative to avoid error when generating tests coverages. --- [1]: https://gcc.gnu.org/onlinedocs/gcc/Gcov.html#Gcov --- Arthur Grillo (5): drm/tests: Add test cases for drm_rect_intersect() drm/tests: Add test cases for drm_rect_calc_hscale() drm/tests: Add test cases for drm_rect_calc_vscale() drm/tests: Add test cases for drm_rect_rotate() drm/test: Add test cases for drm_rect_rotate_inv() drivers/gpu/drm/tests/drm_rect_test.c | 362 ++++++++++++++++++++++++++ 1 file changed, 362 insertions(+)