From patchwork Fri Feb 3 02:07:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joshua Ashton X-Patchwork-Id: 13126918 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 318D0C61DA4 for ; Fri, 3 Feb 2023 02:08:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6F33810E700; Fri, 3 Feb 2023 02:07:58 +0000 (UTC) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01AF010E700 for ; Fri, 3 Feb 2023 02:07:55 +0000 (UTC) Received: by mail-wm1-x335.google.com with SMTP id bg26so2889912wmb.0 for ; Thu, 02 Feb 2023 18:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=froggi.es; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=cjUnx4x5mlPFG//GaXPZVIo0syw4My60NKu5onSFotE=; b=bcm3aJ2U4uNSZn1Xq44bN/UfqYkB2p/L0H3YUn3zOv7VzJ71D66cVE5oNLb6JnegpK xbxRZ0utia13PbDnTQBjEqDvhggs9bqHpxw/vEeZ3f1P5N0YL0o0DDpNtnCeBvFE07S/ xaQVXYSjbHSS4yvgPG/23R1b4Te0/wExJRa3JJBE4R24eEpTRNU5VS5jdCd9T8HYqzpW tSFS71DEcmHeaeQUv9hSx4zpK8WtMTqsTYqV893zrTN0ut4iisIo+r1DqlOADmp9XZ9T XSt94Wv8kwrUgGwGreTrNlnkuskpAp84/0JyeyItd86RB2IkFw6xuA74wV8+ZUXqzzKc xciA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cjUnx4x5mlPFG//GaXPZVIo0syw4My60NKu5onSFotE=; b=kBkkN+lrO7vc5bF/eQ5QUiKklR0NfXOruuII8T5fj72DfBm/hOaJh4IuYyaYONJ9gV r99QuUgBFr/5tFvzL7bcEHfxR40qNXE+oKM8x5SKZxOAQ3QLUubrPqZ9JdXXCWW/KTz2 tRDHyWZ6ao8viyq7hXyY0K9KHYW9TvN5fCnsMErxchL5Hd7RD+z6EaBt+l06qMIjSU7Q 4GHDLnFttx9yH7AAHfMJYmLF6++t7TBfvyPWIkqzyCRYu3TiNhB70P4qFhKfLTAl0juG h0rHpHxvyt1uRd8Jwxpu6M4GISvEOZ1gNVOt1eo81/AarEXWfRnmixO79IabEyJsFORJ xz5Q== X-Gm-Message-State: AO0yUKUhsJ1h41mPYzir2Y8lnQpMpuKl0GAVJA59N6XO/juq9mbQ9xMW Cb9ei4tgQuE9ii6xhYAIqRBjIzXY+Ff2Ylbpj+w= X-Google-Smtp-Source: AK7set8b/VBHTheGEa4fJf5wqglUijSnXyYcuC3BlzpWNGlEzW4lWBtxJ61BywZz1zaVeeTb35mbkQ== X-Received: by 2002:a05:600c:3d8a:b0:3dd:af7a:53ed with SMTP id bi10-20020a05600c3d8a00b003ddaf7a53edmr8309238wmb.11.1675390074481; Thu, 02 Feb 2023 18:07:54 -0800 (PST) Received: from localhost.localdomain (darl-09-b2-v4wan-165404-cust288.vm5.cable.virginm.net. [86.17.61.33]) by smtp.gmail.com with ESMTPSA id g10-20020a05600c310a00b003de77597f16sm1297327wmo.21.2023.02.02.18.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 18:07:53 -0800 (PST) From: Joshua Ashton To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/connector: Convert DRM_MODE_COLORIMETRY to enum Date: Fri, 3 Feb 2023 02:07:42 +0000 Message-Id: <20230203020744.30745-1-joshua@froggi.es> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sebastian Wick , amd-gfx@lists.freedesktop.org, Pekka Paalanen , Uma Shankar , Vitaly.Prosyak@amd.com, Joshua Ashton Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Harry Wentland This allows us to use strongly typed arguments. 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 | 48 ++++++++++++++++++------------------ 2 files changed, 25 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..edef65388c29 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -371,29 +371,29 @@ enum drm_privacy_screen_status { * a colorspace property which will be created and exposed to * userspace. */ - -/* For Default case, driver will set the colorspace */ -#define DRM_MODE_COLORIMETRY_DEFAULT 0 -/* CEA 861 Normal Colorimetry options */ -#define DRM_MODE_COLORIMETRY_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, + /* CEA 861 Normal Colorimetry options */ + DRM_MODE_COLORIMETRY_SMPTE_170M_YCC, + DRM_MODE_COLORIMETRY_BT709_YCC, + /* CEA 861 Extended Colorimetry Options */ + DRM_MODE_COLORIMETRY_XVYCC_601, + DRM_MODE_COLORIMETRY_XVYCC_709, + DRM_MODE_COLORIMETRY_SYCC_601, + DRM_MODE_COLORIMETRY_OPYCC_601, + DRM_MODE_COLORIMETRY_OPRGB, + DRM_MODE_COLORIMETRY_BT2020_CYCC, + DRM_MODE_COLORIMETRY_BT2020_RGB, + DRM_MODE_COLORIMETRY_BT2020_YCC, + /* Additional Colorimetry extension added as part of CTA 861.G */ + DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, + DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, + /* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */ + DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED, + DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT, + DRM_MODE_COLORIMETRY_BT601_YCC, +}; /** * enum drm_bus_flags - bus_flags info for &drm_display_info @@ -826,7 +826,7 @@ struct drm_connector_state { * colorspace change on Sink. This is most commonly used to switch * to wider color gamuts like BT2020. */ - u32 colorspace; + enum drm_colorspace colorspace; /** * @writeback_job: Writeback job for writeback connectors From patchwork Fri Feb 3 02:07:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joshua Ashton X-Patchwork-Id: 13126919 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 AC90FC636D3 for ; Fri, 3 Feb 2023 02:08:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CFF410E705; Fri, 3 Feb 2023 02:08:01 +0000 (UTC) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F28610E704 for ; Fri, 3 Feb 2023 02:07:58 +0000 (UTC) Received: by mail-wm1-x331.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so5076152wma.1 for ; Thu, 02 Feb 2023 18:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=froggi.es; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CB7JgucKeJ6phjSQlRY4scMyhMMpSUS4Rmo8NmixujE=; b=SwNhqEGTUaH2kj+FonmmL52VueekCZG7f4+4SnI7zaknfCbI7h7AAvms4I6h2jMe9c rOvtqPIpRzalBu86lrlnDnNvPlGoaFnJYeHIWzuZOik3xYd/Mh3wV4WPgeAFWD+SO77/ WbtRtNUp41tL3H/mCEvFDNDigf77ls+ySW6M+Lo2oTeIt0lDRywole8nLLdWncDRVGg8 bifMQq3Hr5S4VJj4SbG0Jk7iGSmtL0bgJKtkCboWxQEIumy+maFH1SpyGMZqtQGMSeoA uuC3C4OyKUCtzl8vuTZeshhpwpWTZkNlrRirMvvoX2O71GAEXZMo+1ps93ffxnYhgwCJ Bnzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CB7JgucKeJ6phjSQlRY4scMyhMMpSUS4Rmo8NmixujE=; b=xGiKBOuxt405kIUqcngem3xYYHlYCv7MN6ArBHQHWYVb5lESL3P+zPugqYLrfjtUU3 eI7onko9Ky7Y8b7rTCRlp9lJxtpR/LrSqx9gLCxQ+z2z9Ztiz7VGZ2326RdYAQ4cU96X eBcW1KkXOYOksxmPssTJJ4DPLVRSV6WjXgroDhR4LuNQtrjzpdW1aVS6lofaUYtqrAPh X2jOLWyrm6gxNJoRit+S4zuu58tmm4NBjaCMfHcQnTetentnulXjVd+6WrFPdoK0l9Or XGErECNFQbHjYsHAv6m8xvqyYUMYAmgP3bpMhPMBRhxxWbaSsquDvth2sOP/nLUi3Qb+ cxzQ== X-Gm-Message-State: AO0yUKXfr94Ge9LTOrvEPGU2LHXyXkEqZkrkgflcZi2eRfVPZmXo8mzG t8n1NrhyO6QnwrNlx4joaIlwYRgefs58MXnB X-Google-Smtp-Source: AK7set91M+xvFaOAFSsE0hJX+6hdQd0Y60s7w8Z/RJF1gp3q5Vs3/rNN+nEGEwKkjOg/5BXA0XzNbw== X-Received: by 2002:a05:600c:3d0b:b0:3d0:7fee:8a70 with SMTP id bh11-20020a05600c3d0b00b003d07fee8a70mr9310429wmb.19.1675390076978; Thu, 02 Feb 2023 18:07:56 -0800 (PST) Received: from localhost.localdomain (darl-09-b2-v4wan-165404-cust288.vm5.cable.virginm.net. [86.17.61.33]) by smtp.gmail.com with ESMTPSA id g10-20020a05600c310a00b003de77597f16sm1297327wmo.21.2023.02.02.18.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 18:07:56 -0800 (PST) From: Joshua Ashton To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/connector: Add enum documentation to drm_colorspace Date: Fri, 3 Feb 2023 02:07:43 +0000 Message-Id: <20230203020744.30745-2-joshua@froggi.es> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203020744.30745-1-joshua@froggi.es> References: <20230203020744.30745-1-joshua@froggi.es> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sebastian Wick , amd-gfx@lists.freedesktop.org, Pekka Paalanen , Uma Shankar , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To match the other enums, and add more information about these values. Signed-off-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- include/drm/drm_connector.h | 41 +++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index edef65388c29..eb4cc9076e16 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -363,13 +363,50 @@ 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. + * + * @DRM_MODE_COLORIMETRY_DEFAULT: + * sRGB (IEC 61966-2-1) or + * ITU-R BT.601 colorimetry format + * @DRM_MODE_COLORIMETRY_SMPTE_170M_YCC: + * SMPTE ST 170M colorimetry format + * @DRM_MODE_COLORIMETRY_BT709_YCC: + * ITU-R BT.709 colorimetry format + * @DRM_MODE_COLORIMETRY_XVYCC_601: + * xvYCC601 colorimetry format + * @DRM_MODE_COLORIMETRY_XVYCC_709: + * xvYCC709 colorimetry format + * @DRM_MODE_COLORIMETRY_SYCC_601: + * sYCC601 colorimetry format + * @DRM_MODE_COLORIMETRY_OPYCC_601: + * opYCC601 colorimetry format + * @DRM_MODE_COLORIMETRY_OPRGB: + * opRGB colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_CYCC: + * ITU-R BT.2020 Y'c C'bc C'rc (linear) colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_RGB: + * ITU-R BT.2020 R' G' B' colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_YCC: + * ITU-R BT.2020 Y' C'b C'r colorimetry format + * @DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65: + * DCI-P3 (SMPTE RP 431-2) colorimetry format + * @DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER: + * DCI-P3 (SMPTE RP 431-2) colorimetry format + * @DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED: + * RGB wide gamut fixed point colorimetry format + * @DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT: + * RGB wide gamut floating point + * (scRGB (IEC 61966-2-2)) colorimetry format + * @DRM_MODE_COLORIMETRY_BT601_YCC: + * ITU-R BT.609 colorimetry format */ enum drm_colorspace { /* For Default case, driver will set the colorspace */ From patchwork Fri Feb 3 02:07:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joshua Ashton X-Patchwork-Id: 13126920 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 6379DC636D3 for ; Fri, 3 Feb 2023 02:08:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6FFF10E706; Fri, 3 Feb 2023 02:08:02 +0000 (UTC) Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0894C10E706 for ; Fri, 3 Feb 2023 02:08:00 +0000 (UTC) Received: by mail-wm1-x335.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso2844897wmq.5 for ; Thu, 02 Feb 2023 18:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=froggi.es; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VXSQiHpGfYdrvyEEoaiuEk5XU3y8E6/bAvCTVd55IDs=; b=kz9a3PAmEeNVyhP4kYtwEz/+GaE3eOz3HXcap506ZRyLp31zr0yALUi2lgVzN9/5vP E4m6oR7Z+yswj6oDkBOEzQammzQI5TknZXNILwUp9tdAvOwQBE+qBoxx2EQL8hHyeyLk +emjRMXHUKBdjJkI/mt7/cL6yuHPYoVKmmikqQbNwqpcCv9+XLH32wstaB0zfpOZEXpN P57iu2szZwXLXWBYw7zRFpepnjmgEccExD0Pjn2R9mRC9Rg7dV64l9TKQXxvxUwCOA/z 0VPvxUJ4aCwrAdtEXCORfBd0pwTKzV0AHJ9he4rVjCWU4pI1L3fOu2G22WrzvM7/lPLu d1jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VXSQiHpGfYdrvyEEoaiuEk5XU3y8E6/bAvCTVd55IDs=; b=0e50bfR0VsTkX/5VRn5wIHYMBbtOLw5HMHRyg/FXg7Rqrf7dHxOiIL98BE2vSriIWN Bfyj7cfxcYtpS2eTjOJ8cWVOCDbx4Xv+2mZdowh3RNlTKAB76V4HcsMSScr/YsandK7Y ce9x7X8dEI1IOrhlVEYN9aOFz1LQuyaVXPgNge1gu4QypsMQgV+VViJKyWUyzYCrIv+N ka4sLINAi4KvY4wM3pXLOty31stQpPDqfcr7HJAnuAjVQoHZuxjzVhhd3UVapbJpo8FK ppywpkrdfORN5kbJ1I7IpDSyKajLLuhM9F1Mi0cmqvKGG6zz9VVL9ccqb5Oti0zU6XYI uPUw== X-Gm-Message-State: AO0yUKXPCmZKCOVK+ma3Q9O8zEqXvTb2a4vU9Qi0pl3i/2Z744meiPZ6 hAeBP5SbscHJ8AzsjVBgpvlLF0AuOdnToHVd X-Google-Smtp-Source: AK7set998dFbtbpFHS4Ar29rP70bL+nn/SkoQM+/oU3bzy8rcRLcEtNF6fwDpbobsC7Y9WrTn9BBNQ== X-Received: by 2002:a05:600c:35d5:b0:3dc:443e:3a8b with SMTP id r21-20020a05600c35d500b003dc443e3a8bmr8070730wmq.16.1675390078485; Thu, 02 Feb 2023 18:07:58 -0800 (PST) Received: from localhost.localdomain (darl-09-b2-v4wan-165404-cust288.vm5.cable.virginm.net. [86.17.61.33]) by smtp.gmail.com with ESMTPSA id g10-20020a05600c310a00b003de77597f16sm1297327wmo.21.2023.02.02.18.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 18:07:58 -0800 (PST) From: Joshua Ashton To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/connector: Deprecate split for BT.2020 in drm_colorspace enum Date: Fri, 3 Feb 2023 02:07:44 +0000 Message-Id: <20230203020744.30745-3-joshua@froggi.es> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203020744.30745-1-joshua@froggi.es> References: <20230203020744.30745-1-joshua@froggi.es> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sebastian Wick , amd-gfx@lists.freedesktop.org, Pekka Paalanen , Uma Shankar , Joshua Ashton , Vitaly.Prosyak@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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. Note: _CYCC was effectively 'removed' by this change, but that was not possible to be taken advantage of anyway, as there is currently no pixel_encoding control so it would not be possible to output linear YCbCr. Signed-off-by: Joshua Ashton Cc: Pekka Paalanen Cc: Sebastian Wick Cc: Vitaly.Prosyak@amd.com Cc: Uma Shankar Cc: Ville Syrjälä Cc: Joshua Ashton Cc: dri-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org --- drivers/gpu/drm/display/drm_hdmi_helper.c | 9 ++++----- drivers/gpu/drm/drm_connector.c | 12 ++++++------ drivers/gpu/drm/i915/display/intel_dp.c | 20 +++++++++----------- include/drm/drm_connector.h | 19 ++++++++++--------- 4 files changed, 29 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_helper.c b/drivers/gpu/drm/display/drm_hdmi_helper.c index 0264abe55278..c85860600395 100644 --- a/drivers/gpu/drm/display/drm_hdmi_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_helper.c @@ -99,8 +99,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)) @@ -113,9 +112,9 @@ static const u32 hdmi_colorimetry_val[] = { [DRM_MODE_COLORIMETRY_SYCC_601] = HDMI_COLORIMETRY_SYCC_601, [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_1] = HDMI_COLORIMETRY_BT2020, + [DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_2] = 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..58699ab15a6a 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -1029,11 +1029,11 @@ static const struct drm_prop_enum_list hdmi_colorspaces[] = { /* Colorimetry based on IEC 61966-2-5 */ { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, + { DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_1, "BT2020_DEPRECATED_1" }, /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, + { DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_2, "BT2020_DEPRECATED_2" }, /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, + { DRM_MODE_COLORIMETRY_BT2020, "BT2020" }, /* 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 */ @@ -1066,9 +1066,9 @@ static const struct drm_prop_enum_list dp_colorspaces[] = { /* 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" }, + { DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_1, "BT2020_DEPRECATED_1" }, /* Colorimetry based on ITU-R BT.2020 */ - { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, + { DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_2, "BT2020_DEPRECATED_2" }, }; /** diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index c9be61d2348e..1aa5dedeec7b 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -1763,14 +1763,12 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc case DRM_MODE_COLORIMETRY_OPYCC_601: vsc->colorimetry = DP_COLORIMETRY_OPYCC_601; break; - 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_1: + case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_2: + 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 +3041,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_1: + case DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_2: + case DRM_MODE_COLORIMETRY_BT2020: return true; default: break; diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h index eb4cc9076e16..42a3cf43168c 100644 --- a/include/drm/drm_connector.h +++ b/include/drm/drm_connector.h @@ -390,12 +390,13 @@ enum drm_privacy_screen_status { * opYCC601 colorimetry format * @DRM_MODE_COLORIMETRY_OPRGB: * opRGB colorimetry format - * @DRM_MODE_COLORIMETRY_BT2020_CYCC: - * ITU-R BT.2020 Y'c C'bc C'rc (linear) colorimetry format - * @DRM_MODE_COLORIMETRY_BT2020_RGB: - * ITU-R BT.2020 R' G' B' colorimetry format - * @DRM_MODE_COLORIMETRY_BT2020_YCC: - * ITU-R BT.2020 Y' C'b C'r colorimetry format + * @DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_1: + * @DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_2: + * @DRM_MODE_COLORIMETRY_BT2020: + * 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_DCI_P3_RGB_D65: * DCI-P3 (SMPTE RP 431-2) colorimetry format * @DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER: @@ -420,9 +421,9 @@ enum drm_colorspace { DRM_MODE_COLORIMETRY_SYCC_601, DRM_MODE_COLORIMETRY_OPYCC_601, DRM_MODE_COLORIMETRY_OPRGB, - DRM_MODE_COLORIMETRY_BT2020_CYCC, - DRM_MODE_COLORIMETRY_BT2020_RGB, - DRM_MODE_COLORIMETRY_BT2020_YCC, + DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_1, + DRM_MODE_COLORIMETRY_BT2020_DEPRECATED_2, + DRM_MODE_COLORIMETRY_BT2020, /* Additional Colorimetry extension added as part of CTA 861.G */ DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER,