From patchwork Fri Jan 13 16:24:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101094 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 68F6BC678D8 for ; Fri, 13 Jan 2023 16:25:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9791010EA35; Fri, 13 Jan 2023 16:24:56 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2043.outbound.protection.outlook.com [40.107.223.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71AE510EA2A; Fri, 13 Jan 2023 16:24:53 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A03eU3fz9WkU/sGktLyfUDr0HErRgHwO4OdxnSk+xeJwvKs7JZT4nfCdC1Paj8SiMhIP3+JyyhXsVdghVUG0UiMBw6R0kqZluM3tSZ2oWt7BFU5N80t1GtvgJK+PmuDlEgGaOC/w7bm4FWihtkGeRXA45KTMzK/ZwXFnSEfIOPmOw9SIEKsjTURuuHEZvBT0uUwd/w3zi7S8CoO+un0CjPpfourM5vKwEMZINkP9TjQKbSmcHUJmaIqOt8e+KJuLK/M312qWYXrq9uAah+W9CkZDa09z8WWgCbwYMtAeWsDtoHy9ffSWhtrimkqeqBRJbOGrhdcUjdjGfIy0fHAgQw== 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=czRmDJSPIx6S/HatNAGmQ1apR0JX68L/YPT/QreF7QA=; b=NTaf8b4dbMS5Mb5kl331kX1HWoI2Fhgse4cd+RDA9dvPCahqYsHZ5qdyk75P074tP5/D4vtecX8EBUDYCWvonrsGrqpz4Rfch/Tcz4McQUq3Dp/yoLFdWvSwRaIiyA8DgEkwWcTYPe1LRdgmEV1CpiE/WvXF1iZfzzfeAb2fX0/V9V0sMMJ2F+X2AHbPms0Obo0OuZwwFkWt5AzO2Rsj76xCWBQ+J74ryzLqWAQWSCNUH/rw7WWJ9uLIOF3pOMfO8qY7mjo/lDtbXsofaHKLKI884HNX7JRgB/NL0DHzdnLsK5MwS/Fip+vajtxHAdd3vYDkb8tTlNv2c20xw2pvRw== 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=czRmDJSPIx6S/HatNAGmQ1apR0JX68L/YPT/QreF7QA=; b=R8nLkYTy2PxqzOCyXaywIq2lTeKlYe1m4lAnnCF6c9w0LaTs+u+a6lqGKmTFCO8ZGsjOUeGc2PKCLJ0w/p3f7K5LE+vGI48rjH/2TCrHunkPSgsD8r2aGKi5w8LGNCC+n4Zl779uIhjYMA98Z9n1GO2Pf/l2MtPlH/SZrmDHi04= Received: from CY5P221CA0135.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:1f::27) by DM4PR12MB5167.namprd12.prod.outlook.com (2603:10b6:5:396::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 16:24:51 +0000 Received: from CY4PEPF0000C96B.namprd02.prod.outlook.com (2603:10b6:930:1f:cafe::3b) by CY5P221CA0135.outlook.office365.com (2603:10b6:930:1f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.14 via Frontend Transport; Fri, 13 Jan 2023 16:24:51 +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 CY4PEPF0000C96B.mail.protection.outlook.com (10.167.241.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:24:51 +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; Fri, 13 Jan 2023 10:24:50 -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; Fri, 13 Jan 2023 10:24:49 -0600 From: Harry Wentland To: , Subject: [PATCH v2 01/21] drm/display: Don't block HDR_OUTPUT_METADATA on unknown EOTF Date: Fri, 13 Jan 2023 11:24:08 -0500 Message-ID: <20230113162428.33874-2-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C96B:EE_|DM4PR12MB5167:EE_ X-MS-Office365-Filtering-Correlation-Id: e61c5662-69c0-4a59-f1ef-08daf582b259 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ny9xDBbCtMIMHwRMo3Fbc4i3n9QvNuy7+/KJ7doIeGe5VEQXlnc9HcZnKCzprNt+DVgp3oKqQ4VciItbYL7i9f4P6/KWvqj/DOAvVCPzZk39GE8ZLiECAa6/CSpueu0Iv9MKH9X1KMNHhcbFECRlDwe+6TEG2fIOBpFga5sA5WMgYqhoXM9/NdoOkFjnB/HpOmnyChM3QOxqoORYTXfih0jpEliUY0a1etW5WvgHE5/f+ptowQqJH8VWIDT1EEkb0Kl7+xyrI8XObOKiEx9gz3pCeY4objVx+YmxGEtGnA072amjVl7/hKNkqGmDjV6yjKKLnIh4wZs9W1wdmkfbWBY9BlP96rRYuNLeo1FBtMJXtmgBV6CEjHhpIss+5bABrEtMkOfRsFkVXhBGlABQA6j4ioTrXKdSth2wv1mRbHru75DOT/gA96YW7XsVTz9V00qXVPjr7IieCQOpDwQgrcf+EFzhrmBPAH1PXDb6r73SAnLYfw6TgQsS9uv+G9AaOBmN3KYaqrmEZ8wBR1AhEfgqdu1wh0mDcVbv4m2AjR/YRnsA+oHGlezyKpa4i8aCb8hSZ2wBJmwqDjIIYfitD8jxDmndA9KyM7pXTJrg7Dsxm9jP/ZNEcsXwVdQaC8y9UlR1NO/R37BnbnOo0vuJk55lm170NbzL3r9FNNEZIIFs1IyZPXZG2MeQqLdv9ije X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199015)(40470700004)(36840700001)(46966006)(36756003)(6666004)(82310400005)(186003)(26005)(966005)(478600001)(7696005)(82740400003)(426003)(356005)(81166007)(40480700001)(40460700003)(86362001)(83380400001)(2616005)(47076005)(66574015)(36860700001)(1076003)(336012)(44832011)(8936002)(5660300002)(110136005)(70206006)(2906002)(316002)(4326008)(70586007)(8676002)(41300700001)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:24:51.2044 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e61c5662-69c0-4a59-f1ef-08daf582b259 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: CY4PEPF0000C96B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5167 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: Jani Nikula Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Acked-by: Pekka Paalanen Reviewed-By: Joshua Ashton --- 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 Fri Jan 13 16:24:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101095 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 3BDB7C71132 for ; Fri, 13 Jan 2023 16:25:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBA5910EA36; Fri, 13 Jan 2023 16:25:02 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F56C10EA35; Fri, 13 Jan 2023 16:24:55 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C1padJUBKfP2iAnMWli+Q6367XHQjW604q9nGnFmBU7ogj5ZaoJ91dl4l/PrZK/TT2bDnFcuDLIdqfHOE2xkjp4OXJowgoTXtG1alJLwBs7NgVznCXFbbzTZ/lrjJZ6DIBvl+GNEbo1IMwGr3hUgAdxn4ZJOnKsKEOW2GUKC6fRNLk5HAvphFWb3wbALWc/ODkaUUSnL/dc2mWIGv4JxfrVpOCXGJ0Hze/NecM8pxyXX6iKM0N0h+LYjwvvgJQoFcoVJP63ZFVbjFsF85QRXGiohCCNZVCTtQ2FIO4nCJWzp6O4fQkf+lzmbID/XDSMuAWCYUb3Pb9u4Nd/71SIIUA== 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=ZXo7A0+bicfIrCQZ75MCDvc59Zdb8L0twMtTH/p0X7s=; b=doFCbEBGY9llI6lK0KUb/ZvY+mm68EA/ZeA+JeIqB7qvUC+wYU4tvMOjzGU5jo+V7vVQIrNI/cfNXVfqKbcnbKqzWyrZO35vwx/98MjTc/E1YAa1m/xH2e/Lar73+AzhntGqGT0a2KtmFFQfSfb972e4Q1MgOWFHxG+8fq/aFloFOGMnBb4N6eb5cBDgAi4LSi+jauOuJ5XHkaKXA19VbKZ1Voi1Htpu/QEiAgCqWTN5IrNk0KUL17mpiyt2q5S4Mn5//97y9Kvz/0G+Wc2FiP6txu6kogtUI2faz+jXVh/04q9cVcQZV+PcVGa/LbycxHtxiGIBut8phxlMFmYvKw== 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=ZXo7A0+bicfIrCQZ75MCDvc59Zdb8L0twMtTH/p0X7s=; b=W7Om78JRTIkHXQQZdiT0UV++xXbkJvlJLbLv6Hr7O/oD9tZfO/k0GVpKfqqxzUOU8Ld+yRoGVA0qyamYGESjH5Q9u4fTNNtRF+hgSvRAx3aNcRkGOJD6moj32h4ZIuzIRp7ZQOKYWE2ccPoTuv05ISM9lYsNvq8Lr3wQ4toDQOQ= Received: from MW4P220CA0028.NAMP220.PROD.OUTLOOK.COM (2603:10b6:303:115::33) by MN2PR12MB4487.namprd12.prod.outlook.com (2603:10b6:208:264::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Fri, 13 Jan 2023 16:24:53 +0000 Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:303:115:cafe::cb) by MW4P220CA0028.outlook.office365.com (2603:10b6:303:115::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:24:53 +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 CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:24:53 +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; Fri, 13 Jan 2023 10:24:52 -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; Fri, 13 Jan 2023 08:24:51 -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; Fri, 13 Jan 2023 10:24:51 -0600 From: Harry Wentland To: , Subject: [PATCH v2 02/21] drm/connector: print max_requested_bpc in state debugfs Date: Fri, 13 Jan 2023 11:24:09 -0500 Message-ID: <20230113162428.33874-3-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT042:EE_|MN2PR12MB4487:EE_ X-MS-Office365-Filtering-Correlation-Id: c07e05ca-998f-47b9-cf72-08daf582b397 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: itUhtY0kEnM5nbPBHa1GUS/idX7r31C+v3bTJ2XbpAellHmPpz/2COlwm3pEclSOZi8WhWTQbNxl5uvdF60lsCl9PB6t6H1lxIUaStcP/B2cOtwO5gjx3sEjdduvM/sbn7vkwPmeEyPW0bx2xLBB26fBOwLGHQ81B1jOW+rgyqJcl6T1sA+9JpgZMxr2552fLgb/ed1P6LuzVjPXtTYaCvbkuAfbz04QbL4U2Bsvmoex2qBcMlMSz+hrULh1zXb9ipup/rxx0Lrsa/fX2OsFNk4dESdBitlDw/yW9jA6jaTJbH4p+w8oRE2sfNuCYn0mb7K8sX2NkR6OpOUCE+nCjZ8kgvGleGSIBqRt+OW5aJ9TnbxDFOFGzLPyt+poqPUbDwDMYP1bRgny7VQAWgfH8SARyH/uJ8p3Bev66dlsPelBN9VI4L2WZwUUfpRDvUhoCrNKNPYpL7iBsLlc80CoeHWISpn2E0484G2WKsaw5oG4dE+7zF5l1/oHwRW3NNbLLhZohi2KdqcjtreHAcw3O7V/uUfGwQflQRaaUCqXl1Y0rTAYS5ZTY+gOuSbOmtHr4yQ/eFiK3hhe9sZY6srFo03HkkKS3JuZfCGNqYngVLBOR3D/v71oMSVjEUZzlBWU0GkMIMgwjUdR67a3fNvtJ3uHyDIJbsr6FGhm3NW+HXiL+wCFnyjbl0VyzLlQly3CKEhU+V3e3MifzTwDE43w5NQTu7PsywXZm3jJTel/aJA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(6666004)(36756003)(82310400005)(26005)(186003)(478600001)(7696005)(82740400003)(356005)(81166007)(40460700003)(86362001)(40480700001)(83380400001)(2616005)(426003)(66574015)(47076005)(1076003)(36860700001)(336012)(44832011)(8936002)(5660300002)(2906002)(316002)(4326008)(70206006)(70586007)(8676002)(110136005)(54906003)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:24:53.2252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c07e05ca-998f-47b9-cf72-08daf582b397 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: CO1NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4487 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: Jani Nikula Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- 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 Fri Jan 13 16:24:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101105 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 C7D8EC67871 for ; Fri, 13 Jan 2023 16:26:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01B0310EA45; Fri, 13 Jan 2023 16:26:52 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5300610EA41; Fri, 13 Jan 2023 16:26:43 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XaXxPH2PACECs1mDrSmQVOlXcKQv2RyxrR2YN+tqSh13IlgrRRyQPbmg5UtIvLxvZPtPH36wVD8kix7yhJ/AakdzOxtkkfjUJFuaJ2/ibdYsq4hn7X0jTpedTKKQM6LnTKwsl2x5AmYtNtM6d0HtIcuQwTi7qP3ZQhn+SxorOvLSYF0w9gCnkuye3G6/53G+oiy1RAt8yKc0VtPGErTx9d4Pb3XuSVWGVt614VfStMEJKkI/29+OYDoT2gtFRj7vKMSepz6Ix6IpZm6B/mtJ6trLcN1jnldhjIMjPCQv6PxpBocjApvGjAhX8PDhd7TmR8o/vYb9gqmKELa9IQDKOQ== 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=5UbE7PYOQjI8gsCXEp48tAoVUErD6R8wWQhilTvZIFw=; b=a8qQPmAVKx01FQQ60XI2Q7yimWjWbU603nBDCdAjc0qK7S7zQ8S3KHlNxR6oqbDJpOCHUgjlpWEDHp4B3bN17OR8eMNyaesP7iyBAgZwkzieDYbQuuH2EGFsiSNfWJxNAa2W3cD+BYw8/6fTLMPEESLz4+4f56R6vBjCrzukSX86BuP/nzm6xBlXeMO1pxW5DzK+CqphOVTQP1m9YY15UX3Hv3Sz6mxVnW52DIgBJWQJ5qQAGXZ4R280Cg9t3r63fLtOLIGT+TNZrNQKVQdqw7jRZotCB8Gt3qB99lKH4PU74JfUlw7Rrbs53A7AWGQTzK0sd/pbMjkKA1oaf4j1pg== 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=5UbE7PYOQjI8gsCXEp48tAoVUErD6R8wWQhilTvZIFw=; b=2yMG1J01IF2xBledSxTTz9M4W5Ni0+2DhsXki+IzkD6b0ozfBlZuZRdzMIBA+w9woy17RmxGaUK9/SZu4LQzc4OXF9YERg1Tu4uuBwQ1Q4oB+u0t0SP5sfl6OG8ju7a89yLjR/q+uooyrGCCeTII5CCyabCxboBsVfSkq2o3pqw= Received: from DM6PR08CA0040.namprd08.prod.outlook.com (2603:10b6:5:1e0::14) by CH3PR12MB8211.namprd12.prod.outlook.com (2603:10b6:610:125::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:26:41 +0000 Received: from DS1PEPF0000E630.namprd02.prod.outlook.com (2603:10b6:5:1e0:cafe::8e) by DM6PR08CA0040.outlook.office365.com (2603:10b6:5:1e0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:26:40 +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 DS1PEPF0000E630.mail.protection.outlook.com (10.167.17.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:40 +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; Fri, 13 Jan 2023 10:24:52 -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; Fri, 13 Jan 2023 10:24:52 -0600 From: Harry Wentland To: , Subject: [PATCH v2 03/21] drm/connector: Drop COLORIMETRY_NO_DATA Date: Fri, 13 Jan 2023 11:24:10 -0500 Message-ID: <20230113162428.33874-4-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E630:EE_|CH3PR12MB8211:EE_ X-MS-Office365-Filtering-Correlation-Id: b01a918a-593a-42f7-4d4b-08daf582f3aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LWTyN63ZrsPaWlbod61gWaftELZyvrPrNWfTl4yoF0FJU5YI6WFARulM4kdufj8mn9AOJv/hhqIzXGYObE9pAi4g+jIMdesHt8uAdqtt3tyiVFMJIHMOAmuJc2a/UtoCNKpi3ErGWEVWY2Dt3062m6DIYcKfht60n/e3wLgt9sT46qNTcUFXlaXijh8W2ql9DUV3IwyG+pslh1FP4cU13t5mblabgNiAEHzucVknqIEcQDilgZ3mssXbOfEkcUd3wnFYqYpf6L85nuTrES3Xqd8cbUFyzIr1NLQVgntuUaToH7NwCjAiexmubgmeTyaCeYrg1ylUUnjnQttecMSyfa2V+33kEW3A0JuU4Lgqi3ezh0eemvsyGjr0OV1lZ1XPjdL9tnFdVRS58spBmh3lJH9XT9jEjIQGUIBgsJDOSYi5iT+Ff+YvAfDrhcXYC840TXBDf6I7MRhm3+GzbEL+R6ly74wiQv1YRND28Odcor1bakBQZiPzBHBX+/Jc45LfIMUL1ymjZkNla2Qs8St+Ep6xTwmwb5WPrK6PFnjTTB0NUHAS1Su4A6wWzo/R/2zo6ihiQJazugox8xLyR/8wL9zi4uQpR7lrYKPS/ecXOT/Qs3xJU5/ArIOMIfAGBnW4gLiwPdh+Ih/DbaiFYaA7G+I8v4YH+G0lzqiSapisFxP1yG0OibV2oJARqD91tzs+gkV8dT+RlSoOrAJ7Rso+qx0vfO1zLOq86IHUnV+fT6M= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(8936002)(26005)(40480700001)(478600001)(186003)(1076003)(336012)(2616005)(70586007)(8676002)(6666004)(7696005)(41300700001)(110136005)(316002)(54906003)(4326008)(36860700001)(86362001)(83380400001)(82740400003)(40460700003)(47076005)(81166007)(356005)(426003)(66899015)(70206006)(82310400005)(36756003)(5660300002)(44832011)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:40.8299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b01a918a-593a-42f7-4d4b-08daf582f3aa 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: DS1PEPF0000E630.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8211 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: Jani Nikula Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- 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 Fri Jan 13 16:24:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101103 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 5AEB3C54EBD for ; Fri, 13 Jan 2023 16:26:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 798AF10EA41; Fri, 13 Jan 2023 16:26:44 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2045.outbound.protection.outlook.com [40.107.94.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id DEED410EA2C; Fri, 13 Jan 2023 16:26:42 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IrOfZ6Vpq7wPKmXwAeYnc/GcOSletj1ovXINrO2SLUnxyyJ/ppjKdAmaUIgaXoeOeejQ6cOX2S0fRNqNuvfBaW0PIocZ/mpqBA1bFNB0P0UYDSZe/1+Kg8+rTgOZQU9RT7Kft00KkwOE1V5AZ7xfvDD6J8gGmb3uKfnWGb9yw3vZAy81mVDf7rjEYk/6bN5fwQ/4A8p+I+Ul0AocNAsir+1ANK3LN8XZ1JUMh9HlXlGU553KUzY+NTkmIUXzjWuj6SKc32TWdAD5QYohv4Y8KXOQL/YUhUPUdAvQXcnI2/vcXWJ7pGUE8X8BugcXNHXRZAS0oLTSHKtPl8Yjzd4cHQ== 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=gGs5adAp657AM/dYIPE/acEs4J9DPMwVtX9JoYE1+CA=; b=DW/O+XcmWmZ9eRp/a8WIzskHdAZ+hWSsZaWsCuGPgMtNdF/Bwpt7rI9EDbuDX6C2kSbB1aMgLkycT6etkVXNWCkwqo/WjVqUOX7tz3qoF6M7scLyiGMiIDJtF2KTqbocRPkxAQOcmv2PU+/YHxVhwPFGgQ15T0Jc3XL50Roa8jgnKCasF2Us5yuSU7nKQZz0gnC+hhp6HSF5RiyQoB4AQ/tQ72XoD2DCU5iNN8SvIZPNcV+1J2ReVom5N43MysGk7iyD719BeNvqbep0iMEWmxILLyEKtGF5ElLLKuaIwyiNRVeGhQAybLXgV+f79kF9BrwPqCitGKxT/picylI8rg== 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=gGs5adAp657AM/dYIPE/acEs4J9DPMwVtX9JoYE1+CA=; b=nmdudz95ncOXp/kTI//T05sHkbHVjU0/xJh1axeIUFOcue84hmraXG3L3FH78qC9Z8MuJn9E6sUl+4MMCx09j66QxoFt9p1bXfzx4kJ+cjJvvSQiLw8NFgi7HBehimMOYh4K5XqQAvHJZrn7ayGtIRKZvb0FqbXntdRsKtII6z0= Received: from DS7PR05CA0091.namprd05.prod.outlook.com (2603:10b6:8:56::12) by BN9PR12MB5242.namprd12.prod.outlook.com (2603:10b6:408:11f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 16:26:41 +0000 Received: from DS1PEPF0000E636.namprd02.prod.outlook.com (2603:10b6:8:56:cafe::e5) by DS7PR05CA0091.outlook.office365.com (2603:10b6:8:56::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.6 via Frontend Transport; Fri, 13 Jan 2023 16:26:41 +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 DS1PEPF0000E636.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:41 +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; Fri, 13 Jan 2023 10:24:53 -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; Fri, 13 Jan 2023 10:24:53 -0600 From: Harry Wentland To: , Subject: [PATCH v2 04/21] drm/connector: Convert DRM_MODE_COLORIMETRY to enum Date: Fri, 13 Jan 2023 11:24:11 -0500 Message-ID: <20230113162428.33874-5-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E636:EE_|BN9PR12MB5242:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c6f0965-2f40-42f8-49e7-08daf582f3e1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3m9XuOKrgY64gp9WdZGXjXB5X3Vx0rS6+ZyzgMMTltg91YCDcReOOteehcCM6pKWwsSbeX+o9fxZlasyIAo6xeudwvapbSchzGJ9rw8DW5ITD3aiPaiTJdkppGFVciAHGVrgX69+hCcemZiQH8Msi2rLi2cPtGvaZwBYgMWzfyyT1FIjUuvON+I1gomrybAhtFHraLBIHSfzXawNq4GwBHuRmczfu9P/vFD+Jr7LK9YVj3o5IB3Rl0lUqPiJ5bxeX/ARLZOBiGt3BcqLX7z3xonxWJZ5fIVEV+LyByB3/0xNz7VnKVeh0/4r8I05DThR4L6hp6rY9BxhDTPtjN38IFHwYzpSxT/RhM0ebOQKzBk6788VzE6sMKYae7oJ4zENN4TFFI2yfONTyU6CXGpLawM1XgGUs/K4C7nxXew43EHb6jcGuU4KlRW0Pw27L34C3if26bMOeQCPngkqWwzaAO8LvCoPsdpc6R5FPl8VkohKEYxZMxtN87s+vowT5C93ReUOCsy0jE5NQ6M0W8NZB4UvtR5SDeIU0Z2SDKjF8nMe9dzAVddhHLTQpWunPAHQaFMPhemGVivm/2hit0ZiJvi44aRXSJ2LIyn0XO8ILUGLTZ6301IcIwg1n03kLv5Ny0det1M43tLuNJO5U1luLJJxhLcPR376tdDVx9arfE5/QLL54kJJkzyVBV3OgVh7pjH4WNAXzGaYwj3Oh2yGtgSFfxrOUe9r0zNo0IpDE/k= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199015)(40470700004)(36840700001)(46966006)(426003)(478600001)(82740400003)(81166007)(41300700001)(356005)(66574015)(47076005)(1076003)(316002)(110136005)(54906003)(40460700003)(2616005)(86362001)(336012)(70586007)(40480700001)(26005)(186003)(7696005)(82310400005)(70206006)(5660300002)(36860700001)(36756003)(2906002)(6666004)(44832011)(83380400001)(8676002)(4326008)(66899015)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:41.1746 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2c6f0965-2f40-42f8-49e7-08daf582f3e1 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: DS1PEPF0000E636.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5242 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: Jani Nikula Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton Reviewed-by: Simon Ser --- 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 ed10e6b6f99d..28899a03245c 100644 --- a/include/drm/display/drm_dp.h +++ b/include/drm/display/drm_dp.h @@ -1623,7 +1623,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 Fri Jan 13 16:24:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101113 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 A42EBC678D4 for ; Fri, 13 Jan 2023 16:27:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A1D310EA82; Fri, 13 Jan 2023 16:27:02 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2076.outbound.protection.outlook.com [40.107.92.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id F035010EA2C; Fri, 13 Jan 2023 16:26:43 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AmzizEb40+3mMc7AUX6GjaV/3kB8vTAinJo3Byrwtx+zPIXZGpTe1Y07aIRSO6Jq43vkA3kw7HKCDp9acOF7a74WwRAUl4GNVgyYM1upa9fGh2UkzxNB2yxkTpbS3RmXMpEo67N8FQpSV1BEQ6O3tSKmB6c0S7phxoPm7r60LRJbwxPLGg/LdB1i7fOsJAisE4N/z8LWTirFpBQPIERzvc0vHr5WEQ2lOAtOa53PjVXkl5n9SSvbHpeJyqSy/+j3QAxB6lcRKbxMqB4uhtPGK9SvuPFBeSRAGh5X8fmUT4cI69eExJGKgn5FmCgN5MwgpXC+zh4/hgPgZsnOCfubbw== 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=5s73/vEColYOLgso5yBPNWZLOfZkh6u+gq/M4kzdSP0=; b=PgQi7RFm2uG71YRK/7F7bA23sjj3qhiRRF9rZBFCXCKW/crAExG93y6K7d9xH1EoHS4xHrrwf5XabkBLhRjj9iFq+L5r9ZOcpNkJqKKJbvUbYw57z5juGObQDXf8tnNcFvnt+xZCtKYhPhDSjHh5ybUK23atjid36LHVfA9inQmnk3tZCz82J3kBjqrPKSidm7HNfM1pBlx+Y90w2PsVwDPceodkdZRQ77sdEqk9vfGTUmVq9TOCD4uqWGNiXBVBnNtcntOAc37GP1jU7YR6Ec26riPUmujK+Xa5d/Cl0SQM/ybiCmfRnqoursO5ZWk5MEFtoTWnp8TsUu9+J4qaNg== 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=5s73/vEColYOLgso5yBPNWZLOfZkh6u+gq/M4kzdSP0=; b=g6k/qqJpRv7TvCCDMNCqFgmWmQ6hJyOW+BcLF2tqmll6Ny0MZ9YqNqrvwM25qiIJg511L73IKQgUamv2zMKCc4ajd0hNe+mEAsAiSqNAyAciOgvMyhkxfZuPJzQqDPTGIxx23/OmjqDyJWDT1tQahG9fk9AQ/rLYxNcrKp3Zcdk= Received: from CY5PR15CA0021.namprd15.prod.outlook.com (2603:10b6:930:14::26) by CH0PR12MB5331.namprd12.prod.outlook.com (2603:10b6:610:d6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Fri, 13 Jan 2023 16:26:41 +0000 Received: from CY4PEPF0000C96B.namprd02.prod.outlook.com (2603:10b6:930:14:cafe::48) by CY5PR15CA0021.outlook.office365.com (2603:10b6:930:14::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:26:41 +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 CY4PEPF0000C96B.mail.protection.outlook.com (10.167.241.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:41 +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; Fri, 13 Jan 2023 10:24:54 -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; Fri, 13 Jan 2023 10:24:54 -0600 From: Harry Wentland To: , Subject: [PATCH v2 05/21] drm/connector: Pull out common create_colorspace_property code Date: Fri, 13 Jan 2023 11:24:12 -0500 Message-ID: <20230113162428.33874-6-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C96B:EE_|CH0PR12MB5331:EE_ X-MS-Office365-Filtering-Correlation-Id: e045d734-b57e-47a7-f8ab-08daf582f410 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T41U4FEM++WsdxN683qBmjVjxcYs2euHLa5/QA5r3Zl11+cg4LDHDvok0winvzTRTts3/PxX1FjCceaRgImoR6Xevui+2pG69rJnKF9ldlVMvfA9pd1TzPWTNK3uZ1yfiti+QNAhH4t3wvKykIPzCWUeKeUB58l4vjh1Oh4Kcphk41qVo+BZjsAyMR5AT1Yb04QfYoaEQiUMvg4MssbzbAccq53AJvvYL1YVvGj45WdAw/e4XiJ4KvCf0sx3X0qfEOeMp+wEdnFHr330G3Ytz07BHS6xff0nD1jtd3GYQE6YepgZawDwHrtyRc5kRBnE7i6lpmbIN2EYpOzcoJ6LlBo+JA2tT0z1f9nh5O7TFhbRN+q7hiQvl/zFbl63S4J5FcMwMsgoXsqfahG2oC3LrlZdzhqgb7tLXh9bu8U7n7kC17WKb2Kk+onZ4bIAuC03qSUcOAmOmO4vLxDDZV6fUm/VFXjateHB0QWT3qzGE/CAuuJZd7JdZHvkYW/dGNG5+XIkfaiBAnoK9v/ONreqNJZVy84NnkE7Ei9CHgypfVwtNSyU9sSmABY3aqeyciSoVKOle4CsfaoI95wBVKFwlWpPXJw+tA8WLoGW5++JUlV1Jl4vlT7Yjj6NubTPYJm3o/1tTCmYMSW1FQQmDAPNST4I2bIJE6xkeKT53cKzOJcQPhFnV90jT2/XMg0WSuyg6hR3YwielSH9qY7Oi/GJBca1C+bfMqbC7Zm6lAxJ32Q= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199015)(40470700004)(46966006)(36840700001)(8936002)(5660300002)(41300700001)(83380400001)(86362001)(426003)(47076005)(81166007)(66574015)(82310400005)(36756003)(40460700003)(82740400003)(356005)(2906002)(44832011)(40480700001)(36860700001)(478600001)(186003)(7696005)(26005)(8676002)(336012)(4326008)(316002)(110136005)(70206006)(1076003)(54906003)(2616005)(70586007)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:41.4558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e045d734-b57e-47a7-f8ab-08daf582f410 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: CY4PEPF0000C96B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5331 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: Jani Nikula Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- 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 Fri Jan 13 16:24:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101107 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 6092DC61DB3 for ; Fri, 13 Jan 2023 16:26:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4421E10EA53; Fri, 13 Jan 2023 16:26:53 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id E7A2F10EA45; Fri, 13 Jan 2023 16:26:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kB/deeLA6qMvt0DJYG/ThkhlYVC7aHosNpnbb35+SqpgJFRO+DaJlgZ+VznQo0oAqRZV/Lur4qebtjiicgd5F7xx45TK9kL8SM4wASlvmyESYudHCOnINp/L/2xgOMwFtJ4pvyPHbQZcrbtPxoAoDDycgUnEDqTiBdOQ1ksycuEiHL7SWwLa/yFAwpQLBDZqKfaemSvY4KnYRRP8952PYNKCraFzzmQJR/cGiRcXiZTKEYq518CfO8xYP/JAvEi0a+vxvrgg63kaGhL/MCgI3JtSKGLVpGeciICIDgjQUComeTtQxNrEDgAnjAVMoJOmKIy7aI63eAUYVuZSi+U1zw== 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=zJIAgw8mMCtt9FIyvYx61tjZISOmCn2P6DmK6G4xZws=; b=nOV+D3S/WaXuZwCf6WQaoD9OsKBz5bcFctUmysch5RrxlFEY+PSu0xwZWiNgb/k8phGVOipqZY4rtJXHz9lwkvU2To5Ki+hinUSK/Uy/txe41Y0cysr70wcQHv9ZxO3od+MYztEQNWKs/EhqlHkt58c4BAtKDz+ycgbg44Ej1YpjKd9dMJLVREpBmvE59tgCDfmrDzISiAk9nPNyqos2+lVBdpevYYYEmP68lPKVApJtKuAYUzltj5c7n1cQxkRvqnTTPefB/YBlEV4x6a5iWdJSjSOoDFA269uUex8s1UUe+E/g7r+akd+w47aqCM1uG55Tk7JIVJ6hjisNnBjpRQ== 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=zJIAgw8mMCtt9FIyvYx61tjZISOmCn2P6DmK6G4xZws=; b=VwfntDmOl5Qpi7l/0o1nujSnyqIr/H2pTGFkjR2MzHXN0TDCUo3X8/6TRmB+uPx4QxJPOe7X8uCxt6FUVh38VWaBfROQ9ZgVmEQnaWi2dURmPNsTL7xF6ej0o43T/aPHrdNpAnl4RiE7Wk3S4o/GErExoi2Dqh2jQikQWdu54pg= Received: from DS7PR05CA0085.namprd05.prod.outlook.com (2603:10b6:8:56::15) by PH8PR12MB6674.namprd12.prod.outlook.com (2603:10b6:510:1c1::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:26:42 +0000 Received: from DS1PEPF0000E636.namprd02.prod.outlook.com (2603:10b6:8:56:cafe::58) by DS7PR05CA0085.outlook.office365.com (2603:10b6:8:56::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.6 via Frontend Transport; Fri, 13 Jan 2023 16:26:42 +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 DS1PEPF0000E636.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:41 +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; Fri, 13 Jan 2023 10:24:55 -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; Fri, 13 Jan 2023 10:24:55 -0600 From: Harry Wentland To: , Subject: [PATCH v2 06/21] drm/connector: Allow drivers to pass list of supported colorspaces Date: Fri, 13 Jan 2023 11:24:13 -0500 Message-ID: <20230113162428.33874-7-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E636:EE_|PH8PR12MB6674:EE_ X-MS-Office365-Filtering-Correlation-Id: 682a9470-abef-4450-7f8a-08daf582f458 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fcHsOlONczV/iic/AVRs3s5HALYEwp4W9l5trOvi6+YKm2wxdMOhoxQdptxZtbxxyVb0TH0qQMERrPS+nisvuIMiqSfs7Rr06otL4SuIhnjpeBMb5CIwFC5VUAjcHPSPNdDOPAH8RUXelFPL3Y3yFwfTs3ICcuBP/R67FICfA4RswOWdL9qMEcMIfW6DsGsbm5FxCaj0DKNv0lkJ3tma7F42zkQsQ29y8HNYRTWexVOBeOssgYyJwLiJ8QsP0WfdDqCcgBUn9ORXMrI/C8PPqirz2D/kawxZJv99Rjtz0ALnirPgj0eqTwjKweVKCpLbq+nbD1lFRA+dIiLBZ6m7ADpoOYgJCL7vGAqU8G2WRe3FRxrwzmPv8XoHvrkaXx+kVnWx4/JIUIn5rZcwJ/WJci+ctZOsGszUnrX9I00ad7IMZyWz46XmmxnE02h/6vZWH5zGcGm6nnduZao+f76zVe9+GVZNaU+DA46MhqcEC0oEJZAi7eWLays2REzgAwST5B380VIoZsIy6ARq3mDKAualYjJTjwUchPLq2vmyLsA//EeAg2S/n2Fkrvj1FhiVPWev1wFSC89qospkMMR9jy7VAQC9AlBN6+/7ilx0kFAyLLJgZtHkQWcO6Dl5XfJqtOoglWwdDaYCaaxgqBJJVlRrpwdUI2o54BYGVpDD8ZZjesEVXNZHZatNfC02fjgusv1jQ0IXdASITSTWlvEmeE1iPvQPBcpN1PIJvYr8qN4= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(136003)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(66574015)(1076003)(40460700003)(426003)(41300700001)(36860700001)(54906003)(36756003)(110136005)(8676002)(2616005)(70586007)(316002)(70206006)(336012)(81166007)(86362001)(82310400005)(356005)(83380400001)(8936002)(5660300002)(4326008)(44832011)(82740400003)(40480700001)(47076005)(30864003)(2906002)(7696005)(186003)(478600001)(26005)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:41.9559 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 682a9470-abef-4450-7f8a-08daf582f458 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: DS1PEPF0000E636.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6674 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. v2: - Use 0 to indicate support for all colorspaces (Jani) - Print drm_dbg_kms message when drivers pass 0 to signal that drivers should specify supported colorspaecs explicity (Jani) 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: Jani Nikula Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- drivers/gpu/drm/drm_connector.c | 148 ++++++++++-------- .../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, 91 insertions(+), 71 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index ddba0b9fcc17..8e81105fb2ab 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,30 +1965,49 @@ 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 (!supported_colorspaces) + drm_dbg_kms(dev, "Driver is not passing supported colorspaces on [CONNECTOR:%d:%s]\n", + connector->base.id, connector->name); + + if ((supported_colorspaces & -BIT(DRM_MODE_COLORIMETRY_MAX)) != 0) + return -EINVAL; + + len = 0; + for (i = 0; i < DRM_MODE_COLORIMETRY_MAX; i++) { + if (supported_colorspaces != 0 && (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; return 0; } + /** * drm_mode_create_hdmi_colorspace_property - create hdmi colorspace property * @connector: connector to create the Colorspace property on. + * @supported_colorspaces: A bitfield of supported colorspaces or 0 for all + * HDMI colorspaces * * Called by a driver the first time it's needed, must be attached to desired * HDMI connectors. @@ -2003,17 +2015,20 @@ 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); /** * drm_mode_create_dp_colorspace_property - create dp colorspace property * @connector: connector to create the Colorspace property on. + * @supported_colorspaces: A bitfield of supported colorspaces or 0 for all + * DP colorspaces * * Called by a driver the first time it's needed, must be attached to desired * DP connectors. @@ -2021,11 +2036,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 6d5cbeb8df4d..9e4b054266ea 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, 0)) 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, 0)) 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 9e145690c480..95d73b817b05 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -605,7 +605,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, 0); 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 Fri Jan 13 16:24:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101112 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 20982C54EBE for ; Fri, 13 Jan 2023 16:27:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E0FBA10EA6A; Fri, 13 Jan 2023 16:27:02 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2048.outbound.protection.outlook.com [40.107.244.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D99210EA2C; Fri, 13 Jan 2023 16:26:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZFSIHzkasEqUxxf5s3CjoCgYRfHEsTvX8tkejPkLqXz9XbtO8e2sYT1UihkrYQjQ65Z9BVCcDAUIBZx+eM4GNOQXmmh/E4eDdizB1V7kTqAqZSQzQvcGk/dljARY6whas0RxOt44xqgRpFuWrj4QKmOk/rtrngcNVZ1T/3DnuA6L8r6qF96z8n7lOU8drvm4VJt/poywmE1xXJV4M8uwZ1Dc5OyDRaRcQTV7Ba3/TMgFZTb0iTbI/rk061EdAiqDGL569II8aeUWOzjSiMq04e+n3v9yzHcLvWUbYr/L5cquVgOt4kaMLuR+xjVqmFgTSoLgeCfkb5qBUW68vawbHg== 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=YjGySziy0vDiOfhMYQsJE30n/7kjotnzQ3/U+lCmqw8=; b=F4DKSirxvEJf820b1uWl06paEDjPqwqGwHPi6aXOseaQae0DrhnMco59pqFTzsdCmtxYjt08HoVlC0cpSwunr/PkZr9PKB+OMESe3fQJ9flNdSMwbiw710x7aVz/0Bdn95NHcSwm8D+3m8NuipPEAlJAqxTbFiPc38qmdRPVayoupu5gj/F22zEziQJTIfJMqtk7kNuu5Pnyux7CmGtXddQfyJ7OzE+jD4oRz4vnnumA1VyhxrLKmeW1eIcxnrCCXzvh92ewCfgVZXXYQteXGL3dmq7MQbjwItmipQGsKy3e/8kSbFRSXg+pLYCFmLcgUMLClzBTjuQMeJUAugzs/w== 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=YjGySziy0vDiOfhMYQsJE30n/7kjotnzQ3/U+lCmqw8=; b=Mvqfk+b39nxCQVrxo0vVsxpKvxgvQxamtaQR+ah8URI89KQaYKT2VtWVusWObStEUpXHtV5EnsnU3LFrdGpJCJQT13RK49Hp9QrmZZ842q0im1wdtDas2zEMKgs7fcC8dejOZgnM1yom2zEEgeME/TXHqMMZoJKE09yz17R9EDI= Received: from CY5PR15CA0014.namprd15.prod.outlook.com (2603:10b6:930:14::35) by CY8PR12MB8196.namprd12.prod.outlook.com (2603:10b6:930:78::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:26:42 +0000 Received: from CY4PEPF0000C96B.namprd02.prod.outlook.com (2603:10b6:930:14:cafe::32) by CY5PR15CA0014.outlook.office365.com (2603:10b6:930:14::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:26:42 +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 CY4PEPF0000C96B.mail.protection.outlook.com (10.167.241.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:42 +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; Fri, 13 Jan 2023 10:24:56 -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; Fri, 13 Jan 2023 10:24:56 -0600 From: Harry Wentland To: , Subject: [PATCH v2 07/21] drm/connector: Print connector colorspace in state debugfs Date: Fri, 13 Jan 2023 11:24:14 -0500 Message-ID: <20230113162428.33874-8-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C96B:EE_|CY8PR12MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: a298d7fb-ae35-4af3-63d1-08daf582f4a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jctQpH6gv0/uF3ia9HIfWRPWZPHUYXqANkeOw5YzxZ1i1v8As/MRBGIduxoBShFtuzBgsH2u+Y6biEi9DnN1ecvlXwLA/gYKJGIYXMFzNcXyKCS4EKpHITypQ+tqC/GBKrmFRR/qK4pYD60S4zm7zxRan22ucCjfpAMVg755ql1Ma8BEiE+Wln5Ztinidc8kkPU6zJKPbSpvie5m2b3hbW4zt/WvtHEZMxQ7NIOd5leRI4eLeVNew9b3IonpnmZO/g0eqQMcDKxhAYqDRPl+hd1pQNFV5fzXHD0aR3EwJUFuyUl3uNqCLD03nRyoZJMibiV/IFTRVaVQN4N5u9zGfTLpPfs0+9XJgcWkxF0VwG8Sz+EG/4oE8elde6WoRNs3zMZD+0dF2uejemL4JeQWpyV/TafnMitPmSv7Q9DUtn6L+NnmtUHwvixX7gf/HWBIaOWcpfDu4R7YP856MJWBnC4btRmTUb3guhhu0p2zc/lSUaXIHK6LeDhYusUPVARRHKe8nBrnzP4QPc0bQsh6FLHrUQOAVH3dgZmWWmWzoMVUClO4AKNdj1wO0bqCmq3wTADz/W1YaqZ6E+3jRyGtYz/7VAv27e43v+KBBqGmHRF9uhca+8JrnIBGjL46pIkTEaQQg0TEK6pqWJCF1jsCyNRiCMOjtsBYodJ3sPhqREif0X6xTqjSfpzR1r7pJGB7QGzEZvuFEKaxLwXfSaXnZEmHSpENi8Trk82NkjoArZk= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199015)(40470700004)(36840700001)(46966006)(86362001)(40480700001)(316002)(26005)(7696005)(186003)(44832011)(478600001)(5660300002)(1076003)(2616005)(41300700001)(426003)(47076005)(54906003)(70206006)(4326008)(110136005)(336012)(70586007)(82310400005)(8936002)(40460700003)(36756003)(8676002)(83380400001)(6666004)(36860700001)(82740400003)(356005)(2906002)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:42.4089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a298d7fb-ae35-4af3-63d1-08daf582f4a2 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: CY4PEPF0000C96B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8196 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" v3: Fix kerneldocs (kernel test robot) 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: Jani Nikula Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- 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 8e81105fb2ab..913e50a8bb38 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_colorspace_name - return a string for color encoding + * @colorspace: color space 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 Fri Jan 13 16:24:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101106 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 D591FC54EBE for ; Fri, 13 Jan 2023 16:26:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F64810EA4C; Fri, 13 Jan 2023 16:26:52 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id E6ACE10EA2C; Fri, 13 Jan 2023 16:26:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FQcmFkfveXMbSYDFlnKK0nSauzLXkvI8tSx03PW/DWsMZV7WOG3aq3fS2q/F/B4/FsvhpsU6kM8eZxOMkDS06m+eN8bUh5qxwkwDq7Ttvdk+EG0Ug3u8SrOofEXa2LPx5iB+gFBcwj6eVCMo+VUdFvK2Dtwll0nXYZxNf+O22OzYC0x7tcGvVDfRiv+fdXkg99Sm1xcaBv8fQqVQN2x6laXaBucaTBlNE9FCREXiNvOZJtbacmTaDvM5uAcOy3Ep7voATFdH8K0LRNPUIM+topiK2OzF7IETKzZnVAflrsZAUvDwpQmIeLvEPb3p8oqYK0arv3vWeO19y6OKols6GA== 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=FXnlXww2mGNYT2t1GK5lhCJcdxhGrfeLD2rfbCJoSdY=; b=kegWadtAfcQmhM8VZSE0qUmNgzaP8/765cJtm6NxSmR0wrW39rPaN8fLDVDNHLKvMipaE/IyYyguYtn8pzv05BH8LW/HIE8JL/lDqiV/SLCHaw1I1SLn+PPfyw+GMNM11CKbYjaWt+cn37KEYzX3WhQCYgxU30TnxRS5roD/Z1we6uzVF/VRHwFN2TcZdg+D3QwV1zgx9qIcRE/WkTxfGGTEq1M1yRYNRef17c7KC8kcjL/1KyfhavRBUdU0y9drUJ34NU+udIoh+PtXg8Uc1kzixWPnCKWkkUml0ZA9OKEjuh4g2R0dVsri8eFXKb5em/kGUQm/tETGNI7fK6SapA== 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=FXnlXww2mGNYT2t1GK5lhCJcdxhGrfeLD2rfbCJoSdY=; b=AEd3hvhj05HJ18I+/pJOexudlb1b73/xxIkdG32SGvI03Jxy/EDSy7VP7dcomHAbMfC175I3AvamNr1Vn/uZGjZIFL88AUa2zr1i04/ifJs36DjowDuj0KmBRytoXCtc0pE1T9ltjYAsJieVTtoAlQxVwGFb8Bt18yzq9DktpVQ= Received: from DS7PR05CA0098.namprd05.prod.outlook.com (2603:10b6:8:56::8) by SA1PR12MB6872.namprd12.prod.outlook.com (2603:10b6:806:24c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Fri, 13 Jan 2023 16:26:43 +0000 Received: from DS1PEPF0000E636.namprd02.prod.outlook.com (2603:10b6:8:56:cafe::b0) by DS7PR05CA0098.outlook.office365.com (2603:10b6:8:56::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.6 via Frontend Transport; Fri, 13 Jan 2023 16:26:42 +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 DS1PEPF0000E636.mail.protection.outlook.com (10.167.17.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:42 +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; Fri, 13 Jan 2023 10:24:57 -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; Fri, 13 Jan 2023 10:24:57 -0600 From: Harry Wentland To: , Subject: [PATCH v2 08/21] drm/amd/display: Always pass connector_state to stream validation Date: Fri, 13 Jan 2023 11:24:15 -0500 Message-ID: <20230113162428.33874-9-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E636:EE_|SA1PR12MB6872:EE_ X-MS-Office365-Filtering-Correlation-Id: 48b5db1f-7ea4-4a57-2a5d-08daf582f4e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lYIFzUNRa0MHbduysv813H2oPTL5C3tmdO0iu9KAEA5iRBbHkBQn6qlUpPI6u26iyg+kLFYQ/GmUHjcPQcAn2MZIdCZt81ncVvkml7zH1zwvYzeYBqt1iYEtUDFaw5Wy4ajO6+AzCqxLWpmN546Awdc7QnfYqK9clsEtRuT1R/OEkGg0OmoMTEjHiAwmrZHUmZv8UIxexMslJ0Q+OHowL1YjWnNhR9jrQrnuPDA/0dV7ysKLIeHvmSIgUnM571Tb+YivwfBMqKhQy9uPVtLScUv5YUZLcCmo9MtpT4wtLs/Fd98fIuNXyIu0A6AcNLPbtQ0z39VMUg03CY/OFrigIBfyfKw4ONfV7kdsa18/tA17gVHsY34LNO5WKsypKfxHecxEPfIo61jXhVOai+7Mjy0wFDPDueXP06lFJanf/WbbhfGZuP/y3ChoYeCRR/3D+R7ZhklqZwIBlOBQDasiulOgMon4xE4rSXqLCoyE1yyU2z957pOr3szMiPrZYKmrlhX5R8pk5PxBFid6d5bHIBVkPFqUbDoAcsWOb8K034+UyC2WnAM8f9xSudrIHBvWCnwJLbIRxDIqrIE1eZhAf7sexKncfCHCjbvFttZLwy0quwLZM5AltUvAUmwWyR0FchsZWxBq4UC77pN+NuipOHjqldhrJNSHbZKpgtJ+kvMMmjHMTfVQDYVG9KOkWQQKkHAHDIQjHcvCWGPW/emJseV3gQV+Dw0pS9RG55KvEmg= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199015)(36840700001)(46966006)(40470700004)(47076005)(426003)(83380400001)(40480700001)(40460700003)(36860700001)(82310400005)(44832011)(81166007)(356005)(86362001)(36756003)(82740400003)(316002)(336012)(2906002)(54906003)(70586007)(110136005)(8676002)(70206006)(41300700001)(4326008)(8936002)(5660300002)(26005)(186003)(6666004)(1076003)(2616005)(478600001)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:42.8778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48b5db1f-7ea4-4a57-2a5d-08daf582f4e5 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: DS1PEPF0000E636.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6872 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com 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: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- 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 b8638f0508b0..bc10ac5e772d 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5776,15 +5776,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; @@ -6397,7 +6396,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 Fri Jan 13 16:24:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101104 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 9B1C6C54EBE for ; Fri, 13 Jan 2023 16:26:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4368810EA51; Fri, 13 Jan 2023 16:26:51 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2055.outbound.protection.outlook.com [40.107.223.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FDE310EA45; Fri, 13 Jan 2023 16:26:46 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AlPADZLElNamxQbEn4Io1xV5f0my5B3gx+HsTYIa31kRKSPyuq5X8nr0a4d4lxqaIhWfOqvgebvV85Eg1lKY7E+KtwAgYgcDda+geJJDYdsZNhkWsPLEYteM4KC9XQRE51YhWeEVuuuXJXFjlv/3TrgEdi1FrklNdw9hLSb2DIi29kARRbVfaMncJ9x2rJQSVWm9flDDKWlGxH87X4d+wPgdTD+GoQ2JTI2P4is5NrtxpZjTXmGJVGmNYUq/nntHx/rhFo1n4q4qTULQdYfGULAr9E8VG7YD3Vb9wlJTqJAVWOxgp6IuCGWX0ipcur368ImFP/7LUALMmtJa1gSuIQ== 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=AOV+nHYTTMSI0b6q6UJK7Byijo1r75PpB0THduwiPTw=; b=EThr/2GeD23DbWie0guA/Esd5bt+fR/GhCBgf081MEUTsWRwTOBmVUiYUfkEg5IkX7zLhDwy2VWAl6IlctcJ8eUM0BNkgjXGdXuyLLPx9FSZHd19/jVlad7BLfA6zpT6DssotIGpxkMaVXmNgsXYK/EukD7cA1tIOslgCHJF3SaoIprFJYaetzYHT6NgnZQYHfMLx71Gk69YM89QgjCEruh6e99MiLcxV1HJyMwaxjQGDxkpUT/wExc/oYYRWZ4HPvNpOyu9IMQLJkDlOetrfU9IbMvGZ/dltQdYUlgpB8yUueMxwAQtdl1srzh6abQJ5VVJcKe0t+MUKAPP6tXXyg== 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=AOV+nHYTTMSI0b6q6UJK7Byijo1r75PpB0THduwiPTw=; b=Vmhw+FQlAqq27Av7UC3KM6eiytwV/iZwbTZBv559lBAxB7RVYsBAAbCQnwwc28yy3JMT+NDAIaD2CKQxbTErVlCqaBY0Q/SmQ3Ot3wDVGQxTcfpOd0NHt3JabxhOOBGzEXEI4wbE7sdP/cb2lkDAYAa/fo/+PoVogZc0aTHlcu0= Received: from CY5PR15CA0164.namprd15.prod.outlook.com (2603:10b6:930:81::6) by IA0PR12MB7554.namprd12.prod.outlook.com (2603:10b6:208:43e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:26:44 +0000 Received: from CY4PEPF0000C96E.namprd02.prod.outlook.com (2603:10b6:930:81:cafe::b0) by CY5PR15CA0164.outlook.office365.com (2603:10b6:930:81::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:26:43 +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 CY4PEPF0000C96E.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:43 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) 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; Fri, 13 Jan 2023 10:24:58 -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; Fri, 13 Jan 2023 08:24:58 -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; Fri, 13 Jan 2023 10:24:57 -0600 From: Harry Wentland To: , Subject: [PATCH v2 09/21] drm/amd/display: Register Colorspace property for DP and HDMI Date: Fri, 13 Jan 2023 11:24:16 -0500 Message-ID: <20230113162428.33874-10-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C96E:EE_|IA0PR12MB7554:EE_ X-MS-Office365-Filtering-Correlation-Id: e7b68492-a622-45d1-8546-08daf582f54f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uQYMFosUt8LVZALGFGtgcBMkwJ9xj2QQ4hiPY0SwRw8gbQdMrhneHdW/eDS6tVKgor4edKC41klx8Ej07/gNjrvQsV0j3gVIvevKE+TIoWKOK5PATYPVz+R9CJuUcgqO/PRZGio2xOkVU+ZDcjdxoF68Ql8UhGx8Lq6rEFxpn7VXTZPGCMKpFK9BPJsOLTJIU6lVaPb/sT4zneOHHP8qBDquowbIZTcn95wBk4FIXnA8DysUW/8HfAEMH0XL72VDXM/LxL619jEEydk4KK77rJwCa3B4DAJfm+GT0LdVveQeTH6xiRezMDWyS3Lnc8bTX8W7nPcKUguKmMhVx35u9kGoEGtyE7XC61hyyV55R9D6VUxGcxYfp/5bvkhh2t8lvJeYCbbU9X15kWOjQfKyKt8loWIsc1m1/HSl7l1UxcogJGVQT47kH5+PhUwonB81sE51v1pU5cDulG/OxJHyGaoDjEAhax/Rwb+ajjER4uLnmcDqifziEAeeH1khq93ohEIq7N4ozp4dvUIJDJbrlIyAAcWXsadM+GHK/42a+5rb+Bkq1zFU58734iEeOIN5H9wnIu/vDIq6UIpsL9jvyBQiA4ZF6uLQkCJDw/UVu/Zup1rpHBU35NjIJwEUWHsB6rY3xDAXyFq/Q82JeLpj2ldQSfF8BMTJUv/fi9vb23x2wMPXMBWkIgWcdbtOpugpSvzcpL0CAUSDbGWgLXtDDWD9Yzn6zKwvBFkaXF0g4hM= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199015)(40470700004)(36840700001)(46966006)(2906002)(6666004)(7696005)(478600001)(26005)(186003)(2616005)(36756003)(110136005)(70586007)(70206006)(336012)(4326008)(41300700001)(316002)(40460700003)(47076005)(426003)(1076003)(8676002)(5660300002)(44832011)(54906003)(82740400003)(8936002)(81166007)(40480700001)(36860700001)(86362001)(82310400005)(356005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:43.5435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e7b68492-a622-45d1-8546-08daf582f54f 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: CY4PEPF0000C96E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7554 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com 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: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- 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 bc10ac5e772d..c311135f1e6f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7035,6 +7035,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, @@ -7112,6 +7118,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 Fri Jan 13 16:24:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101096 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 0579DC67871 for ; Fri, 13 Jan 2023 16:25:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C960110EA3A; Fri, 13 Jan 2023 16:25:05 +0000 (UTC) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2084.outbound.protection.outlook.com [40.107.101.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id C181A10EA38; Fri, 13 Jan 2023 16:25:02 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DyNdbZ6wPobdT7ZH0iHUIwO6yqbiSwLzTC7u9Z2hwVeDbNsQcqmYRZwawrhvL2qEnbDdUtLOPFwtMU21UNhgW7kNVQPzjwnuEt1J/mRH5vuU2sNc+yMmcp23frhCrta930hSMG+J6ubapii7VCZuVe8ENsAva0nUzU7UXhekPsOcE8IMo3m/7NvEOpEEkqnzmjublJajPj8nrLWb3vMNvMTvLisKGHtzm2Ep2CVvpZwPFUQyHFkQ6WIwoslfIapamCc7dvKPq3rUceHcmNcVnPZrO3VfFUIHoNDjpc7FRS7tifrc+mir9Ob6F6ZHztuQbWpsbqekuu85949E+ZezDA== 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=3/eirbUtDiuTc+B3M2uibeKm18s55f6Tuq1ADxUNY3Y=; b=ho5Zu60wlt5I/g3DZ21t/J8S6Gpiv3x8RGKpr21ovoqPBkkQEGMufIoO74wV8HfV61ufwj28205TjNqCg17WT5hwv09SwkcmlMYu92ZSWXgielR+Whd+MuIPB1nGyQV08xWvDbl4EGZL+eThrRlsDS1RbsaQbmbAgbBsXilZn4IMggn9bTzoUcdtEHJqeuVxICMr8kIO4P5qED65aBQrryBAqtKmeAKBGdagEzz6KcvEdwiCa8Y+zz0+zQdgwICmo5BBwFvTU5r9/TlFUuxCHMb9Aul23ttaIddVDXrJaH/DIRzTifpSF34u6EZu7Nj8FSB3TPg8Dw1kB0Dplod9+g== 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=3/eirbUtDiuTc+B3M2uibeKm18s55f6Tuq1ADxUNY3Y=; b=2dky49KTChE+AjYIrB7hKL2+YgwOjZT0qGDlOGKfVls9BBR6LjOtePIBDGfMbn828XTDRGwNHHeAqi+55zLkPnGXuh2XFThedSeC0SpVEcb8jiSoAEUBDnrrK0dXA1C5rlFxBjEjEQ0803GaX0AbsqORlts0k6D4fMvnljLDH1Y= Received: from MW4PR04CA0183.namprd04.prod.outlook.com (2603:10b6:303:86::8) by BL1PR12MB5996.namprd12.prod.outlook.com (2603:10b6:208:39c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:25:00 +0000 Received: from CO1NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:303:86:cafe::d9) by MW4PR04CA0183.outlook.office365.com (2603:10b6:303:86::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:25:00 +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 CO1NAM11FT011.mail.protection.outlook.com (10.13.175.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:25:00 +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; Fri, 13 Jan 2023 10:24:59 -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; Fri, 13 Jan 2023 08:24:59 -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; Fri, 13 Jan 2023 10:24:58 -0600 From: Harry Wentland To: , Subject: [PATCH v2 10/21] drm/amd/display: Signal mode_changed if colorspace changed Date: Fri, 13 Jan 2023 11:24:17 -0500 Message-ID: <20230113162428.33874-11-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT011:EE_|BL1PR12MB5996:EE_ X-MS-Office365-Filtering-Correlation-Id: 35da7ba2-85d2-416e-3d3f-08daf582b7cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p1RhCmxwrIShJPU9C2IcHypUrUiWk9x3Q3Dn+mu8p0N01kSZmfE42zQZmdzOpqeDnWvlRsAH6E7PH5eWrOFJEIeNLoQnp4McKxLyvJWKG7cx/SFLDkc+SyHJmL4XcLyFc1YqWxYM0C8kx+wo+L3etWuZrX9kxbpZ9Vz15Sxu6fr5XPjqYz3Ge4aXbd4TPOvheS+TEEf1frhFkn31jbs6FpzCaCnijLBj4l/87v4CgGtw0d5Tx7+7lyUCjuknrUSmio+EFXnWYOK+FgBrfV0AIEwT2mM0fN30UGCzUNl2O4GgAqfPO5Crn9S40604n4nA/MsGVeL0y0J2glBJqoMrMtEEF0fiWD5W1Qat+nOnKJY20B9THEFzdYQDvi785R9Xkswh57OCieU/J1xZIYAdF8MhNol9tzUd4LGIxy7fp+RptZvASOmhWVZ6qiaI//hZ4yCedF9Nre3sIt22NS16KfAhTennNPAltgtcuWpv3FbdbF0fbxzGD9m/09atk2slrDEOhnls03GaZn7+vq2oaEMTTS8E70qgnQI5acwv08r7MXuiX5stVn84MCn8pH/mvXEA1AXsza8YLT0H/YortIqtY59gyzZiwe3UIc5bWU2fau51KDN0d7g3FvgzHbG22w6e8zcuSI7IaQKI+qBKf8MatU4ta7KSTLT6AeNEHKceLP2kePkboz8DsQgzdZ7i3cOzAYyS11/SrEz8c+FTSQMn13QPGelKTm8+IZBEF6g= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(39860400002)(396003)(346002)(136003)(451199015)(36840700001)(46966006)(40470700004)(82740400003)(81166007)(356005)(7696005)(70206006)(8676002)(41300700001)(54906003)(36860700001)(86362001)(40460700003)(83380400001)(4326008)(110136005)(70586007)(1076003)(8936002)(44832011)(2906002)(426003)(316002)(336012)(40480700001)(2616005)(5660300002)(82310400005)(478600001)(186003)(26005)(6666004)(47076005)(66574015)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:25:00.2862 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35da7ba2-85d2-416e-3d3f-08daf582b7cd 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: CO1NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5996 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 to signal mode_changed to make sure we update the output colorspace. v2: No need to call drm_hdmi_avi_infoframe_colorimetry as DC does its own infoframe packing. 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 Reviewed-by: Leo Li --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +++++++++- 1 file changed, 9 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 c311135f1e6f..f74462c282a6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6492,6 +6492,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; @@ -6514,7 +6522,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 Fri Jan 13 16:24:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101098 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 D8009C678D4 for ; Fri, 13 Jan 2023 16:25:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BDE410EA3F; Fri, 13 Jan 2023 16:25:16 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2072.outbound.protection.outlook.com [40.107.223.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D3F610EA38; Fri, 13 Jan 2023 16:25:03 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KLXG9zYN/5mHBpVsrOAQIM8f0dJVDgz0+cuXwI6kep2Q/hnNh2cSiZJbrzhL6FpqQQiFJZBBaMa37R0yGIl9IqIJLX5K4uPRc0RfI3OjfoNk7k9DhzoCASWnvDh5wQopS79uCEbMwXtU6E+dZ9xeXKUoMTn0Hxi86HsSCW7hZAmK12zxYXY94QcqfvfJjJZAhdKn7Q9Fk3h+X6AvmcMNdK12Vo/UmAOWpGMnAANNCNjX66qL2pdYvUnXnM/tmYoQBDLPi/IIoSS4y+BC4Zr8PwF3S/tO/gjzresVPdNYDmjlX9NTIwIFkGm+UzQxFYsfi/yobx12mzZR9rXdEn2DKg== 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=fxMseIc8wt2rzbjzDov2bZswFiGLgtE0ghauS0LmNdI=; b=NOdyn1+lYeoBCpCGazzCuLayjVaxUKsqpc7ERXTW6n8CVZOCytAvzpS4vNO7EvdrrnG13xYCxP5dFD6c4FCphB/YHPkYIFW6ai8q80Tjm80CECWa/EboxtKSZS0cYKOFLnfSPiu4ZS1AUTHGrRCelKEMygfvk1CAdPDitz9aMVZDJwopuaYWf/FivCr1DQw9N3BvMtVmAtreQKwolxxFsLzdTXjngetdEraPQmFOAgIu2deAYdH7dhdG7xTCFjPecsJ110hPkotGqzufxTotlwwPVYUWur/ooy2jcMoi62MoJIDQjBM5x0y8nxCJA8t7qbA3MgZkAd9Z6muZGFNK6Q== 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=fxMseIc8wt2rzbjzDov2bZswFiGLgtE0ghauS0LmNdI=; b=z+bW+6MbFC/LB/6oKdfNP5uQZZjKO0GJI47wvToOeY9WS9ae2VsnCRuX/5kKAtq7GLHSrILSORKmKOluo7lYEXQjrf0ZOIEpnVhngAPhR1eo8FrJ3w0wLKwS9AbJ3tM0txvUp/NMvQ9UyzXR5HeVtyzxX46Am6+fWyIHJcltmVI= Received: from MW4PR04CA0189.namprd04.prod.outlook.com (2603:10b6:303:86::14) by PH7PR12MB8156.namprd12.prod.outlook.com (2603:10b6:510:2b5::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:25:01 +0000 Received: from CO1NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:303:86:cafe::b8) by MW4PR04CA0189.outlook.office365.com (2603:10b6:303:86::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.14 via Frontend Transport; Fri, 13 Jan 2023 16:25:01 +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 CO1NAM11FT011.mail.protection.outlook.com (10.13.175.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:25:01 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Fri, 13 Jan 2023 10:25:00 -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; Fri, 13 Jan 2023 10:24:59 -0600 From: Harry Wentland To: , Subject: [PATCH v2 11/21] drm/amd/display: Send correct DP colorspace infopacket Date: Fri, 13 Jan 2023 11:24:18 -0500 Message-ID: <20230113162428.33874-12-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT011:EE_|PH7PR12MB8156:EE_ X-MS-Office365-Filtering-Correlation-Id: f8907d50-20a8-486b-e5ac-08daf582b859 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y8D9tdieUcgAUTtuMQjU0pw+84+vyDV9zOQPvE0qr29yOh/SHs5UQOfTprWPbD9EEYuWTknc4+QILFWsV7pA/7t37tTU2QjWxhAcvwSDJEh2JXMSD0aMPnBVFzEDugLOTfphoAM3O0Hk3zb7PScmj1TlaEg+YHgWEbTuI5PSevMS9bd1C46vL/mSm5pQS7il31Yab6tFUMdppl7Y8Zm6N37L/Ca1iIfVca7+ciZMpcg/mKjt6R7Vagp7AYXlqQnKZJDVC4xyFby+PfEaDsxXq9B5T9ygkGFbDw5cQNBlicY5kOSwO1SkKi432ymELUEkOSud40r4l5faE1ibYKehb+LIUomJiEpwYOPC7SxW+bxzVzI29rjSGlCPzGuTC7IPd3yVGT/xZWbRXEtVKWd+5jDND7VPzLf2FWDl0soSkKm3Kn3eN02hsoNNV55qHeRvo33Ee18YkqNSvZQ++FpKZabMx+auSCQoRGrqVl5xaaanHBJda0EKftjqQqIwGWw3AG2AHMzSQYfC7kzpiscFu+ypzStjyREl5HF6fgMwYW5ryrp820TN0sNOBvumrgKmpGNNCPxfBr6G+6bQ5yvpFIgCf5ESg2s05+gRqLxdH9+4ut7ur5KEbtCU1bFqpOH7tU/APJg7cKaYD0lN8uFxZ/XD/ifUZ5jftrPcF7I2F+VSIor8MFd7aAJgXnUsLjOpHa1huOq2q4fBMtPaJUFPOTvVl5SwlkOLZjEhU3v5mrg= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(39860400002)(396003)(346002)(376002)(451199015)(46966006)(40470700004)(36840700001)(26005)(6666004)(36756003)(186003)(8936002)(2616005)(7696005)(1076003)(5660300002)(40480700001)(316002)(40460700003)(4326008)(356005)(82740400003)(41300700001)(70586007)(81166007)(478600001)(110136005)(8676002)(54906003)(86362001)(70206006)(82310400005)(47076005)(83380400001)(44832011)(2906002)(426003)(336012)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:25:01.2236 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8907d50-20a8-486b-e5ac-08daf582b859 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: CO1NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8156 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com 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: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- .../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 f74462c282a6..a31f71f2feca 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5162,21 +5162,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; @@ -5189,15 +5189,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; } @@ -5325,7 +5331,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 Fri Jan 13 16:24:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101114 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 B319FC54EBE for ; Fri, 13 Jan 2023 16:27:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E9A010EA5D; Fri, 13 Jan 2023 16:27:04 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id 901BA10EA45; Fri, 13 Jan 2023 16:26:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n6oopLTZyOLOPQbzfPdSQ6/3hzDzN1bcvSRLdYFlBlJQdniLyV4cKo3AikqwBEGx5tZy9V6ymdjHUtUQcnrpm+3jMVyT2jz52+fCe1/xlOzauqdW+VSHGQezBqslI0mtc6cMYrury0LHxfOatt5J0QXxuW2hGpXvmGnghG4PSEdN2Fy7G2aMSYgyVbSgYnrGBlHWyY/gySnrqcJtb+PdDQuJESkdEl6cI6RipxP+1gqoqB9Mlv/Twg6aZfqOInwSVxhKhtqqnmVLPnSFXd7ekLr1DDBzT+5d/CRRXnUHiW0fOl63i8ngECRY2eYHuw1Sex34TzzTIkOQi3kAgCc1GQ== 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=MxkXtenKtpPvF5Go8LPJnoR5/Bpi+HyQB7bNy92vT6Y=; b=EVO3iSVVTepd+ukwl6wEcuAeXYYfuF+FgIeSsEEPmq9Jq5vO1nJilfWgTkVja3S6frlqKI6ed6yLi4UDMVGkN0qznnjQ3PbC270v0903wKhR9+VynXieBQXZEADm1efxO9MYlyrFr0fcgAb0b8NBGM5NC9TvzmWCIkl6QZQtcr1UoH1O6D3I0Q+I32kUWZyOMhfU/q6gQ+wxC9teC6i/jpmzsCswf7L7z8b/fLTIOAoMaLNrfbEhFQh0PfB/VXHoCavJn84Ni8lMdUEbeUDjMCm8KAgxG1VLsLEt+HTaN7yoowVuYJAoZtw8JXsxGF1DxhViPODi/d0YLRwKkCnJzg== 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=MxkXtenKtpPvF5Go8LPJnoR5/Bpi+HyQB7bNy92vT6Y=; b=zFsYCfXira7o11HLAYMJmJNimtCyqrSwq1oePmsRaM4s47hVukBWEaYmaSjBencCI5vu4xeglTmwJBTnbrQntqkb9CaCGLqqtTw4cytqR0GOq0edaanQEcDeBLMIH8a2CUzjNCGvaXjREKUdCpDOZxquXWc96BgIotbcQdqqt6Q= Received: from MN2PR10CA0012.namprd10.prod.outlook.com (2603:10b6:208:120::25) by CY8PR12MB7540.namprd12.prod.outlook.com (2603:10b6:930:97::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:26:45 +0000 Received: from BL02EPF0000EE3D.namprd05.prod.outlook.com (2603:10b6:208:120:cafe::ec) by MN2PR10CA0012.outlook.office365.com (2603:10b6:208:120::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:26:45 +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 BL02EPF0000EE3D.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:45 +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; Fri, 13 Jan 2023 10:25:01 -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; Fri, 13 Jan 2023 10:25:00 -0600 From: Harry Wentland To: , Subject: [PATCH v2 12/21] drm/amd/display: Always set crtcinfo from create_stream_for_sink Date: Fri, 13 Jan 2023 11:24:19 -0500 Message-ID: <20230113162428.33874-13-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000EE3D:EE_|CY8PR12MB7540:EE_ X-MS-Office365-Filtering-Correlation-Id: 320d6279-3878-41e7-e64a-08daf582f65c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dnpoXpHa2/20dcJE/cMXkcHdjuOuzUfIFhAFuMzAxBTe5d78irAgumbOXWZ3SYFOAmVlQCpU97elRuSa5zOQC2UQx06eJHVvmnRVJjEOu4EJ2uZh+q0EQF35atc8gUm+tGqsmtcDfDCz0uYEtdXMzleAMGcZAoiflIzCVZbWysZgEYiBMftRwTl5LXbx3QZaVt9VOI5Ka99/kniX0VSnTCrBPT9/QGUnulJvgcpzNTQ2VCKkcWWUYKi5VrEFD4KLOanGwfj9YCU+FsYNX21xLzxfLTI1C7GhH3VPzEPcSgsGFva28H3YUd5fSWyBmZY4878m0dOIA3IqXhIQ+XJ4eRKD+28MZNE8QXgIBHsP3/O/vfdQ/CE3RN+g30yyW6V53oIi0AJ9hRfxwQxC3SBiYKuxSPqK0SJMp/EoyyD/DaltMFAT7+pksHlM5FAJq6ffM+LVFB6S9f1VM4NcwQdHYaApvAbT5Hdqj2yV2HqIstGwJvkPA33S82p3L++pom897sT/Fmq1mgye7avvdNWPnoVpa6g5eaRJ/0qBqbvjXJo5cXH2FEYb3VI6jypgUMwdJPmcVVRS7NKYSJDRgw7VV1ag+cXVwvAda/uOLvnQ3651+D6OUDiYk41RBF3X0NSTXMk1XlacrgmvyCsCwp0ZeUfPucNDrHXBPFzlu4f7/dTh5YOaMpp7ymQFxTujL+Io8VH0ZoI52Y5FOs7OO9fA8zr95B8NZU0mRaRAPyrUCEM= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(8936002)(26005)(40480700001)(478600001)(186003)(1076003)(336012)(2616005)(70586007)(8676002)(6666004)(7696005)(41300700001)(110136005)(316002)(54906003)(4326008)(36860700001)(86362001)(83380400001)(82740400003)(40460700003)(47076005)(81166007)(356005)(426003)(70206006)(82310400005)(36756003)(5660300002)(44832011)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:45.3714 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 320d6279-3878-41e7-e64a-08daf582f65c 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: BL02EPF0000EE3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7540 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: Pekka Paalanen , Sebastian Wick , 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 Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Harry Wentland --- 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 a31f71f2feca..fc94f4872397 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5870,7 +5870,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 Fri Jan 13 16:24:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101097 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 8D473C678D8 for ; Fri, 13 Jan 2023 16:25:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A66E110EA3D; Fri, 13 Jan 2023 16:25:09 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2065.outbound.protection.outlook.com [40.107.223.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0DC4610EA3B; Fri, 13 Jan 2023 16:25:06 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D5ZZOZwJqnBIoWI1lKzNLbZ9BKLNoOdaAp4MreruyoVWNgDKF63mK8phoIDLGJtiC7kNxxObk77Q/4mCJyeJPEcyVTzkmhmmE41RslXYRSFf3WK+S58uE72FbNTaqND3eVEv7/h88/Ea7EH4dAKMXWXn+OpJeQkKKTrUMk+aCXjKlv+dUWFI4jXEjKy/SS0I2sEI7dXyE72vswAutoxRKXsZAygX/Fs/Boi5Pu327B1j9FZURbzHsPfnmL3QLlziuwTbQaFIPyBG7vK/HUSTkF/RMSXhcEG+Chsi/fYItTkDWt5mo27BMgdm2tV5lFU4QdeYQYJmk0y7Jat+cK3DWg== 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=D4+Xvn+6Mat0LVdjaQBIhUkP7yEJ6rELEB0ZNObmNMY=; b=bbhlmn0UBJIrDt0l58jAiUJ98iCOVCyH4TP+0ocNDyQU6NGGgTfyRbPKipqKMNh6y3tfmhDEaxcOkVt9kZ25FZEZrIlW4aXVoUTGXS/urc+pEYydX+0EuKcX5jb9Qp+OX3Db1kbJSDTf4Tqxpobs7Oq0KiAUSVapyH6SCFKDM2JsyChKePHa02EFYsQkM0iSgvdt3iANJHv653qFXWVtcTya1vqWxjM3mXsuCbU16OiUXIm54ouMbs6bZ9AQSLPt8+C4aFZTOcaOZcjtoFpNCiu5WvBjfAXoh6kEvS5H0A9XO2sDe0ynaETs15uyP14oYezY01+c5ORqe+2UoyHLdg== 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=D4+Xvn+6Mat0LVdjaQBIhUkP7yEJ6rELEB0ZNObmNMY=; b=w8/XaJjFazgeVTOBQ4o1SpBabsVjhySaDQQgZVXPte68mSa55MSQagR2aiif2wphKuhntVnA7wdF627CAP9qhjKgT2hK9vksSBEnlHCWncEAYMQ4kuiRlG10gbOBIbUP8OZolQO2Buc0Fv0LtC+JgUFNidvQE03SDVMNqvrsHp4= Received: from BL1PR13CA0362.namprd13.prod.outlook.com (2603:10b6:208:2c0::7) by MW5PR12MB5682.namprd12.prod.outlook.com (2603:10b6:303:19f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Fri, 13 Jan 2023 16:25:03 +0000 Received: from BL02EPF000108EA.namprd05.prod.outlook.com (2603:10b6:208:2c0:cafe::7e) by BL1PR13CA0362.outlook.office365.com (2603:10b6:208:2c0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.6 via Frontend Transport; Fri, 13 Jan 2023 16:25:03 +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 BL02EPF000108EA.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:25:03 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Fri, 13 Jan 2023 10:25:02 -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; Fri, 13 Jan 2023 10:25:01 -0600 From: Harry Wentland To: , Subject: [PATCH v2 13/21] drm/amd/display: Add support for explicit BT601_YCC Date: Fri, 13 Jan 2023 11:24:20 -0500 Message-ID: <20230113162428.33874-14-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108EA:EE_|MW5PR12MB5682:EE_ X-MS-Office365-Filtering-Correlation-Id: 011bb40d-54c5-4efb-fd80-08daf582b978 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /TGFXy2a0nKilXNBqQNzGpIp7N7dlxP0ohAdQLxwPF0GH8Xco5mm7N4jHRiGCzQ4luFJF7UNDl1lv8WLkUoGnZsPfKtTqPZSXYwQeAaojb0i5ba+cZV0xJQNkpNdk4fFxigEVZxpjge1oe/lA/iPG7dNzZeAychgEQFz6phkDOypZXPkUrYgmMleSfTKHkUQfNL1UBckGoi18Zaz/tga4QiMKO8StkKvAUyqZ6rHpySPAyhbd6nNj8bhOyDRJ5QXGCeRC9vYq1pVKWSPjrekXqeO/SzMFjxQY/HUwN0zRAFAFT3oh//yB686y4l+ZNgPMsRmp9Gnll/t9AL+Fi9iWD0ooan8Rt60MIfArK3OhUkYUSbHZ7+v86GOI1rpzYrObwWl9EBNDuulgdcdBMcLv/iIJJEPg+9VthHE0RtXrJ2+HDT3vQjZLE0TeD4paMwFO6/mDBXqFOCXAEJfEBhebluNXM1HIoHD9wAA0juLfy26upAIafzNpL485KruAHZsGQc60amdFxM1o8y8Jyam37Qr74EjgJEt63mDCslakBacMrU+1TZ8WS91VRThBaGhNI3Cq9G3Halb+rlmrVEDeK0Stji2094wNq91EVNU0qyPNJVYaPpulodILZfMI32MgIuREJ6fbfvvB40o3LAgYRCLhO0QIHpEaNcbry6uaP+pz37GtuY8df9Ew9CPXrh9Z1puzGgen+inrpA9y2TEcbFfjYeASnYvl+vM7ngTnYk= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(136003)(39860400002)(346002)(451199015)(46966006)(40470700004)(36840700001)(36756003)(356005)(44832011)(2906002)(86362001)(81166007)(5660300002)(8936002)(40460700003)(82310400005)(41300700001)(40480700001)(82740400003)(36860700001)(47076005)(426003)(83380400001)(54906003)(110136005)(6666004)(478600001)(2616005)(8676002)(4326008)(316002)(7696005)(70586007)(70206006)(336012)(1076003)(186003)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:25:03.2145 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 011bb40d-54c5-4efb-fd80-08daf582b978 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: BL02EPF000108EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5682 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com 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: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- 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 fc94f4872397..d2921d2179cc 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5190,6 +5190,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 Fri Jan 13 16:24:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101111 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 9B12CC54EBD for ; Fri, 13 Jan 2023 16:27:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4948C10EA78; Fri, 13 Jan 2023 16:27:02 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2059.outbound.protection.outlook.com [40.107.237.59]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB48F10EA4E; Fri, 13 Jan 2023 16:26:48 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z0GEDIMta4BSHqdw4Z18pR4XrOL8Merlk3XFczCSxcsKvMRQ4UcxPFl0pplCTDq4MYla0vQnjz9hGHK27pv3BL7j2GPF3ksn8av4K8x6ysIFJJbMdftq/EtIxdwdQLI/EB9rUTBKP17MGl+XkuJCheJFVMiO5QAH2KyX0G9WbmKOwwEL8jtCjEjUaV0cQEFHnqhLtojy5L10GsR9bPiR3oiJVMr1C+y5jhuqbcXaULYHDLaf3O0eOO//AogPShKduNwiVsqHYbWiNvSvcdkU5qUObKdXnjkb1eK2dU18tuMnJY04cUAD8mArVHqBI3lXHKHRppKbRXOo372MBNm0YA== 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=hq7w1UEWNfnftb+hxeKOS8k47NZxHLK1KEq9ZQ3uOIQ=; b=LzMK+Pv2QPZToUbtQTFNoB2FrPM9dM5dkXpm9iNL/wStM9liE3mPwVJgJhc77Nrx6p7/1OQpfCct1Lcmpt/UxyZg5AyoaYYRWCBlDzrW/wxdKq19MhcySruXWGEI6RF003OkgNkNgD8J0AwuR6fZlTyoh2xcaBDPnuS3oyhWnmmrPw0nUrB3s7NzdpkaxnGUKNlyC1s0fF/G+dL5LDR8jT4eYiio7nlaq3eiUrFbuSkhT6ZI8y6xHXjsqeU7NU6WFf7nEdfk5CPR4suMa8/CLgQnacU0UKfdZRLkdw0VcA8NwU0l4bN2peSQ/1HB1AHhFyP22tUSB629KmJ95kDmWA== 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=hq7w1UEWNfnftb+hxeKOS8k47NZxHLK1KEq9ZQ3uOIQ=; b=VaYaRNgaJF7pWSWlnQHJz01WDTHiPN1AOvSbqNP7iGKpvt8QMXY/9rMPsp3mKwWveLRDmcGFwPGqRuX23uHVHKw+NWfuZJLYbLVej1d1neOiIxvzHa/jigm0TGAzycuhPlr4JhDKfyRtUx4iWmoGxgyREsXtuS3eGjvQj8XkwxE= Received: from MN2PR10CA0028.namprd10.prod.outlook.com (2603:10b6:208:120::41) by MN2PR12MB4285.namprd12.prod.outlook.com (2603:10b6:208:1d7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 16:26:46 +0000 Received: from BL02EPF0000EE3D.namprd05.prod.outlook.com (2603:10b6:208:120:cafe::bf) by MN2PR10CA0028.outlook.office365.com (2603:10b6:208:120::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:26:46 +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 BL02EPF0000EE3D.mail.protection.outlook.com (10.167.241.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:46 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) 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; Fri, 13 Jan 2023 10:25:03 -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; Fri, 13 Jan 2023 08:25:02 -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; Fri, 13 Jan 2023 10:25:02 -0600 From: Harry Wentland To: , Subject: [PATCH v2 14/21] drm/amd/display: Add debugfs for testing output colorspace Date: Fri, 13 Jan 2023 11:24:21 -0500 Message-ID: <20230113162428.33874-15-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0000EE3D:EE_|MN2PR12MB4285:EE_ X-MS-Office365-Filtering-Correlation-Id: da520e1b-c4f6-4714-674c-08daf582f701 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u/MwsOnWQtkmnYG6qWy4f/nRWLtj54ZFdRpfr02713eQ4Ye39X34JvHiwTEFBZlZvL6/rJmlDmdbwK3fKDjpQaBgassnYTK2cMO5HS91bZsdEWGtl4wnSFIVhu9+6vCSX3ioGDsZU94iTEjyZBKc2KkBS2cY4wb/chVsF5AQeC/2PgG4gt+VAqzbhGX5wssso0exR2CE50Sxs8/+WuNTimMzKhKN8ODr+SKv8CUf0NiMWzNse4CHJVDPVm1C/6JCePscOmZo9Q0rEw71HMXw17zFDtOsxXTeAGWgByAEhmNv2pFJvBc6ZC1mCl31rTTR4MjA4Zpi1N8pb4mJTILrJE6khDY10tiNCOrQvOFsuThhbvnQz1pXjlDdo8IxdPmh3GF8TCzAJ3iSlBgesJVkwx1MAFVSOl0nOjKnEs3Z+RIfAsTK+KRWTu0FGE+rd4/EvOV09HJM1c2IUoGm8fKw0h4ddbc2V0oXNOmyKpYIMVl2b3l/qohivJNMbh1r+hQRQQ/57hPt3uQD2Jm1IpL0WyOB3/hwZOYdSgbpgaKOacvIBWEoZxgZ8j+SZlSaknZQ4nw9PJv04EC4yKTL7zmxo0VDNK1Tn6F/3s9CdO+ZPPCUbtWCyqkLJKlzfHgnIL6YRwO3QG+ID1p1T+cgtDR2RWYlWT4tWcdC7uVWNKQEtX9kkzZZGvHuup/uY2HfJSoIEvYP/T4ZYjulnDvdtxbUFAzmgju81TrSocT2W7USI2s= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(346002)(396003)(39860400002)(376002)(451199015)(46966006)(36840700001)(40470700004)(36860700001)(36756003)(6666004)(2906002)(70206006)(5660300002)(44832011)(83380400001)(4326008)(8936002)(8676002)(82740400003)(426003)(478600001)(41300700001)(356005)(47076005)(81166007)(26005)(336012)(70586007)(40480700001)(82310400005)(186003)(7696005)(1076003)(40460700003)(86362001)(2616005)(316002)(54906003)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:46.4495 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da520e1b-c4f6-4714-674c-08daf582f701 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: BL02EPF0000EE3D.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4285 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com 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: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- .../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 a29952cd8f22..5473f022d9ed 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 @@ -3304,6 +3359,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 Fri Jan 13 16:24:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101099 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 C605FC54EBE for ; Fri, 13 Jan 2023 16:25:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D3C410EA44; Fri, 13 Jan 2023 16:25:18 +0000 (UTC) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2082.outbound.protection.outlook.com [40.107.95.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0DB810EA3E; Fri, 13 Jan 2023 16:25:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jy1U0FM/jJCPTJt2zHN/uXCyShWkTYOToz8ZMfxqx7Y3Kz7W2EpWOzi7LIyGf3+mM4T9kAxtL6PReLbuuu8m8PdJX421u7FGLixFUcgZj34T2j/c/PAIDgZg4Co/Q5XjbvyGoFjji2Zpn2MOTP5mBmSXNZCi9hIves6elpmo7N1Sx0vxeuHtDOVr4tOQBC66MA9ziCFn3I6iTUXonw2jNWLQaADZrVRIvdh+Eidu9n5RoMmMFgRSULPWzq1t5LC8UuKWQIgK28YsEtOKw1qablB3zyxonIL3x9wTcm8bOPsT7ghwQL9BIhIEIjzA+JVBBvDQYbt6F//odCrie71e1Q== 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=y7NXZGvZ5ttZWoFvf9X0bOkknf/wj7R9Rl8QDGcG/aY=; b=UqA9IvVWaIjtTeyvZ8OS3iLiu8pX9e2M9Ic9JvAqJspldDp6mkk3hjnkrnNAe1NRQsU5nP6kbsDm16vlNInTP25IAe6kXNXzJR0k/5bfQkAS4glFdRrRyu+veqMvrbeuF0jdZOP4p0dD2wQBBnBZAg/qeowXDqjRg4faM4WArGvMRXqgDVTHEviagdJEAsHAr0F1mquUZbTK7TZXD5QTuCvlSuJAj1c3Gd9WhzcLYv1nuRDQfaUyXo6NTzEey+ZCpXaYUajev3jaWtaPl33A81KzzDN0G6+QuBQcc999C+MfCmiGrCsxxVCe8to0DGAwrk/DMMtg6zx+nW9er0vlkA== 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=y7NXZGvZ5ttZWoFvf9X0bOkknf/wj7R9Rl8QDGcG/aY=; b=aEFGZt+9EVp7Rywa4ofkLg0l+wqPNik79sPjvV92GZBpCdyRj6GTHVJkVqbOK9WxbvLR559aqz2E3nS6clXHZG4t88GUAJrg0Z8QQ6Xm4tIXxehwOsg2ocFmcoxJnavCLT9v4KmbsJk0DhuMmJvNXStAt8AoRbM8Q47UEPDXSRc= Received: from BL1PR13CA0362.namprd13.prod.outlook.com (2603:10b6:208:2c0::7) by BN9PR12MB5292.namprd12.prod.outlook.com (2603:10b6:408:105::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 16:25:08 +0000 Received: from BL02EPF000108EA.namprd05.prod.outlook.com (2603:10b6:208:2c0:cafe::83) by BL1PR13CA0362.outlook.office365.com (2603:10b6:208:2c0::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.6 via Frontend Transport; Fri, 13 Jan 2023 16:25: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 BL02EPF000108EA.mail.protection.outlook.com (10.167.241.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:25:07 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Fri, 13 Jan 2023 10:25:03 -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; Fri, 13 Jan 2023 10:25:03 -0600 From: Harry Wentland To: , Subject: [PATCH v2 15/21] drm/amd/display: Add default case for output_color_space switch Date: Fri, 13 Jan 2023 11:24:22 -0500 Message-ID: <20230113162428.33874-16-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108EA:EE_|BN9PR12MB5292:EE_ X-MS-Office365-Filtering-Correlation-Id: 49c5ca20-2fa5-4840-41a5-08daf582bc44 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jPuWOpvWkgIt4IFvqmLoGoPmI+lK/+aD1D+ddmWgDcP7WuOdPnEm5XgYDXXEPCyKltP7OT0C9jOVpgkyG0N/O9ymQF0iQNSFePzTb1Pvt3hJr6esjI03mgf+cTQ0mza+Cs4e+uKUFS3243cHDVYHMpyAu94r5Oxd46rxkESKlVzBi6eLNmRj4R7Qja3U3LaJq9LlQujn1vvm3QyBv21T9y8doe7R46fjiom7gGFLELZK0U3hzXT7xXUHcXxXdViRMZkI0SoOWmleiXPH7NIZB38ItVwNqWd7gk2qI6UVTI+JvCWAMEsjoNCVzgrc2klZqW870G1Q5fTTyragONQI9kvH8jRdl82zEAPMbV4Wi+L6/P2Rc8z5SUlPkVsEby6ktRdih6M41cYIGqQD36W6Ez6Kypn4Si/XSYVJEu/tYuuAa+Sc3OBD+djtOttXszfrwIpXaAW62CnB9YEIrr3R7H8SS3BIw3U8bBPdntKeQBf0BAYjdRaOm9jIr7s+TMOO6z0HJ86e6TG3P7wkGDom8WxA+3mc994vEQ/k8tpHCIlbq9rtsBbMicgZgCUIm0X4r5W7QCt6nZBckOvPtOEEWEi4U3zkTucgtJYXsZVpHgsDwuT2QHBfNHFGydO4WDIQkb7DP2QUeGyC0AS1pV/WpI1UB5fsWW1ZLzZJxCk+40+irpphl0lHlLhMB0xdmadLTl0b4qu0uMoc1w1d0VPV6eYlt3sRzDGj25cO72r0bmQ= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(396003)(376002)(136003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(6666004)(36756003)(82310400005)(26005)(186003)(478600001)(7696005)(82740400003)(356005)(81166007)(40460700003)(86362001)(40480700001)(83380400001)(2616005)(426003)(47076005)(1076003)(36860700001)(336012)(44832011)(8936002)(5660300002)(2906002)(316002)(4326008)(70206006)(70586007)(8676002)(110136005)(54906003)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:25:07.9021 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49c5ca20-2fa5-4840-41a5-08daf582bc44 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: BL02EPF000108EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5292 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com 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: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-By: Joshua Ashton --- .../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 d2921d2179cc..73a98e6e1867 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5168,7 +5168,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; /* @@ -5190,27 +5212,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 Fri Jan 13 16:24:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101101 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 1D6F6C54EBE for ; Fri, 13 Jan 2023 16:25:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24BD510EA47; Fri, 13 Jan 2023 16:25:23 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2081.outbound.protection.outlook.com [40.107.243.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9782510EA44; Fri, 13 Jan 2023 16:25:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rs0EEZNmlTG0LdTMmO5kTXuXFZ73GAZYSMOk8/gwx9ILLAc7/8li5jdd7rFtKOmcFfNggVebn/8R+QxWWA7ag4z2hiTYx6pGrYIvLK6ucjpTZYh5e7PWnlBKLlujmCXgXQQjrhP1W3FGVs3n+9FlXXQGwnMafEDc5QfpHILfqUt7BpNCD3XVEiNQULhwIpYo5+6dOJGEvibKnPyqdMqlScIrrPs4nB49LZdT6hxmDkhDKGDdyC/ynRhjynDMPu5HrCQ7uAs/agDnW7DZUoKwGQmTpQ9pUksOpxOjeF/UZ/e840bH0XM0vTSiRt2U6RlwK5N1qhfrY1zu0AoUHKvphA== 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=sZpXWDPb2QhfZvSYhbPInh/iG8q4NI+E5FI8KbI+94A=; b=bWKk4TujrD5g6D5ObOGeEDN2Z1OQUV8g+kBpGiJrtU7+aX1DHhnA4enB7cospltWPzwwIOO4tK6y0+HJywAdknfoQPvKgaUvX7eknzknM4Nl49gqY9gTCMmCFLsTKtfJZxwBNFsRU9S3qFUCBxVlCcVLTcTyzT7jjONRGJhmlWgk6lCiEJcioV6knS+krAK6g/SY+PRU+Wep5xfu1plO+m5xadGbCbUyr2FNrqoIxUKBJoV/bNNFvKsq1HQbd2LWpMoMY3eAQiCWvB/tJsFiXUz+4oUFPoom0f3aeL1b7oaiZY70N2lvIVV0kQIBMs9mnAmuvtxmB8EUzUaABjhYJw== 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=sZpXWDPb2QhfZvSYhbPInh/iG8q4NI+E5FI8KbI+94A=; b=1trgcTJvGvo3b3bavkgfe7iTMCVFwqwnjRl8ZcjtAYO2XtJW40O7ZocRDkE/cGjbP+Uje2JlojuDeNuQe377PWRmcQ/u1zm2wMjMcNElaYwtfrVNGWZ1p4BWzo2fU7n0a5sRV5Sc1WhpBtKD39U4OQHUyhEA4MTLawGuJKBtAVc= Received: from MW4PR04CA0384.namprd04.prod.outlook.com (2603:10b6:303:81::29) by CH2PR12MB4037.namprd12.prod.outlook.com (2603:10b6:610:7a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 16:25:15 +0000 Received: from CO1NAM11FT080.eop-nam11.prod.protection.outlook.com (2603:10b6:303:81:cafe::6a) by MW4PR04CA0384.outlook.office365.com (2603:10b6:303:81::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:25:14 +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 CO1NAM11FT080.mail.protection.outlook.com (10.13.174.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:25:14 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Fri, 13 Jan 2023 10:25:04 -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; Fri, 13 Jan 2023 10:25:03 -0600 From: Harry Wentland To: , Subject: [PATCH v2 16/21] drm/amd/display: Don't restrict bpc to 8 bpc Date: Fri, 13 Jan 2023 11:24:23 -0500 Message-ID: <20230113162428.33874-17-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT080:EE_|CH2PR12MB4037:EE_ X-MS-Office365-Filtering-Correlation-Id: 895601b8-b17b-47e1-09d4-08daf582c02b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x0bxVXR04yjjRC8ObOKobZDJSt6Q7MD/XRsIxggtNr11Vry/sOhw9UxfKZJE3R9Uxy1oysMux+uRA6uaKFkknOK+lM9MbGiH8CB4BySaVdXqr5NVkOAaWoeu+pB2Y8e/XtPgg5KKCAu4gjtDoERfGjziNbaQ7PSrbEOfzQ/7K9bNn4jV23K8DNpCBa6dsmdBSeCPWoktQfb3L5i9X95ej1XaD/HD0zK3hE8VFCpuRHXIlQzIVgPVkBQS8Mggdun9/Hov7SctpC2yOVCAeJGoWMsR5FPsNmdmTuhru6Nd0cL2G8ZQVhrpU7Cnb8gl/AGIP2j5SecN9B7TvSMjwHIyzyU10TJJfx0j3UpUAG8ZUzQ8CkOGklwjuPBMUpp29yiOIEVaHyX5Do5gckutzcBWJTkFUNwCo665zdNKepnt51Vv3FfH1qoDK3Iyc6Lv+bnITrGqZuUDWCIr/UXNDECV9PgFeKTpK8j7VNMlTOHNyWlXcEXo2L39129j+yOQ1J8oqjXydt5gckVhPKNKbvsT0kR2msU6wXGXC3bIOalJIiM2Apk+Q1LsDEdVAKgt8t2E1iZNFolW5mjDoYYCLcY0nVYrCReAzCMth7KVKEURLkeHmosUxOt5Hz3Or/kVeahWZzxjypGA7gq0lJ5UrheP3/n61B4mP3pEfSlRhEcfkjW5OIX0fjbYU7SkMJlZguEF0spXgnLImBFAgGbLmNZUsLrnACPPZcwx2B8r4KrN7W8= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(346002)(136003)(396003)(376002)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(6666004)(36756003)(82310400005)(26005)(186003)(478600001)(7696005)(82740400003)(356005)(81166007)(40460700003)(86362001)(40480700001)(83380400001)(2616005)(426003)(66574015)(47076005)(1076003)(36860700001)(336012)(44832011)(8936002)(5660300002)(2906002)(4326008)(70206006)(70586007)(316002)(8676002)(110136005)(54906003)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:25:14.3383 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 895601b8-b17b-47e1-09d4-08daf582c02b 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: CO1NAM11FT080.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4037 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 , =?utf-8?q?Michel_D=C3=A4nzer?= , =?utf-8?q?Mich?= =?utf-8?q?el_D=C3=A4nzer?= , Pekka Paalanen , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This will let us pass the kms_hdr.bpc_switch IGT test. The reason the bpc restriction was required is historical. At one point in time we were not falling back to a lower bpc when we didn't have enough bandwidth for the maximum bpc reported by a display. This meant that we couldn't enable some high refresh modes unless we limitted the bpc. Starting with this patch the issue is fixed: cbd14ae7ea93 ("drm/amd/display: Fix incorrectly pruned modes with deep color") This patch implemented a fallback mechanism if mode validation failed at the max bpc. This means users now automatically get all modes that can be supported by at least 6 bpc. The driver will enable the mode with the highest possible bpc that is supported by the display. v2: - explain why this is no longer needed (Michel) - refer to commit that fixed bpc fallback (Michel) Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Cc: Michel Dänzer Reviewed-By: Joshua Ashton 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 73a98e6e1867..f74b125af31f 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7130,7 +7130,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 && From patchwork Fri Jan 13 16:24:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101100 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 5FAC4C67871 for ; Fri, 13 Jan 2023 16:25:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 039BD10EA46; Fri, 13 Jan 2023 16:25:23 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2067.outbound.protection.outlook.com [40.107.244.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5757D10EA3F; Fri, 13 Jan 2023 16:25:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MyS5P+Yp4f5ymo9oAazpV0rwwXbUg+T+qq19KYNdkdQk6QRYbpTFySjOLvhcOz+ziHauFXPih2anNmsPS7vABvSX6lGpiyOXSnjusethr/cO9e/eGcWvgehUFprWnxJsA7AcbJ1nuzQiMpmnY/YksfEvZfcUYRhXaJaZuYbbpgc5LP2j1uIDLgOahXeE33untUsg7nQbgOxgnQglYM+VOTV59YASMBkBGoUq1j/jBVYiQm31hfzOcoOehEDpByUMVXs8lAxv4ngWWzAZ21Hth3oDnwM6QiCLU7UBVhZ4Ag0JGQpwHiGd1SyLBaSOGb5NLBq9NeHdtbxR6PMwj4UCzQ== 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=NRfBP81zMXERwt3tcb7lniYMS35doyZbkdoXuvLjBaM=; b=PeU9qp/QEqFWgqUujG27eHekpP5dfpvHq7tZP5o1MVPk7rLRJsAWsXbf7bSlStFNu3MEvbWE7io8ooM5rXyU2ePZmymm9rvqusXtRvxu3KZBV/BblHOKB+1posZeTfI0RJmlO2UowSbQoLWrcgwUyWasvlwStddamwsHCVZc454q1YgOSqRvTli55LACEwIRrnKLRW7YEW7K2P3vvXbqoXFxDzSsimoc6XS+gPD018THSIrJ0UGWe5DZ+KrJBRDUAO1vA4pqAgcEhGlhCDHGKM8qTik9FQiUF/Mltb7DMuJdtHlQh49Puq8/NaEQn6W4n6hi9S0OARswlgBRW/cNTQ== 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=NRfBP81zMXERwt3tcb7lniYMS35doyZbkdoXuvLjBaM=; b=JjJMJWaR4L97hsu+c65L8yVChHXmd1LyQ1BP9AwIz3KsZnQPX9Mf/6bR4ucWl1MQUq/bt1M/foozpIIkCX0Vaekf0d/WT0eZoAV8DdICkfWY7jYvjKCtHcco678Ja6jcPw0gGHDV6AzSrdDlafk8sKg9Gt1DbXYz8Oq5XPOJen8= Received: from BN1PR13CA0005.namprd13.prod.outlook.com (2603:10b6:408:e2::10) by MW3PR12MB4490.namprd12.prod.outlook.com (2603:10b6:303:2f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:25:12 +0000 Received: from BL02EPF000108E9.namprd05.prod.outlook.com (2603:10b6:408:e2:cafe::81) by BN1PR13CA0005.outlook.office365.com (2603:10b6:408:e2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.6 via Frontend Transport; Fri, 13 Jan 2023 16:25: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 BL02EPF000108E9.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:25:12 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) 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; Fri, 13 Jan 2023 10:25: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; Fri, 13 Jan 2023 10:25:04 -0600 From: Harry Wentland To: , Subject: [PATCH v2 17/21] drm/amd/display: Format input and output CSC matrix Date: Fri, 13 Jan 2023 11:24:24 -0500 Message-ID: <20230113162428.33874-18-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108E9:EE_|MW3PR12MB4490:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a0a5889-ce03-4998-814a-08daf582bedb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GBLZSbRT7OAx+k18qrSTxqv/SbaUWwxr1LNQh7Lv58jj8+FcQ3pwef4iRHwBYmqDFAx/UNB9GmSfQ+RPmwN0IrwPFx4uWBKydXxE5NUWg90QWStwO7+Cqe+LlMOu7OJN5MsopY876vjJgjAc5PV9+7AlKwHYSuucMjVo2rscSIwX+SqFIn7Im4xyLryPBK8pxJ03Ou3qr2cUpHKuhDAmUWTd8WnM4uOdtyTzZ7y6AChxO3Fgf0IFEDC0SSY5riaGwE2NAOIv8KvpjPZpCiVVjpFTmeG0WupSi1PmwLwlsICUReDtnz+Hz3bElKrwhilQa/DSimjdhvETeCalZActUPul2DDW8+dyGmktJZE+vp3gELwInWSu/4FJsk/K51laLmKxpCpDP9F5VHzSSTpCzELUtbugYhKQMohJNqYPeJNAq+k4p+PbwdQ1MUNfzRQcSwW4YYjKuTDkYfGROHX+9oIOV5BCNENIFDlOm1unu7X751Fg0gZb9+Tniqn4C1CFs2OzBFXC8QwpMjZTLAzKsTHC0qyylhY9U2l7xDxnC7mODOrNZ8nKSd0gZJyN2gvZUeC51eJxYdtAY5AV8Zh6W8dBO38h6u/HclQDp2xn7LoulYcyW49Cmi4JbwFy2ACOtTcofRnB2CjdGNeqTlcXMpEBa+UP7FpnW9pu1nvi590iBgdFMa8Cxer5+wbo6OXEbl9+ktSOGZpIrrqEBgZLw4JIMOK3TWrhGx+/QLFKq4Q= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(136003)(39860400002)(376002)(451199015)(46966006)(40470700004)(36840700001)(82310400005)(40480700001)(5660300002)(8936002)(40460700003)(44832011)(426003)(41300700001)(54906003)(8676002)(316002)(7696005)(70586007)(4326008)(356005)(110136005)(70206006)(81166007)(82740400003)(336012)(2616005)(26005)(47076005)(2906002)(1076003)(86362001)(186003)(36756003)(36860700001)(478600001)(83380400001)(6666004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:25:12.2488 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1a0a5889-ce03-4998-814a-08daf582bedb 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: BL02EPF000108E9.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4490 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Format the input and output CSC matrix so they look like 3x4 matrixes. This will make parsing them much easier and allows us to quickly spot potential mistakes. Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Leo Li --- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 38 ++++++++----- drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h | 54 +++++++++++-------- 2 files changed, 56 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c index 471078fc3900..a70f045fc5c1 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c @@ -73,28 +73,38 @@ struct out_csc_color_matrix_type { static const struct out_csc_color_matrix_type output_csc_matrix[] = { { COLOR_SPACE_RGB_TYPE, - { 0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} }, + { 0x2000, 0, 0, 0, + 0, 0x2000, 0, 0, + 0, 0, 0x2000, 0} }, { COLOR_SPACE_RGB_LIMITED_TYPE, - { 0x1B67, 0, 0, 0x201, 0, 0x1B67, 0, 0x201, 0, 0, 0x1B67, 0x201} }, + { 0x1B67, 0, 0, 0x201, + 0, 0x1B67, 0, 0x201, + 0, 0, 0x1B67, 0x201} }, { COLOR_SPACE_YCBCR601_TYPE, - { 0xE04, 0xF444, 0xFDB9, 0x1004, 0x831, 0x1016, 0x320, 0x201, 0xFB45, - 0xF6B7, 0xE04, 0x1004} }, + { 0xE04, 0xF444, 0xFDB9, 0x1004, + 0x831, 0x1016, 0x320, 0x201, + 0xFB45, 0xF6B7, 0xE04, 0x1004} }, { COLOR_SPACE_YCBCR709_TYPE, - { 0xE04, 0xF345, 0xFEB7, 0x1004, 0x5D3, 0x1399, 0x1FA, - 0x201, 0xFCCA, 0xF533, 0xE04, 0x1004} }, + { 0xE04, 0xF345, 0xFEB7, 0x1004, + 0x5D3, 0x1399, 0x1FA, 0x201, + 0xFCCA, 0xF533, 0xE04, 0x1004} }, /* TODO: correct values below */ { COLOR_SPACE_YCBCR601_LIMITED_TYPE, - { 0xE00, 0xF447, 0xFDB9, 0x1000, 0x991, - 0x12C9, 0x3A6, 0x200, 0xFB47, 0xF6B9, 0xE00, 0x1000} }, + { 0xE00, 0xF447, 0xFDB9, 0x1000, + 0x991, 0x12C9, 0x3A6, 0x200, + 0xFB47, 0xF6B9, 0xE00, 0x1000} }, { COLOR_SPACE_YCBCR709_LIMITED_TYPE, - { 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3, - 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }, + { 0xE00, 0xF349, 0xFEB7, 0x1000, + 0x6CE, 0x16E3, 0x24F, 0x200, + 0xFCCB, 0xF535, 0xE00, 0x1000} }, { COLOR_SPACE_YCBCR2020_TYPE, - { 0x1000, 0xF149, 0xFEB7, 0x0000, 0x0868, 0x15B2, - 0x01E6, 0x0000, 0xFB88, 0xF478, 0x1000, 0x0000} }, + { 0x1000, 0xF149, 0xFEB7, 0x0000, + 0x0868, 0x15B2, 0x01E6, 0x0000, + 0xFB88, 0xF478, 0x1000, 0x0000} }, { COLOR_SPACE_YCBCR709_BLACK_TYPE, - { 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, - 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x1000} }, + { 0x0000, 0x0000, 0x0000, 0x1000, + 0x0000, 0x0000, 0x0000, 0x0200, + 0x0000, 0x0000, 0x0000, 0x1000} }, }; static bool is_rgb_type( diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h index 131fcfa28bca..f4aa76e02518 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h @@ -70,28 +70,38 @@ struct dpp_input_csc_matrix { }; static const struct dpp_input_csc_matrix __maybe_unused dpp_input_csc_matrix[] = { - {COLOR_SPACE_SRGB, - {0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} }, - {COLOR_SPACE_SRGB_LIMITED, - {0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} }, - {COLOR_SPACE_YCBCR601, - {0x2cdd, 0x2000, 0, 0xe991, 0xe926, 0x2000, 0xf4fd, 0x10ef, - 0, 0x2000, 0x38b4, 0xe3a6} }, - {COLOR_SPACE_YCBCR601_LIMITED, - {0x3353, 0x2568, 0, 0xe400, 0xe5dc, 0x2568, 0xf367, 0x1108, - 0, 0x2568, 0x40de, 0xdd3a} }, - {COLOR_SPACE_YCBCR709, - {0x3265, 0x2000, 0, 0xe6ce, 0xf105, 0x2000, 0xfa01, 0xa7d, 0, - 0x2000, 0x3b61, 0xe24f} }, - {COLOR_SPACE_YCBCR709_LIMITED, - {0x39a6, 0x2568, 0, 0xe0d6, 0xeedd, 0x2568, 0xf925, 0x9a8, 0, - 0x2568, 0x43ee, 0xdbb2} }, - {COLOR_SPACE_2020_YCBCR, - {0x2F30, 0x2000, 0, 0xE869, 0xEDB7, 0x2000, 0xFABC, 0xBC6, 0, - 0x2000, 0x3C34, 0xE1E6} }, - {COLOR_SPACE_2020_RGB_LIMITEDRANGE, - {0x35E0, 0x255F, 0, 0xE2B3, 0xEB20, 0x255F, 0xF9FD, 0xB1E, 0, - 0x255F, 0x44BD, 0xDB43} } + { COLOR_SPACE_SRGB, + { 0x2000, 0, 0, 0, + 0, 0x2000, 0, 0, + 0, 0, 0x2000, 0 } }, + { COLOR_SPACE_SRGB_LIMITED, + { 0x2000, 0, 0, 0, + 0, 0x2000, 0, 0, + 0, 0, 0x2000, 0 } }, + { COLOR_SPACE_YCBCR601, + { 0x2cdd, 0x2000, 0, 0xe991, + 0xe926, 0x2000, 0xf4fd, 0x10ef, + 0, 0x2000, 0x38b4, 0xe3a6 } }, + { COLOR_SPACE_YCBCR601_LIMITED, + { 0x3353, 0x2568, 0, 0xe400, + 0xe5dc, 0x2568, 0xf367, 0x1108, + 0, 0x2568, 0x40de, 0xdd3a } }, + { COLOR_SPACE_YCBCR709, + { 0x3265, 0x2000, 0, 0xe6ce, + 0xf105, 0x2000, 0xfa01, 0xa7d, + 0, 0x2000, 0x3b61, 0xe24f } }, + { COLOR_SPACE_YCBCR709_LIMITED, + { 0x39a6, 0x2568, 0, 0xe0d6, + 0xeedd, 0x2568, 0xf925, 0x9a8, + 0, 0x2568, 0x43ee, 0xdbb2 } }, + { COLOR_SPACE_2020_YCBCR, + { 0x2F30, 0x2000, 0, 0xE869, + 0xEDB7, 0x2000, 0xFABC, 0xBC6, + 0, 0x2000, 0x3C34, 0xE1E6 } }, + { COLOR_SPACE_2020_RGB_LIMITEDRANGE, + { 0x35E0, 0x255F, 0, 0xE2B3, + 0xEB20, 0x255F, 0xF9FD, 0xB1E, + 0, 0x255F, 0x44BD, 0xDB43 } } }; struct dpp_grph_csc_adjustment { From patchwork Fri Jan 13 16:24:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101109 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 2769CC61DB3 for ; Fri, 13 Jan 2023 16:26:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61CE910EA55; Fri, 13 Jan 2023 16:26:54 +0000 (UTC) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2065.outbound.protection.outlook.com [40.107.93.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0ECEA10EA4C; Fri, 13 Jan 2023 16:26:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kD5+P29wk/VSRIbCdOGVvdr17pXV1r4c4+Y2/A7hprC3mUrhG7EK8IM7V4U2jLdh71FkUKWD6pmPJw8ItdfWlacfdaw67XVQ28LMw626akYuG90S/GYPtceFu9JBTyTJ9ZTeIyr7D/3fGWfMQQEhajpBJtHnH8aLiTc8QlAA/C6bFhJ/lCBmENQaBhwBWwpmYcyQOOX2Rv1+t8GwgYToeEb+RctMQIxTOS17IMNOrq5WNJqFuNvtAp3T6Ms+iG2iERgiIj4btQHFwpnJYsJBSeBMGR8JWlIZipV5TFtOQU+bWUuCUsikywUwneCEvDWmu2MELqVR/cdedX6u21gWAw== 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=IGZRaSifNH9Gy2SRNlWvPBm9yXwCta8T7yMCdFycRxs=; b=JiEe0R0+giFPDZUZnvt+AmkF/oOaGz5HMExJCR965cALPHN8Wl+eUodXi1B3R9/SWviS2fSp5/18WH19fq3X16ovzLSnGOCVd9IigDkV3S6fgOzzqHVQnsXaiKHekfg3HU/RgSFEnl2WHGS91DakWw4ShOzJhVfQtnpmNw5w3FbIavwhR+wfr/1/rTa8/OycCLOiIOn+pTPlOrlHTPeW1hfGqHXUF0XrIzP4sr637USJSy19cgcNiaRn45E0OQ3kJb9dlEZtJK3uzFSpcg5HQdejmzQQqILpyjoH8XLFwMdBcg0piCIFwPKjdjzqyW0nLA3jstcE1nv/RBH3tNj2QA== 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=IGZRaSifNH9Gy2SRNlWvPBm9yXwCta8T7yMCdFycRxs=; b=Or4S/etfFOWuTL1LWZyw63SdUji2KDTfgindD/FFIjoEwLVDtFaSWj27Aoxlvz4BTYraGsL0Q6y849JOVHNs7vPYck9teSgXr3lwdEkXi2AsIaiYzqXf/XRay777HxoNWB4LP2F6dfqgxDCIBorkrVVXQV+VUcE7vE3Ymhyu3n4= Received: from DM6PR07CA0062.namprd07.prod.outlook.com (2603:10b6:5:74::39) by IA1PR12MB8192.namprd12.prod.outlook.com (2603:10b6:208:3f9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 16:26:48 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:74:cafe::52) by DM6PR07CA0062.outlook.office365.com (2603:10b6:5:74::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Fri, 13 Jan 2023 16:26:48 +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 DS1PEPF0000E633.mail.protection.outlook.com (10.167.17.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:48 +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; Fri, 13 Jan 2023 10:25: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; Fri, 13 Jan 2023 10:25:06 -0600 From: Harry Wentland To: , Subject: [PATCH v2 18/21] drm/amd/display: Fallback to 2020_YCBCR if the pixel encoding is not RGB Date: Fri, 13 Jan 2023 11:24:25 -0500 Message-ID: <20230113162428.33874-19-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|IA1PR12MB8192:EE_ X-MS-Office365-Filtering-Correlation-Id: d6a24aa9-b16d-460a-f7fd-08daf582f80a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HjBfcGSDdj9cYApyGgGecDT5MKzICdVBaCiYTDyjod2RfK3awkrEn8Fyiq8ufYpUlslTCrl26DkOk7UKZRIKrmxXmWT8LtpzCO5+ijhm/t1G+y1bxuX7RxuktX2a9Z6l1kbgHLEW6XoAojZE1Gykd3gnZxUJPSzOtEMcuFTjk3WZ6FVjrEOja/Yh2GYwS2BtYivAWzVL+kBjEe4TuCZH8Tp2ASyTDVeRsULKmWuajAx898BEBZMt8/mTLv1P3YbZkXyDVtl+8hqHGdoYSxmcR3COfA1VY3VVSu0RatvEaOAYZz5fDn71Tu0lP//+RuhU9Y59cV4XWtQnCCz8sp3iKV0enQ0hRvCF2hkNMB5N1rH4dpEix3v4okuWPF88h2v9HKxJOuBbeshSn3aXNqw7RRI4ClvrL2mqlTPoat0fO562qhNyFN/KCD4QUMQe+KTSu7i0XOQFsMIcYWTqoI6SUy9zbEJ8ytyuR0Rs6mGot4ETUu8LtiSiQ19m2T1FAQRT4u7HTeOFLtAreMS6SPDpQ/hpAKTadKLp7Y1mCw2rvLPnsyTCF6SEfG44R/3fO30Oh97Kz8xDIXy5axGSvuP7Iff21SCJ7hkPd+ZEJF+355SNA+LugCRshfUCmQmoM+bjxpdSEhyCh/bHBTq/5I91yWSexcLLB1qWlVQ8f/IJrwKCphW0ctkBWArP7B84A+AM/4MTAXBIKGY1yjZ5iytnVYNYkVKcn5brNHVO47D0ZfI= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(39860400002)(136003)(396003)(346002)(451199015)(36840700001)(46966006)(40470700004)(82740400003)(426003)(41300700001)(356005)(81166007)(478600001)(47076005)(40460700003)(86362001)(1076003)(316002)(110136005)(54906003)(2616005)(336012)(70586007)(40480700001)(26005)(186003)(7696005)(82310400005)(70206006)(5660300002)(36860700001)(36756003)(2906002)(6666004)(44832011)(8676002)(4326008)(83380400001)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:48.1587 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6a24aa9-b16d-460a-f7fd-08daf582f80a 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: DS1PEPF0000E633.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8192 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Joshua Ashton Userspace might not aware whether we're sending RGB or YCbCr data to the display. If COLOR_SPACE_2020_RGB_FULLRANGE is requested but the output encoding is YCbCr we should send COLOR_SPACE_2020_YCBCR. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++- 1 file changed, 4 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 f74b125af31f..16940ea61b59 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5184,7 +5184,10 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing, color_space = COLOR_SPACE_ADOBERGB; break; case DRM_MODE_COLORIMETRY_BT2020_RGB: - color_space = COLOR_SPACE_2020_RGB_FULLRANGE; + if (dc_crtc_timing->pixel_encoding == PIXEL_ENCODING_RGB) + color_space = COLOR_SPACE_2020_RGB_FULLRANGE; + else + color_space = COLOR_SPACE_2020_YCBCR; break; case DRM_MODE_COLORIMETRY_BT2020_YCC: color_space = COLOR_SPACE_2020_YCBCR; From patchwork Fri Jan 13 16:24:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101108 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 C822EC54EBE for ; Fri, 13 Jan 2023 16:26:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8913310EA54; Fri, 13 Jan 2023 16:26:53 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2075.outbound.protection.outlook.com [40.107.243.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 90DBD10EA4E; Fri, 13 Jan 2023 16:26:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXtgIgxVIRk7BMT7eijcPE9oogWjfZztCMjHyQEByt2kVajsDDR5JrJIRmt7gIHzn3PsT1oaU2nkDHfBH9+ezEGPpMvBn7PoijeHbZcZ6pLucz/Snn6pwD9PHx+vSo8znkjg7xhcLMiVMUfn2n4Eyizj3gcLaNdIUxXm/Nfpo31rp0wpwFwUoqiJd7hEsfwWpUtKQJ9EU/UwV67G+BNaZLmI2c5vi0H9/aFdCPs1Y0YcCeh+es+/hxQGCZW8nOwdrg48NAp/1DQyGAuXheBTpCn6LMS3ZoijYHkHI9w4JUVbhXv78qtrGWXqhaUyLMprFAHIGWQIHctZjOotmGzKaA== 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=IIo57x4geoKKsrkmhF4K5SIiNyJ+cYMq1U0RRqpGivU=; b=HTmSG1c2avaXsQT3fho/8Q9xMjj1U7czm4PO5Ncz2rF+9iz6fVokr3UPQPb9qq1x99wviayh+dvHiQM9P050Lq1bvocTOsLQf4XGuf2X00QzHu2jeF/Jq3P6nVSG1LbyM//gI6ryL59laOFdUMSBaTsD6FrN/x5jz7KHd9rPQsvRB3xhlkjXtMYBFA9HybGhwbU5JLrwJGbdwdzb7EZtQuNRLj9a+Qek2MH8bXjlIJT2Klv5l7AO5atPzXN/BbZXG7C0PnYsk7wrDtgxeYShZQo8yIHqhxfIeahrQyqr0x+ATEDei04GhARaGS9ivFdvnF/BnJLeW46wvzWF/OEv0g== 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=IIo57x4geoKKsrkmhF4K5SIiNyJ+cYMq1U0RRqpGivU=; b=xsCQZL7Ck4I0nO/bLG0jGIPlFlQO4LI2QXDNfHtiyI3JkEHADNSULIsQpcSqfMl4pjz5krCa1fS91VOxoIjjtMbu5Mm6Gzzy72UzBelZ7pRkptshcj29lNwiBsCisbazaFUhKofyQ3aLTYl+xTTToKZs271uwuCdOb/ywXljFbQ= Received: from CY5PR19CA0125.namprd19.prod.outlook.com (2603:10b6:930:64::24) by MW3PR12MB4474.namprd12.prod.outlook.com (2603:10b6:303:2e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Fri, 13 Jan 2023 16:26:48 +0000 Received: from CY4PEPF0000C964.namprd02.prod.outlook.com (2603:10b6:930:64:cafe::5) by CY5PR19CA0125.outlook.office365.com (2603:10b6:930:64::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:26:48 +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 CY4PEPF0000C964.mail.protection.outlook.com (10.167.241.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:48 +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; Fri, 13 Jan 2023 10:25: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; Fri, 13 Jan 2023 10:25:07 -0600 From: Harry Wentland To: , Subject: [PATCH v2 19/21] drm/amd/display: Refactor avi_info_frame colorimetry determination Date: Fri, 13 Jan 2023 11:24:26 -0500 Message-ID: <20230113162428.33874-20-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C964:EE_|MW3PR12MB4474:EE_ X-MS-Office365-Filtering-Correlation-Id: 07445219-e701-493e-7caa-08daf582f846 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t4rg6i8SMjzAx8jDT1f1PxTgO0EbhpigL1cefieN41QFSgDBhNQLJQPvB29QKvTTetcGznIYavEfZGYPUHOPZ/mCzxHF4FOPUWDcxQwrtXhO8S4G2DxJ/WtwYcOnY+MXUdoaFUqnqOsc5buzv9jWoKaPjj5Q4FOA+4BMI8U+QVow65EbNz9pehLbWGqIhX+cjEb/3bWywN/TyY8rWMjRxFOpJezonhBC9WfADsa8lQ+xsZx57NbiZ0bHhX8JkARwjHKgJF06OtIm0Fmx2s0fOs4/wlSekqlGLplhVVhIeMOSQr5mRSFkE+cBKFLiBQZ9rGbO5hUNxLZSxNDjKyWXfKqALUTOUZTtxDUitWmeNdCfscBNIGPZWrrPpgWHYeKXHMQ/hW/E3tHhM2CqLsaTE6RWK5deoIrTJJSdzByptzcKODBptRv/rXwKM/0dGgSoKrmkl4DhAVYBXQPiSR1/rcHCBClFamTTwdraZ8OTZLMjJh0OPnqMmho4GE8Kc31sL/xcf1kTFkXh/CbUFd1+zjz2lpK8IZHr3E0zxpljU9I4ErJnbo2jUzWlstve5+zc1QuqoHbYRJjjchpBtEXTu2fPuU5nPpqQ+g9pG3OV6Se51G6tBVJbJfZ9WcBrvktfzBVf6liUOymNJjsBA+h5RJ1jcY70qLeHzxySQ2FBA/5FHoNkAGLoQzXrZ/r3PFtTJG5Apm1IwtAYs4sHSgBii8sLk7FEK1Y4KdVfJP8ekRg= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199015)(36840700001)(40470700004)(46966006)(47076005)(41300700001)(83380400001)(426003)(36860700001)(82740400003)(82310400005)(2906002)(81166007)(356005)(5660300002)(8936002)(44832011)(40480700001)(316002)(478600001)(8676002)(1076003)(186003)(2616005)(40460700003)(336012)(26005)(4326008)(54906003)(86362001)(110136005)(70206006)(6666004)(7696005)(70586007)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:48.5332 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07445219-e701-493e-7caa-08daf582f846 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: CY4PEPF0000C964.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4474 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Joshua Ashton Replace the messy two if-else chains here that were on the same value with a switch on the enum. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Harry Wentland --- .../gpu/drm/amd/display/dc/core/dc_resource.c | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 06b5f49e0954..151981217c5f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -3010,23 +3010,29 @@ static void set_avi_info_frame( hdmi_info.bits.S0_S1 = scan_type; /* C0, C1 : Colorimetry */ - if (color_space == COLOR_SPACE_YCBCR709 || - color_space == COLOR_SPACE_YCBCR709_LIMITED) + switch (color_space) { + case COLOR_SPACE_YCBCR709: + case COLOR_SPACE_YCBCR709_LIMITED: hdmi_info.bits.C0_C1 = COLORIMETRY_ITU709; - else if (color_space == COLOR_SPACE_YCBCR601 || - color_space == COLOR_SPACE_YCBCR601_LIMITED) + break; + case COLOR_SPACE_YCBCR601: + case COLOR_SPACE_YCBCR601_LIMITED: hdmi_info.bits.C0_C1 = COLORIMETRY_ITU601; - else { - hdmi_info.bits.C0_C1 = COLORIMETRY_NO_DATA; - } - if (color_space == COLOR_SPACE_2020_RGB_FULLRANGE || - color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE || - color_space == COLOR_SPACE_2020_YCBCR) { + break; + case COLOR_SPACE_2020_RGB_FULLRANGE: + case COLOR_SPACE_2020_RGB_LIMITEDRANGE: + case COLOR_SPACE_2020_YCBCR: hdmi_info.bits.EC0_EC2 = COLORIMETRYEX_BT2020RGBYCBCR; hdmi_info.bits.C0_C1 = COLORIMETRY_EXTENDED; - } else if (color_space == COLOR_SPACE_ADOBERGB) { + break; + case COLOR_SPACE_ADOBERGB: hdmi_info.bits.EC0_EC2 = COLORIMETRYEX_ADOBERGB; hdmi_info.bits.C0_C1 = COLORIMETRY_EXTENDED; + break; + case COLOR_SPACE_SRGB: + default: + hdmi_info.bits.C0_C1 = COLORIMETRY_NO_DATA; + break; } if (pixel_encoding && color_space == COLOR_SPACE_2020_YCBCR && From patchwork Fri Jan 13 16:24:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101102 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 E9503C678D4 for ; Fri, 13 Jan 2023 16:25:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B501110EA4A; Fri, 13 Jan 2023 16:25:24 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2076.outbound.protection.outlook.com [40.107.223.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7112C10EA41; Fri, 13 Jan 2023 16:25:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WuSEALY0bpMRJP8omt+52Ewn3SyhR0I6enhz3+bYAM7dQ1D0vP1wDah3M5MPBEkKgUg9pMbwr+sfE5KsAHvnHSwZnmpME4SLGoXp67ByxD0qjUWw676HVaN0iXpdIPQ4ihUD8uqP9NhnIjYd9XZi+Z1gnBwR/asJuxt8tRYBZxYUmxyiK58pesQY83dE6lwQom9muMzqrO9BcNDLf3t/GhlehfnJULurQCCHqKrzP9PO+BD0k2Z2Jz/1A+QsfTjhVPifC3GZdhOvhjm1uXVz2+h5gCxG5kvrdRMrcL2B8zKzymWvOwFh6KmNit62H3l0HBOuVZ9tFBvFzdWcFFxVdg== 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=ldQ0m3ile5oExLguZb0+RnZJ6kVP37CXjOcvdS45bVA=; b=EPBPILSHxsS6Avw8zK6dTqMZr5x1nDWO/ZzT/9+aOL8qVuPauW1rNfU2CcByS9aau22Ncyu9BraWyVeZhHqgoTBpqXCw7PFfjK3H49neGyfbcZ1B3iswgPvWBOrZZvZrbgNfnAzYeoTMoqOdQZroFPyVP/r6qTLjpv0iMcfJ6WkBERFWkUvWdZfaQ6513MjWr/tYFzhL19JdeZKPXdE/tVh7qYW1Q+/MEwbA1UMKV7OpfBH7eLWGJOqtt23GEywsPRhM4DRRZbzerdItdCXYtF4Gz1v18AoUfFck3A9QwIVeK/YKfAS8Kld6wNGI52S+V8oXyxsLw2cbpe47kfgEnQ== 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=ldQ0m3ile5oExLguZb0+RnZJ6kVP37CXjOcvdS45bVA=; b=L581/7G4yuh82EqW+eJ8wE9xsY7JAYP5MyB/hCKD7Ey4KxnXNIOqFyEyGvNUCTJA1fPbcrGN1D6D90AIVEn1969izfQ/G8gCEADvuGhkbR3noWOUiaHiGIh6GphRwN51gP1Zq4wF/bWw/j+qkMnb7aybGo/fStez2mms1ndOYIE= Received: from BN1PR13CA0026.namprd13.prod.outlook.com (2603:10b6:408:e2::31) by DS0PR12MB7748.namprd12.prod.outlook.com (2603:10b6:8:130::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Fri, 13 Jan 2023 16:25:14 +0000 Received: from BL02EPF000108E9.namprd05.prod.outlook.com (2603:10b6:408:e2:cafe::55) by BN1PR13CA0026.outlook.office365.com (2603:10b6:408:e2::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6023.6 via Frontend Transport; Fri, 13 Jan 2023 16:25:14 +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 BL02EPF000108E9.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:25:14 +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; Fri, 13 Jan 2023 10:25:08 -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; Fri, 13 Jan 2023 08:25: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; Fri, 13 Jan 2023 10:25:07 -0600 From: Harry Wentland To: , Subject: [PATCH v2 20/21] drm/amd/display: Calculate output_color_space after pixel encoding adjustment Date: Fri, 13 Jan 2023 11:24:27 -0500 Message-ID: <20230113162428.33874-21-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108E9:EE_|DS0PR12MB7748:EE_ X-MS-Office365-Filtering-Correlation-Id: 9dc1e048-875b-40cc-e80d-08daf582c045 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: htZKSkdXBFSm6or4sdM3rL2CY3U8LTMx4jg/coORFBpPUe+oH5xU8cI3wrIOH36b7BOKfamSMI2blQZltyXFPepKrrtMvBBdKLXHDxebDwJwcMFXmTMtFHkgc/g57HUjjoV6gsd0LHkpAIqZ7ECksOYHQUj1ofi+vjfYt/YMQdSwhqyv1shWzjPdFI5UVuWirh/jzrn7HICemW+eEVvsV7v1QR+lP05RXFmhhP1sbd4rsmLZxRwbLuU8hBr+y0SXGqKq4QuXlNhSTY/Yjz4zrLIJo02cjkPiMV86Jcj3qwpxbLjixeOOl5amfZEHrY3E+S5YcbEuHsjwJhtUqqXwDgx/EW7A995dY7CVn0VVbycAQVzSnzFLE2Wczvm1gkOSX/VGRzWSOYJbWLoGBs0HH6YeIv75nqyth+eq9nyll8h90LXY+e7GZBtX4gHxcSlem4RUqR8wcRKZ4wnegysvRUSEoxT6u0jIDYm5Yym+If/mcx/f2cq0domQON2Ufu68xw9mMu3ZUlWlIKjeO/L+PIj+w2ZD8G3BomP4GGaBCUTWJElAySyF2+j0GTygOgzFM/ycafusbLwA3VCOPKd2cqZFn1g0hqeFLyZ5lVWLUjojTekZC40npH94BYSaGykecgMwL8ZIzA/+JEolczsfmOTM2MLP8o2rLsxJ4qF1BuXL8s2Xmn4+sdbQB53Ryu5HlI6QeinRxtyj3ap+IaNY7mplV838zqkBO/r5m8POfnA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB03.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(376002)(136003)(39860400002)(346002)(451199015)(46966006)(40470700004)(36840700001)(36756003)(356005)(44832011)(2906002)(86362001)(81166007)(5660300002)(8936002)(40460700003)(82310400005)(41300700001)(40480700001)(82740400003)(36860700001)(47076005)(426003)(83380400001)(54906003)(110136005)(6666004)(478600001)(2616005)(8676002)(4326008)(316002)(7696005)(70586007)(70206006)(336012)(1076003)(186003)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:25:14.6238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9dc1e048-875b-40cc-e80d-08daf582c045 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: BL02EPF000108E9.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7748 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Joshua Ashton Code in get_output_color_space depends on knowing the pixel encoding to determine whether to pick between eg. COLOR_SPACE_SRGB or COLOR_SPACE_YCBCR709 for transparent RGB -> YCbCr 4:4:4 in the driver. Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 16940ea61b59..eb188487f0a7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5341,8 +5341,6 @@ 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, connector_state); - stream->out_transfer_func->type = TF_TYPE_PREDEFINED; stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) { @@ -5353,6 +5351,8 @@ static void fill_stream_properties_from_drm_display_mode( adjust_colour_depth_from_display_info(timing_out, info); } } + + stream->output_color_space = get_output_color_space(timing_out, connector_state); } static void fill_audio_info(struct audio_info *audio_info, From patchwork Fri Jan 13 16:24:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13101110 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 3C9A9C678D4 for ; Fri, 13 Jan 2023 16:27:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E70A710EA72; Fri, 13 Jan 2023 16:27:00 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2074.outbound.protection.outlook.com [40.107.92.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7998210EA53; Fri, 13 Jan 2023 16:26:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=clC06QvCTLM4bjuFp/ifLNlDBMDCl3puCJ3RGCU4PpVjDAKMJz6mNdAFK9limdABbvPCFz01d4/28ti793h9YQNfO+mMKqMJqGT4SkfRm92GpWLhxOGYXhoUs/CFU7slJ030h3I+RxYHXUpzWrx2xm+/RuQmwSQBvfoFYW48mZ123srOtB2Z+VCzuDGsTgAPtAGuRFjwUdGXeuxDclXeNNvDl1x8eAahmN3AZ2uV3ijWfLe6WYLTVpADpnK1F7c0uTYA/ha3Ii1zBLJ7bPF8ecHSPPgvuAxRDp3m8TJqG5UtRTvO86lJj6mWhjLXnqElwmT18aLfx9NsY8ifJfcgYg== 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=4wb0I2qtuMqmfW3vgD4MjFOgsJRRT1zN8hmgLbW6zQk=; b=Hq6+PwwXHNV0LuvhXmIXvNXi31O+0XZvgNoOHwghui+euWNvqr3jgxl1b2sHbp4Q1+BW/zqTEt61RHrVjP++zc1Z1mY5hMksAuroT82X+4u7DqEPZt8EsAiq7eZm1tf4MDePFYN+VYUjWoMywAh3H0A4viXyMCaa2S916J1XFbS8Eo1e8MIaHgcER+N5Va6sNS4YLMFjZQt57JTx7ijivCXFDnB9HeFAY5qDJgsWwaRsKpmdhZ1KGfv9qOD4KEvtzIeWMWE7z1SgYMB6Hj7MsgGeeYaKcOyxrLIPCQQCNRtqcgR4+GIyU1TNeYL1/4UtGFLK2OeTK6sqLV+rndZ2Aw== 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=4wb0I2qtuMqmfW3vgD4MjFOgsJRRT1zN8hmgLbW6zQk=; b=Ijy4Urw1VWL+dA4lh8biNGiAlNKwYxADP8Y77wrdCyfDBh7s21BgDn/OiWBG0+sJOHB4LOZVz9eeiA55kOYaoS8OTsMgMru8aVTjr2tFMO6lJ+1l7SAC7oU1Pnuq1bRXu3M/5nQB0Nea0WkOJ4Qju0dOCU62Ig1ItegqTdFZO0s= Received: from DM6PR07CA0059.namprd07.prod.outlook.com (2603:10b6:5:74::36) by MW4PR12MB6898.namprd12.prod.outlook.com (2603:10b6:303:207::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Fri, 13 Jan 2023 16:26:49 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:74:cafe::28) by DM6PR07CA0059.outlook.office365.com (2603:10b6:5:74::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.16 via Frontend Transport; Fri, 13 Jan 2023 16:26:49 +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 DS1PEPF0000E633.mail.protection.outlook.com (10.167.17.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 13 Jan 2023 16:26:49 +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; Fri, 13 Jan 2023 10:25: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; Fri, 13 Jan 2023 10:25:08 -0600 From: Harry Wentland To: , Subject: [PATCH v2 21/21] drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix Date: Fri, 13 Jan 2023 11:24:28 -0500 Message-ID: <20230113162428.33874-22-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230113162428.33874-1-harry.wentland@amd.com> References: <20230113162428.33874-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|MW4PR12MB6898:EE_ X-MS-Office365-Filtering-Correlation-Id: 5aba9a20-aeff-4978-51b0-08daf582f8c7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2eJmTLcPFV+hCUUXTdqJ8ye7z0fKviowIlf5/hMJ7B6e4ii1Pbih6a4TkDnIlTc4nsDM/tzJlK1CPKZCAeJNQq35vubKH1s25CQUeRKVmUq7zaaFdLHUq5gz6wWGv2ex9FvFXcHK0gZjL3I+oiu31ry8Uc6RVvtTLpS0/HucUMnu53sXLCn+rhPjdVxw1h2Qbtcm11amUL22Y9xOoTbcRKC3+yhAVQzMUv+NkdLEZhERjIQcjzrNA21A8bJTGaofInvHhOrTWSa6yojPC0JKvywGdwAoosUIBeRzO+lMQCO/NNOljftA7RNaTZv079Uze4NPo9AnCsyQ0dp+CYTFp4TPD28XeYgMCkz8cuGIsgqoarG60MEj8Zpt/Bqu9WMBbKaGif1Abh4yLK7AkeZkI2DaUHm9pMFnnqQZ9vJRkDND7iKcJ1o/tS04mtV50Mad2ue9HdhzJrcy53H1jn3vGv6ERox1eD9iowySyBfHhpdNRL2l433ptYCJvBnUmHQkgVNRmQ15dZQDghlQmaGzOPz+ThLzsX2iNvawig0LKL5y+UG0+R75fq6drDq7xRsILRJoDYp5/r8pPpKgSGqGAPA3T1v12xAid0SLwhr3wB0nkPAiqlalb04L5PtlrhxKKTlKhrEvIREL6i8iSIAPCNOijaAYT17mKc4SszFIagS8qtw7SdEJKWyvN3B4NZb7SjgaeOEfs4d+rxbkhRjFTp1jmyO8z++ziTvVBcATkxU= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(36756003)(356005)(44832011)(2906002)(81166007)(86362001)(82740400003)(5660300002)(8936002)(40460700003)(82310400005)(41300700001)(40480700001)(36860700001)(47076005)(426003)(83380400001)(110136005)(54906003)(6666004)(478600001)(8676002)(4326008)(316002)(7696005)(70586007)(70206006)(336012)(1076003)(2616005)(186003)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2023 16:26:49.1743 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5aba9a20-aeff-4978-51b0-08daf582f8c7 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: DS1PEPF0000E633.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6898 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: Pekka Paalanen , Sebastian Wick , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Joshua Ashton Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c index a70f045fc5c1..2acbf692193f 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c @@ -98,9 +98,9 @@ static const struct out_csc_color_matrix_type output_csc_matrix[] = { 0x6CE, 0x16E3, 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }, { COLOR_SPACE_YCBCR2020_TYPE, - { 0x1000, 0xF149, 0xFEB7, 0x0000, - 0x0868, 0x15B2, 0x01E6, 0x0000, - 0xFB88, 0xF478, 0x1000, 0x0000} }, + { 0x1000, 0xF149, 0xFEB7, 0x1004, + 0x0868, 0x15B2, 0x01E6, 0x201, + 0xFB88, 0xF478, 0x1000, 0x1004} }, { COLOR_SPACE_YCBCR709_BLACK_TYPE, { 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000, 0x0200,