Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp350761lqp; Wed, 22 May 2024 06:37:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXyL9rcm87SqojytCoEkOUW3BtXdDA9ofXDGCG2EaaqePBr+tVBq7XzkSP1sTmhZMbS2WioKLwRDQPSkj0Tg8RFg19A0WI22/L4DPULDA== X-Google-Smtp-Source: AGHT+IEd8BgcFOiEY6fndXCfqkKXmRLHlGGPE1/IPP75FZ9anA8GZZxQqBZafcObpMemMUw5/8H6 X-Received: by 2002:a17:906:c34c:b0:a59:c62c:2122 with SMTP id a640c23a62f3a-a6228069518mr120523466b.8.1716385030466; Wed, 22 May 2024 06:37:10 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be688fsi1525383966b.787.2024.05.22.06.37.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 06:37:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=i6KkroaS; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-186289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1093D1F22763 for ; Wed, 22 May 2024 13:37:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBDE5140375; Wed, 22 May 2024 13:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="i6KkroaS" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2089.outbound.protection.outlook.com [40.107.94.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E240513F452 for ; Wed, 22 May 2024 13:37:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.89 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716385022; cv=fail; b=d+2mHIBDPaKYlGt29zvsSv1yyqXh9K7C33CKDj+v8GTiI5HB+EOIil63hay1feoCraPYV0RPk/hgXD51VFhWKqy03IUF8lxkjiUUROeHgx8gA7bJ9O8T8NbXqKood2VhSdA8RvoWmFGHH48S+DO3XxMuv8FVQb8AQBByWZ175JA= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716385022; c=relaxed/simple; bh=VdQ43YBfuaFawktHl7kRxmILOpJaALbrRZ/+kVjEUso=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=Awimf/rTCDzhzMmALh17n0pNA9ynoyZj8zoJ4Gm3D0B4G4c1QoGk34zxClaLRgjCsfyDY3MH5gzdHm2b7/uZbsQkezTdj5Wu2VHdsjsQwQkMxWmSJaNtMFxmoFVMWTkSImAfIjDKUahsIWm0knmCZePfPHAPdwuPS9ETNuP4P8c= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=i6KkroaS; arc=fail smtp.client-ip=40.107.94.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nzqlIyC524Fjqd+Dc2HJn3SfqMQU5vDiU+qO0xJzMUneqxI1JecEfaieDvzf3LZ72CaeUWa3mqnJyOQQ2SXWJFLUc0DVfrWmx8nlU13fMbNGV0mBsimXmugktGaOBaNOBtFIrpLOX8AilihPerwY8r+RGWF199PsMZr2UVojT0jZBzRDyJZ+UKygiWApvYW8GYNRXFod54zaj5UZBgPcZTPDOI9n6taP8NQ8G7i9izzYDyjGIxjB34OxWzF0rLjiedTrK4kXbrlXlJbp6VVB59eGRRxBzXQAEoTNxHDrt9S+ILhiRUKsTYSXldrri8B9/WBOnhQCaz4//OTlkvPd9w== 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=o9jgfqsZZG4GfWQQI0H4Fny15YsC+L5JhyygSeHIGGs=; b=MANRHekBkrqt7JevJfVqj7z18fRcvTG2Fq3fVHxMJW2qBVSpcHM09Yjt7ZDk151tt7ggRHOwhv727VUnB9GiGA7A7UYvY1INYTVScMZJsHlSBPfbnDvVcK+zsaC5hDGrGLY06NZxyq0i03xX70EhN0BXxW3vkUkeo5Hw5NIts9eOrYAY2FVlt+V79AdB8+As5KlGNmWmFCQ3jZEelIUbO6fbhVDQuy98CAA+NT28s6izi8OcQIWz6pZjNcmIOcBa2d8wqBpE/7Y1HSCtTPHuWndPrs0t2U3Hi4xT7YbQNCi6hAzCosY3V3WX8Irwsq41iHIbvcv0TJEFQIBk5gPX1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=o9jgfqsZZG4GfWQQI0H4Fny15YsC+L5JhyygSeHIGGs=; b=i6KkroaS+l26EM5yMXypTL2BXgADa3X8m0Ypgo+xv7ZrfYIZFx0rm00kzpdSjdcrIzcZk18uauMvwSkiAi7yvVl3xGcAYM0XCi073usdMjYmn9XIb41oWyaoyGkBcg3/N377ued44xbmOOYs8IVfxBtbUnrbP8rZrj5SIIF4VWw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by PH7PR12MB5617.namprd12.prod.outlook.com (2603:10b6:510:133::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Wed, 22 May 2024 13:36:57 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::37ee:a763:6d04:81ca]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::37ee:a763:6d04:81ca%7]) with mapi id 15.20.7587.035; Wed, 22 May 2024 13:36:57 +0000 Message-ID: <666e36b7-5379-46ef-a16b-00ec499fb42c@amd.com> Date: Wed, 22 May 2024 08:36:54 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] drm/amd/display: Add pixel encoding info to debugfs To: =?UTF-8?Q?Rino_Andr=C3=A9_Johnsen?= , Simon Ser Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , alexander.deucher@amd.com, Harry Wentland , Leo Li , Rodrigo Siqueira , "Pan, Xinhui" , David Airlie , Daniel Vetter , Aurabindo Pillai , Hersen Wu , Hamza Mahfooz , Wayne Lin , Srinivasan Shanmugam , Fangzhi Zuo , Tom Chung , Nicholas Kazlauskas , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240521051140.30509-1-rinoandrejohnsen@gmail.com> <17782a6e-db84-4c20-874a-342b9655ffc5@amd.com> <86410711-9b88-448c-9148-109f81b1ca55@amd.com> Content-Language: en-US From: Mario Limonciello In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SN7PR04CA0048.namprd04.prod.outlook.com (2603:10b6:806:120::23) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|PH7PR12MB5617:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f179ef4-3b9d-476b-e08b-08dc7a643ff3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|366007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?VGhIN0NiVUtwek4yMkpDc05YbkdjZzBNMlZJdHd6SzdkUE1NcllNajN4azlj?= =?utf-8?B?T1FUUTVGUW10SURsN0dOT09hdHF5dlhVblZBTzZhQ1JaeVpLeXhGdkJkRjNr?= =?utf-8?B?eUpNbHpEMk1KQm1qYWRMUS9xczlCeVNuMDZvcEZ0aGk1T0w4U0NnTjFTMmtB?= =?utf-8?B?N2o3NHFnK1F0b2dGQWZxMk45eGNhaVpyQ1hCQWpoSUd6Y2pEOCtEbzl6QndO?= =?utf-8?B?ZnIxV3crUGRSRlJaaXN5dUhuYzU0QjkveHc2MERCOEE4WnB3UzVZNkFFcjFL?= =?utf-8?B?NU93SFg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oSERLSHlaaFMvRUdSV241Q2wzWCtsa0xhV3pnQ2ducEppN21kejRKOE85?= =?utf-8?B?SExEclF2R0VBNnVGNEZCZ09xRWxyZGNRbWpvRVhtWW9YU21GYUh3Y2ora3FY?= =?utf-8?B?NUZFVHgwN0FQTXU3Y2lzUUFkb2E0SWhna1F1RWZlODQ4UFFWT0ZMUWRRaHhR?= =?utf-8?B?UGRFb1JOSWpacXEwTjZybXZvb0oxNkxGcjJMSzJ3SlBUclhLdnA3cjRUMlU4?= =?utf-8?B?U1c0eURiVU5naTRjUkhXQm9kVHlQSUxxcnpTYWM0RElsOG5NeEhmemtrZkwy?= =?utf-8?B?MzVteGNFUllULzhYZU5ic0hHbEVqZlpCbWwyeUVOaXdHbGl3aVhnYWZCbmZS?= =?utf-8?B?aXd3NCt5dXRqMWZ5UGpQdWFvWWlRNWpHdkNGK2lVbzRTZWtjdVBHTTMzRkRX?= =?utf-8?Q?9m71t0Mv+WpRieFO70QAH6AkDJ0sXGjLgUPhYrGiKTWA=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dnhackFEenJLTmdvWE9kWEZzMHhERzd1VzhLdVVCazBCN21ZWlB1NldUTmZV?= =?utf-8?B?NUFVNm1LS0V6VEVNQlRsZjY2TlRtZVlpa3ZZZ0k5M0grTW9BZVp5b054RHN6?= =?utf-8?B?MEF1N1RNYlo0L1lQS0dXeFZTdlp2eGFsK2tKYXpIYlVzSmJVUHV6c0dkK3Zv?= =?utf-8?B?K2NEd05YRkJTZWhNUE5SRkFjLzZYVGpoK3UyVXFoOWY0eURyMGd6YTFkRFRr?= =?utf-8?B?SW53WWJsNG9s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= =?utf-8?B?ZVR0WE5XK2hLY0ZTM28xWVB3Uzl5am1qOVo4ZkQwSWpIL3VDS0Q1MXhtdHlE?= =?utf-8?Q?U0CvN1oQHWK9Hbf4keP23NZwI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f179ef4-3b9d-476b-e08b-08dc7a643ff3 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2024 13:36:57.0933 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /m5wj/Bvk4nNw9EBT4elddWUaWBpNw2IzcBTc5GQE5sNjH7JzEIgXHnmX3wn2wrifuhLFFIftsV0CrgaEn+OfQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5617 + Simon On 5/22/2024 05:07, Rino André Johnsen wrote: > To be perfectly honest with you, I haven't given that much though. I > used the 'bpc' and 'colorspace' property in debugfs, since I could not > find that information anywhere else. And since I also needed to verify > the pixel encoding being used, I added it where those other values > were. That made for a simple and easy addition for this property. > > If you want me to do this differently, let me know. And please point > me to the standardized DRM property where I should expose the values. Here's a pointer to where the colorspace property is created: https://github.com/torvalds/linux/blob/v6.9/drivers/gpu/drm/drm_connector.c#L2147 I would expect you can make another property for the information you're looking for and then can get it from userspace using standard property APIs. > > Rino > > On Tue, May 21, 2024 at 10:55 PM Mario Limonciello > wrote: >> >> On 5/21/2024 15:06, Rino André Johnsen wrote: >>> What is already there in debugfs is 'bpc' and 'colorspace', but not >>> the pixel encoding/format. >>> I have searched high and low for that to be able to verify that my >>> monitor and computer are using my preferred combination of all those >>> three values. >>> >>> I do think it should be available as a standard DRM CRTC property, but >>> for the time being, I figured that a simple debugfs property would be >>> sufficient for time being. >>> >> >> It's just about as much work either way to populate it though, why do it >> twice instead of just doing it right the first time? >> >>> Rino >>> >>> >>> On Tue, May 21, 2024 at 9:04 PM Christian König >>> wrote: >>>> >>>> Am 21.05.24 um 07:11 schrieb Rino Andre Johnsen: >>>>> [Why] >>>>> For debugging and testing purposes. >>>>> >>>>> [How] >>>>> Create amdgpu_current_pixelencoding debugfs entry. >>>>> Usage: cat /sys/kernel/debug/dri/1/crtc-0/amdgpu_current_pixelencoding >>>> >>>> Why isn't that available as standard DRM CRTC property in either sysfs >>>> or debugfs? >>>> >>>> I think the format specifiers should already be available somewhere there. >>>> >>>> Regards, >>>> Christian. >>>> >>>>> >>>>> Signed-off-by: Rino Andre Johnsen >>>>> --- >>>>> >>>>> Changes in v2: >>>>> 1. Do not initialize dm_crtc_state to NULL. >>>>> --- >>>>> .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 47 +++++++++++++++++++ >>>>> 1 file changed, 47 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 27d5c6077630..4254d4a4b56b 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 >>>>> @@ -1160,6 +1160,51 @@ static int amdgpu_current_colorspace_show(struct seq_file *m, void *data) >>>>> } >>>>> DEFINE_SHOW_ATTRIBUTE(amdgpu_current_colorspace); >>>>> >>>>> +/* >>>>> + * Returns the current pixelencoding for the crtc. >>>>> + * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/amdgpu_current_pixelencoding >>>>> + */ >>>>> +static int amdgpu_current_pixelencoding_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; >>>>> + 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->timing.pixel_encoding) { >>>>> + case PIXEL_ENCODING_RGB: >>>>> + seq_puts(m, "RGB"); >>>>> + break; >>>>> + case PIXEL_ENCODING_YCBCR422: >>>>> + seq_puts(m, "YCBCR422"); >>>>> + break; >>>>> + case PIXEL_ENCODING_YCBCR444: >>>>> + seq_puts(m, "YCBCR444"); >>>>> + break; >>>>> + case PIXEL_ENCODING_YCBCR420: >>>>> + seq_puts(m, "YCBCR420"); >>>>> + 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_pixelencoding); >>>>> >>>>> /* >>>>> * Example usage: >>>>> @@ -3688,6 +3733,8 @@ void crtc_debugfs_init(struct drm_crtc *crtc) >>>>> crtc, &amdgpu_current_bpc_fops); >>>>> debugfs_create_file("amdgpu_current_colorspace", 0644, crtc->debugfs_entry, >>>>> crtc, &amdgpu_current_colorspace_fops); >>>>> + debugfs_create_file("amdgpu_current_pixelencoding", 0644, crtc->debugfs_entry, >>>>> + crtc, &amdgpu_current_pixelencoding_fops); >>>>> } >>>>> >>>>> /* >>>> >>