From patchwork Mon Dec 12 18:21:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071327 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 8F140C4332F for ; Mon, 12 Dec 2022 18:22:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC5BD10E25E; Mon, 12 Dec 2022 18:22:15 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2049.outbound.protection.outlook.com [40.107.92.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id C542D10E24D; Mon, 12 Dec 2022 18:22:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGipPqGvuJkunQZeMIewfmEHBVcxlSVelzjAavY7z5q7faJ3RSULZ6dpB+Wa5UDwhdLBls7pdkVvQwkG8XfWrVou0pZEdZzhbNo+5FGoFBfAs3RKDIkQKLVtCLvJb6rp2xypqsHr++mH8ZeKB/fObXy3nCMJTvHgnohjFvqGEVKMwwaLDKr+ATFiMQtvSsjHhVFDduywe6m61vXLhzzYLMtdDEF+osJh8P2IWOYcWO3dMtv8aKWx8bOEvVYdEPgXVS/qysE/ec7WVw2JrGyNaGo/Pc5cgO6vt9KC9JM5pCWI90BSpIpUdB+DZPRS/75PxypdRwDZP7EgCBqjvYgd7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cC+/yyhzUL9R1NeoQ+82scgpsMR0VgmOzjoc3lGhOaE=; b=DAp/mgMzAhqg4QjUHYY8+CmQ7T6GUsuch8ghSKQwc79QLXTB3IOPhk6GKzAEUT6Bgo/6OhDFhPvSXfPUUZlrjQKTb5ecCwdFAvV8eshIVqZhhlLOJh2ASTTHKPxG98iyMc6197WaQmlPwWVHdvHD2R88iMW9q0aQm1CgTZ/UX5m7NhXeiq6wmPuCw5UbCsBY45TQc25WMX6NYa/Wg0J7WUDm0KIAIOR6GC2kaBEDpuaxdvLE9enSSsTDicK917zsfBwppYP44CcP5iKnRdtTPKLdGsL1f3bkqB/wkGZyp2q4LWDkL8dg0zTykqePhhEG9J/bRrN0NwwceraSOPI9dw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cC+/yyhzUL9R1NeoQ+82scgpsMR0VgmOzjoc3lGhOaE=; b=F7BbqtQQ+inEO8Uo9Pt65xIclykpHhvuUAo6HDHhclyXzOd0z8WyJBBgFz1ICxH5FPkXlmRZQMCW2C10H35Hi47F/TPQmKs1p2oCsnrbiyaeldPOBTT9dxgFx7kAGuhwYCyeB3y5n9P+S2nhbdTds1lCmXLzvc44PhO69kmmRLk= Received: from DS7PR03CA0027.namprd03.prod.outlook.com (2603:10b6:5:3b8::32) by SN7PR12MB7323.namprd12.prod.outlook.com (2603:10b6:806:29a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:06 +0000 Received: from DM6NAM11FT092.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::78) by DS7PR03CA0027.outlook.office365.com (2603:10b6:5:3b8::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT092.mail.protection.outlook.com (10.13.173.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:05 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:04 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 10:22:04 -0800 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:03 -0600 From: Harry Wentland To: , Subject: [PATCH 01/16] drm/display: Don't block HDR_OUTPUT_METADATA on unknown EOTF Date: Mon, 12 Dec 2022 13:21:22 -0500 Message-ID: <20221212182137.374625-2-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT092:EE_|SN7PR12MB7323:EE_ X-MS-Office365-Filtering-Correlation-Id: c77d3a31-4b22-4991-fa1f-08dadc6dc62b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y2skLWhxtAIEosyFUVwC9sIZUNRI8VmdS1ZrBwWuW9minUNFcaZDWkg4ECDgde4MK0No8R7adbGFCpNQDBbEJV9Qtqmny1KvWItkvFs0SSa3xY+NaF6IJMTFtUHS83sdm4rS/LiwR7YFHiVCsmmuW2wYNEPqtaChEStsSkujBmE5sMVHUvNKBUPGdFeUHde8iBl+nqHKBJluLlfR9/uope0CVIIkVh2prMolyPwfOjwhaOVUkTpCyzKFSN0E/IrswuJD7PY51eLL6XZbFjbE1KvsaRUkhwXqXCIxS7g4hJ+LF8QRczLcWjrFtQShcKXiClj9uMOURclLUKdFQKRafSxHYUyvVeTdYXZmionHcZo0mI9r4NtikCTmRSNP/h8BZrDkpwR/09CUn0al6FRWxbci8hPdZAQ41GjY9GKceKBllli6RnmibaWes4UUQ00nKGfg1MVcImwxlph272W3VPVr7zp5AIsVgQXlLWAyCEhgfsnB9Gygvy4+xRs/QftN9YbGTYHsBWB2hegzaRPSO9N68WEOdQuwt1ywTeuqbuB2S9Cvxu2gAgaXEVkIs/qx0m3LSZ4oXhaQxxdpFthc3ZJmvpSPXXKAt8H31dluVw4jT1lmmwu2zInvvnN97rKHXDYPK4ZabeT21dmDV93FRs4bmhVf8+80qlR8puquCTCa44/zvMV7Cuk/EWghmFek X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(136003)(376002)(39860400002)(451199015)(46966006)(40470700004)(36840700001)(36756003)(86362001)(966005)(478600001)(40460700003)(110136005)(316002)(81166007)(356005)(82740400003)(82310400005)(54906003)(26005)(40480700001)(1076003)(186003)(6666004)(7696005)(2616005)(70586007)(41300700001)(44832011)(5660300002)(8936002)(2906002)(336012)(47076005)(426003)(36860700001)(66574015)(8676002)(83380400001)(4326008)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:05.8007 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c77d3a31-4b22-4991-fa1f-08dadc6dc62b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT092.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7323 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: Sebastian Wick , Pekka Paalanen , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The EDID of an HDR display defines EOTFs that are supported by the display and can be set in the HDR metadata infoframe. Userspace is expected to read the EDID and set an appropriate HDR_OUTPUT_METADATA. In drm_parse_hdr_metadata_block the kernel reads the supported EOTFs from the EDID and stores them in the drm_connector->hdr_sink_metadata. While doing so it also filters the EOTFs to the EOTFs the kernel knows about. When an HDR_OUTPUT_METADATA is set it then checks to make sure the EOTF is a supported EOTF. In cases where the kernel doesn't know about a new EOTF this check will fail, even if the EDID advertises support. Since it is expected that userspace reads the EDID to understand what the display supports it doesn't make sense for DRM to block an HDR_OUTPUT_METADATA if it contains an EOTF the kernel doesn't understand. This comes with the added benefit of future-proofing metadata support. If the spec defines a new EOTF there is no need to update DRM and an compositor can immediately make use of it. Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/609 v2: Distinguish EOTFs defind in kernel and ones defined in EDID in the commit description (Pekka) v3: Rebase; drm_hdmi_infoframe_set_hdr_metadata moved to drm_hdmi_helper.c Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Acked-by: Pekka Paalanen --- drivers/gpu/drm/display/drm_hdmi_helper.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index 0264abe55278..faf5e9efa7d3 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -44,10 +44,8 @@ int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame, /* Sink EOTF is Bit map while infoframe is absolute values */ if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf, - connector->hdr_sink_metadata.hdmi_type1.eotf)) { - DRM_DEBUG_KMS("EOTF Not Supported\n"); - return -EINVAL; - } + connector->hdr_sink_metadata.hdmi_type1.eotf)) + DRM_DEBUG_KMS("Unknown EOTF %d\n", hdr_metadata->hdmi_metadata_type1.eotf); err = hdmi_drm_infoframe_init(frame); if (err < 0) From patchwork Mon Dec 12 18:21:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071326 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 50C1EC4332F for ; Mon, 12 Dec 2022 18:22:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D283610E25C; Mon, 12 Dec 2022 18:22:14 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2082.outbound.protection.outlook.com [40.107.220.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id B17A410E24D; Mon, 12 Dec 2022 18:22:08 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JL7vrj49984kFH9u8HoEjXYr42Twr8OLQug5fpM8l6IX8uqzymYeCvQd2ijQqPAv9vs8kkD02ROKW0QeEUTmzuYO/ci8jNYYisdtFquaP1yADzhK2tP7CUBTIulDCQJPe8OarNgb6chQQCqcTJPLpezdtPkSCL1myQKCYRd36wYknE2CltUkDI6OrgWPk5NVjEoBYz4NXqgr1Eh9hdZ7Zz1rs2xfGrWDabBowEhrdGpvuMzgwoW3ppTwUMDR6a6WMiZDffmKcoss+/MYQ0vlyl8WiEFbpvMdA58moRGR04pOuGbKqzRMHQ/buyW/ebBPM6AAz9tfaTNUHgjV/APCrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JTWKeSe4qe1+T8w6tUhAOTq4ROQ1dXNNzsXiU5otyRA=; b=Jmmi4kEN/Cx1WORwQyVY758GiJ8RFrLuDSuRbkMZZjdVSFDD+AS3BUzpLBxAizrk1JRL2bW38C/c/Cf7R58hENwGPj21cGIhS2I6zK9t7fX3eGy4mwGljyreZ+Bp2y/eR9XuQzwhjKU4NnxBJQg7x0pwydQQKu2GgThMc8A/JxVfamqFz6jIOejL/q6mIT176ZdXdKmbPx0EzTQqkMtlT74O4mknRjS3KjZMFeFPC6JMB0VILYVW0CvhxOjtCs6/8CiO4GiY7pn4D4TDA9wSBHj+7nYlOPv5QMpe2HBRE46wa3/S9aPrqQJk/Gy57UWZn3SRYT4+G19K0DKT4ru1Ng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JTWKeSe4qe1+T8w6tUhAOTq4ROQ1dXNNzsXiU5otyRA=; b=L6yudXo+/zlkJXBJN0JZ92qOSdJBqsuSkKawd3gfajesXWGt+S+lB480iWKq/NnFWv0DjbhQTCKt6dNcpM2bEjE7DvwSWp/6xnIrqm1T9P3MUWFnopFlzPyDGtNi3Xo9vu+Dbq9TDtQqzTFqmJP3NwxwNjJSfk4qzIci5k1DxrY= Received: from BN0PR04CA0098.namprd04.prod.outlook.com (2603:10b6:408:ec::13) by SA0PR12MB4366.namprd12.prod.outlook.com (2603:10b6:806:72::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:06 +0000 Received: from BN8NAM11FT103.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ec:cafe::64) by BN0PR04CA0098.outlook.office365.com (2603:10b6:408:ec::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT103.mail.protection.outlook.com (10.13.176.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:06 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:05 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:04 -0600 From: Harry Wentland To: , Subject: [PATCH 02/16] drm/connector: print max_requested_bpc in state debugfs Date: Mon, 12 Dec 2022 13:21:23 -0500 Message-ID: <20221212182137.374625-3-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT103:EE_|SA0PR12MB4366:EE_ X-MS-Office365-Filtering-Correlation-Id: f664788f-b7ff-4d44-3a57-08dadc6dc65e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QVHehbTVe0RnEfCs0rwHPU6J+B59b8W/vELG68PLaBOuO4l/CCQCJFoDY7PdwM8A1jY2dMUDCcetXBSCMjY3m/jBQ0NP16PRm77+NJNrSIoxBTDlMe/z9W2qfKrhaPDWriMI8+ZqQstsMlMlqbozBsF28NseP3vddKp25VZx08wEOdcpvf7Qq/1dX4pGv3N9c0r63YadbO75JzDxjnyQ2uvzvOsKx6PtuxnZTd2aRwJmbDu7gZdJ23rsjDLu2AeHCRcxLH0ElGFYQTJmAHyRVpi2BABYbi9YQTyJm3d3t1q+U/yU7WOcbTLS14q3S7CM9Jl4Dd32HqhcGcCGDtXML+RGDYB8txVQAhGvRY1XBhaWm4rnoWSp3+MCWQs209uo18uDzmuH2U4nrO6RB9n/iPceBk5rkdxSr3Ql6XvzYbrvat/lKeKYcMxRmkpNvNy4koLWwEqxAZulXoZvooolxSkk42w2Lb8teM5Mi7zQYmfnrXrWMY7VB4PVjaYxEWDoYmD50AyEX2b+cEmM4kVL45K3v0U67Kh1ZNvho5cvq2xb70XvS0binU/eUY6Y4X8A5w6obMS11No+8UICKp0q3XNcTEpMvMIdIOs/81mkort05YLwlvLWQeRKIubpzB9Hr8mgFCbrWMVZarF08dkmnllGKtXis5sgqQV60kvcZXXRmS8E90Eafuf9XSYsRpjN+aXScTwxc3oxmJwRSHklHfsZgwe8aq885ppWAmLlpDQ= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(39860400002)(346002)(396003)(451199015)(36840700001)(40470700004)(46966006)(70206006)(70586007)(8936002)(336012)(4326008)(2616005)(40460700003)(8676002)(1076003)(81166007)(41300700001)(316002)(47076005)(186003)(66574015)(26005)(356005)(36756003)(426003)(83380400001)(36860700001)(110136005)(82740400003)(54906003)(2906002)(86362001)(44832011)(40480700001)(5660300002)(6666004)(478600001)(7696005)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:06.1925 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f664788f-b7ff-4d44-3a57-08dadc6dc65e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT103.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4366 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is useful to understand the bpc defaults and support of a driver. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/drm_atomic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index f197f59f6d99..c0dc5858a723 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1070,6 +1070,7 @@ static void drm_atomic_connector_print_state(struct drm_printer *p, drm_printf(p, "connector[%u]: %s\n", connector->base.id, connector->name); drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)"); drm_printf(p, "\tself_refresh_aware=%d\n", state->self_refresh_aware); + drm_printf(p, "\tmax_requested_bpc=%d\n", state->max_requested_bpc); if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK) if (state->writeback_job && state->writeback_job->fb) From patchwork Mon Dec 12 18:21:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071328 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 4FE33C4332F for ; Mon, 12 Dec 2022 18:22:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 086DC10E25D; Mon, 12 Dec 2022 18:22:23 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2044.outbound.protection.outlook.com [40.107.223.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F27A10E24D; Mon, 12 Dec 2022 18:22:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PqCWLpUwDx8C248V9ohvNA/n01T6bmUHCLhjc2+mEypBaGBbcT6NTVU2bepTdq4zO17v3KKhaThLEKSsqqkLYKCNqLDoWwxnS5lZID+iPp4NittXrXUVOUma9aKa8eDEOWeUZGzgHWzTLG3rOxVknnpVINBUXZcCUO1U4IIOutZ8MsC3kwuIQ7JSct29XDgQyJGxyTF/Ew5zgOLjFfTtWJ58loile3GV5jKWlSng/2EMPlgyJhprB+C1+hhjT8NiNdUu0lk37RkXrDaRjGHrMs70QaBx7hHOpZW1/m3nzr30TMqnMGPpw0GOhBU3Lr2pIKm3az/5TkD1cI9nDwPl8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KGslImqR+p0erx3X4NkO3J7qAhaJFNDv5A6RVvCGHjA=; b=GIPEQX14mfAw2kyrGSad3VZWjTpprAZFTdeeQwNAXTDuTqhmAvEjQM+66hGR/nLqPfjj7W71ZG5quAVH1YyHqugXDKTDrG8ZuLj32hc7DlClFbec/+88A73P4+Cvw3bTbqtDNkw6idiN0ZaqIZosiZ8Se/fTO/hirffAkB0qlA0Pw736bVVAvGnEmjlw5c2AsTlEPpSA0cBF1Mw6oDjQCSgMkXoOQeWuzJ6iY1BWuCrn2fcaw8iVNjceYPT2LiYLUoIji18NueOo6RDqQwYGoeFXvYVJkzzVlN9OsYz9G3iOYIwcCPhj1iSby4V3wumc/ZvZJo5hslAyWZZimAIH4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KGslImqR+p0erx3X4NkO3J7qAhaJFNDv5A6RVvCGHjA=; b=I1WKuFEcNI8xqGZFsIbQCjQZSoCbqG4J69LzxU6QgqhQy3VSc15/pvlK85PSCJejupftRjD6urFLJc81T7Pxg72CWlTITcS8ImIyyK354rGZ/dz5Y/85+gHIJ3r1JVvDokAVwcA8M4bwFPOWl9rzkUbrwIKUXsc+jLAKy/zgUCE= Received: from DS7PR05CA0004.namprd05.prod.outlook.com (2603:10b6:5:3b9::9) by IA1PR12MB6626.namprd12.prod.outlook.com (2603:10b6:208:3a2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:08 +0000 Received: from DM6NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::2c) by DS7PR05CA0004.outlook.office365.com (2603:10b6:5:3b9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5924.6 via Frontend Transport; Mon, 12 Dec 2022 18:22:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT028.mail.protection.outlook.com (10.13.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:07 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:06 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:06 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:05 -0600 From: Harry Wentland To: , Subject: [PATCH 03/16] drm/connector: Drop COLORIMETRY_NO_DATA Date: Mon, 12 Dec 2022 13:21:24 -0500 Message-ID: <20221212182137.374625-4-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT028:EE_|IA1PR12MB6626:EE_ X-MS-Office365-Filtering-Correlation-Id: ee695529-ff0c-4ff4-65af-08dadc6dc729 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /PLyYLTXZhTzrbYQhMkNq5HxExeq8Msg2gVW+S1VafhoF/kBWblkuUi5YGo8MCzVK1n71kZfintErVOP4EVMWaA1RwI1CabYT6VZYn0vmTZz2hKdeBeYRky12BmsGNNMrwm9b00gRIpURVNMXhxtUh1estT/2q2TWRPaDTdpnVgSGlmKVTLwhVlhtiqKSYXM+93OaX7dN6keezmSZpIFWAeIiExVM41eMFQNBiuHnPNufbuwqqmNtHXYvOWcYuL4GPffsA0cMn4Pympdi8uMR68+JVYJIIesgO+jXiGQVubrv0SgWFdcQFL48NdHpom6tUFLdGXycFhI8GqJ9aIUe9pOy4ah99JrGzFji88oYcN8on6YBi342CkrcSWu9gYQ3xd5bxcRKRmppxn+E+CoQWxQUZOp/lLiz++k2z87yfjO2hMbHVwWTLfSTIyDY8z+OHGV5CV46AxB40IR2imZiQobAjhgH2UsVA9Emy1wQGeGHvl0BgN3W1l8+ti5/DOmt9raG1+oPS3LbN3zohWZXkaT0BiVIbihURXBCgIrHkkfook+DpO5yzzZAux5jF3YNChJ9ZUucz72e6SkFl2xQFHrCyltmNDYH5f+gAQ778uuic/S543dyGWoE3K79YYliKxfZn4zcYZ5pWS/YpJhjr9auGo5xJ/YT9rvmcwVBLQ8ahphw9T8oYn1hlBRD+M09XN/2tVAJbPT77AT4NeVnPUXxofni9B2q/QCrfFmM78= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199015)(36840700001)(46966006)(40470700004)(110136005)(44832011)(2906002)(66899015)(8936002)(316002)(54906003)(70586007)(36860700001)(8676002)(82310400005)(70206006)(36756003)(41300700001)(4326008)(186003)(1076003)(336012)(478600001)(5660300002)(26005)(40460700003)(86362001)(2616005)(81166007)(47076005)(426003)(83380400001)(82740400003)(7696005)(6666004)(356005)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:07.5240 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee695529-ff0c-4ff4-65af-08dadc6dc729 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6626 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The value is the same as DEFAULT. The HDMI_COLORIMETRY_NO_DATA makes sense for the infopacket but it's meaningless for the connector colorspace. or, in otherwise, just means to go with driver default. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/display/drm_hdmi_helper.c | 2 +- include/drm/drm_connector.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index faf5e9efa7d3..c1e6851b2606 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -103,7 +103,7 @@ EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata); #define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1)) static const u32 hdmi_colorimetry_val[] = { - [DRM_MODE_COLORIMETRY_NO_DATA] = HDMI_COLORIMETRY_NO_DATA, + [DRM_MODE_COLORIMETRY_DEFAULT] = HDMI_COLORIMETRY_NO_DATA, [DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = HDMI_COLORIMETRY_SMPTE_170M_YCC, [DRM_MODE_COLORIMETRY_BT709_YCC] = HDMI_COLORIMETRY_BT709_YCC, [DRM_MODE_COLORIMETRY_XVYCC_601] = HDMI_COLORIMETRY_XVYCC_601, diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 4d830fc55a3d..62c814241828 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -375,7 +375,6 @@ enum drm_privacy_screen_status { /* For Default case, driver will set the colorspace */ #define DRM_MODE_COLORIMETRY_DEFAULT 0 /* CEA 861 Normal Colorimetry options */ -#define DRM_MODE_COLORIMETRY_NO_DATA 0 #define DRM_MODE_COLORIMETRY_SMPTE_170M_YCC 1 #define DRM_MODE_COLORIMETRY_BT709_YCC 2 /* CEA 861 Extended Colorimetry Options */ From patchwork Mon Dec 12 18:21:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071335 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 D54B6C4167B for ; Mon, 12 Dec 2022 18:23:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E01910E262; Mon, 12 Dec 2022 18:22:52 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2051.outbound.protection.outlook.com [40.107.96.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1365410E262; Mon, 12 Dec 2022 18:22:25 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wc74E0JHEh2geZ6lQ0J5EDUo9NrmcfyhkCNn5a/bqei9TV4SssZX/7LK/sJXuRq3Nrj7SKdxofXkpIDkXSxaGtBLIRN+1TtnhJM/7w8gKUEwVw+bHhYRDspAjk/TY3IY0Oj7tTzw38TL7RYU9kLsS1mKK/5VUmYvS0wd+ieNlrmF9STgQGoCE55reQfeFpV6lyHDJZFRK2wM+is98xKJuIIzR7shvgLsokgXC+34lnpFzoc40RQ3tVVqwU2xROiRIoxnQbq6lQ2Df4GylKAvMlm26p4hB5kHInyAiRCuM4Sojmt5iIn+qVaMWiZf++T9Nqx+V+dBSIoGw41Y6CWsuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+iK87zqqznC9FrU/NRQaUnHSRP554WbcOEFf+Q554LA=; b=j89aR+qwlfSFq0kmvgY1u8FTeFgRLSkFhfa5P6Xjj4BXx0rfAclhIOG8XrlIemr0u/kLM3jxzFN7yixBFwaaM4gQnRZ/lc7hNIsrAxNeBdkYaZCqqqPn25O+wlWWRGBuB/97RhSfV/lsf1zrhxRcjsvl34ZMzsUAic7QbEG3NJXCFf++s2a4nJCXD0EXYtwq1pq/OYnAFklAtehzbBJKWk5WpOhHwaeZLQ/r09SHy0KQKVCkU8nQbFBjGx7jsdCZNuDR4II/SaSYqmusG50ptpj0Jy6KJSz1XzOtUbOi0xENNazR+Kypvr2iyutACbWvak/BA2XffPa0hWwLJie9CQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+iK87zqqznC9FrU/NRQaUnHSRP554WbcOEFf+Q554LA=; b=5e7Q275iBuFyaz2p/ufv1q/5MmL7HeontXUmruCriYNcYrm0KwYZgcn7LDyRdW57351VpZA+JIfFpGIADdup4nfQYAiOg8KBQwXR6dfgecNofc8LRkyHY1V5rstog7yCwrD65L+NHYvm5Hu2lhLjasCHV2MGOCPUAHK0/L7QFhI= Received: from BN9PR03CA0469.namprd03.prod.outlook.com (2603:10b6:408:139::24) by SA0PR12MB7004.namprd12.prod.outlook.com (2603:10b6:806:2c0::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.18; Mon, 12 Dec 2022 18:22:23 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:139:cafe::a7) by BN9PR03CA0469.outlook.office365.com (2603:10b6:408:139::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:10 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:07 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:07 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:06 -0600 From: Harry Wentland To: , Subject: [PATCH 04/16] drm/connector: Convert DRM_MODE_COLORIMETRY to enum Date: Mon, 12 Dec 2022 13:21:25 -0500 Message-ID: <20221212182137.374625-5-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|SA0PR12MB7004:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d2689fb-f870-4f50-9a9f-08dadc6dd03f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SwSU5vnXIOkUxaZEPrrLXoYD1wdIqp0+Il8WIk94PTwsYxNCdRi25R3KzmOtE/uqcqlGH9X97Vyw9kdlH5omTXuZu1zeuRLl0PuTfBwB7ozWRpBlumooKkk7Q3xq/Msr14pGmnDNEtLQ6J0WVIfuWFsDMjtAeNVqO6g4m+5rVTz59H+Dh2GJNz7cIDKqjy/3dfS8J2BNWRT78G7P+C1x7hItj1MZjwLYQFeyNp6ah8FyreFmRoyETVbEr+1ziziKFxdMhCarAd3WY1Ch0pKidbh9cj7VJjr5IWKnbYhoiwsmQjx9oqXDA8CFykDe5lDofRojwE9ucPbusIKFzpIfAFsHiG98n/4rsXLRc5ZZYMmz7LfaQSuOTyOVoMCKXYi1lAQND1IGiX6KhMCGpx0WpzRuz+UN9V18RokZJPTbIpxnOdveFUOjfWcJLdJXi6GaSKT9xQ3ntXRl1rmIOMiMt7cXgXuPEzW2DnRXubwa3J4h+ZjaIGpV26XiX/0rQSJ7G99Om2rZ2FZxMeUwg3sfX9p3LUxNacA/nO1Yz68Mqcr3s1xpfcnDccT9pIYXhLcyPV9DUVfz/HqbGu6HXRUO5wvOZUzeZgj4WrfAZ22BrE4C6dKoAePZhZxMVh97nTArCgjaz7RDvOxkNlHsARoIehdBh41CMAWf6rgigzfHebgl1rjimK6Jp94qfNyxb4w6cKjcs6kABHRHxNXyQtzUdlztwmkt2IwB/zQd4pGgrAU= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199015)(40470700004)(36840700001)(46966006)(66899015)(83380400001)(36860700001)(2906002)(1076003)(41300700001)(36756003)(336012)(70586007)(70206006)(40460700003)(86362001)(40480700001)(81166007)(186003)(356005)(316002)(26005)(82740400003)(82310400005)(66574015)(44832011)(4326008)(47076005)(5660300002)(8676002)(426003)(110136005)(478600001)(54906003)(7696005)(6666004)(2616005)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:10.0511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d2689fb-f870-4f50-9a9f-08dadc6dd03f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7004 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This allows us to use strongly typed arguments. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- include/drm/display/drm_dp.h | 2 +- include/drm/drm_connector.h | 47 ++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/include/drm/display/drm_dp.h b/include/drm/display/drm_dp.h index 4d0abe4c7ea9..b98697459f9c 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -1615,7 +1615,7 @@ enum dp_pixelformat { * * This enum is used to indicate DP VSC SDP Colorimetry formats. * It is based on DP 1.4 spec [Table 2-117: VSC SDP Payload for DB16 through - * DB18] and a name of enum member follows DRM_MODE_COLORIMETRY definition. + * DB18] and a name of enum member follows &enum drm_colorimetry definition. * * @DP_COLORIMETRY_DEFAULT: sRGB (IEC 61966-2-1) or * ITU-R BT.601 colorimetry format diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 62c814241828..edef65388c29 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -371,28 +371,29 @@ enum drm_privacy_screen_status { * a colorspace property which will be created and exposed to * userspace. */ - -/* For Default case, driver will set the colorspace */ -#define DRM_MODE_COLORIMETRY_DEFAULT 0 -/* CEA 861 Normal Colorimetry options */ -#define DRM_MODE_COLORIMETRY_SMPTE_170M_YCC 1 -#define DRM_MODE_COLORIMETRY_BT709_YCC 2 -/* CEA 861 Extended Colorimetry Options */ -#define DRM_MODE_COLORIMETRY_XVYCC_601 3 -#define DRM_MODE_COLORIMETRY_XVYCC_709 4 -#define DRM_MODE_COLORIMETRY_SYCC_601 5 -#define DRM_MODE_COLORIMETRY_OPYCC_601 6 -#define DRM_MODE_COLORIMETRY_OPRGB 7 -#define DRM_MODE_COLORIMETRY_BT2020_CYCC 8 -#define DRM_MODE_COLORIMETRY_BT2020_RGB 9 -#define DRM_MODE_COLORIMETRY_BT2020_YCC 10 -/* Additional Colorimetry extension added as part of CTA 861.G */ -#define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11 -#define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12 -/* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */ -#define DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED 13 -#define DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT 14 -#define DRM_MODE_COLORIMETRY_BT601_YCC 15 +enum drm_colorspace { + /* For Default case, driver will set the colorspace */ + DRM_MODE_COLORIMETRY_DEFAULT, + /* CEA 861 Normal Colorimetry options */ + DRM_MODE_COLORIMETRY_SMPTE_170M_YCC, + DRM_MODE_COLORIMETRY_BT709_YCC, + /* CEA 861 Extended Colorimetry Options */ + DRM_MODE_COLORIMETRY_XVYCC_601, + DRM_MODE_COLORIMETRY_XVYCC_709, + DRM_MODE_COLORIMETRY_SYCC_601, + DRM_MODE_COLORIMETRY_OPYCC_601, + DRM_MODE_COLORIMETRY_OPRGB, + DRM_MODE_COLORIMETRY_BT2020_CYCC, + DRM_MODE_COLORIMETRY_BT2020_RGB, + DRM_MODE_COLORIMETRY_BT2020_YCC, + /* Additional Colorimetry extension added as part of CTA 861.G */ + DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, + DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, + /* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */ + DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED, + DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT, + DRM_MODE_COLORIMETRY_BT601_YCC, +}; /** * enum drm_bus_flags - bus_flags info for &drm_display_info @@ -825,7 +826,7 @@ struct drm_connector_state { * colorspace change on Sink. This is most commonly used to switch * to wider color gamuts like BT2020. */ - u32 colorspace; + enum drm_colorspace colorspace; /** * @writeback_job: Writeback job for writeback connectors From patchwork Mon Dec 12 18:21:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071334 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 BEF51C4332F for ; Mon, 12 Dec 2022 18:23:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 52B0510E270; Mon, 12 Dec 2022 18:22:43 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2044.outbound.protection.outlook.com [40.107.244.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7CEAE10E264; Mon, 12 Dec 2022 18:22:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aEEQQ2jDlNkEsT/adY+HJoFgI9Jf52DBOxMKjFcIpiTID7W+ogmR6NWVeOa8A1nf1xd42QONDFgZ3M/u85xh7HL+g4n8s3nObcqY/uiWyOaZRxbtgq2iJVIJEBUpE3WQFTjElNetN1VuoVNeb6d2ME2eTDT7WnBRw3e/T+YRKarULakW5tXuSDXNzYUYLf1Y6CeCoKOo9a/Jyj/wYKvlnazzy/UKNNIFGzOt/ZI0QNV/IL/tWlABbjcTtAjzye2H21JB5bhU7LkiW0oQW/eR6XNdNT6ifcHMsEJ0hu+h/Ykw87sFkqUsQymoTMZe9vXY1YAN5K943RdGTO90LWpI0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G5I+XY0eLakBgxRG8NZPSadATni+LzlPh2iwpH1HGdI=; b=kqL5pSRPTzrRY7aRDEuoQ6jQtYTy3PtwhU56/GKqdA7KdiVYge7+80zMkZkmYgwBAjilrDLg9Oghu3RJiUQ8mDzyixgkS5XZXwVkQUsuVWQIFaucg/K3/Gi9aM3tUx/zf9Co6nbw+NuEBpyitB2YSR816wGc/o4ezEGjNM2vjolYk06ptOmGYOlFRv+GbvZdLFvrqgzUycvDL3fcq3RRZq7mGeW+uy5FZF7ray3v+hUeaWgGlISQrDdM9m2Eon8M6HTbDtExJ88I5iZEq2MYcf2rOfOwaQ18Pz+RsaZyD66IMxHzWFzlDLE4XnlCeqT8N/EhpEjcQpup9RAW609Y8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G5I+XY0eLakBgxRG8NZPSadATni+LzlPh2iwpH1HGdI=; b=rlJnq8SOdI9XoJeozKdXBBluuV1js99cz7KRkNhuwkyHYh/Mov6Fm2Dw8XTI9WQKI3n4wQFd4VxRLr7AR7MVEZwnlksNwVAAFwQUqh6EVwGRFxxcxYKSTnCuKK4mDBv0OlFSwMGopRATZdbQ16dJc7EPriptO2gzP3fXurdrd3g= Received: from BN9PR03CA0473.namprd03.prod.outlook.com (2603:10b6:408:139::28) by CO6PR12MB5409.namprd12.prod.outlook.com (2603:10b6:5:357::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:23 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:139:cafe::df) by BN9PR03CA0473.outlook.office365.com (2603:10b6:408:139::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:23 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:08 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 10:22:08 -0800 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:07 -0600 From: Harry Wentland To: , Subject: [PATCH 05/16] drm/connector: Pull out common create_colorspace_property code Date: Mon, 12 Dec 2022 13:21:26 -0500 Message-ID: <20221212182137.374625-6-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|CO6PR12MB5409:EE_ X-MS-Office365-Filtering-Correlation-Id: 794f41e2-7481-4038-a532-08dadc6dd0ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qjp6AQJcHlXYw+lB93mxEXBlVEdQH0Yu0gP61uGk7e6u4jSpPwYUc0mIqLZ9CK2JEKjUAZrTAFwzSA0ChG+YkQOIbLp4i9Dnd78jiSp4FMaJVEBN7Kk4orrsgQu6LYj2mnz18EUdoLE/PiwS7aFzWAtDBC5kwkzf6BQ0L8dHPjoZc7CJSfafo6NiBJGCIiYYoiFhWQ6/8fIG+n5Bv6vOSOPvfaoYUdwOkm/fKQWGTTfWAYJsDqyE4JS/pKhtmXmhgDy7d+2URfw+ZGULxbt7XkIdmSSUWE+Oyi3fTVDduPCo76i6ZE7VbbXtt77CZLL+8QYC4DyH/5ZBHaGq9NhYJDRIDREbnqgUjO29+q5ln0/rDeAkVOBo/eE5NPvsKqee6pNr3q2YYkbjzRHcbuS3ZlIEBC3kJ5rMJ7aqIP/jEaUWbnt4jfeMBSKIscgElLVzYnUtc0yfbAPOm9fq08S2MJ2Nh7n1QT5HU7XgTHme1odB7RFRPtRuF3F+TAxgXhASuqeNw+buwHuSNZWr+pF/KHCAwX/q2HJYd22ulQy2jJ55qCO6D5ipoljzaE9UmuQsReOgbM8R7ZPiTG5szgVc1eSitNti7j3Wvayi97CahFTTjeDVuFAFnzrTWu9nbejfXFXPmktBS0yQuNVcuWlC1+Fm5SitkulhTHHbDm1pfLZd3SUfYDoVmddaSkeDzyc5F2xi7Jeih8wOZed6mWvV9CnJMs/zWHuYnQZ6ojnwHqw= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199015)(46966006)(36840700001)(40470700004)(36756003)(40460700003)(2906002)(1076003)(44832011)(54906003)(2616005)(336012)(86362001)(83380400001)(47076005)(426003)(186003)(6666004)(110136005)(66574015)(26005)(81166007)(82740400003)(478600001)(7696005)(82310400005)(41300700001)(40480700001)(70586007)(356005)(5660300002)(8936002)(8676002)(316002)(4326008)(70206006)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:23.8627 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 794f41e2-7481-4038-a532-08dadc6dd0ce X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5409 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/drm_connector.c | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 61c29ce74b03..ddba0b9fcc17 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1971,33 +1971,44 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); * drm_mode_create_dp_colorspace_property() is used for DP connector. */ -/** - * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property - * @connector: connector to create the Colorspace property on. - * - * Called by a driver the first time it's needed, must be attached to desired - * HDMI connectors. - * - * Returns: - * Zero on success, negative errno on failure. - */ -int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) +static int drm_mode_create_colorspace_property(struct drm_connector *connector, + const struct drm_prop_enum_list *colorspaces, + int size) { struct drm_device *dev = connector->dev; if (connector->colorspace_property) return 0; + if (!colorspaces) + return 0; + connector->colorspace_property = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", - hdmi_colorspaces, - ARRAY_SIZE(hdmi_colorspaces)); + colorspaces, + size); if (!connector->colorspace_property) return -ENOMEM; return 0; } +/** + * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property + * @connector: connector to create the Colorspace property on. + * + * Called by a driver the first time it's needed, must be attached to desired + * HDMI connectors. + * + * Returns: + * Zero on success, negative errno on failure. + */ +int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) +{ + return drm_mode_create_colorspace_property(connector, + hdmi_colorspaces, + ARRAY_SIZE(hdmi_colorspaces)); +} EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); /** @@ -2012,20 +2023,9 @@ EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); */ int drm_mode_create_dp_colorspace_property(struct drm_connector *connector) { - struct drm_device *dev = connector->dev; - - if (connector->colorspace_property) - return 0; - - connector->colorspace_property = - drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", - dp_colorspaces, - ARRAY_SIZE(dp_colorspaces)); - - if (!connector->colorspace_property) - return -ENOMEM; - - return 0; + return drm_mode_create_colorspace_property(connector, + dp_colorspaces, + ARRAY_SIZE(dp_colorspaces)); } EXPORT_SYMBOL(drm_mode_create_dp_colorspace_property); From patchwork Mon Dec 12 18:21:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071329 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 C3D3CC4332F for ; Mon, 12 Dec 2022 18:23:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B7FA10E263; Mon, 12 Dec 2022 18:22:25 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2070.outbound.protection.outlook.com [40.107.96.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6384F10E25A; Mon, 12 Dec 2022 18:22:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SVHCZEjPgiiiZU0xfC6iOx9vLdB6hG/pPHig1ASyau9ygB/cU/7Ms8XYu2k9Op61OkMm+Wlw5IVjfYKVjKXXXnk6VXRuKHpxvjFixLY7o7xih+g4NZwBJkKHn9cnY+BCMmMmgLy2jZQ8YJ3kBby1P7eHUdwBc3xLtWAwQiRHx+ar2UfgeDkJBYRCB33dz2QdfUaJkfkAomJFbzUOcHs8PK8eqvbu8Rc8pMvlwp9DUI+Zfpphms8u8M0gVxbnX0YNLU+33Zor8HkKh5THGcxgJoUFX5+T/9h3kcVV/rILgRtK+D8q0abFJGsVNcd0W7/i9lFR90gcozNl2J2GPwng6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ehNxlOf306sOQAwMo41GKJcva27daO2d7cWuMCZRbko=; b=LO4Ad78KSgchRR3lmiQdH7gWWCiqKa+6P888vACbTLy1ntggDgGOB+pgNg6L3sdZIpOVOfRgtu+kQRs/i/8IDf8c96AbwK8/QJbDpBnbmffLFRZlL4c7Mcvcw5fhhOiugFPIh7U9akH/K2IR3VEWbMSSLn0dI0O/guMMApFooelnX+RIj2Bg3UXXz8yBAjPiraPfMXFVOvcIXU6gTXl+IsqliSQ/vGP9FLHRhyFsZ3WgE1/b/xxJzgooHDDyXPrhiDj3QwgxoAhiX4Phgz2mUTS5Hf2rfQ+ga7v0eG35roRrhfh2lARjov2T4UNpjyh++257pFvZCjyjkReIzGkd2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ehNxlOf306sOQAwMo41GKJcva27daO2d7cWuMCZRbko=; b=TYxLXdzupZDIu/Ytn24F3qN26mS1wyfuFb9aX66cwEfAXmVpyzOb0eCy4iO+I432a+RN7jNlQ2LlfT/OqUtvv5lnSDy5n2VOkQ+gs8+gVohY22wPELDZGbdvdJZGCUzU4Ncv4lHn+4xY+LyhE1fQ1QKCkTYVsFTrfFZqtR4/qWI= Received: from DM6PR02CA0160.namprd02.prod.outlook.com (2603:10b6:5:332::27) by PH7PR12MB5757.namprd12.prod.outlook.com (2603:10b6:510:1d0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.16; Mon, 12 Dec 2022 18:22:12 +0000 Received: from DM6NAM11FT079.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::45) by DM6PR02CA0160.outlook.office365.com (2603:10b6:5:332::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT079.mail.protection.outlook.com (10.13.173.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:10 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:10 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:09 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:08 -0600 From: Harry Wentland To: , Subject: [PATCH 06/16] drm/connector: Allow drivers to pass list of supported colorspaces Date: Mon, 12 Dec 2022 13:21:27 -0500 Message-ID: <20221212182137.374625-7-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT079:EE_|PH7PR12MB5757:EE_ X-MS-Office365-Filtering-Correlation-Id: be73b9a2-b0df-4163-c9d3-08dadc6dc8f8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9ULHU4bgVK3Yhak2Zk4G6Z/ElbLivpfiY/qwIqHRZfoqlNHcNDqO/uHA1VPyxrbEXCa3vaYkEvzDR2Zuxr4U8lJwNV3Q9u+GaFHuCryLurzHJIneb3dOkU9jJrlSXpigHorcl2m7XFIpMZ9Lttd5XmNAuwpSTw6kFFddkMbC7n9YZWlp7P27aQQOmX931tH2lng6gMQg8DO3/vTtCqb5nC6wjtC37/qZ/Aoc/Cngd76b827nxtmMxH4K6ax4OISxNb+4eOxW8QGzuMThyWrEWae99jjtzSHVJROTVsy+swfTU6s/JNKEs8IfGDhHwV08qUL3vnaFILo2haTsbIkj7hOykMn+sa27edwzyyF7Hd9Q4EURM2V1y8kwYPj3/VBO7CUEWBeBlEzHEp7FMV925+N6ndGcb2Oy9x3BAL6enr4nVTsROqOMhZJOyGGOsK/RWL2CwbJgmhxz3d/u2pS2T7x5Zk6QKKt4RFhjT2qYZbPOs26B0XM5TVkyhVVTKB4Ln4iJ1FxQFaV6+n7yCbP81nloIsV6Igp44GVX8bQtji6yz7mRTF4hZvkzP2JlYh2zm/rL6pzLhs5HxQxN47tvwgIHYZANc0BIIYDvF3r/3B3u8uuAeoCDRkkXp1znEa6uUTnfsNuZ4BOkg5DbdP9E6Wb3KgB5i0rdAZpnMvmwQhQ/UcoC8VgoqEXcuYbneSUdPMO5Jwup2Du3dcfIYK6oi/DXhmw7oMoqM0GBYHc/wEg= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199015)(36840700001)(46966006)(40470700004)(426003)(478600001)(83380400001)(54906003)(47076005)(66574015)(186003)(4326008)(8676002)(82740400003)(336012)(44832011)(70586007)(36756003)(70206006)(81166007)(30864003)(316002)(356005)(7696005)(40460700003)(8936002)(36860700001)(110136005)(41300700001)(2906002)(5660300002)(6666004)(26005)(40480700001)(86362001)(82310400005)(1076003)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:10.6859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: be73b9a2-b0df-4163-c9d3-08dadc6dc8f8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT079.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5757 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drivers might not support all colorspaces defined in dp_colorspaces and hdmi_colorspaces. This results in undefined behavior when userspace is setting an unsupported colorspace. Allow drivers to pass the list of supported colorspaces when creating the colorspace property. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/drm_connector.c | 140 +++++++++--------- .../gpu/drm/i915/display/intel_connector.c | 4 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- include/drm/drm_connector.h | 8 +- 4 files changed, 83 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index ddba0b9fcc17..0df5db3e4fec 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1012,64 +1012,57 @@ static const struct drm_prop_enum_list drm_dp_subconnector_enum_list[] = { DRM_ENUM_NAME_FN(drm_get_dp_subconnector_name, drm_dp_subconnector_enum_list) -static const struct drm_prop_enum_list hdmi_colorspaces[] = { - /* For Default case, driver will set the colorspace */ - { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, - /* Standard Definition Colorimetry based on CEA 861 */ - { DRM_MODE_COLORIMETRY_SMPTE_170M_YCC, "SMPTE_170M_YCC" }, - { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, - /* Standard Definition Colorimetry based on IEC 61966-2-4 */ - { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, - /* High Definition Colorimetry based on IEC 61966-2-4 */ - { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, - /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ - { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, - /* Colorimetry based on IEC 61966-2-5 [33] */ - { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, - /* Colorimetry based on IEC 61966-2-5 */ - { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, - /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, - /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, - /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, - /* Added as part of Additional Colorimetry Extension in 861.G */ - { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, - { DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" }, +static const char * const colorspace_names[] = { + [DRM_MODE_COLORIMETRY_DEFAULT] = "Default", + [DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = "SMPTE_170M_YCC", + [DRM_MODE_COLORIMETRY_BT709_YCC] = "BT709_YCC", + [DRM_MODE_COLORIMETRY_XVYCC_601] = "XVYCC_601", + [DRM_MODE_COLORIMETRY_XVYCC_709] = "XVYCC_709", + [DRM_MODE_COLORIMETRY_SYCC_601] = "SYCC_601", + [DRM_MODE_COLORIMETRY_OPYCC_601] = "opYCC_601", + [DRM_MODE_COLORIMETRY_OPRGB] = "opRGB", + [DRM_MODE_COLORIMETRY_BT2020_CYCC] = "BT2020_CYCC", + [DRM_MODE_COLORIMETRY_BT2020_RGB] = "BT2020_RGB", + [DRM_MODE_COLORIMETRY_BT2020_YCC] = "BT2020_YCC", + [DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65] = "P3_RGB_D65", + [DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER] = "P3_RGB_Theater", + [DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED] = "RGB_WIDE_FIXED", + [DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT] = "RGB_WIDE_FLOAT", + [DRM_MODE_COLORIMETRY_BT601_YCC] = "BT601_YCC", }; +static const u32 hdmi_colorspaces = + BIT(DRM_MODE_COLORIMETRY_SMPTE_170M_YCC) | + BIT(DRM_MODE_COLORIMETRY_BT709_YCC) | + BIT(DRM_MODE_COLORIMETRY_XVYCC_601) | + BIT(DRM_MODE_COLORIMETRY_XVYCC_709) | + BIT(DRM_MODE_COLORIMETRY_SYCC_601) | + BIT(DRM_MODE_COLORIMETRY_OPYCC_601) | + BIT(DRM_MODE_COLORIMETRY_OPRGB) | + BIT(DRM_MODE_COLORIMETRY_BT2020_CYCC) | + BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) | + BIT(DRM_MODE_COLORIMETRY_BT2020_YCC) | + BIT(DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65) | + BIT(DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER); + /* * As per DP 1.4a spec, 2.2.5.7.5 VSC SDP Payload for Pixel Encoding/Colorimetry * Format Table 2-120 */ -static const struct drm_prop_enum_list dp_colorspaces[] = { - /* For Default case, driver will set the colorspace */ - { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, - { DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED, "RGB_Wide_Gamut_Fixed_Point" }, - /* Colorimetry based on scRGB (IEC 61966-2-2) */ - { DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT, "RGB_Wide_Gamut_Floating_Point" }, - /* Colorimetry based on IEC 61966-2-5 */ - { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, - /* Colorimetry based on SMPTE RP 431-2 */ - { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, - /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, - { DRM_MODE_COLORIMETRY_BT601_YCC, "BT601_YCC" }, - { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, - /* Standard Definition Colorimetry based on IEC 61966-2-4 */ - { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, - /* High Definition Colorimetry based on IEC 61966-2-4 */ - { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, - /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ - { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, - /* Colorimetry based on IEC 61966-2-5 [33] */ - { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, - /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, - /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, -}; +static const u32 dp_colorspaces = + BIT(DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED) | + BIT(DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT) | + BIT(DRM_MODE_COLORIMETRY_OPRGB) | + BIT(DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65) | + BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) | + BIT(DRM_MODE_COLORIMETRY_BT601_YCC) | + BIT(DRM_MODE_COLORIMETRY_BT709_YCC) | + BIT(DRM_MODE_COLORIMETRY_XVYCC_601) | + BIT(DRM_MODE_COLORIMETRY_XVYCC_709) | + BIT(DRM_MODE_COLORIMETRY_SYCC_601) | + BIT(DRM_MODE_COLORIMETRY_OPYCC_601) | + BIT(DRM_MODE_COLORIMETRY_BT2020_CYCC) | + BIT(DRM_MODE_COLORIMETRY_BT2020_YCC); /** * DOC: standard connector properties @@ -1972,21 +1965,34 @@ EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); */ static int drm_mode_create_colorspace_property(struct drm_connector *connector, - const struct drm_prop_enum_list *colorspaces, - int size) + u32 supported_colorspaces) { struct drm_device *dev = connector->dev; + u32 colorspaces = supported_colorspaces | BIT(DRM_MODE_COLORIMETRY_DEFAULT); + struct drm_prop_enum_list enum_list[DRM_MODE_COLORIMETRY_MAX]; + int i, len; if (connector->colorspace_property) return 0; - if (!colorspaces) - return 0; + if (WARN_ON(supported_colorspaces == 0 || + (supported_colorspaces & -BIT(DRM_MODE_COLORIMETRY_MAX)) != 0)) + return -EINVAL; + + len = 0; + for (i = 0; i < DRM_MODE_COLORIMETRY_MAX; i++) { + if ((colorspaces & BIT(i)) == 0) + continue; + + enum_list[len].type = i; + enum_list[len].name = colorspace_names[i]; + len++; + } connector->colorspace_property = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", - colorspaces, - size); + enum_list, + len); if (!connector->colorspace_property) return -ENOMEM; @@ -2003,11 +2009,12 @@ static int drm_mode_create_colorspace_property(struct drm_connector *connector, * Returns: * Zero on success, negative errno on failure. */ -int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) +int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector, + u32 supported_colorspaces) { - return drm_mode_create_colorspace_property(connector, - hdmi_colorspaces, - ARRAY_SIZE(hdmi_colorspaces)); + u32 colorspaces = supported_colorspaces & hdmi_colorspaces; + + return drm_mode_create_colorspace_property(connector, colorspaces); } EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); @@ -2021,11 +2028,12 @@ EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); * Returns: * Zero on success, negative errno on failure. */ -int drm_mode_create_dp_colorspace_property(struct drm_connector *connector) +int drm_mode_create_dp_colorspace_property(struct drm_connector *connector, + u32 supported_colorspaces) { - return drm_mode_create_colorspace_property(connector, - dp_colorspaces, - ARRAY_SIZE(dp_colorspaces)); + u32 colorspaces = supported_colorspaces & dp_colorspaces; + + return drm_mode_create_colorspace_property(connector, colorspaces); } EXPORT_SYMBOL(drm_mode_create_dp_colorspace_property); diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c index 1dcc268927a2..6e7cef58a626 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.c +++ b/drivers/gpu/drm/i915/display/intel_connector.c @@ -283,13 +283,13 @@ intel_attach_aspect_ratio_property(struct drm_connector *connector) void intel_attach_hdmi_colorspace_property(struct drm_connector *connector) { - if (!drm_mode_create_hdmi_colorspace_property(connector)) + if (!drm_mode_create_hdmi_colorspace_property(connector, 0xffffffff)) drm_connector_attach_colorspace_property(connector); } void intel_attach_dp_colorspace_property(struct drm_connector *connector) { - if (!drm_mode_create_dp_colorspace_property(connector)) + if (!drm_mode_create_dp_colorspace_property(connector, 0xffffffff)) drm_connector_attach_colorspace_property(connector); } diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 6ab83296b0e4..8d08d6a36f37 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -416,7 +416,7 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, if (ret) return ret; - ret = drm_mode_create_hdmi_colorspace_property(connector); + ret = drm_mode_create_hdmi_colorspace_property(connector, 0xffffffff); if (ret) return ret; diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index edef65388c29..5825c6ab969b 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -393,6 +394,7 @@ enum drm_colorspace { DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED, DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT, DRM_MODE_COLORIMETRY_BT601_YCC, + DRM_MODE_COLORIMETRY_MAX }; /** @@ -1818,8 +1820,10 @@ int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *conn bool drm_connector_atomic_hdr_metadata_equal(struct drm_connector_state *old_state, struct drm_connector_state *new_state); int drm_mode_create_aspect_ratio_property(struct drm_device *dev); -int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector); -int drm_mode_create_dp_colorspace_property(struct drm_connector *connector); +int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector, + u32 supported_colorspaces); +int drm_mode_create_dp_colorspace_property(struct drm_connector *connector, + u32 supported_colorspaces); int drm_mode_create_content_type_property(struct drm_device *dev); int drm_mode_create_suggested_offset_properties(struct drm_device *dev); From patchwork Mon Dec 12 18:21:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071330 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 E7C32C4332F for ; Mon, 12 Dec 2022 18:23:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 81B3210E24D; Mon, 12 Dec 2022 18:22:24 +0000 (UTC) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2064.outbound.protection.outlook.com [40.107.101.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0372010E25D; Mon, 12 Dec 2022 18:22:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JRFd4IDEBdfAJBxysNf4TvL44uaFKZ8Xq9y48xw4YHSOC5cNB520QXlXtB11dKODEYhFmo4s4U8ozy/thqeIsa0EpyDPGPY9Psn8EkRaDI5vlL5XdVBJgZw17135EkJqkJE/UJpLqjsedgdIiA3yBIgZwQGtHqYyEsyC5F9Af8+PGE/y46o25jf6G1uP4zHon5f9DZkCLyQH20Oykb4sKwWLU7K2tOtldCrV2BMUzgXC71XFEC+Viz3dHeCj/3K4XvaPxurLQejvEDHQNwRkTkuaoi6SNUxkRzPTYuBL+aQ10vNCYSEpCBpaRUyWb7pGgQdUFTnmEe9eO/+Xxum9PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E8NcwNrqPrkWHyjqO7fXPtJjKjdY5P+ooK7ozCM6Ogs=; b=Dxp1xNI74yqTgAAAn/yG4+jTshV1zeyc68RPBl0gagcBbZrQUaE5od8T7+UF47n7nxMmkbpFnLyx3WmI/4NrjMr/GHkHuKLTyuQ20V4cnXj/7EjsWJnoaaVzQrSDNV7MLz3cQw2V8Dzq7oPZdnJfcmmBetkflrJ7PVVrVnkqRySJlsP0V3NRnZmFpBflcNQvS2aSJT7FVyDZx3r2rgUqOf0PCGSaJdqMzCQykDv8Ir1rDMr8U4HxxZq1TDfESocxUl8JUnteX1obv0rRp4lzaNWMaPih9smFCaYB0VpCuSEMk24+wjODDt7vNwIXtUlKu8j8ZE5V10uBw1zROvQ1/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E8NcwNrqPrkWHyjqO7fXPtJjKjdY5P+ooK7ozCM6Ogs=; b=21s2OR67q1U4FIArvdxeYMVv3awSOqEVBX2ynOgORrKj3+W6pkNbEUacZUmQCrEQxWyqe9knZMM781reVrePOiyK6Wq2HC4YxALbXKx2qDpPFS14r0pWzqMzebfY5b/taaF5S7V2sERm59DeEXkCdwAxmgZAxWZvsOE242yIVeU= Received: from DM6PR02CA0166.namprd02.prod.outlook.com (2603:10b6:5:332::33) by IA0PR12MB8228.namprd12.prod.outlook.com (2603:10b6:208:402::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:12 +0000 Received: from DM6NAM11FT079.eop-nam11.prod.protection.outlook.com (2603:10b6:5:332:cafe::72) by DM6PR02CA0166.outlook.office365.com (2603:10b6:5:332::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT079.mail.protection.outlook.com (10.13.173.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:12 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:11 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:11 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:10 -0600 From: Harry Wentland To: , Subject: [PATCH 07/16] drm/connector: Print connector colorspace in state debugfs Date: Mon, 12 Dec 2022 13:21:28 -0500 Message-ID: <20221212182137.374625-8-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT079:EE_|IA0PR12MB8228:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d2c8322-09b4-4bb7-e08b-08dadc6dc9f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6321+wXfFkj9+yGs8jl1jox4itW7FsuXWrfK9daiIX/wpEwbD77+cRWWYzMc5HggYZF249XFdAVVlTWzQhzMoDn51SM/JgKZLjHLrztVAKXEh18jU7IljGCQHbWnisEPXMRrhXZGxOXDZE8rxfih+VjGLSlGO3KNXJfktFX+V6CdnIXxwSIJ8F8MSaXDhZACjDkX1eCB60KBd4TKwZhV7J3Y4B+/6sdJBGFbU7bsiXN0pLJBXkxhhqldHuiWEu+nvKNno1lC4VOiloov1Hz9nVvM1t0UEOADPFgFKiyrGV4B/yBTGpptO8/7+bp2UCLfKu7NDIsJWkIio/DcfJRfXVClSl+jds/WMUxOYT5GSoUX9mHobdV5nNEMiJKy5sRcdOakeopBaTpU2pZLK30dpGZj1SFNNNSFwpeXGvxLaTjgieW5cnzU9OspXOle0yNzShe09LRfoTGdnqDK1EDzvRl22JxrwE8T6brOMVUJHOJTKJoeETbIoFDciFTIIHTdKiN/17msAkGQWkSMGcO9LFq78xYoEa9nFEppETR0O5DvKV8RbDsGCDmJTUYVh+Ere5DyW1EshX8wb22GKXKrONK6LDaU+ksSwnDdWKkdrMMEbA9B//wQvU2USaY5WAWaLwLCEYgMHks/O3HT4KA0c5vW7hDxijRFDsEPVLJequEAVLximz8Ly4JrK2jt7ZDGSqlkpu9krP74mOCg5Z2bci4sBb4heVuUgpIdrxlfOdI= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199015)(36840700001)(40470700004)(46966006)(36756003)(81166007)(40480700001)(8936002)(478600001)(41300700001)(6666004)(82310400005)(356005)(82740400003)(86362001)(40460700003)(36860700001)(5660300002)(336012)(1076003)(44832011)(2616005)(316002)(70206006)(110136005)(4326008)(70586007)(8676002)(186003)(26005)(54906003)(426003)(83380400001)(47076005)(7696005)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:12.3732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d2c8322-09b4-4bb7-e08b-08dadc6dc9f7 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT079.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8228 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/drm_atomic.c | 1 + drivers/gpu/drm/drm_connector.c | 15 +++++++++++++++ include/drm/drm_connector.h | 1 + 3 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index c0dc5858a723..d6d04c4ccfc0 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1071,6 +1071,7 @@ static void drm_atomic_connector_print_state(struct drm_printer *p, drm_printf(p, "\tcrtc=%s\n", state->crtc ? state->crtc->name : "(null)"); drm_printf(p, "\tself_refresh_aware=%d\n", state->self_refresh_aware); drm_printf(p, "\tmax_requested_bpc=%d\n", state->max_requested_bpc); + drm_printf(p, "\tcolorspace=%s\n", drm_get_colorspace_name(state->colorspace)); if (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK) if (state->writeback_job && state->writeback_job->fb) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 0df5db3e4fec..2305eddcd0d4 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1031,6 +1031,21 @@ static const char * const colorspace_names[] = { [DRM_MODE_COLORIMETRY_BT601_YCC] = "BT601_YCC", }; +/** + * drm_get_color_encoding_name - return a string for color encoding + * @encoding: color encoding to compute name of + * + * In contrast to the other drm_get_*_name functions this one here returns a + * const pointer and hence is threadsafe. + */ +const char *drm_get_colorspace_name(enum drm_colorspace colorspace) +{ + if (WARN_ON(colorspace >= ARRAY_SIZE(colorspace_names))) + return "unknown"; + + return colorspace_names[colorspace]; +} + static const u32 hdmi_colorspaces = BIT(DRM_MODE_COLORIMETRY_SMPTE_170M_YCC) | BIT(DRM_MODE_COLORIMETRY_BT709_YCC) | diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 5825c6ab969b..545eb6eb456a 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1906,6 +1906,7 @@ void drm_connector_list_iter_end(struct drm_connector_list_iter *iter); bool drm_connector_has_possible_encoder(struct drm_connector *connector, struct drm_encoder *encoder); +const char *drm_get_colorspace_name(enum drm_colorspace colorspace); /** * drm_for_each_connector_iter - connector_list iterator macro From patchwork Mon Dec 12 18:21:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071331 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 2AFEFC00145 for ; Mon, 12 Dec 2022 18:23:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6BD310E26A; Mon, 12 Dec 2022 18:22:38 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2057.outbound.protection.outlook.com [40.107.237.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E6D910E262; Mon, 12 Dec 2022 18:22:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lnsXSs3Bnc/Dx046zn1eYanLgIfRtkt7PztpA5vhmEqXd8wUOGrH/7o54ABikP3XXdWWo/7dKxwZwyY1/tqhl0sOCqth62LBmvdOQt3mWzB3khLmYFjPxQrYX3QNrWM+vsntSeV6ala9UUN0Jh1PGuYSi/Pj7QCJ95oy1mUsNyIR2XzvixuDJFCfhoIyg7RBtRO9eL5eG0SdWFYiOzWFlYdfZ+/skc3fWCuKKqRFLpX0aLLa7cRS7XD2X1dvdkLeXSO0dcUN9G4+5CfxyGy2KSHZkhvh8RKntTkFFSSE+SJLd37fUAsVbxqY8IqPGHpacO/faVxX8wwVkN3KRpiR2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=THwYQK8M1CE0cNtnrcXk+e+ULQkOk5fC0QlDuhKHl3s=; b=INpNJBQmKRk4n0TesxljZtO7Tp0LeTsG2wnG6v27h/V3+SCano6p7lRGgKRMKSh2ECAGrhYh2DyW8ROA3h2/kZAavIhAx9SYvGT/CXrZnS/b4YhcIBz4xb80rfQLOpLzOwTR9DVjA2gt8a14edLs7R1/fa9PtIUheHTlBqxNQ8s9cqHFZs1SBw37SLPs9hpxwfB+98cZb57VsHK9sMvdi2uq3zk73802Yo2EbYlWLRbazwvi587PhVqBssMsvWJgVEMdj1mNbrdIXF/PZvE3Pp7XfmiWMqlWJem4MjzlDsl4vTQtCzNlIDWVyp9jURegkuwcGJzSXbz1WGkrLIgdkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=THwYQK8M1CE0cNtnrcXk+e+ULQkOk5fC0QlDuhKHl3s=; b=WyMTWf3jEHmJdXI152VbmzdvbiHFaOQeogcc/SppUeS61a0a0yhZQBQczPC9Q+7WTfkVjXPCfMeDTlZ51Me59eiPz9CPKZV58lVVXrLqifVChyFtPjiybv6H7g14bXvBn9uW9u5LINuZGqXodUnEx9VdsgV0T9a51dPZty0MmS4= Received: from BN9PR03CA0477.namprd03.prod.outlook.com (2603:10b6:408:139::32) by CH3PR12MB8073.namprd12.prod.outlook.com (2603:10b6:610:126::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:24 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:139:cafe::5e) by BN9PR03CA0477.outlook.office365.com (2603:10b6:408:139::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:24 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:22 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:12 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:11 -0600 From: Harry Wentland To: , Subject: [PATCH 08/16] drm/amd/display: Always pass connector_state to stream validation Date: Mon, 12 Dec 2022 13:21:29 -0500 Message-ID: <20221212182137.374625-9-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|CH3PR12MB8073:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b9061d8-2624-4e05-2a77-08dadc6dd116 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pUo95Ko/m+OYErJgB93wZeSrzWr0j2Tbvs9Yi35e74GQafAzBMofHdcnRnT7ooiHPY64cpr1+r2SMMwUSeiYL1m6fgzm6DkztNid0IshnWhj20EXqhjUCdXgJZL3qALItT7Ye4y4Hl+Cn8au25nnEVouTuw6fDphMkqWQQXj3wLT1gJrGFQc10eQFzJKoUTyQqswDUMQI6Ohf1QkgXSH1TmhX3OTUWLKVoOdKCSqe7FfyCGGZvBFScLYApsOMoH7+1aCoDAugkekGvF/OIqC63lFDWkZi/9bOht+A/opFu6GiiQN5vi/ntzkvYrrDVH9iMK5w9e8izNarGC1jhu+3p+wR6YzsnYxtLAFAWjXGMgHzXCIQXdRi/jgdY9Zff6sgg5zfh4R5HheZGmTvDzwWsJ0LvD3NeMshrWxyOnCYp091kkWKhHHgr63BltYcVAXr3X6DABj1b4DPh04zibeCZWiGwYTwuWa37pj5fZIkqtDxNAq9Vbts2j8U86HV47zI2AjSf6ApNNTfdYwhG/HCVwCzi0ztA1fgj4FZgOL4QU/QaFDZBJ6n0GqB5nG5ceyhkZbjw79dP8Dlu7jSoDqO56aE8u2fcvlxPlxt1Stjqrm1ZAdUpnEv78lKZQlc6a/YzEudas/HK4W8tc70URL2rkSLmf+gXMgsOBJTwCJg56csJH5uD4iBt6oHIbUCMdPWJehta8pa0NllwXdhj7m0+Ju5aqzkb9Wy0JPmjvbTVg= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199015)(36840700001)(40470700004)(46966006)(36756003)(81166007)(40480700001)(8936002)(478600001)(41300700001)(6666004)(82310400005)(356005)(82740400003)(86362001)(40460700003)(36860700001)(5660300002)(336012)(1076003)(44832011)(2616005)(316002)(70206006)(110136005)(4326008)(70586007)(8676002)(186003)(26005)(66574015)(54906003)(426003)(83380400001)(47076005)(7696005)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:24.3314 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2b9061d8-2624-4e05-2a77-08dadc6dd116 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8073 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We need the connector_state for colorspace and scaling information and can get it from connector->state. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 0f391a147354..74cb0e200d90 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5761,15 +5761,14 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector, { struct drm_display_mode *preferred_mode = NULL; struct drm_connector *drm_connector; - const struct drm_connector_state *con_state = - dm_state ? &dm_state->base : NULL; + const struct drm_connector_state *con_state = &dm_state->base; struct dc_stream_state *stream = NULL; struct drm_display_mode mode; struct drm_display_mode saved_mode; struct drm_display_mode *freesync_mode = NULL; bool native_mode_found = false; bool recalculate_timing = false; - bool scale = dm_state ? (dm_state->scaling != RMX_OFF) : false; + bool scale = dm_state->scaling != RMX_OFF; int mode_refresh; int preferred_refresh = 0; enum color_transfer_func tf = TRANSFER_FUNC_UNKNOWN; @@ -6381,7 +6380,9 @@ enum drm_mode_status amdgpu_dm_connector_mode_valid(struct drm_connector *connec goto fail; } - stream = create_validate_stream_for_sink(aconnector, mode, NULL, NULL); + stream = create_validate_stream_for_sink(aconnector, mode, + to_dm_connector_state(connector->state), + NULL); if (stream) { dc_stream_release(stream); result = MODE_OK; From patchwork Mon Dec 12 18:21:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071337 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 35A77C4332F for ; Mon, 12 Dec 2022 18:23:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AE3F10E26E; Mon, 12 Dec 2022 18:22:54 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2054.outbound.protection.outlook.com [40.107.94.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2198410E264; Mon, 12 Dec 2022 18:22:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X8UluuN6/kYyXrTM9ij63sGdx5mnQK1jLAjjn8O19lFl46ADfbVTni8lVuv6R8q6913MOL1QgcrZP5gnkcJLbVfeldShQ8q5otMq5CAklboh+5snW2Y1Qa2bIq5kGuvuy8/foHUuynVzE63/4SvKh9fmos9/wFeRbAVvPlXVeTgq5NEMaxr52jPljYipEQ5TWslBLZ9nJuYiRSi3GERzK00Ir8NyG1lEDffDOXjXfXwVLOYZuZIyjs9Pzu7xSgiejrq4CuPlYbjfR0hcl3YaTNJnSP2hYUnz9M9dgRj/JjzHKSp/km81cSBYpl6Qbv4SdGW+pnZnvPjv2oFOnH5vZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Wo4pjxNpws7oCxvcuSS9zFF5/vrFTw0qZY+COUa3CrA=; b=SeZEBfgE0K8z/r3uY42+yspZ6u6g/X72ooneFHp3kcvG7ybdCRbt9iSRUEdaxcXtLq5oVbqX31qGp5Fk7Q4TIOtpbkCvf9A1rWOO2/KD0RcAFRFXkMogzmGa65h9kslFGs64RInkFXALXsZMVkwa8AGTCr0NCj5vltOMsn9L5W8v/mpkYq5XokhiTfmgzTalrjvin9YhypZOfP4veLUyOy2DUYMGdQCVhLgbm/U6CjlTkXHtLVaK0f/pcfjiIOOsIOoWoH6IBJtWzU14Ibsn18TwtiS1OvbfujqchpHCLtd7Flh7aR1HHJ0Hk37wQrsSQN2XW90ImLqT6qIJ33NHrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Wo4pjxNpws7oCxvcuSS9zFF5/vrFTw0qZY+COUa3CrA=; b=YabgOqOmegxRCjItosbOx8PXgzYA7ugJpTKDO5Nsl9VEC4QjPm8ukcF5PM4xF7vx9lyOJGTiWM4vSaGAt+JUYtgzWtbGw2wAbp/8M44gxX5K8dD6BC0Ii/OA51oEB5EMPYF8sgQUyA/McXM9bZ7cdU44btsZ4J6oi/A2qcAkixs= Received: from DM6PR07CA0037.namprd07.prod.outlook.com (2603:10b6:5:74::14) by MN0PR12MB5834.namprd12.prod.outlook.com (2603:10b6:208:379::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:23 +0000 Received: from DM6NAM11FT115.eop-nam11.prod.protection.outlook.com (2603:10b6:5:74:cafe::32) by DM6PR07CA0037.outlook.office365.com (2603:10b6:5:74::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT115.mail.protection.outlook.com (10.13.173.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:23 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:23 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:13 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:12 -0600 From: Harry Wentland To: , Subject: [PATCH 09/16] drm/amd/display: Register Colorspace property for DP and HDMI Date: Mon, 12 Dec 2022 13:21:30 -0500 Message-ID: <20221212182137.374625-10-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT115:EE_|MN0PR12MB5834:EE_ X-MS-Office365-Filtering-Correlation-Id: 227d6966-5053-4524-7502-08dadc6dd09b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zuHiOM2yaGW71ZNBbeGrJxJGnOPF4gv5GvX99zeRTqZpWnwywxxQAZGdUI6SNb+RTVMa6wnhKeMUcQGtLUBg2Ib7cvyPdhAD5i+8NGEDlQKYCCqJ9Li6UbBg5KPtPTlTx8x49S2/supb2M9s37foq9CKXJkEa0PCOXQCZvQWwvIZ/1+S82Boe5y4v7rL5oOCARCErKIGts3pGLwPmZwiUPaErwEwjux+vqXlez+4SwJbUSkXCU7IrygmL2ji706YyZaLwaR0s+tCnz5hmKQYia2vQ1IzMy8z+dlwsLu8t7FXzd3cvu7NMbJm0/+v+RE/7uZ9y2lI1AEkGb6Qc4yb4Xl80HdPkwd2j4sarLG1duVsh6BPlTywE0OVkIcLVv8m8XCqXaRGbj2a5lSNNx9vtomayQRSWsyaQpjiMjYzCt3VkNSjzVNIbt8N2LyYiZQqZ22my7IdNwbRDPiVJLhTRmNeDmdopj1TYZgLpW3dradgrl7tX75nSvRd8addRrbP23tMGER1JDyuPsCsQsVTWl/Y+2sBJ/98/nYF/nDC0Hm5rjeDn4N5/k//cnfTXRi/ShHnwnXuvub0whAdSfz09FX0PCKcztZZucXV9SZMXX0W8EFiAQ+fVFCRmks/8Sj8jLwwPobGi1eCSQ/94NRnK/1KGaGCUSVIRV/1Swd0L3JZvakOor+OEcVU/uBXRvslW6vj5yQxiI63fPRC3Xz8ahf9YJQ0yl03YWzMkocG0Y0= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(39860400002)(346002)(376002)(396003)(451199015)(36840700001)(46966006)(40470700004)(426003)(36756003)(2906002)(186003)(336012)(47076005)(44832011)(54906003)(1076003)(110136005)(316002)(40460700003)(6666004)(7696005)(40480700001)(86362001)(2616005)(478600001)(26005)(70206006)(70586007)(82310400005)(41300700001)(82740400003)(8676002)(4326008)(36860700001)(5660300002)(81166007)(356005)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:23.4960 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 227d6966-5053-4524-7502-08dadc6dd09b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT115.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5834 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We want compositors to be able to set the output colorspace on DP and HDMI outputs, based on the caps reported from the receiver via EDID. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 74cb0e200d90..67def042e9b4 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7019,6 +7019,12 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector) return amdgpu_dm_connector->num_modes; } +static const u32 supported_colorspaces = + BIT(DRM_MODE_COLORIMETRY_BT709_YCC) | + BIT(DRM_MODE_COLORIMETRY_OPRGB) | + BIT(DRM_MODE_COLORIMETRY_BT2020_RGB) | + BIT(DRM_MODE_COLORIMETRY_BT2020_YCC); + void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, struct amdgpu_dm_connector *aconnector, int connector_type, @@ -7096,6 +7102,15 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, adev->mode_info.abm_level_property, 0); } + if (connector_type == DRM_MODE_CONNECTOR_HDMIA) { + if (!drm_mode_create_hdmi_colorspace_property(&aconnector->base, supported_colorspaces)) + drm_connector_attach_colorspace_property(&aconnector->base); + } else if (connector_type == DRM_MODE_CONNECTOR_DisplayPort || + connector_type == DRM_MODE_CONNECTOR_eDP) { + if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces)) + drm_connector_attach_colorspace_property(&aconnector->base); + } + if (connector_type == DRM_MODE_CONNECTOR_HDMIA || connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector_type == DRM_MODE_CONNECTOR_eDP) { From patchwork Mon Dec 12 18:21:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071333 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 9E475C4332F for ; Mon, 12 Dec 2022 18:23:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 398F310E26B; Mon, 12 Dec 2022 18:22:40 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2070.outbound.protection.outlook.com [40.107.96.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0156910E261; Mon, 12 Dec 2022 18:22:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ByeNxFqRsz4gCLWmaeFH2ihWvUtL12WJdNiQgqH7hm8LrwO/oH1mG/1w1owuvkm+Igc8DHav6+t42rFbwv6ED2HFpvO775Ll/4T28DawzLqLQCO6mf+t5nJg9BRXnj4vKWg0PsBepYHd+CxgguvqQkowa63RmrCLqcdiLM5vVce2iXyoHGU1z54s1efG0ldFwwt037rJXwqIveSO9vBWW7nfmpAkoM+chU83PdOx8qDoao3fOasiQOKQPbUel2gt4RLd+bJa79jIweV1TDzDCdNqRaV2hDRIefwykEM0FTw3waamd8u5PEHy05f1SCWbhYrfxTxIrh1x7l2W94cBNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t8gF1f3PbaC1ZPEzYg4/cPK1YI+We0uVvb/odDaBF3g=; b=NZADPLda2sTulPVUHREbd799XOnUQrhuhTXg6NpVzf4cf7m37kFLmGN+8LI8Fk6cRBXEpJN9jOKv8OV/0mESCO4CR2U10M93Gw44KNZmvu+fDuyUo/WuOobxeYxTPuao6UnQBUqCf3tbyIrhtzb/weX2hKAJb9IOfn9+q19fLiPUL3+5PpAp/KEc7O0gKNtJYanKTd49AYCg6bR7blu0aixI2hhZhqfBVvaQPGKOjPRkieyyAbUVgFoBVYMVNfjZeKzY4HUEh1cT4/xyfzGXLOlyRP/J84M3xR5YRHhXIasCuWKjl5jqHYNN8tFnTlfuv9/WRY5zTWgKuKqKm7iiPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t8gF1f3PbaC1ZPEzYg4/cPK1YI+We0uVvb/odDaBF3g=; b=uT+kc1smpge3VT6DmN19NzABNWt79lcf/Y1/iX9sGUYRaMc2ZGzOs7TgV1Uk9GkKCIaInIJyAswjvXusfcVXrgVlUsVf2fFLfq/YgQlXSs8/4oRopRQvoNEt/HbbJ06+Qb0DAHDmsc9FxEvPjqCrzN3wFxn5TZ837Kxthu++I9A= Received: from BN9PR03CA0469.namprd03.prod.outlook.com (2603:10b6:408:139::24) by PH7PR12MB6786.namprd12.prod.outlook.com (2603:10b6:510:1ac::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:25 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:139:cafe::a7) by BN9PR03CA0469.outlook.office365.com (2603:10b6:408:139::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:25 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:23 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:23 -0600 From: Harry Wentland To: , Subject: [PATCH 10/16] drm/amd/display: Set colorspace for HDMI infoframe Date: Mon, 12 Dec 2022 13:21:31 -0500 Message-ID: <20221212182137.374625-11-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|PH7PR12MB6786:EE_ X-MS-Office365-Filtering-Correlation-Id: c6fc9e5d-c8c4-432b-3709-08dadc6dd186 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2ZQcD1GbIEfu6hwMKQjWKY32IlW1sxGhFcR4a07BZ6VxlM0ZEgXx1C3T8n05dfAmfebQPLrvG6O0NNZD+AaolAjbn7VL1le73J6xAP63sPd/TRUbmMnpVZa5URepcj+2Qv0SdoGH9g2l/vtuqQ+HO5Sxs9D9ki9oWIP/M9IVAV1re+MqkzKDa7LmigMXk6kOUlK6aawldHxFPBzKFwxk1siYkEskcet/GLysqDwZkjlObZVO7i1bHzVYF+2Dm65LI+15KezZvX+C8wdxFVYpKSKoOHQybJMCxtAMs9YKaOjoG2czx0JZtbBkxmc5WI8+q9Wd4A30I+KF2sGiJicABXoInpUQo4H3IGXdx+B+/FyGhRq5usX+j9GOu/ypeHtIMQPl2RQ/XugSiMw/lkbPssx5l5TKGiqLjp3pcN8e5UK9sXXRvnfag3kxz8GWsn1g5ypdCXP86CveUmmYz85U12JYAFJ0M5R3/6P5KqlIjd/h5cll4CnPQV6IX1y5Z0XBL6qHgshhLterOjqVvbyAkR714xzzU/f1TwCazHu+1vevnkhjS6uHhNTXtUD0yjVvKp/2UyXtTO5V8ZVBTqT0thNyoFDkM73gksp/OFZtxiY5P4Ol2zFIurLCW18QqBelQokGo0mzNMZaZ1GkHmUpTqmgAjey410m2pJrpgtSce4aD/pz8bFFJn2O1ux3xSd/kTvW5Xq5qSb9dAY2LEz683bZ5zv4myKdD8NAJ4FDdUs= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(39860400002)(376002)(396003)(451199015)(40470700004)(36840700001)(46966006)(36756003)(41300700001)(83380400001)(36860700001)(26005)(186003)(478600001)(8936002)(5660300002)(316002)(54906003)(110136005)(6666004)(70586007)(82310400005)(70206006)(8676002)(4326008)(86362001)(426003)(47076005)(7696005)(66574015)(44832011)(356005)(81166007)(336012)(40480700001)(1076003)(2616005)(82740400003)(40460700003)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:25.0814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6fc9e5d-c8c4-432b-3709-08dadc6dd186 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6786 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that we have the HDMI colorimetry fill the corresponding AVI infoframe info. Also signal "mode_changed" if colorimetry changed. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 67def042e9b4..310388219f8c 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5282,6 +5282,7 @@ static void fill_stream_properties_from_drm_display_mode( if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) { drm_hdmi_avi_infoframe_from_display_mode(&avi_frame, (struct drm_connector *)connector, mode_in); timing_out->vic = avi_frame.video_code; + drm_hdmi_avi_infoframe_colorimetry(&avi_frame, connector_state); drm_hdmi_vendor_infoframe_from_display_mode(&hv_frame, (struct drm_connector *)connector, mode_in); timing_out->hdmi_vic = hv_frame.vic; } @@ -6476,6 +6477,14 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn, if (!crtc) return 0; + if (new_con_state->colorspace != old_con_state->colorspace) { + new_crtc_state = drm_atomic_get_crtc_state(state, crtc); + if (IS_ERR(new_crtc_state)) + return PTR_ERR(new_crtc_state); + + new_crtc_state->mode_changed = true; + } + if (!drm_connector_atomic_hdr_metadata_equal(old_con_state, new_con_state)) { struct dc_info_packet hdr_infopacket; @@ -6498,7 +6507,7 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn, * set is permissible, however. So only force a * modeset if we're entering or exiting HDR. */ - new_crtc_state->mode_changed = + new_crtc_state->mode_changed = new_crtc_state->mode_changed || !old_con_state->hdr_output_metadata || !new_con_state->hdr_output_metadata; } From patchwork Mon Dec 12 18:21:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071339 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 3D156C00145 for ; Mon, 12 Dec 2022 18:23:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A079210E277; Mon, 12 Dec 2022 18:22:56 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2084.outbound.protection.outlook.com [40.107.92.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBBB710E261; Mon, 12 Dec 2022 18:22:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hiDxqAmjqS/3Xs1qOW7P9M0CxKKKIjdGpyQYcS4qK+Z+nXRsJJtcMMcrbpjtI98p5HFx1K5OgguKktsto9sRvkA9f+c9e1rqNmlVtm5gDfln8Pm/5DYhwO2KL4WGUnrsrbea0J7ryLLPTVWIZMDFpive5dhuLkrHDye87lZLiPTdtTZcXv0j9hvIHXdqkalDDOSojWw0vRzlnu3seAm9P3uyBGhZunICu9HMPnKDbV33+oqyA0axg8XDoN9AYl9XxAspaeAOogVVd0YQH2Rye+iwt8hQrBKD9j1BhKZ/zLjAWQlhFFqe7rddDIu+ggMSbMj74jZ2LI4LD6TTCCWsIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oWJtm8bxmVex7XnYQ+6KI71aHeW9BGrFMdDXdtCDrWI=; b=IfazUMYA3CmDybR3U0OAvrr2c8YNP66TsQS/X00r9r8tVtWBByQk4OTUwO5CYY7TFxoN+Q3jRgKQQmaseVQqZafFJXGr9WPrTxYxBujLvWqTTLVsJP0gHxx/N7XuN+Zhn5Wfdci4RfESRpyiaS3gjVaf/qd3n47ubLwDzma5+zmMKcwCRfC8AjOJWvcogwDO3WYdYyitkhCrUjXvPKTXqqz+55i4cjapQWZKh7IuK+CJxKIvvpP36C1wh5s6tLAzSOiP6oOsT01rXLVE578sGw9tpKV6vAE2fBAoZMftMCpBK/c8N1rEEk/pWlplNDpWHSWYtOiAHKwifKVk8KG4vg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oWJtm8bxmVex7XnYQ+6KI71aHeW9BGrFMdDXdtCDrWI=; b=NmWxThEcS+UzziE3KyovO7NVJNdrj1j4UG5yD2Qo8Iab/zSklNPyyY+p3tsVMaKcvUGw4BB38s7xsNLogoZKh5nO5mg40o2lSZQYhLDow3fMYqxCO6gcRgrw9tFLQJeGOVuPsmn7x5bvDC1UENr5e3/U2iGPC/ecDbnVHKuogsw= Received: from BN9PR03CA0469.namprd03.prod.outlook.com (2603:10b6:408:139::24) by DM8PR12MB5416.namprd12.prod.outlook.com (2603:10b6:8:28::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:25 +0000 Received: from BN8NAM11FT058.eop-nam11.prod.protection.outlook.com (2603:10b6:408:139:cafe::a7) by BN9PR03CA0469.outlook.office365.com (2603:10b6:408:139::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT058.mail.protection.outlook.com (10.13.177.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:25 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:25 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:24 -0600 From: Harry Wentland To: , Subject: [PATCH 11/16] drm/amd/display: Send correct DP colorspace infopacket Date: Mon, 12 Dec 2022 13:21:32 -0500 Message-ID: <20221212182137.374625-12-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT058:EE_|DM8PR12MB5416:EE_ X-MS-Office365-Filtering-Correlation-Id: 4050de57-8ad6-4431-1e99-08dadc6dd1d0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YhA6QRwZDQ8dP0mow3c2WQFbhbDXXRerqsbLywhtDXoZOz2pLv6/mByVxvH8Lhby6VVgair4ouDnDjibZtTmN9Pw0hZqhrca3+ImMqxFZWEEOQgUesqbm1Tg3iESQeHtUMyCGTJPrm3w/ns/04bY9efiBcWuZ8dgs8oOyoesIfuy+MmObG1jGj9Z2KrhZsxfZgeGJV3f1w2I1SpAR036Gu0RNybbyHt4LaKw+jdi7cUPsCIfaoCPfCHJiR/wZS9VU3JT3yQYJIqK4OJxVk4F3SW7iYbNgkCVaGxGodSHKPWgRvTCO4JuN/wesAvjstx3ybsC2rquUHmjn5deSOBUCKC+jOkFv6E+AkerV8yXibt9VnU0ihKTEXJNLSnjNhz1OBP4iQkXSmzPowXk6YhxyXvlPi5bQyDNj6SlHdq4FnfwtaV+/4S62kmb6IzdK/s5RU0XVyjIdGsWGNVBKfKZFvvAMsg0TOtKS7H5h8SFUTVrrnl14RT5clij4My21ej8v0+vxbdjW8DiKRsJ/FCVBSar62s4KsugHA2yLcz3luOj1ybGOnTFxA0E6QSpNK0tbjmvfKKX3NrQCqYqLfNXLW+iwQllQAyPiclzVMVCNHMAuB6vq/dyXb4XbeOUosascOWW4TRJXDlEjg0gEwxwXg8UADHSAMruIJwq3VxFu4FnJe5qGy1DJ9GdZitSu55QgMAF870FstBoKiZJ6JXeqr769/1yO1QO60HFjKdhSe0= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(39860400002)(396003)(376002)(451199015)(46966006)(40470700004)(36840700001)(316002)(54906003)(26005)(110136005)(40480700001)(36860700001)(6666004)(2906002)(426003)(86362001)(70586007)(36756003)(70206006)(186003)(47076005)(40460700003)(356005)(8936002)(478600001)(2616005)(44832011)(81166007)(83380400001)(82740400003)(5660300002)(8676002)(4326008)(41300700001)(336012)(1076003)(7696005)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:25.5501 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4050de57-8ad6-4431-1e99-08dadc6dd1d0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT058.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5416 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Look at connector->colorimetry to determine output colorspace. We don't want to impact current SDR behavior, so DRM_MODE_COLORIMETRY_DEFAULT preserves current behavior. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 310388219f8c..8cf5a44d1d15 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5147,21 +5147,21 @@ get_aspect_ratio(const struct drm_display_mode *mode_in) } static enum dc_color_space -get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing) +get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing, + const struct drm_connector_state *connector_state) { enum dc_color_space color_space = COLOR_SPACE_SRGB; - switch (dc_crtc_timing->pixel_encoding) { - case PIXEL_ENCODING_YCBCR422: - case PIXEL_ENCODING_YCBCR444: - case PIXEL_ENCODING_YCBCR420: - { + switch (connector_state->colorspace) { + case DRM_MODE_COLORIMETRY_DEFAULT: // ITU601 + if (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_RGB) { + color_space = COLOR_SPACE_SRGB; /* * 27030khz is the separation point between HDTV and SDTV * according to HDMI spec, we use YCbCr709 and YCbCr601 * respectively */ - if (dc_crtc_timing->pix_clk_100hz > 270300) { + } else if (dc_crtc_timing->pix_clk_100hz > 270300) { if (dc_crtc_timing->flags.Y_ONLY) color_space = COLOR_SPACE_YCBCR709_LIMITED; @@ -5174,15 +5174,21 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing) else color_space = COLOR_SPACE_YCBCR601; } - - } - break; - case PIXEL_ENCODING_RGB: - color_space = COLOR_SPACE_SRGB; break; - - default: - WARN_ON(1); + case DRM_MODE_COLORIMETRY_BT709_YCC: + if (dc_crtc_timing->flags.Y_ONLY) + color_space = COLOR_SPACE_YCBCR709_LIMITED; + else + color_space = COLOR_SPACE_YCBCR709; + break; + case DRM_MODE_COLORIMETRY_OPRGB: + color_space = COLOR_SPACE_ADOBERGB; + break; + case DRM_MODE_COLORIMETRY_BT2020_RGB: + color_space = COLOR_SPACE_2020_RGB_FULLRANGE; + break; + case DRM_MODE_COLORIMETRY_BT2020_YCC: + color_space = COLOR_SPACE_2020_YCBCR; break; } @@ -5311,7 +5317,7 @@ static void fill_stream_properties_from_drm_display_mode( timing_out->aspect_ratio = get_aspect_ratio(mode_in); - stream->output_color_space = get_output_color_space(timing_out); + stream->output_color_space = get_output_color_space(timing_out, connector_state); stream->out_transfer_func->type = TF_TYPE_PREDEFINED; stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; From patchwork Mon Dec 12 18:21:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071332 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 8EB0CC4332F for ; Mon, 12 Dec 2022 18:23:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B95D210E264; Mon, 12 Dec 2022 18:22:39 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061.outbound.protection.outlook.com [40.107.244.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id DCC3810E262; Mon, 12 Dec 2022 18:22:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D6Utqv38dCuO/MBxcThpotutiXyWFuy//UAU0Hyiph0G1TYK8/eyoNjZKofn+CAVVNTu1UQWgq5CxAV5zt1FtC3VNt/W8O1JWPOxdJfpV2x9rPthDbjChtz7M8E5f3v6Qpf37zAIj8uLhymxrFOOxN57g7IV0PZC7TDnes+BvkonyrQSR3EpE4DrEF38CS0GCumMtAB0ygjIpprBecrkMWwg96ptoeuQMyUewORvXBVEsjui31ZFUbJiY2ZtJO6v4WO0Q/N2N1Rbcqi+0COiZL6bY7qpao427vRzI+W/VCIB5zbj1a+uHzRQONdG9Nac89Q6KLI5PQXlVUuuDhGKqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MMDRUuosAz7gnr0jDxOfRPO01DL5ySiBYx7Kb4cJ9z0=; b=X/d8PQENZAPYR/ChaddbzcqD5Ne0Q7dN7YQv5ZDEvmhG/3fmNf1m39R6tBFIMx6APFtTpHrIqjLd/PYiVu7sWMnD1YcGsr939sVQmKqXob8EcIe3ZvwTLs2QUJjXJB/DyQ4hEGbqQSaSTqGnBjVd+YpHVrRdBE6+tpZlkMI3s+IfGYRnp7UOkYMDk1fsxLDtquYB670G238xUQ/s97EysMJFwEgFTrGXm695kTYj1r+sggRdt8HEkzSUgxXmGEJKmkDY8d3jsEeXE0WKsTjWZEXKFSFbXThLlLnAqyyaGQTMMX0imVsjqpl1aeQDMXFW4tm72lkLpmvPwFnIK7AjDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MMDRUuosAz7gnr0jDxOfRPO01DL5ySiBYx7Kb4cJ9z0=; b=swH/Kwhi7XUSEw4bPBpjO1J6I4sV5IdCqzxK40NoJR81icbODI7taTUYdOnnVKfbHZm8nmCYsrtTVoHLKa951mkxxIAKLD87jcvHSNS1+fP7P06vv6+I2P2cwVqq6omXLgcSc7fhXaseNHyKn51ZDMlvb1ziZZ9MWEGkxv0iRkw= Received: from BN9P221CA0023.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::11) by CH3PR12MB8332.namprd12.prod.outlook.com (2603:10b6:610:131::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:27 +0000 Received: from BN8NAM11FT113.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10a:cafe::5) by BN9P221CA0023.outlook.office365.com (2603:10b6:408:10a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT113.mail.protection.outlook.com (10.13.176.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:26 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:26 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:25 -0600 From: Harry Wentland To: , Subject: [PATCH 12/16] drm/amd/display: Always set crtcinfo from create_stream_for_sink Date: Mon, 12 Dec 2022 13:21:33 -0500 Message-ID: <20221212182137.374625-13-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT113:EE_|CH3PR12MB8332:EE_ X-MS-Office365-Filtering-Correlation-Id: 15ef0817-be22-41b5-b2dd-08dadc6dd265 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dvNzzgxprRSXKgtGnjnyWr1O7Bu688IoRuhUhaFQzM8hb4aWAzOZXIDVJjIgv8fzp1riqsq23ZShWmcx6XrVKgGcQLNRdpMscqnZ21lINL6H6CIZex1KT4wt+TsJkviB3ofo8aggu5qW9mkcho76+ujXCXZ3Facj0MSXhTft7KeACloTFzJxteg77GYQOHu5TN1ORzftiFmLewivAfs0RyZ5jz6o+7HZYKCw+kxQSeU/WZaIlMMiZk/l3SINgxh0NkiKOHemCaqNrX/a4TbuBTnIa7LPcsC0oSfF8HUmM6Ec6T7uzPaV4TUbEWHyfXvFMAHeyPnXLHnZVmzVT6gR7d4wiMnSzTrEX6MXadFByKkpqTuczXG4G+vZ79zMDO6f1cXgsWHvoNZA348jR9m7zg8e1N5jqgT/i5+I/HozCYKCNHETQn73CRUHPJDONKdXFNglBCKGnAnkxks5MyTfgbyRRnA6btocf+vQX+ERmKXNNHCV0vv8eA2geBUn1AEcwJYBsNCQIwWsDNYOGAYPoR3cCCzq82BakJAdeCm0o3xqFDwsQUCWHp9UUMNwX+nWtAVtDdB7MAOJxuqAs7C2g4Y6RViAVvObO3JPpLYGlYbyhEHK4Br+G2SQrMJP+1XnLAj3jgofORGgK51FxrLHJeZM1wjCpbxNFnZ5Id/DuDlKrQZbJvmrfHYpPLbLWCsfxGImd2euoayMqA2BLJRXlDXrzmc9+T+dsivvr1xlOg8= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(39860400002)(376002)(136003)(451199015)(40470700004)(46966006)(36840700001)(110136005)(316002)(54906003)(7696005)(8936002)(70586007)(5660300002)(4326008)(8676002)(6666004)(41300700001)(26005)(36860700001)(36756003)(70206006)(82310400005)(86362001)(66574015)(336012)(83380400001)(186003)(1076003)(2616005)(40460700003)(426003)(47076005)(478600001)(2906002)(356005)(81166007)(82740400003)(44832011)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:26.5304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15ef0817-be22-41b5-b2dd-08dadc6dd265 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT113.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8332 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Joshua Ashton Given that we always pass dm_state into here now, this won't ever trigger anymore. This is needed for we will always fail mode validation with invalid clocks or link bandwidth errors. Signed-off-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 8cf5a44d1d15..5b347f8f4193 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5855,7 +5855,7 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector, if (recalculate_timing) drm_mode_set_crtcinfo(&saved_mode, 0); - else if (!dm_state) + else drm_mode_set_crtcinfo(&mode, 0); /* From patchwork Mon Dec 12 18:21:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071341 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 DE6B0C4332F for ; Mon, 12 Dec 2022 18:23:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D20410E27E; Mon, 12 Dec 2022 18:23:16 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id B53D110E269; Mon, 12 Dec 2022 18:22:34 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fP/K4vYFQN1GisIwcm2NHerVBLvbgwDNq2lDmP7KMCTD1bFlMrV2mlUc2aLhgJB3cxc+SqQDXiewq0BWb0Tz4cfFQvEgY+Yh40wETGsUAN/ilD5GKlxITMQHQ22yxNd0s8NKAESezvTttPkJL8oHZ12Kz1iZY4u8kAT1s6eAsbIlzKvBqOBqT2L1zuv4PaWy6A8oN8yA9/kESt2geir0IoZ9nKMLESEGGPnoLlk5Kqc7k6QGtM8NqpJ31K9ExfK4YlIE8ghcZprad7qIONHolYrixhfRiM015aEXPRiE3fjKwpbIBLCPm6PE0zR3V5eJsBeWHSjSKeMTJ7puVT3/Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j69fMfOL+PelgJvfYmIWOsfLIOxkqNoOjprsfR4XUdE=; b=cKwh+o2xR9mwoNn2F+r6komZmjOm/zzCobXcnEHRm15d1xRyE7ubxRqxGk2UY4JGf9Z3BXOKXgk96SVPOPZiqj1PvasEBb9YfiwNpgan5bItsf7QB2d1g5itjJ//oKH55IxZG+2rv4WFci1rE9yooKDBWjnj73uto0aeoIVAgn0QmziaYFm8iTWQeh+wF2VpnqXJP0Z+C0LhlvrTvqVQ/suQEUCMNCGLJb15LnnSu20xnaD5jHmdntLoe6o9YawlCHlfF5mVdcuVsM4NKiq0bV5r1ziYOnm0FFirZDwppqdY9xFLpNyD1j9EKZL71Veomvu+aX3/jvRmpS5yLmREKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j69fMfOL+PelgJvfYmIWOsfLIOxkqNoOjprsfR4XUdE=; b=TF270bnMarwzQ0hswjywonTr94FyTIkPQ0SrCtH9nrekUsghUznr0rubwZB4//ir7xhXya6ySxJFTESkKhRaCc2PloFmkR2924NNV0zRXbQOFZ/A0o7qdCYgbjjU+UYccBdKP/0GYnrjoLM1pQMxnIzQMCLsOyfnVIoAuJR6IkA= Received: from BN9PR03CA0520.namprd03.prod.outlook.com (2603:10b6:408:131::15) by IA1PR12MB7662.namprd12.prod.outlook.com (2603:10b6:208:425::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:32 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::3c) by BN9PR03CA0520.outlook.office365.com (2603:10b6:408:131::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:32 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:27 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:26 -0600 From: Harry Wentland To: , Subject: [PATCH 13/16] drm/amd/display: Add support for explicit BT601_YCC Date: Mon, 12 Dec 2022 13:21:34 -0500 Message-ID: <20221212182137.374625-14-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT013:EE_|IA1PR12MB7662:EE_ X-MS-Office365-Filtering-Correlation-Id: f8b71a90-bbc6-4b23-74e3-08dadc6dd616 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X5waaN2NE9KibYgyiYjUfdA5nGV1O3wwk/PB3xabXkelzepDxLDNOXUumLJ519HLtLGfftWA/DCY54yQ44ybBozIBKg0i2u2FsT9s0q0Hn6jtEjUWl0Cj5JTEShdFR8PEQvSdktowqtga1aw9tOUofqJw6NXTh25/aRMIglruNGzzNfpbdPczxe5l8wpz5+AW5/UUj3viKv44b8zxygd5bosmYha2aISlzq1EFoHXsb48bAcm5BVv3i7zVHbpRvatlLCTbKJ2EJi1Nlo2IircprdocybxWsV4AniNXyaBP+WQB8lZdCH34/4IVSiQKXKwuzjgJGxpshQJTVlxUL7ZEvka3wf7Rb8qWG9nGsZuW+Z7Be7ww1SWZXRt/cYpDAAituIBNczRvUdkOvn6RVVO2fQxMIPx/aQ71H3MeVLjjDzr0cqoJkrqMlsQfJrDLUFg8mB7OQW+HUI+Mt9+fRkbAIvaX5aak6VXf1apv6S7+fCOly0MZdjCueoGKk6enoqq6VD1ZfOwx1oeCT+rd6qIBhyqiPeYeFI9lNyWFpDNOiMNbXqEINbdtTwQObhLJyCsoHKvhxBCxh1nYdfbSVDbJTpoRx1DtJVNT4O0pCk9MJDxCODIW1A7F3ogl6+jZgYHMBrZLQxZE663df/vuYsJQUF5qd/tps3oSA0Pik5JzA6WfGiDxuQW52OVN3lmZqOxF9IszJalad/4mQoYRR0WzP8JSOIQ4sxk/W2fldpFYg= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199015)(36840700001)(40470700004)(46966006)(36756003)(81166007)(40480700001)(8936002)(478600001)(41300700001)(6666004)(82310400005)(356005)(82740400003)(86362001)(40460700003)(36860700001)(5660300002)(336012)(1076003)(44832011)(2616005)(316002)(70206006)(110136005)(4326008)(70586007)(8676002)(186003)(26005)(54906003)(426003)(83380400001)(47076005)(7696005)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:32.7219 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8b71a90-bbc6-4b23-74e3-08dadc6dd616 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7662 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We use this by default but if userspace passes this explicitly we should respect it. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 5b347f8f4193..768c0c8fada1 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5175,6 +5175,12 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing, color_space = COLOR_SPACE_YCBCR601; } break; + case DRM_MODE_COLORIMETRY_BT601_YCC: + if (dc_crtc_timing->flags.Y_ONLY) + color_space = COLOR_SPACE_YCBCR601_LIMITED; + else + color_space = COLOR_SPACE_YCBCR601; + break; case DRM_MODE_COLORIMETRY_BT709_YCC: if (dc_crtc_timing->flags.Y_ONLY) color_space = COLOR_SPACE_YCBCR709_LIMITED; From patchwork Mon Dec 12 18:21:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071340 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 7F3BDC4167B for ; Mon, 12 Dec 2022 18:23:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 626AC10E27B; Mon, 12 Dec 2022 18:23:13 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2066.outbound.protection.outlook.com [40.107.92.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id A9FD910E26A; Mon, 12 Dec 2022 18:22:35 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oGV3mbbsVBl+cHqOg2IN2d4fcVeTPNoGGp8oAA5K8z5+L7+jWMWA14AqEQLVQAAyz5CevtfNyB5e8aaoM978NHHhy1pWfvKSODXVlwU44GPLa7WXV7bxduYzx/XYkBVxoY7dcJHN2w6kPvsN+EkkumHm4y6HPJsYN/g5l3jEv1lPYbbQUI/JbSSn3v3/dhXbPaCYV/JHCXmRPky+x1yQxkSRFRTI5A4XJj6tm54SPAkycE8v8cgGm4EYFTUq103YWmAs0Sj+KNJVTPda4DzilORk+JZsEv/YmUXv2CUrvE+ylAlL3Z64wZFWHUzpNqcrf05rs8/6bSg75DZavCKBCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=strXx8EAnWxVGo0HQWV/YiVdscdt38EhBux5Osi7zdA=; b=l2+d9ja/9P+VrMQeczaN5q4P6ORpsOfCyWzdsbQgiQJpOd3uLpUTvjZVFLd+YB9VSWzuo7GVQCC/sPBOEKSevlsAY07cXXHDLwyEsjClRtV/Jomo7Z82ka0/hCKry0ps3uF+l+/RhsnB5EjDFjc9yDlFoHFmShJzyUZ7As2YAqmPjt1L7QgHoOPpmWUzn81hV6nSLE/b5G+SnoKz75uRks0dWbpCreruKG0GM+khtqUi46jqT/9WMQyCb2v8fdHN7gV248DKw82OsKX0C/qUmliIbzttg3p/Eqv9OR7+oS01A+0YY8xhqBd17ihb8C71XBLUkUeodIksKQWZnbMLgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=strXx8EAnWxVGo0HQWV/YiVdscdt38EhBux5Osi7zdA=; b=l4p38IctjeoJUvFXKGWTN2b/n2rYuBZoSBKD5SGFLRgHBvvR/99higEM6qVkWdve3XPP7fvfvY53A1GtiHFaohRaIuqfpDV4oJ+g8gGyfBp3KQEG/tYw59mM2VbBZo8Ew2ilRONN0RdS0t1bZYjpIQD9Y5IC1dbihHrleGJuvSM= Received: from BN9PR03CA0530.namprd03.prod.outlook.com (2603:10b6:408:131::25) by SA0PR12MB4447.namprd12.prod.outlook.com (2603:10b6:806:9b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:33 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::4e) by BN9PR03CA0530.outlook.office365.com (2603:10b6:408:131::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:33 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:28 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:27 -0600 From: Harry Wentland To: , Subject: [PATCH 14/16] drm/amd/display: Add debugfs for testing output colorspace Date: Mon, 12 Dec 2022 13:21:35 -0500 Message-ID: <20221212182137.374625-15-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT013:EE_|SA0PR12MB4447:EE_ X-MS-Office365-Filtering-Correlation-Id: 470806fc-f965-4049-e37f-08dadc6dd688 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WtpsNPfXpOxN6K1ihpAGHACM5lyVSUK/P6leA8DqKhkPC6UGk8m1JVmkyLbvj8nbs1tj7+wAMNNi2ffb4IHDFlSuGvIA3yvt6J7KFAtvXxr5WqYT7b+LCLiXd3g7NInh2UjsnBjK/G5q12kaCgbIGn8pMTf4juMdTmX7B9+hiQVD7Q3F9R6q1J2uEuwO2CaSWDlqMam5K5MtFVxCRqDMC5uK1coG5ZhiIpDYZ6c9XZNG9lqEplgclHFMsPNliI6cyl8M0MHrGv0DNWOBCvgOm75DlKFzb/XnpjxSSbTrRly6IEsoX8YLfazYxakDZwmxeXppoLAKopT6EaSBmS5HQ0NnxoOai2n10eXeOZGsH1fNGD04ei42c5Z/4GikT1e7MjQGODbXpsympeStFo29cJfXj5gTK5xLkKqoQwqUSxnUYjNk3WKOqBT0JfsgtOKCWXYpHtwOl4CiRfN636OW1mfAsYhHmY1MIt9zxD4wcntznIIEavgQcmQKAMsovFn2vcQm0aNjaNPA0LaJPj02+ps9ddYSc0XIX0MBUdWHjxoUXAJBLtrhYiP7n1J9mTIsLaDv59s8zCx50Fn5BLOo1GG3D+wcfEOWMXZU2UFzV2W8Zy0x9eiqVfJx6ijAV1U1HaRaZJyKBD0x1BOo7lOaJZIRJ07p4Ig9WhefN//B5c7pdvz9HAFlOC/BuecasauoX98CsJ8G+BaAbayBxw9MuswNH7HdZKUZZIMDEBCvV+w= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(136003)(396003)(376002)(451199015)(46966006)(36840700001)(40470700004)(478600001)(70206006)(316002)(4326008)(26005)(40460700003)(41300700001)(6666004)(8676002)(54906003)(8936002)(36756003)(7696005)(44832011)(70586007)(5660300002)(336012)(66574015)(47076005)(426003)(2906002)(86362001)(2616005)(186003)(1076003)(40480700001)(81166007)(82310400005)(110136005)(83380400001)(36860700001)(356005)(82740400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:33.4875 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 470806fc-f965-4049-e37f-08dadc6dd688 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4447 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In order to IGT test colorspace we'll want to print the currently enabled colorspace on a stream. We add a new debugfs to do so, using the same scheme as current bpc reporting. This might also come in handy when debugging display issues. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index 461037a3dd75..d95d1c9f4805 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -935,6 +935,61 @@ static int amdgpu_current_bpc_show(struct seq_file *m, void *data) } DEFINE_SHOW_ATTRIBUTE(amdgpu_current_bpc); +/* + * Returns the current bpc for the crtc. + * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/amdgpu_current_colorspace + */ +static int amdgpu_current_colorspace_show(struct seq_file *m, void *data) +{ + struct drm_crtc *crtc = m->private; + struct drm_device *dev = crtc->dev; + struct dm_crtc_state *dm_crtc_state = NULL; + int res = -ENODEV; + + mutex_lock(&dev->mode_config.mutex); + drm_modeset_lock(&crtc->mutex, NULL); + if (crtc->state == NULL) + goto unlock; + + dm_crtc_state = to_dm_crtc_state(crtc->state); + if (dm_crtc_state->stream == NULL) + goto unlock; + + switch (dm_crtc_state->stream->output_color_space) { + case COLOR_SPACE_SRGB: + seq_printf(m, "RGB"); + break; + case COLOR_SPACE_YCBCR601: + case COLOR_SPACE_YCBCR601_LIMITED: + seq_printf(m, "BT601_YCC"); + break; + case COLOR_SPACE_YCBCR709: + case COLOR_SPACE_YCBCR709_LIMITED: + seq_printf(m, "BT709_YCC"); + break; + case COLOR_SPACE_ADOBERGB: + seq_printf(m, "opRGB"); + break; + case COLOR_SPACE_2020_RGB_FULLRANGE: + seq_printf(m, "BT2020_RGB"); + break; + case COLOR_SPACE_2020_YCBCR: + seq_printf(m, "BT2020_YCC"); + break; + default: + goto unlock; + } + res = 0; + +unlock: + drm_modeset_unlock(&crtc->mutex); + mutex_unlock(&dev->mode_config.mutex); + + return res; +} +DEFINE_SHOW_ATTRIBUTE(amdgpu_current_colorspace); + + /* * Example usage: * Disable dsc passthrough, i.e.,: have dsc decoding at converver, not external RX @@ -3326,6 +3381,8 @@ void crtc_debugfs_init(struct drm_crtc *crtc) #endif debugfs_create_file("amdgpu_current_bpc", 0644, crtc->debugfs_entry, crtc, &amdgpu_current_bpc_fops); + debugfs_create_file("amdgpu_current_colorspace", 0644, crtc->debugfs_entry, + crtc, &amdgpu_current_colorspace_fops); } /* From patchwork Mon Dec 12 18:21:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071336 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 863A7C4332F for ; Mon, 12 Dec 2022 18:23:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0A9810E271; Mon, 12 Dec 2022 18:22:52 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2075.outbound.protection.outlook.com [40.107.244.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F5FF10E26B; Mon, 12 Dec 2022 18:22:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j33mNkiYqKF9J2rE8JglHpoG5DZ/EuARLqIgkAYi1hQDXcMeGPeVP+l2ayyZj+qKSN24eev2Br9MryfI1HI/boPPyBiNPixF8Sy8e74bokiSXdNXjOtMxvxpE5kq/EfA8A0prjnKPFhSYC2mn4Sul2iBeMJL5KLNzWnz+J/GlyC0yieBPj/yI75QX73T/CcYpzdGtYEupzSpx8XOHW/MZoUOFxTY9cA1kDNZwhgKT9sL4SOXbY/+G0/MK9O8gabkdJHGEroTnwwPv3d8Dl9oPr7DBzZVM6sKLlMa4c4pKcTFQHkZORG6pz5zfv8+q8J2iFkjhqWkISoqblF2hn910Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PKyOzJvoKGL8tZNe/xR2f6QSMNcaK9V3/V2qg52fle4=; b=oQOf+VxWPXGB3bbOm8aWvcwCqCTcZOpHLCOTV7mBtnQz+ak2cjTz1HGEIGRKaKyksikXRar4kP0c2NKc6k94yR+DFD7jqQ6Lml+ZSNCo0g8/jlbAIObeE4hEnnz5DMLzwML0D3AEc91wul6p+kyJVt+f2trnbedWkLLhinRtTqxooRTWbIegG44rgwFawi1lGDulpSlHCoevRemLMgGnLnvOv0Hv3+QtEKWACoYJAibTee/hihk2zBeHVee8VOI1HS3cw7bKFYu2/6az8cr+O9F0iu8bmgmL6GSCB/jiYMf8i9+5JDMIzf6Un0kRpxzt1VLvPMcz1rB64do56l0cLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PKyOzJvoKGL8tZNe/xR2f6QSMNcaK9V3/V2qg52fle4=; b=ZfMyFCxOme0+AXKX8O/ZlugzvtcaI+WlTaugPWBhs6mJlxpjIzz8Bcm5dZ8QgoWCv0XmWW31r9UGFqmyece6boCup1RtiNCaNaiQDAQyJd3EGN/hj1APri+w13J+2lddAZqAFn5GWtwDIgBA07iKbFUEp1zha9Qavp0kLm8KUR8= Received: from BN9PR03CA0512.namprd03.prod.outlook.com (2603:10b6:408:131::7) by SJ1PR12MB6195.namprd12.prod.outlook.com (2603:10b6:a03:457::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:34 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::87) by BN9PR03CA0512.outlook.office365.com (2603:10b6:408:131::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:33 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:29 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:28 -0600 From: Harry Wentland To: , Subject: [PATCH 15/16] drm/amd/display: Add default case for output_color_space switch Date: Mon, 12 Dec 2022 13:21:36 -0500 Message-ID: <20221212182137.374625-16-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT013:EE_|SJ1PR12MB6195:EE_ X-MS-Office365-Filtering-Correlation-Id: 602d8cb8-c292-4fc3-91bb-08dadc6dd6b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4JbrA/mg1vIL1FLu5ekalTiq2MSTRMFwBW7zzeGpgguD5wvamiEi7qm/xMgwekBbdQE/mcW+Y43ioSu8wtDaPsS4+WUY6JZj0P34cNoueWnAc2XhcahbsJ0pwA9Y1lPdi3gsYfhBSV9sh475APgD/AE3Nh+tYVJSEE3NyboZ7xhoz3g83detWn48sf8lReALvGgU6AWrT5zdR8aoX1Se3cZ0swOIpV5sD8lMj0MZnTMsyM02BkI2C/iqdnVGGWid3HBdaar29dWN+WcBCjW2Aqkq1Ij2ZLoV/TaCKgdEh7h+Uk/xrq1tsLrwmLW9FUjU41NxhT8aDuyIsz1ik4L62rzAkYPlPZYMy8ap6vY/D3QoKYmKO4Yybd3/vI6/UuboaCZOXqCoIlEcJJlXC/jkBcS9rQW3K1rs90v4MEHQv1oNxAPr1O9iSHMgDYlWDuCuiE+b9eM+Hc1l747k7qYXvCCNQX7r7IOeiCZ3LopPgqw9JL0BJdk6W2HhYZfzXno+rL7MqT2TnPgM7/xn0dJwgASXqxwOecaIIfBRnwUh6/NZ3Fr9+U4oAWQ69qPNvgisWm004AxMWc2iLjTp+HIYn9bfWzeifY3vt7r0KgbjrwbbhUwkB+dZXeStAhxnY6M8oKQrAUHGCTWGBa5HtpMI9vR9LQ1/A64fuOv++rvRyaH9cgvO2DSOieLBkmw/m0lgZr2q73DyBdec1dMNOhB80mUk42kyE25u9Ps1lTi/Q4g= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199015)(46966006)(40470700004)(36840700001)(36756003)(40460700003)(86362001)(478600001)(54906003)(110136005)(316002)(82740400003)(356005)(82310400005)(81166007)(40480700001)(26005)(186003)(6666004)(7696005)(2616005)(1076003)(70586007)(41300700001)(44832011)(5660300002)(8936002)(2906002)(336012)(47076005)(426003)(36860700001)(8676002)(83380400001)(4326008)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:33.7843 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 602d8cb8-c292-4fc3-91bb-08dadc6dd6b8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6195 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 768c0c8fada1..d0c071000a5d 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5153,7 +5153,29 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing, enum dc_color_space color_space = COLOR_SPACE_SRGB; switch (connector_state->colorspace) { + case DRM_MODE_COLORIMETRY_BT601_YCC: + if (dc_crtc_timing->flags.Y_ONLY) + color_space = COLOR_SPACE_YCBCR601_LIMITED; + else + color_space = COLOR_SPACE_YCBCR601; + break; + case DRM_MODE_COLORIMETRY_BT709_YCC: + if (dc_crtc_timing->flags.Y_ONLY) + color_space = COLOR_SPACE_YCBCR709_LIMITED; + else + color_space = COLOR_SPACE_YCBCR709; + break; + case DRM_MODE_COLORIMETRY_OPRGB: + color_space = COLOR_SPACE_ADOBERGB; + break; + case DRM_MODE_COLORIMETRY_BT2020_RGB: + color_space = COLOR_SPACE_2020_RGB_FULLRANGE; + break; + case DRM_MODE_COLORIMETRY_BT2020_YCC: + color_space = COLOR_SPACE_2020_YCBCR; + break; case DRM_MODE_COLORIMETRY_DEFAULT: // ITU601 + default: if (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_RGB) { color_space = COLOR_SPACE_SRGB; /* @@ -5175,27 +5197,6 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing, color_space = COLOR_SPACE_YCBCR601; } break; - case DRM_MODE_COLORIMETRY_BT601_YCC: - if (dc_crtc_timing->flags.Y_ONLY) - color_space = COLOR_SPACE_YCBCR601_LIMITED; - else - color_space = COLOR_SPACE_YCBCR601; - break; - case DRM_MODE_COLORIMETRY_BT709_YCC: - if (dc_crtc_timing->flags.Y_ONLY) - color_space = COLOR_SPACE_YCBCR709_LIMITED; - else - color_space = COLOR_SPACE_YCBCR709; - break; - case DRM_MODE_COLORIMETRY_OPRGB: - color_space = COLOR_SPACE_ADOBERGB; - break; - case DRM_MODE_COLORIMETRY_BT2020_RGB: - color_space = COLOR_SPACE_2020_RGB_FULLRANGE; - break; - case DRM_MODE_COLORIMETRY_BT2020_YCC: - color_space = COLOR_SPACE_2020_YCBCR; - break; } return color_space; From patchwork Mon Dec 12 18:21:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13071338 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 C7780C4332F for ; Mon, 12 Dec 2022 18:23:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FB1510E274; Mon, 12 Dec 2022 18:22:56 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7099410E262; Mon, 12 Dec 2022 18:22:37 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gIqflc32kjASxupKKHjo+xGh40WRyaEyWzuddYVyt2KbZg2bullQGhR8fGaoIQbacL0/CZXBo/R3GQfF8xTGPPRGPOXlvGaCc922bGXoHedkyqJQ53Rmj/FzqRk5AJR+vF2cz9e6ifE8ORmQKfejopCK2h2pj/1q22vG8tMKA/Mwgc93Is7E22/fmBR+UwQaBMo6oIVGvl0qJaK2NJv3wFm30eHX4k6H1+SgQ4WPtdRyXkRULY5kp6sCWjDhiWXNFKUzl+8JrqMcl9lz7dwI+0raIoigqGG2RpUJGZDwDw3sXw39wrAabbZxNFeLgN5obusCaWaiQH8YI9WiBY+zmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EIblX/EJw89B09/ZThKxlVzH6v3Kalz2tSfdK8b2h7g=; b=U/NuzVa7d+YWmnDmzWU3w3BaRYwW6NQ6YBF3cPkz3Ul11J4BI89rjV+nITAXgYZdm/Q39r8uhk7g10jTYBFbVw2PQqbe+PIYDdecSIOWSHH0myUIkn/+m77yZ106v388wusNcQsE1Q3eHqjeHLxqXW+9OSqa1jvxSS/ZAlLJkm+toK/ynCf2cMJkdfUEqMzpAhtg6RW2Be/OSXhkOMvexSZqeMFqtxUPl81WUc9hKCHvANyQULIyvi/B6Lzealo/k4mGS29zmOOYoacdpntHES2NzG8WFBFPnfzpDfW5f/UsLFX4I8MasjWcLej5ArszQO4++2qbTNtZ6BZPfLvybQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EIblX/EJw89B09/ZThKxlVzH6v3Kalz2tSfdK8b2h7g=; b=M+Ujl2uz8nYI8e/wd/vo5OSIcG9DEqdogGS/359L7FtPZi0/dvfQNyslmeIH85YbHJQ2818Wo8ibMnLoxAzFG3uIiHfAG2hW6mUspk1QbbCXUVorztQ2882TjyqvOS2i7bjfEMWQAB4PidokGyu7nxUWx56EL39l+2154LLT5Z0= Received: from BN9PR03CA0530.namprd03.prod.outlook.com (2603:10b6:408:131::25) by DS0PR12MB8071.namprd12.prod.outlook.com (2603:10b6:8:df::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 18:22:34 +0000 Received: from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::ff) by BN9PR03CA0530.outlook.office365.com (2603:10b6:408:131::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19 via Frontend Transport; Mon, 12 Dec 2022 18:22:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5901.21 via Frontend Transport; Mon, 12 Dec 2022 18:22:34 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Mon, 12 Dec 2022 12:22:31 -0600 Received: from hwentlanryzen.amd.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Mon, 12 Dec 2022 12:22:30 -0600 From: Harry Wentland To: , Subject: [PATCH 16/16] drm/amd/display: Don't restrict bpc to 8 bpc Date: Mon, 12 Dec 2022 13:21:37 -0500 Message-ID: <20221212182137.374625-17-harry.wentland@amd.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221212182137.374625-1-harry.wentland@amd.com> References: <20221212182137.374625-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT013:EE_|DS0PR12MB8071:EE_ X-MS-Office365-Filtering-Correlation-Id: 22effc34-021f-488f-606c-08dadc6dd74c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z2Ld7dvzzYICkXylteFBnnYv1vNdo0piVkS0thlaLyuhCbbk9dXupjjMLSl6W0aIu2YB3+LGwU89cktJLa5gdSi2A5T+Qd2m/l09pWY93wP9/iOxJUu7QLsv+YKYgdSbGDZkLArXcZM3dmsfXRvct5WfMUINuPCmuwBE/e92JbzZmOAijUGqs4JrH4Xzn2wljFoa92ufnmfmaruquSOYaOZyBk4hQrSpQBndqoID42l9G3bXINCeQq00Q4IUk4rDtzOX2e6mHnHXFlVSf5NZpQUiMRMOprSFYAe1y3W0XGJ6T5jAyHHjjtzJADQYaWGeU5HT0Rth4g8rDnVsSsDHHbP6AF8+QGeTTiA7zI7k2iEOMlq/eD1+IPscyRGFofsSgVRPtnGedgaGhP4jT1fhN5k/T/Tj3khx34062ipkbOOWZVBvLif7FxjISz77jgrePXzFBJ4GJLqlY6phjLg/hA4b4AJBSsnjrX5JAAG1GC4o0Ckfg8slIKdSoLCG5HQmWxbH/ew8iH7f6oDtZaUA182QmBtpWZLyZxzg8uQ9xg6DNfNPYM/QCMH8JaonVZ23tK8crsLpwO5fExDWlSD+f3TWPsR189agdNWKGNdkfT2067N4cuWsZGgdfQUqwAKuOZLnycApt/Z7iHDKJJqpPHtr3C6YHefsKVXz3pmmtos7ExBFQkVEIbGNBdY6hQv4iN3z3tpmkpj59RtfDYWVq5w6GZgfqc+rNxl0Zrht0pU= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:CA; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(136003)(376002)(346002)(451199015)(40470700004)(36840700001)(46966006)(54906003)(86362001)(44832011)(41300700001)(8936002)(316002)(70206006)(36756003)(110136005)(70586007)(26005)(8676002)(4326008)(356005)(426003)(47076005)(82740400003)(5660300002)(81166007)(66574015)(336012)(36860700001)(2616005)(186003)(83380400001)(1076003)(40460700003)(7696005)(478600001)(82310400005)(40480700001)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 18:22:34.7530 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22effc34-021f-488f-606c-08dadc6dd74c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8071 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: Sebastian Wick , Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This will let us pass kms_hdr.bpc_switch. I don't see any good reasons why we still need to limit bpc to 8 bpc and doing so is problematic when we enable HDR. If I remember correctly there might have been some displays out there where the advertised link bandwidth was not large enough to drive the default timing at max bpc. This would leave to an atomic commit/check failure which should really be handled in compositors with some sort of fallback mechanism. If this somehow turns out to still be an issue I suggest we add a module parameter to allow users to limit the max_bpc to a desired value. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Acked-by: Pekka Paalanen Reviewed-by: Michel Dänzer --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index d0c071000a5d..396e345f5d6b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7115,7 +7115,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16); /* This defaults to the max in the range, but we want 8bpc for non-edp. */ - aconnector->base.state->max_bpc = (connector_type == DRM_MODE_CONNECTOR_eDP) ? 16 : 8; + aconnector->base.state->max_bpc = 16; aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc; if (connector_type == DRM_MODE_CONNECTOR_eDP &&