From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from delivery.antispam.mailspamprotection.com (delivery.antispam.mailspamprotection.com [185.56.87.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33DB433DEEB for ; Wed, 17 Dec 2025 08:08:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=185.56.87.11 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958927; cv=pass; b=OHfzB+Pi1EGKYFu3B/vYWSDDlE0ssDfo1S11Jg8V7/oFoH6Qir233BEJCEBHf8s5xE5S8wpi0gFCpFH3TyjJSzeYm+N3BUtHkDTPFbXi1to8LsXqV9jC85An+pP2aciGAyBG2m7KTMC9U0td8bgEZPTRuLi+cywMb6sw6wQdNQc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765958927; c=relaxed/simple; bh=RLHVmL+AkjHiZPjhRnlzFFYIAm6PoQJ2uSGv+KlV8j4=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Yov6NraRrT9gHSFnS0uqRDtBGcA34jfvNnv1ntGkAWITV2M+ESFyD5rwofE4WjGKEPmuRIqSw9r3vsaPbBptTx1ouMRxajqhGcDV5C3gUVsa6hruooibE0d9O6V0Mro9L2Bkdq2eGIb/aNez1QdutlpZBQ+LOQZSvu9uTwNJpFA= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it; spf=pass smtp.mailfrom=valla.it; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b=SsC590ZQ; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b=gZ6v+B3I; arc=pass smtp.client-ip=185.56.87.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=valla.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valla.it Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antispam.mailspamprotection.com header.i=@antispam.mailspamprotection.com header.b="SsC590ZQ"; dkim=pass (1024-bit key) header.d=valla.it header.i=@valla.it header.b="gZ6v+B3I" ARC-Seal: i=1; cv=none; a=rsa-sha256; d=outgoing.instance-europe-west4-qg89.prod.antispam.mailspamprotection.com; s=arckey; t=1765958925; b=d/hSbgrMpjIaDkOHo6l0dT5hvio2UJ3meS0o7b0EmM6OASkglO8G1KOU1VItXUi3FaQ75mCVNy recAIoIyb/r46t0e0uNRaTQq7UPuSvTDzjQuA74SUilMN1y39JrJ/evP6EXdy5uAcsE6x8eyFv vPDbQbvRWpb+r4l9zX96imrT0rNOOJvytU7n231DNDr/UYCt+NvwB/KqGsOFcFnWHhDh90ydIq hKN1Xp1K3qH237WzFjF3UjSDjq1aDoD+SLiAryR4F+OMWQxg49e8zFBs60KRt7s/b6ppJ1pQYF C4fJaaDP4IsHmenXE0npa1kZwg5jnSTJ9shYeho0BaYGcw==; ARC-Authentication-Results: i=1; outgoing.instance-europe-west4-qg89.prod.antispam.mailspamprotection.com; smtp.remote-ip=35.214.173.214; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=outgoing.instance-europe-west4-qg89.prod.antispam.mailspamprotection.com; s=arckey; t=1765958925; bh=RLHVmL+AkjHiZPjhRnlzFFYIAm6PoQJ2uSGv+KlV8j4=; h=Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date: Subject:From:DKIM-Signature:DKIM-Signature; b=sFlu43EJjMSULiZ7z+jpjTL5WEGoze6VuFKvp55ENooVHhLfTCyAWqv7YGLsqno+GBj8DcnaYM +dvuH6XaLo81As5D8zoca7cIqA/WKKLpsh7hiVnr9IKQKASrQT2oAuHOK+4ICwLctV3E+au47L ZaZyLIGtiIxhRtjXftcdUyUCN2cqIhoNtxcDctDcwXp4dD4a9lF1UhGfbQVx6AMZWLRFcEfEUo NtCQ69qUSkuTAVC265nKSGUBzot+/N7eiQgYSPLYr24RzM5mYyhxjCjZVhwFVJEdJbPC4hp+4p 8kBuZYhwl2XtQHMrXT6iCa5boVuNh5zNKUeqFLIxRO13fQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=antispam.mailspamprotection.com; s=default; h=CFBL-Feedback-ID:CFBL-Address :Cc:To:Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date: Subject:From:Reply-To:List-Unsubscribe; bh=kwfCrB1sYS5CS5f25/7ftLqKFwSCyzuSjhBagMuYb7o=; b=SsC590ZQqcstCwNNFVwaZ+4VZp TWwsl/dsAOxD9r4OABwiDMKKndQSfip30e3FbKuLqLIjcx4UINkrEiNkXSMovotCLzQFbfEfxHCUO z/SohJjxlOWduf4XKifowc0AB22RREF1EtOMlmtFVOUlKy5hcmi8N/jdO7W/0vfZ3Pg8=; Received: from 214.173.214.35.bc.googleusercontent.com ([35.214.173.214] helo=esm19.siteground.biz) by instance-europe-west4-qg89.prod.antispam.mailspamprotection.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1vVmaJ-00000000dF1-1NfT for linux-kernel@vger.kernel.org; Wed, 17 Dec 2025 08:08:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=valla.it; s=default; h=Cc:To:Date:Subject:From:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; bh=kwfCrB1sYS5CS5f25/7ftLqKFwSCyzuSjhBagMuYb7o=; b=gZ6v+B3IexNIUeooL/0LSGXjnc QoRRGYTSgM6F4vYpOj6kri81hyHJtxZhnk2bRcI7diOQLnC+bqxeHFoFXWpC0SXYUvMfrzj99qrf2 pz//m1r1bnNNRIbuaQWmB7sXN92J9C0mccQ1HE4SfMDv9FUBMUVuJum7r2AS7bxwYSJA=; Received: from [79.34.194.176] (port=63558 helo=[192.168.178.175]) by esm19.siteground.biz with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.1) (envelope-from ) id 1vVmZy-00000000ENx-21ZH; Wed, 17 Dec 2025 08:08:14 +0000 From: Francesco Valla Subject: [PATCH v3 0/3] drm/draw: add check API to avoid spurious WARN Date: Wed, 17 Dec 2025 09:06:53 +0100 Message-Id: <20251217-drm_draw_conv_check-v3-0-15b6f8bc1cbc@valla.it> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/23NTQrCMBCG4auUrI1MkqZaV95DpORnYoPaSlKiU np304LQRZfvB/PMSCIGj5GcipEETD76vsshdgUxrepuSL3NTThwyQAEteHZ2KDejem71JgWzZ3 WxgiQgNrKA8mXr4DOfxb1cs3d+jj04bs8SWxe/57c9BKjkNEjK20tKu6qc1KPh9r7gcxc4iuCl dsEzwRIjU6ghsrpFTFN0w+uSePl+AAAAA== X-Change-ID: 20251003-drm_draw_conv_check-9cc3050ebd57 To: Jocelyn Falempe , Javier Martinez Canillas , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Francesco Valla X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2257; i=francesco@valla.it; h=from:subject:message-id; bh=RLHVmL+AkjHiZPjhRnlzFFYIAm6PoQJ2uSGv+KlV8j4=; b=owGbwMvMwCX2aH1OUIzHTgbG02pJDJlOKVc3nLZOXBQvLrvlfPKswFPWrbuid/RXiBc8YzVdq +T0mutERykLgxgXg6yYIkvIuhv39sw1/5a2gfERzBxWJpAhDFycAjARk6WMDLNuKW+bueJo5+SL c8sqHFeVFhfyu9+VvrnlTZPjobKFsnsZ/mk1vVTd+FRjexojQ6F5QfTG9PrnHYoPdVOyD2yU9b5 bywkA X-Developer-Key: i=francesco@valla.it; a=openpgp; fpr=CC70CBC9AA13257C6CCED8669601767CA07CA0EA X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - esm19.siteground.biz X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - valla.it X-Source: X-Source-Args: X-Source-Dir: X-SGantispam-id: 4fcf2ba97cebc1d66013f3104e3aac0e AntiSpam-DLS: false AntiSpam-DLSP: AntiSpam-DLSRS: AntiSpam-TS: 1.0 CFBL-Address: feedback@antispam.mailspamprotection.com; report=arf CFBL-Feedback-ID: 1vVmaJ-00000000dF1-1NfT-feedback@antispam.mailspamprotection.com Authentication-Results: outgoing.instance-europe-west4-qg89.prod.antispam.mailspamprotection.com; iprev=pass (214.173.214.35.bc.googleusercontent.com) smtp.remote-ip=35.214.173.214; auth=pass (LOGIN) smtp.auth=esm19.siteground.biz; dkim=pass header.d=valla.it header.s=default header.a=rsa-sha256; arc=none When using the DRM draw support, the only way to check if a color can be converted from XRGB8888 to a target format is currently to attempt an actual conversion using drm_draw_color_from_xrgb8888(). This function however will print a WARN the first time a conversion cannot be performed, leading to two potential issues: - a WARN is emitted without a real reason if the caller is only attempting a conversion to check if a format can be supported (which is the case for two of the current user of this API); - a failing call following the first one is not emitting a WARN, but a "valid" color value (0x00000000) is returned nevertheless. The first issue was observed while using drm_log on a Beagleplay, which lists AR12 as the first format for its HDMI modesets. The target of this patch set is to improve this situation; the first patch introduces a new API devoted only to check if a conversion from XRGB8888 to the specified format can be performed, while the other two substitute drm_draw_color_from_xrgb8888() with this new API in the current users (drm_panic and drm_log) where relevant. Signed-off-by: Francesco Valla --- Changes in v3: - Collected R-b tags from Jocelyn (thank you!) - Link to v2: https://lore.kernel.org/r/20251014-drm_draw_conv_check-v2-0-05bef3eb06fb@valla.it Changes in v2: - Moved to dedicated switch cases in separate functions instead of single one inside common function. - Fix copy-paste error in commit message. Link to v1: https://lore.kernel.org/r/20251005-drm_draw_conv_check-v1-0-9c814d9362f6@valla.it --- Francesco Valla (3): drm/draw: add drm_draw_can_convert_from_xrgb8888 drm/log: avoid WARN when searching for usable format drm/panic: avoid WARN when checking format support drivers/gpu/drm/clients/drm_log.c | 2 +- drivers/gpu/drm/drm_draw.c | 29 +++++++++++++++++++++++++++++ drivers/gpu/drm/drm_draw_internal.h | 2 ++ drivers/gpu/drm/drm_panic.c | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) --- base-commit: ea1013c1539270e372fc99854bc6e4d94eaeff66 change-id: 20251003-drm_draw_conv_check-9cc3050ebd57 Best regards, -- Francesco Valla