From patchwork Tue Mar 7 15:10:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163903 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 AED99C678D4 for ; Tue, 7 Mar 2023 15:11:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E8EDD10E4E2; Tue, 7 Mar 2023 15:11:19 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2071.outbound.protection.outlook.com [40.107.92.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8AC0310E4E2; Tue, 7 Mar 2023 15:11:18 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FlH5C+Fym3EotCJwDm02g8h/e4e+/Pp5Iw8LETxA5GwhLBG9WFmXTOzcKHX1kzZ/F/aUPERjzQaTekaItPSBK+uUb56H+csFfRsU0kgAACX4tgIIAI6aFTJVOjdhzpSph9fjlNppc4FsFf7nFD8NTPI3bJFAnpE7yB0SZZcEVJM5xLZnz6gVOF9TTgbLwV3p47K1yB89AslRWs0mKF7tJq2VQoBPB/GkIs9cA1gAMrC5Ugv+BQXfix/7BqczxT+PH1otdMO94txbMB0m9q+TRQmRV4iHW6fMMOgBfjsqkzNp67mmX6hpGhuJ5lA9rGOYiEFpeUAPe+aJ+JD2ZYtBeQ== 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=PFVgjIymUnsEKDLkCdipXD9qxY6s3/lolvt3xhbgANU=; b=ZEGMdjSHhAcDtn7p6dtheIJn3W2yghYWDARmhOJdwuCvhSxfNDiaUGEMe9I2jq/c4vf//WZn5FvmEDcFOiIV3Piauesnq3+zsUcFRPOhv0l7QDhE6TdR9T6RHSsIeek5lP2CEpK70q60hZMNvxvpurGqBbUVnFJmFzyTal2egA6XnhYgoh5gvvVHqnDOP2ZNU/oLSW3hBJi3F0szWibK0w35xX6jVG18GdHy+PVc0B0BSspvOzaLNeku6e1x4Ax+ui/tdfrbItGQ5kfbOqEW+Nn/wlrZuoXp9VI5fOrq8/e6YOo+FwTLuFqTcALJGp1MoiL4Cd1bOKsv+leq3kVQtA== 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=PFVgjIymUnsEKDLkCdipXD9qxY6s3/lolvt3xhbgANU=; b=kZ7/hqINXhtmJAPOcBjXhAjtuTbuvfEfjMEcnViAgyWOr5MXKJtK4CJD1ZsYeGEgSyX7pp/3GSqLDSq1clNjULI8ZaA9d/M2XZafrSHvuwrc5il6+CO140IzBLiDMGgTbvlx7Lwqk7WQ4ttoZi3ODNw5bVsBsKsGy77dRHs69Lw= Received: from DM6PR03CA0077.namprd03.prod.outlook.com (2603:10b6:5:333::10) by CY5PR12MB6455.namprd12.prod.outlook.com (2603:10b6:930:35::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.23; Tue, 7 Mar 2023 15:11:16 +0000 Received: from DM6NAM11FT071.eop-nam11.prod.protection.outlook.com (2603:10b6:5:333:cafe::8d) by DM6PR03CA0077.outlook.office365.com (2603:10b6:5:333::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:15 +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 DM6NAM11FT071.mail.protection.outlook.com (10.13.173.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:15 +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; Tue, 7 Mar 2023 09:11:15 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 07:11:14 -0800 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:14 -0600 From: Harry Wentland To: , Subject: [PATCH v3 01/17] drm/connector: Convert DRM_MODE_COLORIMETRY to enum Date: Tue, 7 Mar 2023 10:10:51 -0500 Message-ID: <20230307151107.49649-2-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT071:EE_|CY5PR12MB6455:EE_ X-MS-Office365-Filtering-Correlation-Id: c0b7670c-5381-44c5-6c26-08db1f1e3267 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kPrFaFnsiJzxZ/ey3eZTANgikzSuuGLoynw/omAjikVs2gCuBxsszbdEcA1ZULc3HvoTeKNhJPC3NAupYGri5E16F95X0nh4TB1On0K6x540uuD/Pr+L6itWZIClyCiqtrI9nb4p9VWUaN5cUsWPJcrL8cPrbtXrG6fZh/nTp45HNE1pb5MjdwguSqJzD5Ycx8ML3o++0rZXd/aSP3+4F0W41yEqoBKulNB8W6N+RYTuG0yYHOUqkm6y624JWJxhs2jIHH72sip80hpuYOaQRanTsnHlkVHCVAFO6XgbNe20JU5pA/C+dmF3IsznJsGNgITFWbrKnmbdMHaTPLqAOQJxFYADVkO9qm4pZEGDPGJKSZRT7p0ZmMNcyqp9elipFke0y72c93KaHGUGl6lzzaiOutbQIDRZNN40Nw1NdcyrzM5cM20wexcN/T55kVtXgzXpisx1zCRm2225w1EEVoeDZ5yMmvMcVMFSxSMG7eeWQ8UZ2h0JT2b4Q8mg8AWdnSwn8pDsbUqWbeBPBwYaopJgNWUSgqa050CMXRAfwn05wXQmMN/Te/WPB06dj8IBdMMbIaNd6xsN17ZF6vtUtnae69V97oP5LTAlBve5tgARWdk6wgxejdL7RhqmId/WdLvnBJzqszYK/veREP9toNzHeD8by2Ib2q+E90akMTv2iihGZMb+/3gktVlBRXvfm8MASyy0H23tBObxCRA56DXYWvAaUS+2RZtBacFwDiw= 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:(13230025)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199018)(46966006)(36840700001)(40470700004)(5660300002)(44832011)(40460700003)(36756003)(83380400001)(478600001)(82310400005)(426003)(26005)(66574015)(6666004)(336012)(2616005)(1076003)(4326008)(47076005)(8676002)(356005)(70586007)(36860700001)(8936002)(41300700001)(40480700001)(70206006)(54906003)(186003)(86362001)(110136005)(82740400003)(81166007)(66899018)(316002)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:15.7238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c0b7670c-5381-44c5-6c26-08db1f1e3267 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: DM6NAM11FT071.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6455 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. v2: - Bring NO_DATA back - Provide explicit enum values Signed-off-by: Harry Wentland Reviewed-by: Simon Ser Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- include/drm/display/drm_dp.h | 2 +- include/drm/drm_connector.h | 49 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 25 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 4d830fc55a3d..6d6a53a6b010 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -371,29 +371,30 @@ 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_NO_DATA 0 -#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 = 0, + DRM_MODE_COLORIMETRY_NO_DATA = 0, + /* CEA 861 Normal Colorimetry options */ + DRM_MODE_COLORIMETRY_SMPTE_170M_YCC = 1, + DRM_MODE_COLORIMETRY_BT709_YCC = 2, + /* CEA 861 Extended Colorimetry Options */ + DRM_MODE_COLORIMETRY_XVYCC_601 = 3, + DRM_MODE_COLORIMETRY_XVYCC_709 = 4, + DRM_MODE_COLORIMETRY_SYCC_601 = 5, + DRM_MODE_COLORIMETRY_OPYCC_601 = 6, + DRM_MODE_COLORIMETRY_OPRGB = 7, + DRM_MODE_COLORIMETRY_BT2020_CYCC = 8, + DRM_MODE_COLORIMETRY_BT2020_RGB = 9, + DRM_MODE_COLORIMETRY_BT2020_YCC = 10, + /* Additional Colorimetry extension added as part of CTA 861.G */ + DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 = 11, + DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER = 12, + /* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */ + DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED = 13, + DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT = 14, + DRM_MODE_COLORIMETRY_BT601_YCC = 15, +}; /** * enum drm_bus_flags - bus_flags info for &drm_display_info @@ -826,7 +827,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 Tue Mar 7 15:10:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163909 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 36D38C678D5 for ; Tue, 7 Mar 2023 15:11:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1784210E4F4; Tue, 7 Mar 2023 15:11:30 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2051.outbound.protection.outlook.com [40.107.220.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 838E510E4E5; Tue, 7 Mar 2023 15:11:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H07T9a1862jamy0NKCVUYFr1wf553MgJL6HyfAw2bsy5Rg4BtMRB3Z5xSNl+c8Qg6802llOf5r9SO/a5AJhtg1uWjIHmSxN+IgnDZkhRowf5pnwCky+7kHiexA4KmIp2kOU6jsIiKKIyDRniOadl8TPlCbtTrNKx/RaF/oZZ/IAVU7PwzmwekiAUKDx+wZzN1bOF0ZI0d/JNQTUcqZq4Exc2Ez1Fhmd6/7f/ZC3ITO2hl+ZoERy8Jr1tQz2xK1Pect5xVxHcugg476VB2iAGD+8myBSK29sTJyAAKsSjYNToM/RVxtOK0Q+2Z2C8Ee7VfWT4V4cWj6rvYGqZKjkXhw== 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=HIZW19DbvDdWC/r9RavW89hiQoRl/lkW90EAvIsKTGs=; b=EDsRa5mEaxzMchAuKE1OVYXoUY28vfhq2F2I5rPapvXzi4a0COLvUYCRbW120eAPa/PTo0zTwOLxkmGyVmQxwKiZd3dQES61/M1ahzRqR7kMw4rUyJIjYm1j0RqpY0OB6smhgSo/2BJvk9pUuCF8EN6gRzxC+mOb+7l2PLWaJphjh1SyhK+ZDRHGMwRl1cwLWN7FMTqzheJVzGScyZsUSsFw7m/4Pr7w61x3p+FUkch85Q2V/F4ySWuYX8rTYLxVm2kBsieeKz4vindSeZdoK72vPnxE6ytV/opMcWqd0gr5JJvV8AKdWxarTrTxRV8jZ3/dVnouAyFQ6yAn+kTBaQ== 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=HIZW19DbvDdWC/r9RavW89hiQoRl/lkW90EAvIsKTGs=; b=tasB4vxzb7AWguW7210FaXXrfbqEMXXqwaG7XYtAyrk216W6mrRuU2YfOc6QntdxqblaW8MRqGi7s53cZzCorvubFuzg3EmaYELSebWWpYYYP8JOMynMW1VS3uTLjUpQM6/vh+E1+nykf9cU85iCGwEQ2YhiQ3nW8SieRmAJeLk= Received: from DS7PR05CA0050.namprd05.prod.outlook.com (2603:10b6:8:2f::9) by PH0PR12MB7813.namprd12.prod.outlook.com (2603:10b6:510:286::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.27; Tue, 7 Mar 2023 15:11:17 +0000 Received: from DM6NAM11FT078.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2f:cafe::30) by DS7PR05CA0050.outlook.office365.com (2603:10b6:8:2f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:17 +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 DM6NAM11FT078.mail.protection.outlook.com (10.13.173.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:16 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:16 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:15 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:15 -0600 From: Harry Wentland To: , Subject: [PATCH v3 02/17] drm/connector: Add enum documentation to drm_colorspace Date: Tue, 7 Mar 2023 10:10:52 -0500 Message-ID: <20230307151107.49649-3-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT078:EE_|PH0PR12MB7813:EE_ X-MS-Office365-Filtering-Correlation-Id: f67e50ef-ac8e-4c20-9d9b-08db1f1e3306 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BuLyX/uZA5SxGJQQI7WbHRYUNzW6J0180qtyLb3poDz4o+MZkuKlU4UjzmrVu0U2rxaexIK653kRi4lDrOwj2Bg0aDRdYSU8JolCka4tr81+ZvoB31JF8ooNJLIvAoWAsDcPu5vQkAqAFvZ/S0HvALdyuQ4aLL0qcN8gFhLgZn28POHYzZvF0ImX6Tst/j1ZNIhdvejrB/YnaEILOzkimKTtx494S8DVcGE6IDjdPD5P80LySIOlAAJ5qEJpEmMFM1Oxz9iiVEBDWq+lJgSYOxGOlNn1M1ACbQJESIxzHe7j63bWEFmFuHGxF3uFcaDokVrxz+HkT39zAoLulFEquBIykWHX5boTGgMpgEijrVpWIRGyrathOecp8EEK7RFaTdal8E+4w7//PLuwX6WwqsHyM7I/cXouoDGufjipUkBeUzWjcxrjjFNUc1Gr149RvBBcL+q0o+7QaqXIvi/b+Z8Ah8bjnspDUqYc3qJMdsSLhUEMf8Wwo8JgcmiYEpX6+Rt58mLr5Sq8dEtCEBI7CU7kXjKXvjM8ZQYmTZ1bFPAwlLzZ3ZFA2ZEOTfikb49jd4nORiirc/sZbZx90/V5JtkfxNGgbcCmzPpKpkL3vEeBpVOJBXjqOhRBvbTmXV3AqZ104XcVeeRhFAzwg6oq8FyVtRCnZNSYIKBFycwaT+5FWoRVO3Dp0AfbN/UAWKIGsURwPF0xoS+1JC0IsbpCFBpbEPmbK0MRaslFqwBtU7o= 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:(13230025)(4636009)(136003)(396003)(346002)(376002)(39860400002)(451199018)(36840700001)(40470700004)(46966006)(36756003)(6666004)(82310400005)(478600001)(426003)(47076005)(66574015)(83380400001)(36860700001)(40460700003)(86362001)(2616005)(1076003)(186003)(70586007)(70206006)(8676002)(8936002)(40480700001)(4326008)(41300700001)(5660300002)(44832011)(81166007)(2906002)(54906003)(26005)(110136005)(336012)(316002)(82740400003)(356005)(66899018)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:16.7827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f67e50ef-ac8e-4c20-9d9b-08db1f1e3306 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: DM6NAM11FT078.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7813 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" From: Joshua Ashton To match the other enums, and add more information about these values. v2: - Specify where an enum entry comes from - Clarify DEFAULT and NO_DATA behavior - BT.2020 CYCC is "constant luminance" - correct type for BT.601 Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Reviewed-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- include/drm/drm_connector.h | 67 +++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 6d6a53a6b010..bb078666dc34 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -363,13 +363,76 @@ enum drm_privacy_screen_status { PRIVACY_SCREEN_ENABLED_LOCKED, }; -/* - * This is a consolidated colorimetry list supported by HDMI and +/** + * enum drm_colorspace - color space + * + * This enum is a consolidated colorimetry list supported by HDMI and * DP protocol standard. The respective connectors will register * a property with the subset of this list (supported by that * respective protocol). Userspace will set the colorspace through * a colorspace property which will be created and exposed to * userspace. + * + * DP definitions come from the DP v2.0 spec + * HDMI definitions come from the CTA-861-H spec + * + * @DRM_MODE_COLORIMETRY_DEFAULT: + * Driver specific behavior. + * For DP: + * RGB encoded: sRGB (IEC 61966-2-1) + * YCbCr encoded: ITU-R BT.601 colorimetry format + * @DRM_MODE_COLORIMETRY_NO_DATA: + * Driver specific behavior. + * For HDMI: + * Sets "No Data" in infoframe + * @DRM_MODE_COLORIMETRY_SMPTE_170M_YCC: + * (HDMI) + * SMPTE ST 170M colorimetry format + * @DRM_MODE_COLORIMETRY_BT709_YCC: + * (HDMI, DP) + * ITU-R BT.709 colorimetry format + * @DRM_MODE_COLORIMETRY_XVYCC_601: + * (HDMI, DP) + * xvYCC601 colorimetry format + * @DRM_MODE_COLORIMETRY_XVYCC_709: + * (HDMI, DP) + * xvYCC709 colorimetry format + * @DRM_MODE_COLORIMETRY_SYCC_601: + * (HDMI, DP) + * sYCC601 colorimetry format + * @DRM_MODE_COLORIMETRY_OPYCC_601: + * (HDMI, DP) + * opYCC601 colorimetry format + * @DRM_MODE_COLORIMETRY_OPRGB: + * (HDMI, DP) + * opRGB colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_CYCC: + * (HDMI, DP) + * ITU-R BT.2020 Y'c C'bc C'rc (constant luminance) colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_RGB: + * (HDMI, DP) + * ITU-R BT.2020 R' G' B' colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_YCC: + * (HDMI, DP) + * ITU-R BT.2020 Y' C'b C'r colorimetry format + * @DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65: + * (HDMI) + * SMPTE ST 2113 P3D65 colorimetry format + * @DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER: + * (HDMI) + * SMPTE ST 2113 P3DCI colorimetry format + * @DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED: + * (DP) + * RGB wide gamut fixed point colorimetry format + * @DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT: + * (DP) + * RGB wide gamut floating point + * (scRGB (IEC 61966-2-2)) colorimetry format + * @DRM_MODE_COLORIMETRY_BT601_YCC: + * (DP) + * ITU-R BT.601 colorimetry format + * The DP spec does not say whether this is the 525 or the 625 + * line version. */ enum drm_colorspace { /* For Default case, driver will set the colorspace */ From patchwork Tue Mar 7 15:10:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163905 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 7261DC6FD1A for ; Tue, 7 Mar 2023 15:11:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1AA110E4E6; Tue, 7 Mar 2023 15:11:22 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20606.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5b::606]) by gabe.freedesktop.org (Postfix) with ESMTPS id 298DF10E4E4; Tue, 7 Mar 2023 15:11:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LwDASMFe/x+lnPWCyvXCBt+UXAq61rjCq8lCd8V3y7WrhF6SMm4us5N/w8SMuAViVV6FxyMUuezmLLZQSRcv/q76NaCcloK9QwV4FVFqGYltUkuLqxJgCFfs6M2YjalDaHDrMBGklNJTh6DVu46z6uC50SMH0w/NTBj01uUUABviLYEneW/ASSGel8q4NJZpUgOt/t4fhXT4UyoND/d0eMLlDyNaqELrsCCUIXeRf5fZcH+TfdGrOd1bnomymvbN8iVrLkaLCL849P1VVwQmOsHw0iTbbY1EXYDPHqbX9puBpJYYBdhCuuTKwFNVxfYDWB28OsJeDwGs0nkK074IIw== 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=pBAkFEWpyLbo4zJtQXuE57KdFEh/F2W22fqdVahHseQ=; b=a8RL+J9ypTAf8j+Ekj3h1jTISRJTAFFkN6Pno+yU7NFniQCt+/W9incfZRO6tM9b5fQ1DHnBaY5Z2RrGct+gEHlNAa227wLxR9LrzYzXNoB7nxUqR6RH9BiXNt/a4rX4IGl10e6EBFY/MmAVtucRtOYbZPOYONL/WjphdVpK9Us0nL/Vl49Y/G+RuPvVZGL1YQrjVNwV87LDIWRDFYEhx0tiOCYvG61T4nQfhpEORm8sQ4ClUGEMeoX0uC1lHlwsup4Iwj7VBzEdboWlcyH3URMbqJkFiIljCXLmz7e6vKVoStlrl6B53u38fZKkX0+zt0cPJQjYQ7TMK4W9cSmpMw== 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=pBAkFEWpyLbo4zJtQXuE57KdFEh/F2W22fqdVahHseQ=; b=BIZJdtabtzPDnScrzlBtznD5M5LhZ9Ezu/ssi6DN+JwWrkDrz5hr7E/4N9GuWVGcVlmlidMgyRRGgQFUuIMiW+mT7lAVNHxVcQBbm90ZJSydJM2UlXgagOo+UXpMEFINgoWEBi7yvd0QR2vWOT5t72U9d9LRkMfEQ8yHJgd/a+Q= Received: from DS7PR05CA0058.namprd05.prod.outlook.com (2603:10b6:8:2f::11) by CH3PR12MB7740.namprd12.prod.outlook.com (2603:10b6:610:145::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 15:11:17 +0000 Received: from DM6NAM11FT078.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2f:cafe::eb) by DS7PR05CA0058.outlook.office365.com (2603:10b6:8:2f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.15 via Frontend Transport; Tue, 7 Mar 2023 15:11:17 +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 DM6NAM11FT078.mail.protection.outlook.com (10.13.173.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:17 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:17 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:17 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:16 -0600 From: Harry Wentland To: , Subject: [PATCH v3 03/17] drm/connector: Deprecate split for BT.2020 in drm_colorspace enum Date: Tue, 7 Mar 2023 10:10:53 -0500 Message-ID: <20230307151107.49649-4-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT078:EE_|CH3PR12MB7740:EE_ X-MS-Office365-Filtering-Correlation-Id: bb33c077-990b-4fa9-815a-08db1f1e338e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MFdRsPdnHin9zPgcfWdnvBbaF9dhBvbNpUihMwgVNbpdEsjdLUv1SiqdwY5nMwPmx8BQ1i7Q++LzC6xy/5xqnUwbukL91i9j/Ia7TLgnHkGycAV04zy+AF4levNyxufP2tpOzAOPo2ijIhbAHJpk+Oy2+sKMo89ut2m6jOCllo9UFfw+ktLvh0QJvOxqTnB0ZQIZ9G2znXqKxvFwLriDqF13trNIvicrKpwWgdWYwxFd8FxTcro+g+sMAFI0rzf37KTRVypsb22+bc11IARl/s08DTEuhJx1NtaHHhdzG7XmtIVuo+WO0oHXqO53DmR+9QeA0nim/a+BpTqytJMnIHFcC7o0qg0M66GOo++LLDbqDi09/PdaUkK03ejRKQ77QxSKFWds40jHAeOwjTMGaHo+uTTCegDpAHFRWJciVKRYTQqVIiPO48AEcVPptoIlETH7o9CJ2GqXQqwqlLdDglLitMv/NGYYeVep357vXqCIeG28L04Fd/Tm3QVtLk21t0pIgBs8o2QJlcew6NF4Pi5x8G7wYscacMAMGS3WBNRJMG6CuzvPHN6173LkDTCn6c8YlE95c2B/vbAW8e+WyDiLuVdw1QTj+MZwXbnude2GMivjK2qZY77ulZm0nYLdG/8FlQBYWdCmN5s2waf0GW12YK9VS6koJG4l7qkV/y6OcG3/kSJHNAK8UOqe3F2ZIdSMEx2CPSUO7Ve8yFTdE2DKWP4Kos5pD16jjG9/iVM= 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:(13230025)(4636009)(346002)(396003)(136003)(376002)(39860400002)(451199018)(46966006)(40470700004)(36840700001)(36860700001)(82740400003)(86362001)(81166007)(356005)(36756003)(70586007)(4326008)(8676002)(2906002)(1076003)(44832011)(5660300002)(70206006)(41300700001)(8936002)(40480700001)(82310400005)(426003)(40460700003)(186003)(336012)(83380400001)(26005)(47076005)(2616005)(316002)(6666004)(478600001)(110136005)(54906003)(66899018)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:17.6733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb33c077-990b-4fa9-815a-08db1f1e338e 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: DM6NAM11FT078.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7740 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" From: Joshua Ashton Userspace has no way of controlling or knowing the pixel encoding currently, so there is no way for it to ever get the right values here. When we do add pixel_encoding control from userspace,we can pick the right value for the colorimetry packet based on the pixel_encoding + the colorspace. Let's deprecate these values, and have one BT.2020 colorspace entry that userspace can use. v2: - leave CYCC alone for now; it serves a purpose - leave BT2020_RGB the new default BT2020 Signed-off-by: Joshua Ashton Signed-off-by: Harry Wentland Reviewed-by: Harry Wentland Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Acked-by: Pekka Paalanen --- drivers/gpu/drm/display/drm_hdmi_helper.c | 7 +++---- drivers/gpu/drm/drm_connector.c | 8 ++++---- drivers/gpu/drm/i915/display/intel_dp.c | 14 +++++++------- include/drm/drm_connector.h | 15 +++++++++------ 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index faf5e9efa7d3..05a0d03ffcda 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -97,8 +97,7 @@ EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata); #define HDMI_COLORIMETRY_OPYCC_601 (C(3) | EC(3) | ACE(0)) #define HDMI_COLORIMETRY_OPRGB (C(3) | EC(4) | ACE(0)) #define HDMI_COLORIMETRY_BT2020_CYCC (C(3) | EC(5) | ACE(0)) -#define HDMI_COLORIMETRY_BT2020_RGB (C(3) | EC(6) | ACE(0)) -#define HDMI_COLORIMETRY_BT2020_YCC (C(3) | EC(6) | ACE(0)) +#define HDMI_COLORIMETRY_BT2020 (C(3) | EC(6) | ACE(0)) #define HDMI_COLORIMETRY_DCI_P3_RGB_D65 (C(3) | EC(7) | ACE(0)) #define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1)) @@ -112,8 +111,8 @@ static const u32 hdmi_colorimetry_val[] = { [DRM_MODE_COLORIMETRY_OPYCC_601] = HDMI_COLORIMETRY_OPYCC_601, [DRM_MODE_COLORIMETRY_OPRGB] = HDMI_COLORIMETRY_OPRGB, [DRM_MODE_COLORIMETRY_BT2020_CYCC] = HDMI_COLORIMETRY_BT2020_CYCC, - [DRM_MODE_COLORIMETRY_BT2020_RGB] = HDMI_COLORIMETRY_BT2020_RGB, - [DRM_MODE_COLORIMETRY_BT2020_YCC] = HDMI_COLORIMETRY_BT2020_YCC, + [DRM_MODE_COLORIMETRY_BT2020_DEPRECATED] = HDMI_COLORIMETRY_BT2020, + [DRM_MODE_COLORIMETRY_BT2020] = HDMI_COLORIMETRY_BT2020, }; #undef C diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 61c29ce74b03..fe7eab15f727 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1031,9 +1031,9 @@ static const struct drm_prop_enum_list hdmi_colorspaces[] = { /* 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" }, + { DRM_MODE_COLORIMETRY_BT2020, "BT2020" }, /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, + { DRM_MODE_COLORIMETRY_BT2020_DEPRECATED, "BT2020_DEPRECATED" }, /* 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" }, @@ -1054,7 +1054,7 @@ static const struct drm_prop_enum_list dp_colorspaces[] = { /* 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_BT2020, "BT2020" }, { DRM_MODE_COLORIMETRY_BT601_YCC, "BT601_YCC" }, { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, /* Standard Definition Colorimetry based on IEC 61966-2-4 */ @@ -1068,7 +1068,7 @@ static const struct drm_prop_enum_list dp_colorspaces[] = { /* 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" }, + { DRM_MODE_COLORIMETRY_BT2020_DEPRECATED, "BT2020_DEPRECATED" }, }; /** diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index c9be61d2348e..be100a193bf5 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -1766,11 +1766,11 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc case DRM_MODE_COLORIMETRY_BT2020_CYCC: vsc->colorimetry = DP_COLORIMETRY_BT2020_CYCC; break; - case DRM_MODE_COLORIMETRY_BT2020_RGB: - vsc->colorimetry = DP_COLORIMETRY_BT2020_RGB; - break; - case DRM_MODE_COLORIMETRY_BT2020_YCC: - vsc->colorimetry = DP_COLORIMETRY_BT2020_YCC; + case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED: + case DRM_MODE_COLORIMETRY_BT2020: + vsc->colorimetry = vsc->pixelformat == DP_PIXELFORMAT_RGB + ? DP_COLORIMETRY_BT2020_RGB + : DP_COLORIMETRY_BT2020_YCC; break; case DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65: case DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER: @@ -3043,9 +3043,9 @@ intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state, switch (conn_state->colorspace) { case DRM_MODE_COLORIMETRY_SYCC_601: case DRM_MODE_COLORIMETRY_OPYCC_601: - case DRM_MODE_COLORIMETRY_BT2020_YCC: - case DRM_MODE_COLORIMETRY_BT2020_RGB: case DRM_MODE_COLORIMETRY_BT2020_CYCC: + case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED: + case DRM_MODE_COLORIMETRY_BT2020: return true; default: break; diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index bb078666dc34..3e2e1bc7aa04 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -409,12 +409,15 @@ enum drm_privacy_screen_status { * @DRM_MODE_COLORIMETRY_BT2020_CYCC: * (HDMI, DP) * ITU-R BT.2020 Y'c C'bc C'rc (constant luminance) colorimetry format - * @DRM_MODE_COLORIMETRY_BT2020_RGB: + * @DRM_MODE_COLORIMETRY_BT2020: * (HDMI, DP) - * ITU-R BT.2020 R' G' B' colorimetry format - * @DRM_MODE_COLORIMETRY_BT2020_YCC: + * ITU-R BT.2020 [R' G' B'] or + * ITU-R BT.2020 [Y' C'b C'r] or + * ITU-R BT.2020 [Y'c C'bc C'rc] (linear) + * colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_DEPRECATED: * (HDMI, DP) - * ITU-R BT.2020 Y' C'b C'r colorimetry format + * deprecated; same as DRM_MODE_COLORIMETRY_BT2020 * @DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65: * (HDMI) * SMPTE ST 2113 P3D65 colorimetry format @@ -448,8 +451,8 @@ enum drm_colorspace { DRM_MODE_COLORIMETRY_OPYCC_601 = 6, DRM_MODE_COLORIMETRY_OPRGB = 7, DRM_MODE_COLORIMETRY_BT2020_CYCC = 8, - DRM_MODE_COLORIMETRY_BT2020_RGB = 9, - DRM_MODE_COLORIMETRY_BT2020_YCC = 10, + DRM_MODE_COLORIMETRY_BT2020 = 9, + DRM_MODE_COLORIMETRY_BT2020_DEPRECATED = 10, /* Additional Colorimetry extension added as part of CTA 861.G */ DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 = 11, DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER = 12, From patchwork Tue Mar 7 15:10:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163904 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 91C3CC6FD1B for ; Tue, 7 Mar 2023 15:11:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C7FB810E4E5; Tue, 7 Mar 2023 15:11:22 +0000 (UTC) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2049.outbound.protection.outlook.com [40.107.95.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E5BC10E4E4; Tue, 7 Mar 2023 15:11:21 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bD2r3Dd/h5K5rPFiNxmXddMrtQtUEfvO0lMhfyD4To7tPOJysz/927vN87ELXMHeUgXGeWXiuKgQgheVG7AtOe+Te23Xl+YXMUJhEfS0Ukv/V2C0zaSkHuKknHp/H2nQB+6wk8oFPVqVbnsusKriDFYW8THPODUezzBmYzBKCvEXNyD+lk5x3WRtd36j3S3e3o1J3vkyS437tGmxYc3BB/ru4ILaoxa6MKkrw5Q4BDDg7JBdcQ8Ww0EoV6XrxpZBx8OVttq5BFjVyur+CRSITxXGl4NxtptTswh+zoqziXg5ewTeFb6cEvji/jFLYIz2GoDi6HooJA443665RjSBWA== 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=3uO/xyrDnQzDjM3BfF2UYq3sBZ4nzUtSydxEK5keb38=; b=VZAgeQ3LhMQGQnk/m5FRkY4YCm4pSraOwZjdeWNsK0nxxqYAEuyHqmOkVfZcXgGW85/tBX8MYGStxYcHlNbf6pzoarGWPaVtafBx5VBrp5w6wMAgHkA34PHK4c8sjrNJwPkZamWFHDYJvf4kc1j3XOSS1/nSzyId3msuweMls8B8rKAYQLYgnLQkaZ9ZYWWU9hYgMWyxBz+KqfdhoK9eV1xzgB9AgCF5z9kICxXfgN8bYypxi9s98jLBO73R13uqTPlI5MuMSm/2aaTeGvWfrinZ6BoNvHB2MfWiEKfjVsOOSEEwIcSl2QKR52V4LdJUOGEL7Gj6UjA+ZqG3G2B7gw== 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=3uO/xyrDnQzDjM3BfF2UYq3sBZ4nzUtSydxEK5keb38=; b=oUeMlJ2aCJgFbO9oISB2I/HT/Jq419XJcfA3AbUIbAPiuhszb0EPzayLUn7uKR/Yc+9HnAhUSkXCkKBjXbVWd05W0Xtcfe0IEhPU9r+2FrDB9C2PKICaBd9QDI9kRDecfqexWlDLM+VZYMlfHZF+R2Jnfjfr32Y2ecw8Lma4JEM= Received: from DM5PR07CA0086.namprd07.prod.outlook.com (2603:10b6:4:ae::15) by SA3PR12MB8022.namprd12.prod.outlook.com (2603:10b6:806:307::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 15:11:19 +0000 Received: from DM6NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::5c) by DM5PR07CA0086.outlook.office365.com (2603:10b6:4:ae::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:19 +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 DM6NAM11FT067.mail.protection.outlook.com (10.13.172.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:19 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:18 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:17 -0600 From: Harry Wentland To: , Subject: [PATCH v3 04/17] drm/connector: Pull out common create_colorspace_property code Date: Tue, 7 Mar 2023 10:10:54 -0500 Message-ID: <20230307151107.49649-5-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT067:EE_|SA3PR12MB8022:EE_ X-MS-Office365-Filtering-Correlation-Id: 254bcbce-5f3c-4d64-8956-08db1f1e3485 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mDOQfVEq8KuQQveOsfosQK2O27ULfllOB1g0ub85dVFH2LugCVvXVGeTs9TovpGBCqeHI1yPCr6RFgQRQ/Q38gtA2/DjrGcW+h+UDpTnOURlnZeza9Bzwhp2OBLdbsxNjV4tzPdWRsfi7Xu8SY9F08kNycblHJmq8vu6yCQoDv3XIt95IqKJs2+yGI4c0nPjGuzn8CQxq1+pDxHnwEhFYGNhNXSIBn9Yx5zSgwVEnEIhSHnZstLzZzFfmLR8noPnMHsYcpr3uKg35UUq8xEB7CjMF0VISMD6hbiq7hnAxc8vSPhLJDGQ6Ww5mFndBwkzQmwAk4qFkuGA9HezaGUHhQt3iK7gFukz2Uyy+h0cTjrgA/9Rl1jthk8/zbUGompUIsZ8gHRlgalAbIDmwt3G1tgCfIjz3F0Flt/dmC8so7jueY6R/MalhfIHr3gCBgiraNme4fvHKY3yjr4aFVvGB2KcGtVC8FrDOsVakH2LuUR3DkaQTNXPdlvVHu8DJG0N6+kUuLxu1oIHyD7GS5w0Q5Sw6qrGDey5sUHdbKQhOrt+Mj5ksYHXEZBToJZcUtI2a9nB79hwrlcC70HdgSmbD4w1fLf9Y3ePl/I1Z1HX0eJXF3JH/z/7eFptN/Dd7x/dFtJinEUpGwEft0367zZFz0q9rKkdAVN2g2T+IX41tPZtmboZdJkgsX3OkbYvGEyJdjkuLK99MbZb3DETJ2HTsn34Df1FuXHpJ1Pdrdc0AuY= 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:(13230025)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199018)(46966006)(40470700004)(36840700001)(110136005)(36756003)(316002)(336012)(83380400001)(54906003)(40480700001)(82310400005)(86362001)(2906002)(70206006)(40460700003)(186003)(70586007)(5660300002)(82740400003)(44832011)(26005)(478600001)(8936002)(8676002)(41300700001)(36860700001)(4326008)(1076003)(426003)(2616005)(6666004)(47076005)(66574015)(356005)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:19.2922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 254bcbce-5f3c-4d64-8956-08db1f1e3485 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: DM6NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8022 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 fe7eab15f727..ff4af48c029a 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 Tue Mar 7 15:10:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163913 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 37F18C678D4 for ; Tue, 7 Mar 2023 15:11:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 67A1710E502; Tue, 7 Mar 2023 15:11:35 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20618.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5a::618]) by gabe.freedesktop.org (Postfix) with ESMTPS id E100310E4E9; Tue, 7 Mar 2023 15:11:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G09G8gZrr4ynJYGqvZfiNpbMBiSuNVzKjx1NW2FiTAjrl5sTDcWj5VPC5PH2oT6JsOVoZIYn+6U6XFkk8otcVSGYqtyh17G40Wm78d6nza7fuCAMSRnTejm0mMDXCsGvFt8vCBvETlUnPjPUwfeScuiNm3f2KEOdK0NjZ9fNVEuwPs+op52xkGXNJECWj07ZzXT9p2IGU43qg7Y6xilgVhuXMhDBgKi0fdojE75xfJQCSt9sL5A8jjr68xbA1Pvjl7lMxzrhgkgkM9Cc/fTzcVNoJOwNRNGoeAk0KOza5cE5aA6YwRE8kQtrXzlYoJTxF18Z2WGN/iIyMptSU0b5bg== 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=GnCGGG6Ors6O2DwupxZAon9hPZFraQ1UM5m55sa9SPg=; b=laID61CzYzNHkC0HJjzDFHlHcopJoqdpItXqTisJBKTOEaRAUlFHNaJH+ezF2ejahc73dd4GRzcJ0wVLN0i13hLQVRMK1LEH7CxM54FBCOUJyExOXiE4vibcy5SZyR6ci0yzAv8y0ypmmHaHICRZhKS9qrqXPG34hf2Sn8ZTvxKgcyg1D6wmwQRdwgprVoJ3gx46RDAS4SF2YtlZabW7vciEZH/UFvLTiIDRYJhlGZV12FUymNceAx7xcSWy95boxkC8QuO705MSrSsOLcET5lSxhIq8vPQhaKFb8Y2vjK1kJvxKzS2B194Xf3yEwKzflmzuZcxFYZZ2oSxWNkHqrg== 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=GnCGGG6Ors6O2DwupxZAon9hPZFraQ1UM5m55sa9SPg=; b=3rqxtxPtuX3odnxP6DkR8KVZByaVoRmtfenFXKZOegFZkU4l5HiHZjfXqPSaDEck5IdEo0zQSVWNNqT2mAx/TvGCrzoeERxieqIWQqTQvNmW69fkHvr1Nw8ccB+5rT5EHW5hbS6jUrDNU3RXVsazV9B05vxqKv5GE2ZuvOgThxI= Received: from DM5PR07CA0097.namprd07.prod.outlook.com (2603:10b6:4:ae::26) by DM6PR12MB4562.namprd12.prod.outlook.com (2603:10b6:5:2aa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16; Tue, 7 Mar 2023 15:11:20 +0000 Received: from DM6NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::50) by DM5PR07CA0097.outlook.office365.com (2603:10b6:4:ae::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:20 +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 DM6NAM11FT067.mail.protection.outlook.com (10.13.172.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:20 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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; Tue, 7 Mar 2023 09:11:19 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 07:11:19 -0800 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:18 -0600 From: Harry Wentland To: , Subject: [PATCH v3 05/17] drm/connector: Use common colorspace_names array Date: Tue, 7 Mar 2023 10:10:55 -0500 Message-ID: <20230307151107.49649-6-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT067:EE_|DM6PR12MB4562:EE_ X-MS-Office365-Filtering-Correlation-Id: 712c7f20-6320-4fbb-7f5f-08db1f1e3520 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UXOJEsw1o69TSpSoz3qxKdBAJOPEcJndGAAVbjPiZDei9+YctzxRxV0UmoNQzCqT4GnAYjaBx2BkVy+I8rGFZb/Pr9aG9XeVK6twSNRgA8BcKSgmj8uPSuL0VOcb2Rb0YA3LL+iavXUJlrEjQzC+T28L+XjSOnArcWLhzNfHPwZTeirdEfWlm5hGXzOlnowY7SD0EC8pidjPo3EY5JCuhQMSpCnJXcZCwD0dCikYlAc6SDONCrfkYlk/A1GbW+dm30vQRuYdYRWsilONST9RJvMz8Lxwz9uiv2e2f64fxMkbnQgd2PD22dqc6ZTRoF6o5oUDBtRglwEM7kjXaT7Wud4Mqqm1HAGDihsAItujkrQ/R2p6WXQ0Tk5jTWT7iDfYFvfss/Z1Bys8kBsGMsPj9sw4bBq0ap5eMFvUffUWH2cyLzI92llGr/ukJQDPccfg6hzgAhDklgEDBUAeNlG70as0WwskarPDdvfS0tZF8KZlbQtOHHqap5xDEVPcpNKKrOdad+seOfNebrgq9ZULzZgfC3/nB5/+OdU7kh/1aMgfYpul8k7CxiAZ/8Y2LoFmsXd5RhjTJbTOC9mxaI4airBEE/XEV9iy8a1yE0k+h7AmpBfo2a9aJtkJOlFLRTTRPL35PBhbEak4rBWZAA5CI0Zu7KuTTVp6CGb5sQP4v2zN48fpbLGIs+zK/XyvPu6AnXcsf2LOrT4s8Q1eKZyh6+kLQwei9VJz+V03LgD8RGk= 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:(13230025)(4636009)(346002)(136003)(39860400002)(396003)(376002)(451199018)(46966006)(40470700004)(36840700001)(54906003)(316002)(2616005)(6666004)(1076003)(36756003)(81166007)(26005)(478600001)(336012)(36860700001)(82740400003)(70206006)(4326008)(2906002)(8676002)(70586007)(40480700001)(82310400005)(86362001)(47076005)(66899018)(426003)(41300700001)(110136005)(8936002)(356005)(44832011)(186003)(83380400001)(5660300002)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:20.3078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 712c7f20-6320-4fbb-7f5f-08db1f1e3520 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: DM6NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4562 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 an use bitfields to track the support ones for HDMI and DP. This allows us to print colorspaces in a consistent manner without needing to know whether we're dealing with DP or HDMI. 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 --- drivers/gpu/drm/drm_connector.c | 131 +++++++++++++++++++------------- include/drm/drm_connector.h | 1 + 2 files changed, 78 insertions(+), 54 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index ff4af48c029a..7649f0ac454f 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1012,64 +1012,70 @@ 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[] = { + +static const char * const colorspace_names[] = { /* For Default case, driver will set the colorspace */ - { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, + [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" }, + [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" }, + [DRM_MODE_COLORIMETRY_XVYCC_601] = "XVYCC_601", /* High Definition Colorimetry based on IEC 61966-2-4 */ - { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, + [DRM_MODE_COLORIMETRY_XVYCC_709] = "XVYCC_709", /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ - { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, + [DRM_MODE_COLORIMETRY_SYCC_601] = "SYCC_601", /* Colorimetry based on IEC 61966-2-5 [33] */ - { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, + [DRM_MODE_COLORIMETRY_OPYCC_601] = "opYCC_601", /* Colorimetry based on IEC 61966-2-5 */ - { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, + [DRM_MODE_COLORIMETRY_OPRGB] = "opRGB", /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, + [DRM_MODE_COLORIMETRY_BT2020_CYCC] = "BT2020_CYCC", /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020, "BT2020" }, + [DRM_MODE_COLORIMETRY_BT2020] = "BT2020", /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_DEPRECATED, "BT2020_DEPRECATED" }, - /* 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" }, + [DRM_MODE_COLORIMETRY_BT2020_DEPRECATED] = "BT2020_DEPRECATED", + /* Colorimetry based on SMPTE RP 431-2 */ + [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", + /* Colorimetry based on scRGB (IEC 61966-2-2) */ + [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) | + BIT(DRM_MODE_COLORIMETRY_BT2020_DEPRECATED) | + 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, "BT2020" }, - { 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_DEPRECATED, "BT2020_DEPRECATED" }, -}; +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) | + 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_DEPRECATED); /** * DOC: standard connector properties @@ -1972,30 +1978,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. @@ -2005,15 +2030,15 @@ static int drm_mode_create_colorspace_property(struct drm_connector *connector, */ int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) { - return drm_mode_create_colorspace_property(connector, - hdmi_colorspaces, - ARRAY_SIZE(hdmi_colorspaces)); + return drm_mode_create_colorspace_property(connector, hdmi_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. @@ -2023,9 +2048,7 @@ EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); */ int drm_mode_create_dp_colorspace_property(struct drm_connector *connector) { - return drm_mode_create_colorspace_property(connector, - dp_colorspaces, - ARRAY_SIZE(dp_colorspaces)); + return drm_mode_create_colorspace_property(connector, dp_colorspaces); } EXPORT_SYMBOL(drm_mode_create_dp_colorspace_property); diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index 3e2e1bc7aa04..46c064d9ffef 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -460,6 +460,7 @@ enum drm_colorspace { DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED = 13, DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT = 14, DRM_MODE_COLORIMETRY_BT601_YCC = 15, + DRM_MODE_COLORIMETRY_MAX }; /** From patchwork Tue Mar 7 15:10:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163908 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 196D0C678D5 for ; Tue, 7 Mar 2023 15:11:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AB6110E4F1; Tue, 7 Mar 2023 15:11:29 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20616.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::616]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E27310E4EA; Tue, 7 Mar 2023 15:11:24 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jHXMkTaXhFcG2tcBo8MAKPfGRyhTpWISyNKCx8ptH74oIE3tZ/4F964kD+9vy53/rHY5vmBAJEwu4YfXkkkyS96QZNXBy+doinQDkGKApqrOdd9jMa8UBqjUpMgb3ejNYxXCnVvR3Xib+nVcFcNwpw9W7xEOIKYiQypF4LrA0f5CksxwEAuuovpEvFEBghZy0MNuH4xKCA4TGVG0/MUg0ew7axJ5QBZ263w2edLam6UCNcUtiqRvAMBBQ/FNX+c3nI/XgfC3mhS7x6KGqiotNqTCjlQPpu3Y6bz5kEWab9S5GiB9bYYMo8aeEotQI+u4GwagM/IcWIIARWn+n0cltA== 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=6hqkM3UJ0lNVVhSYBUzRXI8xDkrz77a3byQZmDeT9vM=; b=bXnsQMrBV7QPDVRswgJUEVYLPXdT+LB14ZsaFZb8f/Xo1zO5U78ykF7v0wqDcuP/DU8W0IsqHbeZvdzSdMqZt3hATcZdxYfv/cPDu8bundBwLE2T9BaRKNqcHMyj3Qyeqm/t9KDeK0UmzrJ5i+PtDSMOZ/3kcnQxC6qoZJ7iJbv17UNbZYmz7SswNDexRvQGs10Fdi3YD69nyl6QQyeBRJCJrjZYe4d9hozi6OY/00Eu+Ih7eKDFvuTOqQKUG67XGW8b+HRnJNwgsqkMUat3rm/3l8+GQy6h9gKznZnKChVg4Fmga59zStWsBaCvVAXH5n7kbo4C7ADeVm4Ws6o+Gw== 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=6hqkM3UJ0lNVVhSYBUzRXI8xDkrz77a3byQZmDeT9vM=; b=F39KEvamVKT0Auj1rizDyKLV1+hVj0pkXSb3E3OG0P7wnKIvBNg96Ielu8NKqCuFkCu/tQ2uGzhcygx/x6nZfO/VLRWRIDZ0kyy+ob5DzGvEMrXwJSNkzErthKKBkvm6xmMx6e8UNnKyFMRLAfytB3UV1XEAe0hIY+Et1JV/9tE= Received: from DM5PR07CA0081.namprd07.prod.outlook.com (2603:10b6:4:ad::46) by DS7PR12MB5720.namprd12.prod.outlook.com (2603:10b6:8:73::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 15:11:21 +0000 Received: from DS1PEPF0000E631.namprd02.prod.outlook.com (2603:10b6:4:ad:cafe::58) by DM5PR07CA0081.outlook.office365.com (2603:10b6:4:ad::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:21 +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 DS1PEPF0000E631.mail.protection.outlook.com (10.167.17.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:21 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:20 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 07:11:20 -0800 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:19 -0600 From: Harry Wentland To: , Subject: [PATCH v3 06/17] drm/connector: Print connector colorspace in state debugfs Date: Tue, 7 Mar 2023 10:10:56 -0500 Message-ID: <20230307151107.49649-7-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E631:EE_|DS7PR12MB5720:EE_ X-MS-Office365-Filtering-Correlation-Id: f11044b5-a68f-423a-d4d8-08db1f1e360a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2+b+pjb1av++Q9V5eTqC0eA2/twpoIx90LpS7r3Fjf2MXrMZ4W2fYbCpRpbbUbkfPu4T2uw4Va44QkPfqbVcnzZ3B9jYy9GMI5vgWI55Pg7bAYYPbH+C9WxIsnV0iA61OItwuLl8HO4VtfExxrfjEbCX8BzcRgUZlVPpTm4AkXnRZnVKnE7gD5hEq55864l6NfNQwPpLZ96OnFOI3wQamByLtnAEz+JmgedjXYIma83k3xtTP4Zmq5RtsehCFqx/vcVmYfYJ6lWyGqawaAEhM2MmiIs2leYbDFjW0LjuSPR66fESfrtNyaKzOiOCMZzfs84P/gYnjpR8ML6lJfHPNRD52Kavkfrf1+shUXjqw/MtMpALcoOS4vkcL8pAAORyWYn/qmgJdClu2dnrVjx9AFrqObD5tIGm+8uhMHdy0qcEjkrNvdeJVVOQFcSn/SmDH9xgsoX6qigCw9V9og8W90jeV80rJuKBumY1kgCsxTzGn3/0+AeHn4Wb+d1Y5/GXS0lidDVWQmi8MSxhgAToTDG2S19JM1NsGG8E2QCKZaeTnZ+FnAjKhIGcUQqPc5sVQ34xOANOPJat2kxSjaAYA3v2depHr2TwMjiN1g2GGg/zz6YjTGUaBJIIyER45R+T1U+KTxqmPTqW5h7+cw6Ohc9mbKuur/fVbwySsCA+3cFH6d4QkCrRMZ1gTTdq7ChMBOVVWPIrrHkB9MU/yaKF8iIbGbEw2txGXX9QFhl1wKM= 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:(13230025)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199018)(46966006)(40470700004)(36840700001)(2906002)(44832011)(8936002)(5660300002)(336012)(41300700001)(70206006)(8676002)(40460700003)(4326008)(70586007)(36756003)(316002)(54906003)(478600001)(40480700001)(86362001)(6666004)(81166007)(36860700001)(26005)(186003)(356005)(426003)(2616005)(47076005)(83380400001)(1076003)(110136005)(82310400005)(82740400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:21.8435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f11044b5-a68f-423a-d4d8-08db1f1e360a 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: DS1PEPF0000E631.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5720 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 7649f0ac454f..7ed48f9cbb20 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1044,6 +1044,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 46c064d9ffef..c77e42408522 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -1970,6 +1970,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 Tue Mar 7 15:10:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163907 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 EEB81C6FD1A for ; Tue, 7 Mar 2023 15:11:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B30810E4F2; Tue, 7 Mar 2023 15:11:29 +0000 (UTC) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2079.outbound.protection.outlook.com [40.107.223.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id A740310E4E8; Tue, 7 Mar 2023 15:11:24 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DKz1K1qeKZHYtFnY4jrHlwAErr/RtfVDgabFBp+RuKk0wfvMO1Yj5S8LaK4hl9GXrLmQ6M+gLt4N/TJzXAuahyVpp8qprf2e9A2LyT5YOXCaBZfgWY+y69Q8PTo2dl4yM2tANQIyiVkiYfpSO2tKO8Qcz0Cj9Q807gnXMn/x5EDdRNz8fVdctB5EesnbfX2Et+9+mxOBiW72dwMvdinnjhDJvhyklra+upSWKFK28Aacvn/uZHMk677NivjWrXsLHZASoQ3lK+Xb3VEbr0A+OVffCnPISVXpKVILKInl6ypKLdiydmDBlxKXmfaDy6fpW4H9Q8tGS0jArXs6V1SrIA== 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=cdpNofxcQLjwx4frJIOEvNn3bj56ijS515mmkM4jlnw=; b=GhTpEh+FRIP8AIdFk+GFczBCu2wj00wuFbhoD1vyMM6gAOaxffk5cnvFzJMd9K9Dj9QLRGclzmrp4CHMZJqfssrlXianpMlmaDewuFSeC/xzsGe/0jKhZa1sq/Sos8anOyO0mlmZhsFmmisyyg0X2WOD9RwWOb90t2HzalDuzcy/T2m17y0DkFJ9Hb6Sc/43uHs8DxzE137rg+R+TOvt433qFGN/hYKdMoEDbF7z2qPsy4VUkdL5g+xdJdiaVMb77b7zcqlGzxYOS2ZEFsRXroC6rwXmWSMxRDxTDmeXVVGFGAW+BwSZq/KRForf7WiUfbuZsmyqHWrXjoTkVW8/rg== 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=cdpNofxcQLjwx4frJIOEvNn3bj56ijS515mmkM4jlnw=; b=i3rlhi2UcMxFBMg62WUp/b7V1KdPNIwjdaMM2ObFbJ0DdYDy/m4Uedm1L44te3XSx1StEjg845mX3wwnauOlSg+WP1RK0e6+Kzm5W6xAt32vrHzBTqY+HKci7lBAB5fO0SIK3quIu/vezHpxcvnix5/OHh7+UjVNU+zhKF05HQs= Received: from DM5PR07CA0081.namprd07.prod.outlook.com (2603:10b6:4:ad::46) by PH8PR12MB6724.namprd12.prod.outlook.com (2603:10b6:510:1cf::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 15:11:22 +0000 Received: from DS1PEPF0000E631.namprd02.prod.outlook.com (2603:10b6:4:ad:cafe::ab) by DM5PR07CA0081.outlook.office365.com (2603:10b6:4:ad::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E631.mail.protection.outlook.com (10.167.17.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:22 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) 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; Tue, 7 Mar 2023 09:11:21 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:21 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:20 -0600 From: Harry Wentland To: , Subject: [PATCH v3 07/17] drm/connector: Allow drivers to pass list of supported colorspaces Date: Tue, 7 Mar 2023 10:10:57 -0500 Message-ID: <20230307151107.49649-8-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E631:EE_|PH8PR12MB6724:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bf4c3c3-deb4-46df-488d-08db1f1e363f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mgToDOYiR0ap4tE4CurMD1hzHUyu+RgKxjTkaAS3m05lLPgh0+9UBp5CrHm0tGk6PBHfMTYeNO3J8t19N0yhJJXQHwfbNRzcf7dTqgXdZRXMlR6cGjNEdcH8AoDPmhjXP7shjUVENXdVtoe60Ez6EZ3G7K8ImwAwaeofyp1CrujM09P4a9RRjMuOQcMegXWCJHKACCXBEqARyJPdMcdWn2XHd4wcF05GpBkVOXpeEvwRCIg/9qAnAub3UixhPfBgZ5cbcJscE94OApeMwwauNO98PGwErmlZQYABGbW2mZ6IOu/onGMy1vsSexl4kOSRAJAr0cUouyL5pVCsJ8P3a1PwR9od5KVHj//mTnQ0IC2PX3pU/s2SKkD1yLIiwG/DP/W/S+wfG+Dtvc7vs+WI83qHNYHAj7Fimf4/V8XYoYbDJ4N/RZvpDqADL2sRoYRfbFDWNJYcoUnvTxjKSKUAu887q0X2j1TMQ6Yeaw8fUJn0GN4iP5/qOiFyIWck9Ut61eVQWwjNVeXbDIq9xtkiZSiHS0ACzps2Tq9OalaFT+HE9YYta6fPHsgl9xjsJGSHXbUnfnylv9epskL9FG+IlK0KLcWBOiksed0Jxjr0eq6CrdZlFswqj5FVFGYEZKU/yZurnAzJqGqz8OCxIfMCJ3LVkXx395GKdYY7K0Sds1XuJTqFpwY1GHhV4KGgBIXzXyCN9GGei+9AX8RsJ6xkBAMSgELLd4/vVECGuRXUB8Y= 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:(13230025)(4636009)(39860400002)(396003)(376002)(346002)(136003)(451199018)(46966006)(36840700001)(40470700004)(8676002)(36756003)(40480700001)(4326008)(70586007)(8936002)(70206006)(44832011)(5660300002)(2906002)(81166007)(82740400003)(356005)(86362001)(36860700001)(41300700001)(6666004)(1076003)(316002)(54906003)(478600001)(110136005)(26005)(82310400005)(66574015)(47076005)(426003)(83380400001)(336012)(2616005)(40460700003)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:22.1872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2bf4c3c3-deb4-46df-488d-08db1f1e363f 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: DS1PEPF0000E631.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6724 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) v3: - Move changes to create a common colorspace_names array to separate patch 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 | 14 ++++++++++---- drivers/gpu/drm/i915/display/intel_connector.c | 4 ++-- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- include/drm/drm_connector.h | 7 +++++-- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 7ed48f9cbb20..2581cab7f936 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -2043,9 +2043,12 @@ static int drm_mode_create_colorspace_property(struct drm_connector *connector, * Returns: * Zero on success, negative errno on failure. */ -int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector) +int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector, + u32 supported_colorspaces) { - return drm_mode_create_colorspace_property(connector, hdmi_colorspaces); + u32 colorspaces = supported_colorspaces & hdmi_colorspaces; + + return drm_mode_create_colorspace_property(connector, colorspaces); } EXPORT_SYMBOL(drm_mode_create_hdmi_colorspace_property); @@ -2061,9 +2064,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); + 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 c77e42408522..693e4cba9cb5 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -1886,8 +1887,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 Tue Mar 7 15:10:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163914 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 D3537C6FD1A for ; Tue, 7 Mar 2023 15:11:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C39DE10E504; Tue, 7 Mar 2023 15:11:35 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2071.outbound.protection.outlook.com [40.107.94.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id 52CAF10E4ED; Tue, 7 Mar 2023 15:11:24 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ddUBHnv4XnHPn6aAtxvDlavupRWQmHpwzGZnIxiWIKM7vBcpBm4bzqmTWgZnZANMSVlawkuLTum5io2KdTNEXAAlPrVfKYpQt9Xo7OYqcm/RFpGx86+dyPaJ2tULwC9oNtyRTtms3Lb28IN6p9YLz5YOmZ7QHXcCuclsmjVpJg0Pa7/KfUARx7Q0XufY9oDsrjM1lADYbymMQ7p6rKxVeR4KYvvAXseNcS+0Q28OuQTWbfCqcA7gZWoJL9/MN+h4+3/KURFQSMVuznRgbdXU4Pr6CKIhgkvW8zSvrn4Y2kXyDydVo7W/MoCG5rdecLJcwRaMm7t8jyrFj+KsllgKyA== 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=glBgvLWPIMnRcZxl1wQFqvDI2YIFGh+mMkDjGFiJFoc=; b=R9j5qo6haSwDQJLwWzeB0j0uwyIhnNEdaLGQ+GmVr4J2MySdDoaKCCimNjJGaP8WDEUv8gJRg6+Ehhc8qKBl7uZss9anGAzYqHmKZYdw1GPNLF/dTbNEVrvLf+iO6KgpcYKoYxRNg4ysQQRkUyj5b2F0OM/OFUPCOzYDRlfZCzKVOQyw1X4t28eVD0EC1/LiCMNcP+s/+y48SyqUlkRg1MVd6mjbPj4CSR9ROjWucDTCC+2H6y0nAGAnjvyEZKqi3zDltT+3PYIsFdKfRymOdoEvOTgL/z3/iXEXbVRevnvGfnoosNOqTpKpclzltkz+WQzYmPG2arwTiSfXwZf4nw== 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=glBgvLWPIMnRcZxl1wQFqvDI2YIFGh+mMkDjGFiJFoc=; b=zH52+mySnf81hcAOfMutJ9mdgcoCfSS58gfWzJSzm7Mvd5xmwqUK0sGZLDuGABDXjfUh268jQ7kZg6shs7RwFWSIadZuc8yl92H2tkR/PCG2UwJq/QkAoEk3yC02oldP1srYwzANwHVImVOWO1rQIG+YLCe+G6yK7PijRmsb7p0= Received: from DM5PR07CA0049.namprd07.prod.outlook.com (2603:10b6:4:ad::14) by DM4PR12MB7598.namprd12.prod.outlook.com (2603:10b6:8:10a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.26; Tue, 7 Mar 2023 15:11:22 +0000 Received: from DS1PEPF0000E631.namprd02.prod.outlook.com (2603:10b6:4:ad:cafe::2e) by DM5PR07CA0049.outlook.office365.com (2603:10b6:4:ad::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E631.mail.protection.outlook.com (10.167.17.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:22 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:22 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:21 -0600 From: Harry Wentland To: , Subject: [PATCH v3 08/17] drm/amd/display: Always pass connector_state to stream validation Date: Tue, 7 Mar 2023 10:10:58 -0500 Message-ID: <20230307151107.49649-9-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E631:EE_|DM4PR12MB7598:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d32ca27-9802-480e-5841-08db1f1e3690 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1sIm+iu+/MCSDUDnQUHxypsl2DVkVq8dAFgpjx0COlXzmaH48JQPGbqw0s8ukhuLu3IX3XRH93B0et7Mln2asBIEtd4ABIR9yZfboJ2R1kFZ8UceXuXoKNku/uXUeU7TMigxl8KwuANebU/B1agpVgOObYaDJVKuH6eIGaZ2zqfv5iYbY+4dDyBoE9aGCg3X7f+XqAscsUTursDEbq/V6ptXG0Nfz5f/w6jytRQKxqj/qwVZxFLs/yb+xmEZCVunIuYDzTg7uWl6gHz3/YomDank1tEMM4F7A4PO9XjEdlGSIprJFkI9iJxAn6QkjY5WjHUBZdoJPH9ZcsdoI9jXMjCu2KoIsfSCW/3HKlPqhgdGsiKFmULnmb+IZyBbmui7zFRwV7kE6nM6SK/dxQVaiU8+Kv5J6YV5pS7Xs2caJ56atdyCJ+WMyL+Fv87/qJye5r628Eid0riPlRsR1nIfmVOZQJQtQjjLHAhnkkKzyqKtL8PdTNI6DDqrcN1N8nPpK/R6xhYQTagDNAUgveydBoZ4PCy/wQzQpOw2fX2UIASfaLh1gNxBXXSgxzuK63QJwIhDS0rIF/Y31qa3mf9EzqgwaChE/vUF0aOfBTEKRXe0yjtSRjQ1lTcxbaF+6kClT84as3mxFed4DKgzY042qR0cafr6vkXeMrwT7D5qrkttApa+BqsMZg1gWblP5+3xnnv/OsmlaQ0p2mTzLGRIVShFHv/g/vDL7I8AVsf3jgM= 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:(13230025)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199018)(40470700004)(46966006)(36840700001)(1076003)(6666004)(47076005)(36860700001)(426003)(36756003)(82310400005)(40460700003)(81166007)(356005)(186003)(40480700001)(82740400003)(86362001)(83380400001)(336012)(26005)(41300700001)(70206006)(70586007)(4326008)(2906002)(8676002)(44832011)(2616005)(8936002)(5660300002)(478600001)(316002)(54906003)(110136005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:22.7029 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d32ca27-9802-480e-5841-08db1f1e3690 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: DS1PEPF0000E631.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7598 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 4217ebe6391b..f91b2ea13d96 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5916,15 +5916,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; @@ -6541,7 +6540,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 Tue Mar 7 15:10:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163915 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 6A08AC678D5 for ; Tue, 7 Mar 2023 15:12:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A690310E507; Tue, 7 Mar 2023 15:11:36 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2086.outbound.protection.outlook.com [40.107.243.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3EEAE10E4E8; Tue, 7 Mar 2023 15:11:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MkiTfVGoJzFkR7gIKgZWhnnRzt1py8j6EDJ/4loFUqnN4ULP56yuQOyzpGH1iNOJSbtVcJImSqud2l1yzfnoA7HD9ysvHbQBjiIsLv/jAxW26LuINJlyLCB3ToqgqhRRSTSwKOqqZGohDUoYDoKFM3io/QjXSJxh+737OUMgX+nRNKaUlCfATQsAs3b5aq5UKPjRbW73s4+fuEDU7IuKJX3LiKF8BXy+WsAYkHLKi42Zyt93lqi4SRjH9YX7tovLJt2MQtA5z0lJ0ZulcsdaQaH2013b54dGhHPwVBkGM3DdTiO3SuOC0E9/2zLiBkrlYgJUuu0JYVBAIh2UncnsBA== 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=zZ0GG44IziKAl/NiSieEYFzH9v3uExI1fyfz5ZCvdcY=; b=nHwJe0Z8wySL2BvMWQ8u2Kw3nuP+Vum4PksKQG3r2QFD05tkwvTakcdYzwoBUdOOOc82k9Sm/bs3uAtbMfIYIGWxjzwNJ7mFtGNEe0Rt13hHYrpKR+vfEOib9Qc2GKh5ok9UcyRu1UX4/y1Nxbpxyyn9+CLGB2Rtc5yj/OER7Fw2DqkM5E4hJxTU8G1kpOLtIVSkzP7Ta4hUmnESSPRzohfLokQdl4Wx1UlB96ksb6MQOqRjNXiVyKeXm7P+ZWp9o3WlGqvK/gcuPhacX2QEXYOvZD8faWbWcbwU4A3Ge+PKOwfXxIz9B5TF0mlAmqzcC71nEzPZI1EvbikMWrKGHA== 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=zZ0GG44IziKAl/NiSieEYFzH9v3uExI1fyfz5ZCvdcY=; b=Gwr99g7DrrIlupbl+w83/gJidOK9pM3YpGXJ+Wi/tjx2XqE9aeFh1Bd3ceCtVtCixau6v4gmdO7dlQ88KF1lm6XYIZFc9W/yu2lhgZZ/vAxDYd7PLHRv+G9CspxVUMTMXEI0V5gR2yk/FovOogA7uUifhKp32qHpe0CWWapNQxI= Received: from DM6PR17CA0031.namprd17.prod.outlook.com (2603:10b6:5:1b3::44) by MW4PR12MB5602.namprd12.prod.outlook.com (2603:10b6:303:169::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 15:11:24 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:1b3:cafe::1a) by DM6PR17CA0031.outlook.office365.com (2603:10b6:5:1b3::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by 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.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:24 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:23 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:22 -0600 From: Harry Wentland To: , Subject: [PATCH v3 09/17] drm/amd/display: Register Colorspace property for DP and HDMI Date: Tue, 7 Mar 2023 10:10:59 -0500 Message-ID: <20230307151107.49649-10-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|MW4PR12MB5602:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f87348b-3402-4974-323f-08db1f1e375f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qMiqmfoK6U5afVxC8HQ2qDzUkS6PhI7lqA8m6De6XLDrW7DAXgWksFVfJ52W/mo4AEd8KkSadA1G2sCga7jXGZ3L9Zkfm+XGaOqaxVxqGcky13d76sSzJu3/dqLdca8WzJmDuf0DeMUVflPktXEF829R+v5sFzXZLutMy08oEAShjfGi/OgLI0Fg1E72b/jTtJr3g72Bu2XvETlugqGrn5QuFAs8xldynsIKiJjqbQyiAJStLd27eSUFqGvVNHw5iMli2ps/EL1MqXV8y7yHpn/pRIOi2z39g3lpcnJsc9QT1EiINr+IWwWBlhXbgkByx5r07BlthFU1VsZDE1fw7vorqMR9RJo+t0w46eHabD5qc8oGsackr5LoYIFA3GZWFhI3b03XNj7tDjb0Vjrt5yKJYDFdmeygHcik0z7/TRSqHhS1JmMgTSft4wxfmEPYrlY+RYEdGxZ30QpwjDLpDLd9vvgSdWByCPmR0lyR319vJRQOdsosQ6ZWGoh8EVz2Vah1ly7oH4yjvGQ6VUo/7J4SKB85ycYJnGZsXesJ37LYuBTXzbj0wUUUJBS0nF4fm4dRV1f34/mcMfaMgxaRLb9WkA0JoDPvd9iKYq6OO6mQscy/MDGuZ+qrq7GakNTgLglcUdsnAigSkB+NQjJ9aPwuwSgBLPbfqu27BCCMg6EQ+QDR/V1oFMuGBWVhBePbAhghGCZM5rPidMXmXI400e9DB1KXkuGXHcVizH/27HQ= 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:(13230025)(4636009)(346002)(39860400002)(396003)(376002)(136003)(451199018)(46966006)(40470700004)(36840700001)(2906002)(44832011)(8936002)(5660300002)(336012)(41300700001)(70206006)(8676002)(40460700003)(4326008)(70586007)(36756003)(316002)(54906003)(478600001)(40480700001)(86362001)(6666004)(81166007)(36860700001)(26005)(186003)(356005)(426003)(2616005)(47076005)(1076003)(110136005)(82310400005)(82740400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:24.0741 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f87348b-3402-4974-323f-08db1f1e375f 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: MW4PR12MB5602 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 f91b2ea13d96..2d883c6dae90 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -7184,6 +7184,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) | + BIT(DRM_MODE_COLORIMETRY_BT2020_DEPRECATED); + void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, struct amdgpu_dm_connector *aconnector, int connector_type, @@ -7264,6 +7270,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 Tue Mar 7 15:11:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163910 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 139ABC6FD1B for ; Tue, 7 Mar 2023 15:11:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D31D10E4EE; Tue, 7 Mar 2023 15:11:31 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2058.outbound.protection.outlook.com [40.107.243.58]) by gabe.freedesktop.org (Postfix) with ESMTPS id E34AB10E4F1; Tue, 7 Mar 2023 15:11:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RJU8ehnf+RnY5Q24GGfVnls0BCRDzqXk4UOIvRAefseXq0fTVTEOHACQHLXXFP4LQ3lHDFqDC6pWL7TWGFQydeYtD8aav3TktET2bauAd8SJwYyTnKDTCpe86yEyvQ/YXqGAzCqqIz0V9sYWN2mlezOYFUwQK5FbasQBoOMXR5WLxB8sBvVKFgNsX6pdkonLurKrpvDffV3y+Eg1kS9r8DWNhzvFJ6uK3muVEwUPWMd0b4Bg+z5NXg092IVgYqrGkNJa9WOnDxD556P9Vs3jdZvDkfH+9aPPDkWdZ1C1M0tjjU4mKZpqnvQLi1/ilkai05jMlKammJVXJ4klguv2zw== 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=CPxSj/pstKDQ+rZXBHydpSEYyEeVDl5eSFKBb26CKMA=; b=QjhhLBDsI1DIC0QTTbnyu0j6/vPRoljTqX953MWwxreUvpPG6mKnEHeOv4nZ1G9bdF4qfvBcWHlPav60dtushEAauHx+c0wF7Ae2CQ1sRalz+A9/2estBMGnLUGc6xdjZUTD8gztrcLBNIm89r92aZsBQnC8KYTYas+CxC9zDpOlJH7JIqt/SnLKGACCVGc/pFBxLM3NL9ePHBYTR4irzVGTcbMnP5mukqUED8dsAHFYZlCFfnqsJ0JgrLdWK/C8BSWrizWuLU7F+/7Ov2VW0Xp5kyoJBdNU6i8ahrmx0jxPGIfVV1bJv61xD+J3y6vr50vUIlYg8/W7blPJRvAE7Q== 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=CPxSj/pstKDQ+rZXBHydpSEYyEeVDl5eSFKBb26CKMA=; b=yhOHoqg/46fjshXDqEoHJZZ2+SbxOgOei0+j+aV+TUv/oc9nKX9BQmgGAayKv6AQ3ScgrIR7RMazHSVpVd1JDGtY9irYNKH/QCtp0FNUWTdb+RzzhWKbH020YpJsKpSl4fR5MBKi63oegK9sokxYifJzHqab0lR6VTqCgROgMMA= Received: from DM6PR17CA0018.namprd17.prod.outlook.com (2603:10b6:5:1b3::31) by SN7PR12MB8818.namprd12.prod.outlook.com (2603:10b6:806:34b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 15:11:26 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:1b3:cafe::6b) by DM6PR17CA0018.outlook.office365.com (2603:10b6:5:1b3::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by 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.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:26 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:25 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:23 -0600 From: Harry Wentland To: , Subject: [PATCH v3 10/17] drm/amd/display: Signal mode_changed if colorspace changed Date: Tue, 7 Mar 2023 10:11:00 -0500 Message-ID: <20230307151107.49649-11-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|SN7PR12MB8818:EE_ X-MS-Office365-Filtering-Correlation-Id: 9269e0cb-2d13-418d-993d-08db1f1e38aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iF6pp9W0xRqG9tkDeEgKyW9sCxr4hglGIbrxgqj740bL2Ad6j1a7EsTdmiT69HDm8lVsfhOdISXQQX7+P+gknSlEi0ohfLQPMA0Fony8cRzg8RnjHbEV716HN+PQNah5D8YkVsLw8xJy3ZjgsYQhapDuG2nCXmsYmL3PNQon6BxQYtfqFaB3zAYyOn8L0YbGHL6ZnoNMLrUVbOhSexCU8Xe8ZHrnDc548Iq+OX87qBBU83BVUXjmXyRLg2LpO/Tdnv5CL2NtLNXY3SiGlTDavra9eznpZcm9tMvMLXzGiBXgbnLbSGyoqEsYgy8fv+4g9AsW+QpMqiYkBYk8owbD9Sy/Dm0jtLQObVzrcrAwyO506weBlGKmG8smGxGysI5GCu86EIOxg/HvjezzaKGddzrqnLZvMoqXXihE5jZc8PcLwXA4KalvgMCDO7c2jd9Gv3wNbpietVE+00Vmx6o6CCwxukHVkcOMOOthf3/F6SeM5c5Jc3Ta/hclH6lOjPUchP66hgCrgD8JWNe5+O5PeJ9ecyi7v4fxCbuxgVW27lD5o+bI5gXoLF7e1RlZudNUPBvzZS16kFOmQBUSZv9toGyjq/3H8POtYeCytrTcsMEjjN1RAn5ymdUITI5rxtSA4zt2uilniYfsQUjCfgWgl4Z2k8oRXxUM3CoW9zql1twjsYnmubS3OIYObal0Ra2WWkstoyaIM0GIoGGpnDeGz3gPEKD9vagZelPxIOoAMtg= 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:(13230025)(4636009)(376002)(39860400002)(136003)(346002)(396003)(451199018)(46966006)(40470700004)(36840700001)(8676002)(36756003)(4326008)(70586007)(70206006)(44832011)(40480700001)(41300700001)(8936002)(5660300002)(6666004)(2906002)(356005)(82740400003)(81166007)(86362001)(36860700001)(26005)(1076003)(54906003)(110136005)(478600001)(316002)(82310400005)(47076005)(426003)(66574015)(83380400001)(2616005)(186003)(40460700003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:26.2460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9269e0cb-2d13-418d-993d-08db1f1e38aa 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: SN7PR12MB8818 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 , Leo Li , 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 2d883c6dae90..58fc719bec8d 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6636,6 +6636,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; @@ -6658,7 +6666,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 Tue Mar 7 15:11:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163911 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 582E3C6FD1A for ; Tue, 7 Mar 2023 15:11:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CF1A710E4F9; Tue, 7 Mar 2023 15:11:31 +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 B5F4610E4E8; Tue, 7 Mar 2023 15:11:28 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HWE92kyWKDrw/PR7/wL+OqI1w5+t8YRpvJLTiltjIe8qMsPePhUTnf5j+vv/22nP6EfKKczR4nILWKeXiVoi0un1poO6dh63eNFKIupEDSqWtkeHnSSa2CzxOm03YbS+7wFvrTkIRAcDDr/BRRC18IwBGsx2Hd8aIqAFOKLFQzT11aOUBJxJnK3fRaRcaBn6XwMLtja3xtH8xCQukhPGlc4RR80J4LVKZC1aMOQa7b6gBk1rYaPF32U2o63aLiAy/5zxsH08iZgN5D89j0stRdNaYoNQydl8rCFIdSb6Adc2W38lUGuAFWdjb5I19SG2jDxNQGN5emt/eoy7jZBFdQ== 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=FyLBXG83rw75iZ/awqCaX0+wOWij8tUvdiyX+Zo1tVw=; b=GQgc2oJblzjuiewhQqJE9YHb1tZPbqRfIDHRMgfgukHqcmxnN29ZcHzd/Y7iB01avSMJIecqmpDwL4NjKSACoceUq78cOIIAUSPwk6QnlyuojUf9kHoE3HtILL48LD3bTQ1JoFZdE+Ic8BDaMeB5XHx5ODNPHnhKbFZrHTrIPoSbqCkG70RUWQbsnqRtC/v5X+ZguXM/HSakenahYowzGerNG8hGktF9kuCQt5BnnT3AZ41n8XPNgmKixZMZc78WAPskLKHfvx3ErmEwIAw3m082bQb0kVeEvXS/051RVjV3G9cHYJFjf8k7mUq0vqPL5+09L2Zaj8DQQN8J+DF2Uw== 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=FyLBXG83rw75iZ/awqCaX0+wOWij8tUvdiyX+Zo1tVw=; b=tF1lgm0PNnM3cRY4XFvvAO/4VpIsTX4KCaNMBngqTVR8nu73ceho3KPCRW17fRVvW5GhJug7ycYMy/vxBLUWL86zwrzipAnrVEdIwULHOGUOxrGa0uETN42DnU2NWBdFp5FI6qFN3g7KK5zM2Cttg43v5Bk/6sWuBvwyqANVfYI= Received: from DS7PR03CA0282.namprd03.prod.outlook.com (2603:10b6:5:3ad::17) by PH7PR12MB6859.namprd12.prod.outlook.com (2603:10b6:510:1b5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 15:11:26 +0000 Received: from DM6NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ad:cafe::b7) by DS7PR03CA0282.outlook.office365.com (2603:10b6:5:3ad::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28 via Frontend Transport; Tue, 7 Mar 2023 15:11:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT039.mail.protection.outlook.com (10.13.172.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:26 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:25 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:25 -0600 From: Harry Wentland To: , Subject: [PATCH v3 11/17] drm/amd/display: Send correct DP colorspace infopacket Date: Tue, 7 Mar 2023 10:11:01 -0500 Message-ID: <20230307151107.49649-12-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT039:EE_|PH7PR12MB6859:EE_ X-MS-Office365-Filtering-Correlation-Id: a0fa56e3-a8b4-4b4a-bfa1-08db1f1e38c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: baU9navLFLOcjF5Kf9oTr5mtp5KPmoVDZWEqaO7F2/aZWNZVnSPf0z1VAl/aI4L/3KLTEoubpZkpC7PL+XWoeXozA7MRZJfJM0HgWB7wGL/jntSr7gKVkXdOhR0dyR0Pnr1hdFYCoo3KGRqqRZ9W2bwZKJstO1BmiVmWStaQz13jS5Mdg/mIoVGUjaFLFLmXNhnnRMdAhADnZYCYM5524tSL/oAUqSeK+7BJeu0sF8LJQubh5YravhWIHis0f2paxfDwtT6qvESLJyjy8CoOaWUikaxu2br1W7s+gRbiu/KEdWG7ADbevRBGGFOlmFElnDKmpKdadVxHSrqBRGif25BJFDyFE4TO74wMO8K8SVd+Sm0cYSWc37zBsNevp7Usgg1F59Zsn5nv2kohl6ip0lRpwzkvWFOO8EVdKN6NdYkcRfXZgeHPexIDRR1id1dAudvxT3Oyu6q5/Fv7C73qGx17JUbC9Zd0RHENCPU9juc2Gvhn1MyIwbu/Pygx4nvptNPznhbrrqkcaGmHo505nuPn+By8UOpzgeCVE/ghgkQhNHcgOUXAWqQa4b/mNh6l5xPJLVcKK6M6CAP7VAp8dO3bja993GVP5Xw7FAvN8IfIEICTsOuktZ1dmgBnmFnfIKLaTdSSUvFjX06rf1Tw3DIQCXWB1S2K36SUk51fZS8abEDk3XkIZsrqll3M+Ec0I0QvKdY8xQ4/6Z2gCP5+XIloKqB+1KX4bSECkEhPES4= 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:(13230025)(4636009)(39860400002)(346002)(376002)(136003)(396003)(451199018)(46966006)(40470700004)(36840700001)(110136005)(36756003)(316002)(336012)(83380400001)(54906003)(40480700001)(82310400005)(86362001)(2906002)(70206006)(40460700003)(186003)(70586007)(5660300002)(82740400003)(44832011)(26005)(478600001)(8936002)(8676002)(41300700001)(36860700001)(4326008)(1076003)(426003)(2616005)(6666004)(47076005)(356005)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:26.4239 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a0fa56e3-a8b4-4b4a-bfa1-08db1f1e38c5 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: DM6NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6859 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 58fc719bec8d..cdfd09d50ee6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5302,21 +5302,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; @@ -5329,15 +5329,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: + color_space = COLOR_SPACE_2020_RGB_FULLRANGE; + break; + case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED: + color_space = COLOR_SPACE_2020_YCBCR; break; } @@ -5476,7 +5482,7 @@ static void fill_stream_properties_from_drm_display_mode( } } - stream->output_color_space = get_output_color_space(timing_out); + stream->output_color_space = get_output_color_space(timing_out, connector_state); } static void fill_audio_info(struct audio_info *audio_info, From patchwork Tue Mar 7 15:11:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163912 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 197E0C6FD1A for ; Tue, 7 Mar 2023 15:11:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA8A710E4FB; Tue, 7 Mar 2023 15:11:33 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2052.outbound.protection.outlook.com [40.107.94.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id E827010E4E8; Tue, 7 Mar 2023 15:11:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YzJUHNwD+mtf39bCv0qhY/R6+RlKE3swixcwfPlaKbMK9JwQEEhdZTTBYh6Wd414baZscjnbzHwLFb1FiVRZ6ouSsSkPf5ZCBfYMO8I5II2OsuAFX/zGA47olH9/7ml5HeJsLh0wSdqNTics3JAzHazI4RWLNgu+F9sRd5wdb02e6fEQVHPe1cCj2mVjcA0Q8U/pvfPKkOyIViUDo+GsXcBfemi7reVI7f9R0Z2k8oT+Z/eAde6eIks/DA5Dchg53PsesFd7LX1x+bejQtffy/gizq9eG5nacnJQ2rqm4ZmtpMH3o1xx18mTrsStu0HSm8JSJFiCOJ5/rnp+x3IDXg== 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=QcWJCpvm7NquZn7xsFYACNDtwaet3l9Y3zKd3ejWv8A=; b=Esr0x/Rs+rkraE19ZIIv4aGL3DlceHHYBQll+pQGhjEKT2tL66EzGofLPz3TNG5n854wwnKRptCNVfHD6WqUbTRK6zCSXpzoFKClb6TspOeoR+iEmQFI0pqFC40cHz8dp5bTfHt0yDa7Zf+MasBXad1kIXPZ/NZi3IWm9ORtTNq0UwSf2I95R20/tcV8r0BZPpFoGZ86Y0eZiU/g+QjgETKRZpiCgZ8W/QwhWGNVXknlV2oV2KNA89QoQ70XOElIEUt6/RqxJewlfg7iGdl87BfhQhaQYxDyZWaCfCl6ixsZob5qkeq8WApg5mFJU/TqFFvAGJytOPyRUmlIkLBD7A== 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=QcWJCpvm7NquZn7xsFYACNDtwaet3l9Y3zKd3ejWv8A=; b=LN0AlI1QHKjpg9F8A0DkgQzdBh+3G5oL3uhS9LuBPiUR1rfSsEWneNEi07m3xMEkDrdqkebNsUkB7DbiUX0SxWxQwer+YR8xIvvj647EInby4JEPpXym48EvlA3J/uNY+lCYgejHsUFg4iJAocg6hwYTZMcdH6qgAcklxTBkHIA= Received: from DM6PR17CA0025.namprd17.prod.outlook.com (2603:10b6:5:1b3::38) by IA1PR12MB7639.namprd12.prod.outlook.com (2603:10b6:208:425::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 15:11:27 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:1b3:cafe::44) by DM6PR17CA0025.outlook.office365.com (2603:10b6:5:1b3::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:27 +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.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:27 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:26 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:26 -0600 From: Harry Wentland To: , Subject: [PATCH v3 12/17] drm/amd/display: Always set crtcinfo from create_stream_for_sink Date: Tue, 7 Mar 2023 10:11:02 -0500 Message-ID: <20230307151107.49649-13-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|IA1PR12MB7639:EE_ X-MS-Office365-Filtering-Correlation-Id: f4494c54-f947-4e28-5618-08db1f1e394a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y23G+Y3p9Ts6xQqB+qDwhtKiwUdO6EFhdqW0vyQJfPxB2Bgyh2KuKAzzAvLyVZzF8ps8ZuduUEUQ5EajHjwfU8sG8lt0pq6yC6Gt33Tam/oKe4ObkwBdOcHIBiwP/xcOzRCh4ZUVdivoMXEWPpcKIY/Eawza7zspiIZJow1BtCrMSlVI+aeLR8vubThCvY0NumTYYenKOqunni413WNf2pznI+oFp86F9tz2GLMtNbvuQAdDYaUkd1Cimhs97Dp9svO80j0cA4y/7dC7I24nAhnJS9iQ5pLghzKs6UmTRC71DaOZTjRjSkpAcrn6rJgHd6/+yWjSbn+jgi9K1DXpkLirXjZfRja5YOoOI/9aVNQBZlbb4xdKkFjY//MP0R5arqvagoQZWRfMg2/LBKsmS7Dcki8FlYqT5XxjZViWGdVZN8qf/b+noP8VBgOul0de6dfNr6J1OTWvB1ID/RieifhTWotG75NC113SGJWn+Qgx/PZc1tnVYPEwhHemvhmIELNEHbUzx+nczPBxzB0NKumlfvdRQSQTK6eWZ2O/ZcRKmGtwh1xL06BZ9rEulosF0aPwIKmZWI5YI4Tj0IVujN5zCTf3+iXSPPpP433jnO9v04vVSYbAfYzYPffeyrOzJhsXGqgs88ck6ZId9bBL7WVwzvGguXEn4TUJasRIF7kWSpQn2G8VcBm4vHrssBFiYFLPh0LfwyIrCpiMEbrAj6d9FfZJVOX/I2hk5YTR2k4= 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:(13230025)(4636009)(39860400002)(376002)(346002)(136003)(396003)(451199018)(46966006)(36840700001)(40470700004)(8936002)(5660300002)(44832011)(70206006)(70586007)(4326008)(2906002)(8676002)(54906003)(110136005)(316002)(478600001)(6666004)(426003)(36756003)(47076005)(36860700001)(1076003)(26005)(2616005)(41300700001)(81166007)(40480700001)(82740400003)(86362001)(82310400005)(356005)(83380400001)(40460700003)(186003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:27.2928 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4494c54-f947-4e28-5618-08db1f1e394a 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: IA1PR12MB7639 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 cdfd09d50ee6..580d076b7749 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6010,7 +6010,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 Tue Mar 7 15:11:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163918 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 419C3C678D5 for ; Tue, 7 Mar 2023 15:12:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F04A010E587; Tue, 7 Mar 2023 15:11:42 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2041.outbound.protection.outlook.com [40.107.94.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6924510E4FB; Tue, 7 Mar 2023 15:11:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hWfXC2WPrVQfTw0NBttB4dFXHKFYTyYo/mIcap7yG7MhY7IanL50TWtjFC3KH/XKJAc/I0JTEL7eyazU1mGmWm7SChDyFvjX5i5H+Hbln6oPIWOozm8m+V6y1DIaw9Yi23YWTcJe8cKb6OVd2jcFROeQ0jrTXgyH66pS4hHhPOkM5TP7gk9NAsAko0anWxQg5HAjxctDn6uwSvkIXwdPU14k7+PmAvKozY1AjCqzeDUVe+E6H4BuxFp77t+EQzhd2dKdJM1MMFmSXzy8uZRiKtSrmJeaeZ7zQDvZBvQainfZeG7y6OJq5LXLpu6Iz512ZwDepXlGVxGpeQB+PeA3JQ== 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=y30C2JvYRcfb9xciR0essyrGh5araGAvgr07uPTHjaI=; b=BfYJby2A6xd0wLP3/yHlRjlRiyPXJcgU9FCYOsqXdbBIakiE9U/LbSGVhmEGv2XTPa8bmc1SB+aX41kaAY2Xay92/AJkr5VNlWCPpjoOFHoIEgJfzyxTd1n+qEFXqtRDbfl1R9JEM5swskHa+AeQKZAHMqMOnF6tKEUO/c1L8HRRmQhImm8mR/ICxedlYVzxIA/bkzxpvdIB21iB9cH74PyyEKAQEEWOQLojVqd4ZemF+w6cOjO4LSwIjiM8Mhqsd2t758DHCiI9IEzhlE5iqN89GI8Ec6Gp1fYlTsSgZMQuoZpIGgNMCIOqj7Ea6vGClG6y/M/OI4ySHmtKDWztBA== 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=y30C2JvYRcfb9xciR0essyrGh5araGAvgr07uPTHjaI=; b=zMYv/85l+TCtODHtexYbSvYyoTFFxvDvYcKTJ0lvxHq6H2+mZNn8RCCTHVTfcxb2LXj5+rlkgLUjlZ5Jpzc6sdml19fExm63gK6s4hfs8lQo7K2lbsCGvTaOJ6LSK6Z1SXXt1yuRO2kD1VWnn3dVlkCnUZQctT6MmZGG6h7V2oI= Received: from DM6PR17CA0012.namprd17.prod.outlook.com (2603:10b6:5:1b3::25) by SJ1PR12MB6243.namprd12.prod.outlook.com (2603:10b6:a03:456::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 15:11:30 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:1b3:cafe::eb) by DM6PR17CA0012.outlook.office365.com (2603:10b6:5:1b3::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:29 +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.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:29 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:27 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:27 -0600 From: Harry Wentland To: , Subject: [PATCH v3 13/17] drm/amd/display: Add support for explicit BT601_YCC Date: Tue, 7 Mar 2023 10:11:03 -0500 Message-ID: <20230307151107.49649-14-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|SJ1PR12MB6243:EE_ X-MS-Office365-Filtering-Correlation-Id: 41d3294c-9df5-49f1-094d-08db1f1e3ac3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 59nhw3OSdRgXtZ9XRxGaKnhEo2wC9Z8i4emyZHIk+jJlOUmofri6LI8BD/zJ5qypMQ3bO0EcsU8GVMi0lMXU1dRnUvv61fkEas5+jHMz6ZrCf89T1aFDXr3q1qT3vRRteCcHSoSoIjaPR5jO1I9MhEDHBUAATZXsV6NjgpLZr+h6KVstiTqNeSC8EHbQBugEaV2pzhjZbG7zIShSPBOARbPcskYSFygWxvBbUuAb6tEHRz8Uu+gxmClh9fYQnc3x3et4ZDwR8o2dWa+RZvqcMcOcJTnwzdw2r7/Z9emZhaddPr/AWqWRF9XIT2R6akPeSThmPXVYDt3yTdEQWZKOkziJ4IJT83bQ1Un7OdWQKK7r7QSW8Ft/ucpXg4Ox70R2Jt1VlmPhhcAOsKcciayFx1p14JC5vTnwzh4osVrHY+C3YBSk3bayBeKYYoxSeIxmXYpNOGVONg7++qm+qIpisMzXuyQji8CrNKng7ajJgGZ+29tzLF1uvidkmf9KwC+f+8Z2ArAuEtyknbwIc3+hPnjyAxOHkKMTl5nXwHEyHpQZ2H+OL1GmMVDVkf9+UGrYqf/LHDoFhBHFNVU1ELuzsPsj733sV08b8wDArsX/BbBRy+R81bgvjKgan4ie4uc5WyPYDwom0L837RBFliraEcKCnBvtqnZqoUwtTnF6tfL00qRBaMyiwGjkTmXWQC3v+y9FwqlO2zILrXUkmVfDrFSASRXtTt5EOhIsqcQ5K+8= 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:(13230025)(4636009)(39860400002)(376002)(346002)(136003)(396003)(451199018)(36840700001)(46966006)(40470700004)(36756003)(70586007)(70206006)(41300700001)(4326008)(8676002)(8936002)(44832011)(1076003)(2906002)(5660300002)(86362001)(82740400003)(81166007)(36860700001)(356005)(40480700001)(26005)(6666004)(110136005)(54906003)(478600001)(316002)(47076005)(82310400005)(40460700003)(83380400001)(426003)(336012)(186003)(2616005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:29.7616 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41d3294c-9df5-49f1-094d-08db1f1e3ac3 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: SJ1PR12MB6243 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 580d076b7749..7f77e226f1eb 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5330,6 +5330,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 Tue Mar 7 15:11:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163919 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 5FE15C6FD1B for ; Tue, 7 Mar 2023 15:12:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C8A5310E584; Tue, 7 Mar 2023 15:11:42 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2074.outbound.protection.outlook.com [40.107.220.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8C5B10E501; Tue, 7 Mar 2023 15:11:32 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iFu/SgCB746MMYRhC9xS//6dOfI8MPXiIv4JQXiG7YQB9qHlEHEfxgZwvS8zQEtAmiHWrqd3cqynzXlxfoH0hK4wnuPQ+9U5G/2jtazeS8pwUQGfnyj98OJrln2fjAQ2dP5xNAqXXud0+yj6mA4o7yd/ANa+py/aCabEBEKCO3LPh7VYdHDnmKtF9hCCkyLWM9BnJ0VembPGj4CKuRttFfRnBFpOWu6HArhuc4ITJPY0zZemJ2zw7Pd1AmD9FhlAiQKIF+FewTxCeYv6HR4gA9Ho/nADqtWHQRb/5A5rDwu0bELsInAbIStxnoJUt7JmYZ2xi3ZThqAxxSBrofQVNA== 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=kPUydsJ57swfTrqdb7Iz7Vi0iJfmOTUroLX4rBCHUS4=; b=NgwkUBQ/SEwaBmMo1oYwotof08Iq4rOZAvun4wUOC4Czyzsbl1Wftr54HLibHQ0gMbzj++wrPXAXw6uLnmp5JncrS/ZBfuhQK+iyd3Jdz+E4nA7ICKGaUV//zXmlNkVULjwRmHED/wOEddK+yzQf1RfIUI/67v/ankIEhIjZ3mdyCZgvGd6IsGie/8TyK/N2vVdhNZpn/rUs/LIchJiqZzV0s0RoCjM8h7xnwiviOu/wm9UlRRu5ktkq9slYDdXsq8FYmiFm6BahbicKH0IonrEB4DOSGp+VcRJ45VzMRJs+6GGufjZHfmY3gQbEoNBWLiDVfqXdYCwxON327aDH7w== 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=kPUydsJ57swfTrqdb7Iz7Vi0iJfmOTUroLX4rBCHUS4=; b=OwDH6+HupvW/3U+5MNGjXKSqi/0cyUzxmM3cfps5mTRwmu4rtQVwlfBgqD1gMDkAYuvZX9AizSPPnhQUxSf5eJaCbeXP1YDScDsGsBC/QVvLnh3aa7cmAQfkE5W8Cmeue01Kh5pWzEQHpfOhehq6tYx69Cux8a7QwYOUUX4UFjM= Received: from DM6PR17CA0030.namprd17.prod.outlook.com (2603:10b6:5:1b3::43) by SA0PR12MB4480.namprd12.prod.outlook.com (2603:10b6:806:99::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 15:11:30 +0000 Received: from DS1PEPF0000E633.namprd02.prod.outlook.com (2603:10b6:5:1b3:cafe::9e) by DM6PR17CA0030.outlook.office365.com (2603:10b6:5:1b3::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:30 +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.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:30 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) 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; Tue, 7 Mar 2023 09:11:28 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:27 -0600 From: Harry Wentland To: , Subject: [PATCH v3 14/17] drm/amd/display: Add debugfs for testing output colorspace Date: Tue, 7 Mar 2023 10:11:04 -0500 Message-ID: <20230307151107.49649-15-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E633:EE_|SA0PR12MB4480:EE_ X-MS-Office365-Filtering-Correlation-Id: ed336f66-7e2c-4bf0-b3f9-08db1f1e3b4f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yz0gWNIQDtvdnocT9YuQTKEyACMFEpu60klOloHn8eYsJWpK1Un5UEpHa9XHOkWggiTOS5mWhPxgdWPXbxloIIMa/e7rLDU2w+CYajeFhozjLaSPOVYkitJSG4qRHO64GxSb7gwLOQ3EbUr4V0lbPdl/TTy4iYMJOVuJP7FyW3wL7F6yEORmRmapJr86on4ur4O9detzl3z8xdz/hpbh49pQAlwhat5xRk8SljEuGLxkTpNHvP0olwRQSSZwySRplmHjgoUuT4KhjiaKd+HY1ZZ4mfNNNNARMV3keuZ7jTgEXq38uzrOWoGthSb+Or2q9nUuqMi9MNCN9kTX+fM26kjgcinkjnS8EOTXem4pzLqmXhWIYuEJw9pl2K95ylK7fXD1/LuELSXwOz/qG+HSnQyZb35jalDccfMzsQLHXdvz+O7LvIk253+VFRW7jifZ0PTZRnNkptbhmgc8265QgqItyjIfvwJuCnbQ1jwF5TcFXk8NSx+NZmpn2d5S1t5qtGmjUuCrBTYFRQgYfIaqu70Lk8EpACgSz/lUYFe/yB2ALpLDmg1J/oyjgVmKuNC4AD7mPEMlWnt1UBKAaiiny9Xd5wWukeWhtAPewdHa3qbXwUNkYQFdpU4+nuA3fq8+A2X4leN1xiqv3J9mlIatJmmVlRHYx9ty11xML5dAD7s8StjTftsWFBgsmsWJni6eTZEQ/Mzx4mcFUld6fk9ZKTv6tm0pemu/YcWSGMOhc6A25PUhrUjvh9CmFvqHoofox+sH2Vt2gCQGpPdrftEKuGM7rhFbEN1FerNhrmzyLpk= 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:(13230025)(4636009)(136003)(346002)(396003)(376002)(39860400002)(451199018)(46966006)(40470700004)(36840700001)(8936002)(5660300002)(44832011)(70206006)(70586007)(2906002)(8676002)(4326008)(54906003)(110136005)(316002)(478600001)(36756003)(426003)(6666004)(36860700001)(1076003)(47076005)(26005)(41300700001)(83380400001)(82310400005)(2616005)(81166007)(40480700001)(82740400003)(356005)(86362001)(40460700003)(186003)(336012)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:30.6835 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed336f66-7e2c-4bf0-b3f9-08db1f1e3b4f 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: SA0PR12MB4480 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 4a5dae578d97..f0022c16b708 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 @@ -906,6 +906,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 @@ -3235,6 +3290,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 Tue Mar 7 15:11:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163916 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 68BD0C678D4 for ; Tue, 7 Mar 2023 15:12:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5605010E501; Tue, 7 Mar 2023 15:11:38 +0000 (UTC) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2079.outbound.protection.outlook.com [40.107.102.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA42010E504; Tue, 7 Mar 2023 15:11:34 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YBcULTTEyFqbOobrm0lgbuiIvE6fNBWhKtXP34jIffWG+/clYR2NjvW1wAQnkue/siybz58AcRT5hfyU06D9e7TLPv+95n6EJdMMSZZ4Ujmo6xkDwU1WlAFhBaPYPL2zlTvDQuKPq7Dy9zZ48TUuzHxZixQVJf9l8RyUGBcdIbiH8yA8HuYrAlhQY8gUL3Iz9Xhl1lM99Ik2X9pmK8BrOINtdGye6jEZYGMSwVGbN80EJOQDLzFWbyOT2qEn1OAofqHrq8ImyImZYKErfd+dnC+LySPca/ewjJJY6U2tasV6XOSvbm40abU2FaRSR+6HFC2lIxY1gLeBS0dXmABW6g== 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=OZjQ/ElliK6i9TnKrvkE9vyEF0Fd4l+cfTzXdK7RCtk=; b=N4xB+rgbeNQRqYFIV5wIwDOjYpPMCGy51haHA0RlP8OfnoDlUqXD/DxGL8oDEIJos71jca303GYXH2pXtOmatYP5joZhvNHPltMSl0eoNi8DQ4J+eJq13J+6JFLW8b4k+m+uKhp3lYenwriexziKSU96fDtAEN9qA+Xw5d6dxyW3Fl+pMOAL10gA4sCZd8RK0R8pFkr0Sdco3Zz4t5MJUmLAz0KSUFAeUA09L+rTMZZbQmzq5yZ4I6CG+nLbHPKhG5xCUucdXKPfSE3G6RNKUwols6RyIrf8gvkbmiih0EGbo90zfIMxIrZPgFSr4DDf3hGw82sdKxSxujyHYuEeuA== 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=OZjQ/ElliK6i9TnKrvkE9vyEF0Fd4l+cfTzXdK7RCtk=; b=mV1hJbf1srBaeeHytLdklJM02EAEkoxLC5qs7SKtktI8rYMIOKimZQNtkxvMthuMkGb5HcbEb3rvouHJZR7p1vlFYtaomOj3RYcAgqDh7e3+gb7YESfVsQAotKjji58BaoO1nkErrDEHGDestkfXCETVc8ginQHAk8M8OgHccqY= Received: from DM6PR13CA0069.namprd13.prod.outlook.com (2603:10b6:5:134::46) by CH2PR12MB5004.namprd12.prod.outlook.com (2603:10b6:610:62::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 15:11:30 +0000 Received: from DM6NAM11FT095.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::38) by DM6PR13CA0069.outlook.office365.com (2603:10b6:5:134::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:30 +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 DM6NAM11FT095.mail.protection.outlook.com (10.13.172.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:30 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:29 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:29 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:28 -0600 From: Harry Wentland To: , Subject: [PATCH v3 15/17] drm/amd/display: Add default case for output_color_space switch Date: Tue, 7 Mar 2023 10:11:05 -0500 Message-ID: <20230307151107.49649-16-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT095:EE_|CH2PR12MB5004:EE_ X-MS-Office365-Filtering-Correlation-Id: ea495a9b-45c6-4d45-fe4b-08db1f1e3b11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cgkel1xEJMpCcI/j+Q/ToMOrUIWLzS79Vaqq7QMrkUuQM6kWx0V18ROOgVoQQYutiLg7SXwTn+6oSJzccVAxJre28vx1ZTxLEIGs5MZtRbTjCJl58D7PHUUT3VnFhgjL8HNVvQjfLW0qDhDAFw0/FOcYQNe1sUFEpiAUHjfFr2KmBIXj0Cfb33b49dF169lwxbcCVxBT/NzIQqv98n/CU80gRbHzUvfTHLGC5mqbfmTi71q8DC/cJTHngA/ogIMgriSEwKJpCfe/vhwWsTyw0pLIwaQhCvINkl0R9P4lWmX/siA7q1HtSTK/3/H/gW2ovZLBfPnkG2etDSRUPldR3LAO58auC0eo3rpQH3yqooZ10IceBzq2rvo6d041p/8KklNmNLHuccWUBTNmUEQ4bELfJCPrrvvRSqdFAeFkRBIfWPe2SeJ040qRdqJLY/SKRSZ1FulnY2tBcflMPh3b9TDV7h4pIyWEg9i7T0oPEsi3tdXdzKZtbaqKdd2H9JhwNYto56yJv3PGxcexiIB90eA7tc7IbI5aVjFXBvnQIR/QiFRE6vs7lb6ZDBa4qHfFcnK6AJnH4uBiZ/Ajz65mCCUfGwAAqwSMNhLXZmVW4d8odPK7jp4BAKxNACmZqEKAPM3va7o0oXW2Blm/wUNybJB2Z9EODwKqGw/sVIIVZSzKCXbpvRGrY8mQH3hwsagZILPf6U4XRM8LfQCR3nTAdO9QoGK+2Cjl1IIKAMTpyQ0= 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:(13230025)(4636009)(396003)(346002)(39860400002)(376002)(136003)(451199018)(40470700004)(36840700001)(46966006)(478600001)(5660300002)(336012)(86362001)(47076005)(426003)(186003)(36756003)(26005)(40460700003)(1076003)(2906002)(2616005)(44832011)(82310400005)(70586007)(70206006)(81166007)(8676002)(4326008)(82740400003)(40480700001)(83380400001)(6666004)(8936002)(316002)(41300700001)(36860700001)(356005)(110136005)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:30.2790 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea495a9b-45c6-4d45-fe4b-08db1f1e3b11 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: DM6NAM11FT095.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5004 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 7f77e226f1eb..a15b26962496 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5308,7 +5308,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: + color_space = COLOR_SPACE_2020_RGB_FULLRANGE; + break; + case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED: + 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; /* @@ -5330,27 +5352,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: - color_space = COLOR_SPACE_2020_RGB_FULLRANGE; - break; - case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED: - color_space = COLOR_SPACE_2020_YCBCR; - break; } return color_space; From patchwork Tue Mar 7 15:11:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163917 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 8900DC6FD1E for ; Tue, 7 Mar 2023 15:12:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B574910E5BC; Tue, 7 Mar 2023 15:11:41 +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 74F5D10E4FF; Tue, 7 Mar 2023 15:11:33 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SIJFvY93XceTe6Dt4nlzlemDk9IwIH0ShsICYoP8TwUdRQXJzR7KLjwnmQnFi4FISXq0+Iw6Dp6XSDz7fGbUIl4uXkeTfBdZvfbk4sVQ0DpzPncsF+J0ftk68Ob84YTQ/QgwrRXCbexxgobloQ623Z1Fs+Mj12lDj6lztEUK86gQQGwnNayJO174IL0JPe6X2Iwvady2SSHkRbMeUzqGojrdIGX97QeAtoIJVCb8rTMuUGMJGDrq2aoWEwzWjM6xBCCYKjeE14W0LASD7Ivt3p2BFRA18KxxbXj1IbW5fyDPD9nkB+Dpnt7fNeh6MTIMIgBTPWI/lWwjRNqGPfaz9g== 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=/HdVyesRcI6OoWo1nlZ7KABr+hq5iWU+Yl9X+Wtf2ow=; b=Optxz+zRtTpFVGt9FRTy0lF/HlfyNsy/w7QmvPQ7t7B86H044zYu0g+kWVQU8eaul8GZfOXf3HAzqiEcPzDfE6bg/Pk59+qLapn/NoRe3yE4cjCPZsbTNoQ4VmRx3H4zpnjNw7+V4h1Qac7T7eksJTfikGp09fDAYrsrYi+Khu8pOFTE1T1Att5BOpT3RedkE2YDjrfSkP3zNTX1B5w8EMvEZ6kpGeU1eJcNGHe7ir61w+LDLGsoqq50DCQ2bjB2iKx7F7r2tr0VQ3QfoAj/mFwE+SUCT+xiBc5CgK8RHlzfsvOqBrLpe9lC5teH7jw7M6vV/PjL25yCAHm8hr+xxg== 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=/HdVyesRcI6OoWo1nlZ7KABr+hq5iWU+Yl9X+Wtf2ow=; b=XIxpzfX3pbB7JKKTxHBI4/nGRloGwv1Bz0GugURAq5T7/8MogXdiHAoMNZz0raM4tdlOkUtxhgPxj9sT0shndVjf2smJSQ2Gdq30z80WMLVXOMYmFX2LpeUObqYSVKuKJJP70Lx89wgHEyQQCKaIfFYs4FPUDEhR0cbTW3YqWuM= Received: from DS7PR07CA0012.namprd07.prod.outlook.com (2603:10b6:5:3af::20) by SA1PR12MB8599.namprd12.prod.outlook.com (2603:10b6:806:254::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.28; Tue, 7 Mar 2023 15:11:31 +0000 Received: from DM6NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::65) by DS7PR07CA0012.outlook.office365.com (2603:10b6:5:3af::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:31 +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 DM6NAM11FT027.mail.protection.outlook.com (10.13.172.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.16 via Frontend Transport; Tue, 7 Mar 2023 15:11:31 +0000 Received: from SATLEXMB07.amd.com (10.181.41.45) 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; Tue, 7 Mar 2023 09:11:30 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB07.amd.com (10.181.41.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 07:11:30 -0800 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:29 -0600 From: Harry Wentland To: , Subject: [PATCH v3 16/17] drm/amd/display: Fallback to 2020_YCBCR if the pixel encoding is not RGB Date: Tue, 7 Mar 2023 10:11:06 -0500 Message-ID: <20230307151107.49649-17-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT027:EE_|SA1PR12MB8599:EE_ X-MS-Office365-Filtering-Correlation-Id: 43d9be23-a1d3-4ad0-1232-08db1f1e3b94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u0PjWXjkJvqjPvJqUQI8bUYAv8fOFD9B6ZBcfURaKOQ2cDkQDwkOadkwT4BYlv1O7/6qetU0aDyKDBLWQsjPZj9T9e5kfwVR3ERSR4GMj3WzmOX4z38LD55Sw5fd45zmL1pJu9Z4eyvQr7/Fadr9oJCzM/GJb5Q9E2zyibRRNZbhM1Hrj4d0qyGiqOibBzL/RWh8ZSbO38MA+L8Rfmsb9Rj9nJA6tM1hj1/fE7T5/6DzK3Y3lKw2RIZbG+ZCw2ops+x7jLRu/CUr8GWaEwgMaePOWNeqHJM+BXp0EaKAsamx1oyNOnxpnHHmrEkOHaZpWS049HI6TjcD+r2GTKeExPsdEn4LD61frkxt66CDKLLGb/7MeB4wNahXbNZWC4Tc3x1Hz5V36MX8SwzAq+UhpBnssI7x24S0vnTe9aVjGRbK+UEws2zjxqH7CV6p4rKLxLvYjbRzkzG4gOIUXvg8YVmVIgafaBV/hpaortdo69xMewcMLImxmhw0K+NvstMW0Dydfj44sMEPIs8EU/bmF634Z0O2GqNxhShi7QHCbdZ4/b6LOM9znjxh9AQrETeIZH6XG9SFrbuD0XlLwPI97+AW3zogSycNaDEdomBNPHdj3etIneURQ3yyc51pOPGjAfDkn8VreK2A7cZZkxo+q94IYgGcr8cg4z6OQzlxeDoBWxjC9FUz+DJkS+Vg93R4dv67zEDDh8agGJRiNp3crpaGP2e2WdrWaAcTUdWusJU= 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:(13230025)(4636009)(136003)(396003)(376002)(346002)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(36756003)(70586007)(70206006)(41300700001)(4326008)(8676002)(8936002)(40480700001)(44832011)(2906002)(5660300002)(82740400003)(356005)(81166007)(36860700001)(86362001)(1076003)(6666004)(110136005)(54906003)(478600001)(316002)(47076005)(82310400005)(40460700003)(83380400001)(426003)(336012)(186003)(2616005)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:31.1315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43d9be23-a1d3-4ad0-1232-08db1f1e3b94 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: DM6NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8599 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 a15b26962496..d5e1f3423cce 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5324,10 +5324,11 @@ get_output_color_space(const struct dc_crtc_timing *dc_crtc_timing, color_space = COLOR_SPACE_ADOBERGB; break; case DRM_MODE_COLORIMETRY_BT2020: - color_space = COLOR_SPACE_2020_RGB_FULLRANGE; - break; case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED: - color_space = COLOR_SPACE_2020_YCBCR; + 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_DEFAULT: // ITU601 default: From patchwork Tue Mar 7 15:11:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 13163920 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 A00F8C678D4 for ; Tue, 7 Mar 2023 15:12:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A9E710E4FC; Tue, 7 Mar 2023 15:11:50 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2068.outbound.protection.outlook.com [40.107.96.68]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6C03910E502; Tue, 7 Mar 2023 15:11:34 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xk9BGYRzmGmO3+iMwInGBGF0lf0u/mVy8Z89x7vpp2LoGeIIUK2TjxxyPk4ZbjmSyIWsagZYu0k9UkVGbgmQhgXMgyHU6BR9P487/Mg+S/PBTtKP9JSCN29LyJ23pOQH2F4GkKI/N+dcZOVPjYDO2MLtgT4UY3XUPW/bolQW5yPYYpMhL7Vm9lxEjJmy4PAzo8sHHdxmm+ai9+C41Bp+GxXkV89QOaBeHFVbgaqKKtO+aLk2+bWZsef5qm4N2yNMnxzAA9yOBVBQYNbnJOGP6L/HgiTZbmfhO+ush8eJawOhVF1mq7m+1gagzJfe5rqmEyfO1gOjyWD0M/A0YPIPFQ== 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=GBFhl951ym2UNumFe1k59ihjYJ2aeOvXEb566EniULA=; b=KHJNmq2LNNT8XT/hyxFxXRBWeOT08IypuJ15gOoQFzhO4ozsVq7CqdijC24Ev31V84ru9nRuJpi4ZcDqkqrgs2hIrPwdnkfyS3x/b81i390vvuJRXsRPGYBcUttXrXBm/gov8da4A+anHERdbQLcCNyPTSQg13PeFfchXUL3bSlVd7aZT8D8nCRN938BXUjdf2EwKNtIwotkAQ/drtu6h32uW0kDpHUBV79Eog1rRFkY68FkZx2lcLp1b/31rSqXRyv2F6q7VPKGScmyh5SZQ0/eNWBmE59hBkhR44mQf7P2EL+YnaMuYMQ/W2vu/CLykI69/KQXajLvo/jD8PBtJg== 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=GBFhl951ym2UNumFe1k59ihjYJ2aeOvXEb566EniULA=; b=qCQmsA2eeXo6I0aNRrTdKqiBeLiUAtGHzA9T1URPkgfvJJChUTOFJ07/vq2AXlV4kDzu3T0NnUk4PBhRDg/h7FBk93KOeghg2FwCRuYBHrsHT2ODRiAVtr5ZoAFBIwwuaulokOYVGdOjZezm1e8xqyjCyB5kQ3FOTBZbseaNu+M= Received: from DM6PR07CA0104.namprd07.prod.outlook.com (2603:10b6:5:330::30) by BN9PR12MB5275.namprd12.prod.outlook.com (2603:10b6:408:100::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Tue, 7 Mar 2023 15:11:32 +0000 Received: from DS1PEPF0000E62E.namprd02.prod.outlook.com (2603:10b6:5:330:cafe::f0) by DM6PR07CA0104.outlook.office365.com (2603:10b6:5:330::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Tue, 7 Mar 2023 15:11:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0000E62E.mail.protection.outlook.com (10.167.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6178.13 via Frontend Transport; Tue, 7 Mar 2023 15:11:32 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:31 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 7 Mar 2023 09:11:31 -0600 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 7 Mar 2023 09:11:30 -0600 From: Harry Wentland To: , Subject: [PATCH v3 17/17] drm/amd/display: Refactor avi_info_frame colorimetry determination Date: Tue, 7 Mar 2023 10:11:07 -0500 Message-ID: <20230307151107.49649-18-harry.wentland@amd.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307151107.49649-1-harry.wentland@amd.com> References: <20230307151107.49649-1-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0000E62E:EE_|BN9PR12MB5275:EE_ X-MS-Office365-Filtering-Correlation-Id: 571cc641-9db0-49ed-15e0-08db1f1e3c29 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1qEChgW9xGu+E30xYsXhgYr6NNpHq1y97RItmkjoXX7/Lo6qmuzstLBIDR6N5HwSZqqNoXJGuUD5FJ7JEojo/M/L+mKVXKMjlFHTUasIf6DBqnY1abfABDHdV2UUvSH7f+iDX8x4ppEQbCtoOtbGROlM/us44snjjq7wCEJJaSNv0Z4Rn2PBtI761PWyJiO1iLB1TKlqhXzNWoxlaDN6Nw9cokfGKf3s0wcJykWMBsSHWFMUq4DG8HOJYHkMYIoGN8Fxn+L1QObwEdrfDOvVaI584zQ2tIRlBaH96BpPzD2PAbD3daZgTyi2GzunpZg5kxxE7u1LQtLa8E3xqhgwIWMJEhZ3NaYTk9ZBx8ZuevIHzDvo5FXkJe+vOjuO1amNcjU2jWHUE2XtXZlQgJ32t2NxpbfRlS+75wmvXxVWnamn0Dzz+bF07bJACe+K0yBJgVTyUPYqHFyDo0t9fCi0uwNkLohMSXfW4C/r0mfwOBe9qLrW6qkrV4jgNAYKg0a6WvdG9r4gMSY+S+ptYO86wAXO9NdbbeONOogzb8+oh0ylgcMvFHjM9lR/lSNbKX1BlT2l4rQwza3alSqE33NMUhdjhkjr02BsXGoKqyt+nzJbpQiUtgO/9PzSHrtTWrhxi/t4gOTVW0rMB54Bur2fo8eU3CWSpIhwNH70qroWJB1S2cusJaZTwlZeV6Hxr8oytViWPHBqElFUJ4oFWDOC5zxHBCbWPIr3/SIjNfYrcbw= 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:(13230025)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199018)(46966006)(40470700004)(36840700001)(82310400005)(2906002)(2616005)(336012)(83380400001)(47076005)(426003)(44832011)(26005)(70586007)(70206006)(4326008)(8676002)(5660300002)(186003)(81166007)(41300700001)(1076003)(36756003)(82740400003)(6666004)(8936002)(478600001)(54906003)(356005)(110136005)(86362001)(40460700003)(316002)(40480700001)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2023 15:11:32.1082 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 571cc641-9db0-49ed-15e0-08db1f1e3c29 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: DS1PEPF0000E62E.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5275 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 d9f2ef242b0f..34a7fb225629 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 &&