From patchwork Fri Oct 13 14:43:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13420982 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 8F479CDB482 for ; Fri, 13 Oct 2023 14:43:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16B2110E5E0; Fri, 13 Oct 2023 14:43:43 +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 D09AA10E16B for ; Fri, 13 Oct 2023 14:43:24 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:f151:5551:1af6:b316]) by baptiste.telenet-ops.be with bizsmtp id xSjN2A00Z56FAx301SjN9S; Fri, 13 Oct 2023 16:43:22 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1qrJNi-006Gwd-Cz; Fri, 13 Oct 2023 16:43:17 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1qrJNl-002VpC-Qr; Fri, 13 Oct 2023 16:43:17 +0200 From: Geert Uytterhoeven To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm v4 1/9] util: improve SMPTE color LUT accuracy Date: Fri, 13 Oct 2023 16:43:03 +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: Sam Ravnborg , Geert Uytterhoeven Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fill in the LSB when converting color components from 8-bit to 16-bit. Signed-off-by: Geert Uytterhoeven Acked-by: Sam Ravnborg --- v4: - No changes, v3: - Add Acked-by, v2: - New. --- tests/util/pattern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/util/pattern.c b/tests/util/pattern.c index bd0989e6dbc6aa27..7d4f6610015e7464 100644 --- a/tests/util/pattern.c +++ b/tests/util/pattern.c @@ -646,9 +646,9 @@ void util_smpte_c8_gamma(unsigned size, struct drm_color_lut *lut) memset(lut, 0, size * sizeof(struct drm_color_lut)); #define FILL_COLOR(idx, r, g, b) \ - lut[idx].red = (r) << 8; \ - lut[idx].green = (g) << 8; \ - lut[idx].blue = (b) << 8 + lut[idx].red = (r) * 0x101; \ + lut[idx].green = (g) * 0x101; \ + lut[idx].blue = (b) * 0x101 FILL_COLOR( 0, 192, 192, 192); /* grey */ FILL_COLOR( 1, 192, 192, 0 ); /* yellow */