Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3293064lqo; Tue, 21 May 2024 12:17:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqqA3+9QYSBUbYPswbqb2Y9UzPWbbwTktAcjjU9R4Nv/4Kk3pRPGAkMuneOhuBGL6eGkmJAgyj7rTVAYl7WT5QLM4DM8pwc9GK8kscaw== X-Google-Smtp-Source: AGHT+IG45pfg6FXk9u87UTmfANcKUK049X8CwcgSQdZl4vEq03PsBNLn8co9uiQV1W1jhZLGsqgA X-Received: by 2002:a17:903:2310:b0:1f3:123d:129a with SMTP id d9443c01a7336-1f3123d13c7mr20256505ad.2.1716319071744; Tue, 21 May 2024 12:17:51 -0700 (PDT) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bf3154fsi239628025ad.221.2024.05.21.12.17.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 12:17:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=b+UsNRJh; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-185361-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185361-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 50A4BB24096 for ; Tue, 21 May 2024 19:05:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A39F31494C5; Tue, 21 May 2024 19:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="b+UsNRJh" Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2064.outbound.protection.outlook.com [40.107.95.64]) (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 6EBBA142910 for ; Tue, 21 May 2024 19:04:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.95.64 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716318254; cv=fail; b=BaGniR8mtedYn83eB33g4k87IqPGXE4X0aoHs+UEf+G6p9VO0VTfJyivKF1wcoNlfaWe3bQp7z5kmZ76A1Lt6q9487qqswp93JcR/woVV7SkKX77aOcUAvDyFHylPqmtlEA+vV438lauk80mxMGoiPF3qyd6qmz/2onDy4zIWnc= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716318254; c=relaxed/simple; bh=p/niD2Rfi2lPQBF04U6Ai5d9604pLKy/hRVCdn+HtF0=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=ZC1SKc9BfJ4y/C0sYFfax74IUiMscB2tjVatR4PrG914o68WvRW2cFYOqxRXXGjikveW+Gq7J/YWrikPSYfam+UKro+dRe7ZL2MyKKOmVMsPD5rCQEDEWt3u2nN7dLf3LcJMhFIQGFIjKtKJOBz4OGU2tP0hkzr73tBWbwVA2EA= 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=b+UsNRJh; arc=fail smtp.client-ip=40.107.95.64 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=K4J18LMOC5Sn2QnoTaq7k3HdoP342OVbQnXRfpkA4pxN1vGuSCjX9icBDaL1wkf9VhhgK85TEBOFHwHmsv4vgXadHYzZRWrrJEzFU3FhvkqYHfsk/mjpm8CxVXIIQc3/fUYNkQpHRUjLU6zL5CPK4Xae5+5O0EP89oTk7/kaJBYN4K+phSHix7Kn0nf+2yxyrRN5lis1JphW+bVNIMhzUp7DS2KgyrPkEnrFxqaq8UlkO/nJadeSxV2dfNCYopjYsDsSIRus+9MVzadEWDfwARg02cbjm4yOq9NWU7fYSxSmzrUANazgnASSV6Ljc1GbV6xFWf2uAvENNiIZP2jfPg== 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=KqCQoH+cH8laJp4LOdYfB91k8nSbzCOdASW+yxBqb/4=; b=IEEwlKnR980a+fsZsLMIIkWOeKm8QwXK6e+AIYsFulOSvvFbIgmtFbbAeiBIuNzmBmfn4S2UmD8e86/yJHtEKpyvP4FE/FWuHk83CMOOWH8q3YFPvHmelSEcM1srxkftru3VbCeAXUFBUFZ+6g6nqWuZT3GBGzL0JtZfhvCgLiL60kR1Xup/2yGEajQmdatGMp0dvgt7ykIJqNu60cPFo0tVqGmrCA6PfHjA9eTLGQX//o4GakJMcgGxVFSsazMuTCgaPNggpReEIORW4CJJy0GMRVI2+cyMe6BANF974EXeWgqBqaHd8vSBO5Y7gXIH7p184O1besmDdlQmmckzQQ== 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=KqCQoH+cH8laJp4LOdYfB91k8nSbzCOdASW+yxBqb/4=; b=b+UsNRJhpJbG/1y20Ilw+R9xTMUpoxhS130IxR5XP2Rzskk5FbPgjd+knDI0IjCL3x4xRNjqIUxsLKE2ViseWPlBhfYHknK+C29KwtMCsMZYfmEFFyM7f9lf3l4Wy8ytjyWhk1C8nzinj8nwVdMnceIZvjKpbSnYEO4oAkqTuEU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by CY8PR12MB7537.namprd12.prod.outlook.com (2603:10b6:930:94::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 19:04:08 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::46fb:96f2:7667:7ca5]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::46fb:96f2:7667:7ca5%2]) with mapi id 15.20.7587.030; Tue, 21 May 2024 19:04:08 +0000 Message-ID: <17782a6e-db84-4c20-874a-342b9655ffc5@amd.com> Date: Tue, 21 May 2024 21:03:59 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] drm/amd/display: Add pixel encoding info to debugfs To: Rino Andre Johnsen , alexander.deucher@amd.com Cc: 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 , Mario Limonciello , Nicholas Kazlauskas , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240521051140.30509-1-rinoandrejohnsen@gmail.com> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <20240521051140.30509-1-rinoandrejohnsen@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0004.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::9) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) 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: PH7PR12MB5685:EE_|CY8PR12MB7537:EE_ X-MS-Office365-Filtering-Correlation-Id: 49546291-3b42-4a6d-7575-08dc79c8ca80 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|366007|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RFczYmx6UE1RTWlHNU43TDNQS29OMWNIczJva0grMlVZUVpjWjZLMUVGZ1FM?= =?utf-8?B?NzNxcXo4b2RXbjFxcWw3aUlCVWZQNXlHY2trcnBRWUhFS29ibER5dzNDeXR3?= =?utf-8?B?OE54cWVJallyb0ZXZy8xTnRFeVJXNG5oR1RGL2VENU1SNFhvMnZqREQ5MTYw?= =?utf-8?B?aUIzZmFNa1hKc2R1cS9yanBVWWNzR0NMRUp4M1lQeHZwaGlsNDVrU0ZzR2x1?= =?utf-8?B?aHZpb0F0QTI2aXQ1K2hwd3V4SDU1NEJPWVdubE5IdDB6aUlWSkx4UWd3MUJF?= =?utf-8?B?OGkrVVAxZGJVekJVR0g5WnhOQmdEc1BiMlV3enZXR3ZT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dIdWxSQk54UHVGWldvOUliKzUv?= =?utf-8?B?QTgrQS9WdGVhazZ0RlJzL0VXT1ZWTHhvd010OFE1Z3hhbXBremVVUXY3Mklp?= =?utf-8?B?SlNGTHI5a2cxdUhjNzdaM2o1WHorQ25ML1phWXVnMjNVM1pqVnlhOGlPVHhm?= =?utf-8?B?SWVndlQ4YVlNdzJIbVZmTExBMCtMVHpiWmlJbFBIbTFpOVBUeFU2TDNaV3NU?= =?utf-8?B?NUNEZ1oxc2QvSUxmYU9EcDk3a2ptMDYreEpnVGNvQzJKL2R2VllsUUlsdzV6?= =?utf-8?B?bXlEbjhsV085TEcyVUZJczhiQVFqSWl5bjVncVFSN3NSOHNzUU1EN0dPckhC?= =?utf-8?B?ck9qUFZRaE5nUnpDWkJVN1krNkdya2t2L0pReWJkYWJRVUNEQWJUdlBJZ0Zs?= =?utf-8?B?cVBjbU95ZDlFNm1tQXNkVEJtdUZ2ZFAwMFh6aFdlemtnMGtmcklVSWRycUYx?= =?utf-8?B?OWRPVnNFR0s0RUtGcWFJUE9BWmFlMnlUNEFjNzBmc0M0UTJPSEtDU0F3PT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5685.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YlhqZGxtSC8rVEFQRTdlQU1wNXB6Qy9FNnZYQzd1YTB4N3VBbFRwUG80N2Ru?= =?utf-8?B?NS90MHlOdk9GQkw4Y0V4dityWHBkM1N0UWUzWUVTOUk5eWgvT05VRnRVRG03?= =?utf-8?B?Y2p3VkRjMkNBMnhtUU5qdCtCdlZwamtCUU5zeW43RXZQQXRTS2tyUkc1RlBa?= =?utf-8?B?WGVIZ1NGNGhnQUlOMC9samQ3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?utf-8?B?eERCQ1VpY2ZMUmMxQVNENU1LU2FHSHFnQUJ2NEhiL0RLRzlzOFo2aWYzZVF1?= =?utf-8?B?anRDWnRZQ1N5MU1kWXd3aHpoQ0dTU0dWU1VvcE9jRmVONGNxb3ZiWUNicUM4?= =?utf-8?Q?lUN9SmjTOQewbRAvY+iVoft9r?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49546291-3b42-4a6d-7575-08dc79c8ca80 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 19:04:08.0629 (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: ZZ3owDklt4l2REPplDtJyw3rsqgIVftoqZ3EGXPwv32lwkVu7UNTq52o64u57KRs X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7537 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); > } > > /*