From patchwork Wed Jul 5 15:26:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13302347 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 08EB9EB64DA for ; Wed, 5 Jul 2023 15:26:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 393AC10E38D; Wed, 5 Jul 2023 15:26:28 +0000 (UTC) Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2030410E38D for ; Wed, 5 Jul 2023 15:26:26 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5979:7b6f:39a:b9cb]) by laurent.telenet-ops.be with bizsmtp id HTSR2A00A45Xpxs01TSRp8; Wed, 05 Jul 2023 17:26:25 +0200 Received: from rox.of.borg ([192.168.97.57] helo=rox) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qH4Ob-000ck4-Ma; Wed, 05 Jul 2023 17:26:25 +0200 Received: from geert by rox with local (Exim 4.95) (envelope-from ) id 1qH4Of-00AwXW-94; Wed, 05 Jul 2023 17:26:25 +0200 From: Geert Uytterhoeven To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/3] util: Add NV24 and NV42 frame buffer formats Date: Wed, 5 Jul 2023 17:26:15 +0200 Message-Id: <6cbabaedec836a3a1da332644d4129343fca44b0.1688570702.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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: linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Geert Uytterhoeven Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add the missing entries for semi-planar YUV formats with non-subsampled chroma planes. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart --- tests/util/format.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/util/format.c b/tests/util/format.c index 1ca1b82ce947b2f4..f825027227ddba24 100644 --- a/tests/util/format.c +++ b/tests/util/format.c @@ -51,6 +51,8 @@ static const struct util_format_info format_info[] = { { DRM_FORMAT_NV21, "NV21", MAKE_YUV_INFO(YUV_YCrCb, 2, 2, 2) }, { DRM_FORMAT_NV16, "NV16", MAKE_YUV_INFO(YUV_YCbCr, 2, 1, 2) }, { DRM_FORMAT_NV61, "NV61", MAKE_YUV_INFO(YUV_YCrCb, 2, 1, 2) }, + { DRM_FORMAT_NV24, "NV24", MAKE_YUV_INFO(YUV_YCbCr, 1, 1, 2) }, + { DRM_FORMAT_NV42, "NV42", MAKE_YUV_INFO(YUV_YCrCb, 1, 1, 2) }, /* YUV planar */ { DRM_FORMAT_YUV420, "YU12", MAKE_YUV_INFO(YUV_YCbCr, 2, 2, 1) }, { DRM_FORMAT_YVU420, "YV12", MAKE_YUV_INFO(YUV_YCrCb, 2, 2, 1) }, From patchwork Wed Jul 5 15:26:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13302349 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 32E62EB64DA for ; Wed, 5 Jul 2023 15:26:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9B6B010E394; Wed, 5 Jul 2023 15:26:31 +0000 (UTC) Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5486710E38E for ; Wed, 5 Jul 2023 15:26:28 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5979:7b6f:39a:b9cb]) by baptiste.telenet-ops.be with bizsmtp id HTSR2A00G45Xpxs01TSRMZ; Wed, 05 Jul 2023 17:26:25 +0200 Received: from rox.of.borg ([192.168.97.57] helo=rox) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qH4Ob-000ck6-Mx; Wed, 05 Jul 2023 17:26:25 +0200 Received: from geert by rox with local (Exim 4.95) (envelope-from ) id 1qH4Of-00AwXZ-9g; Wed, 05 Jul 2023 17:26:25 +0200 From: Geert Uytterhoeven To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 2/3] util: Add pattern support for DRM_FORMAT_NV{24, 42} Date: Wed, 5 Jul 2023 17:26:16 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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: linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Geert Uytterhoeven Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add support for drawing the SMPTE and tiles patterns in buffers using semi-planar YUV formats with non-subsampled chroma planes. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart --- tests/util/pattern.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/util/pattern.c b/tests/util/pattern.c index 158c0b160a2ee870..f45a26ccec38f202 100644 --- a/tests/util/pattern.c +++ b/tests/util/pattern.c @@ -698,6 +698,8 @@ static void fill_smpte(const struct util_format_info *info, void *planes[3], case DRM_FORMAT_NV21: case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: + case DRM_FORMAT_NV24: + case DRM_FORMAT_NV42: u = info->yuv.order & YUV_YCbCr ? planes[1] : planes[1] + 1; v = info->yuv.order & YUV_YCrCb ? planes[1] : planes[1] + 1; return fill_smpte_yuv_planar(&info->yuv, planes[0], u, v, @@ -1023,6 +1025,8 @@ static void fill_tiles(const struct util_format_info *info, void *planes[3], case DRM_FORMAT_NV21: case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: + case DRM_FORMAT_NV24: + case DRM_FORMAT_NV42: u = info->yuv.order & YUV_YCbCr ? planes[1] : planes[1] + 1; v = info->yuv.order & YUV_YCrCb ? planes[1] : planes[1] + 1; return fill_tiles_yuv_planar(info, planes[0], u, v, From patchwork Wed Jul 5 15:26:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13302350 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 C7677EB64DA for ; Wed, 5 Jul 2023 15:26:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2977C10E396; Wed, 5 Jul 2023 15:26:32 +0000 (UTC) Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6539F10E394 for ; Wed, 5 Jul 2023 15:26:28 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:5979:7b6f:39a:b9cb]) by andre.telenet-ops.be with bizsmtp id HTSR2A00J45Xpxs01TSRt7; Wed, 05 Jul 2023 17:26:25 +0200 Received: from rox.of.borg ([192.168.97.57] helo=rox) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qH4Ob-000ckB-NU; Wed, 05 Jul 2023 17:26:25 +0200 Received: from geert by rox with local (Exim 4.95) (envelope-from ) id 1qH4Of-00AwXe-AH; Wed, 05 Jul 2023 17:26:25 +0200 From: Geert Uytterhoeven To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 3/3] modetest: Add support for DRM_FORMAT_NV{24,42} Date: Wed, 5 Jul 2023 17:26:17 +0200 Message-Id: <1e43eba23f3a73ed4c18ec4516869a5abc39a475.1688570702.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: 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: linux-renesas-soc@vger.kernel.org, Laurent Pinchart , Geert Uytterhoeven Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add support for creating buffers using semi-planar YUV formats with non-subsampled chroma planes. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart --- tests/modetest/buffers.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c index 0b55aeddfef9a854..0605b12552bb8eec 100644 --- a/tests/modetest/buffers.c +++ b/tests/modetest/buffers.c @@ -129,6 +129,8 @@ bo_create(int fd, unsigned int format, case DRM_FORMAT_NV21: case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: + case DRM_FORMAT_NV24: + case DRM_FORMAT_NV42: case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: bpp = 8; @@ -208,6 +210,11 @@ bo_create(int fd, unsigned int format, virtual_height = height * 2; break; + case DRM_FORMAT_NV24: + case DRM_FORMAT_NV42: + virtual_height = height * 3; + break; + default: virtual_height = height; break; @@ -255,6 +262,19 @@ bo_create(int fd, unsigned int format, planes[1] = virtual + offsets[1]; break; + case DRM_FORMAT_NV24: + case DRM_FORMAT_NV42: + offsets[0] = 0; + handles[0] = bo->handle; + pitches[0] = bo->pitch; + pitches[1] = pitches[0] * 2; + offsets[1] = pitches[0] * height; + handles[1] = bo->handle; + + planes[0] = virtual; + planes[1] = virtual + offsets[1]; + break; + case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: offsets[0] = 0;