Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2801568lqo; Mon, 20 May 2024 18:35:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVvWGxQmCqlE4kQeue/euoPTKVlALMYCTxFs6HR3tNxZ0ozUuoqdPnfzJE3IdupxP/B69hS4PM56Gxyxl5hvO1TBVCPf+/PbJr/vbIwqA== X-Google-Smtp-Source: AGHT+IH29oVD28/rX9J7HrPbfqnT/ikH0X/XqSIlU5G2AGNlAFkKHONHSAcWSarUEf31sMBNmXKs X-Received: by 2002:a17:903:22c6:b0:1f2:fc06:4978 with SMTP id d9443c01a7336-1f2fc065886mr75321565ad.12.1716255322139; Mon, 20 May 2024 18:35:22 -0700 (PDT) Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bf31d8bsi3326815ad.303.2024.05.20.18.35.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 18:35:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=bIqCixtd; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-184349-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184349-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BC0DC2812C0 for ; Tue, 21 May 2024 01:35:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5680BBE4D; Tue, 21 May 2024 01:35:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="bIqCixtd" Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2089.outbound.protection.outlook.com [40.107.100.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 232548814 for ; Tue, 21 May 2024 01:35:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.89 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716255315; cv=fail; b=dRLjNiAOewtSaZ96P7ROsVlbfSYuUhUmYq8b3CW1MFtq8XEqOreZxlwmaHcLJ8j15WDqRzogfOsjZfS0HL33j90/GlWuq7NbK84JVeEMIzfBlhczT/uuyA+KAl2lLPsVvZoSPC1GExCOw+0B9/yrUZfz6mZcU2ky0hrLQqVo9kY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716255315; c=relaxed/simple; bh=nZlFcpeHOA+kzymphoWKKAkH+kslGBpNMP90kfeu5x4=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=DJe/MVVpDieEV2orFLAoyRAlvScnVVLkoITraQyddSzDrtEvWwvMaT+xip3ZheEUbeQWE8eGf/sjZPE2Gxsxdr5mW024lTVO53lceRKP4TyYqZaCAhihFSgSAidiXLmvOCjWVtRpfXD2dKiPQJCeCZrxEwvt5q/ucgTPANj8S9g= 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=bIqCixtd; arc=fail smtp.client-ip=40.107.100.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=LnefnSw/K+tq853OR5BWjXQ1RRS0vWrRWN1yg5RVdQXz/dlz46M3CZlJbA8O326EhvPxcvbbatHFH/1GGsw88LMjYDKZx0aw/LVTr/s3/Yp65/82hp2VJ4Wq0ylivRvYRACLaj6VD5orPA2UiatwOhF/3O19C7YC6OL9/EJj90EjHTMOmrYBtEYVzOYuN0+gq3itaA4L8gxcs0wDKvQZzFMX7KIKN1aX3UIHZons+NQBMjaBzJ/vtT70KAdX8AnIu5fg8Q0PfFHnOsZAZJ09ZXET4YpPDORh19gwi4/cQ9mc8K9j7Mvgf4y6B/VxJtQeQ+eBTQOay/QiyJ8wk2fVDA== 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=TMIe1tkasjQPYAJ8pFqVS+FNpmlqlj2k+Hj1dhqykIU=; b=Ey6VewMwbhCE4PJgYCB7fgk89qI+aXF5gypTpozqDLofWOXVqPRWH/Jzly/kn45Da19M5MNa4ct+4/qZJORGahDr2s17kOElyebBlunXooazdiymB4FsRk8WSlWh155oL1E4NMnaDSh3+7+YObinUDQeR4OAaM0hJ0d5dak3UoDjbdpXOimHhjKCjQmarzG11Ea79o0a8OgOCm6mLSDPi81yKGZ3BDJg87AI4EsOr9XPWYrANTn61PFO7R3Jo6mhn6fhc1tBuA0upmdfRcMx2mhQ7AsB1btFGeNdqzdjGqf8x2PFHLyd6XS0gNwN44tKZLpt1rn9DY2fK1MXbOkTuA== 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=TMIe1tkasjQPYAJ8pFqVS+FNpmlqlj2k+Hj1dhqykIU=; b=bIqCixtdAdZFhmevGDf3OvyssLeflM50o38szhrJNE9b4StHOEk5+k1ZiPJuFxZ/jhPBnxVL8z2mLyOoKS7bPBXXTNx+Hble8rUmBLCtby5uf7qUXJkIa9nm2MmukWp1sM9kyGK7fu7EElMwwzXFARgYrJa9ObAfcyCdp+2bLp8= 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 DS7PR12MB6069.namprd12.prod.outlook.com (2603:10b6:8:9f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.36; Tue, 21 May 2024 01:35:10 +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; Tue, 21 May 2024 01:35:10 +0000 Message-ID: Date: Mon, 20 May 2024 20:35:06 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] drm/amd/display: Add pixel encoding info to debugfs To: Rino Andre Johnsen , alexander.deucher@amd.com Cc: Harry Wentland , Leo Li , Rodrigo Siqueira , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Aurabindo Pillai , Hamza Mahfooz , Wayne Lin , Hersen Wu , Srinivasan Shanmugam , Fangzhi Zuo , Tom Chung , Nicholas Kazlauskas , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240520210817.9943-1-rinoandrejohnsen@gmail.com> Content-Language: en-US From: Mario Limonciello In-Reply-To: <20240520210817.9943-1-rinoandrejohnsen@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DS7PR03CA0169.namprd03.prod.outlook.com (2603:10b6:5:3b2::24) 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_|DS7PR12MB6069:EE_ X-MS-Office365-Filtering-Correlation-Id: 414dadd2-9f49-4fb4-d133-08dc793640a5 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?K3paQkNXOGJtdTgrZkJVaGZXazRmeWZGNTJOWkdDKzk2cWJXNnhmU3dEanNw?= =?utf-8?B?bnY5M2VDREE4Vk0yZUpUdk1nS1JZUzJ6ZCtVbm5EWkVvYVNxMEJXQUF2cXVY?= =?utf-8?B?MWlmcXV3aXBLenp4OCtNajQ5QTE3V3JlYzJEY240dGllYXp3aS8vOGw3S3Vk?= =?utf-8?B?Nk9SMVZxcVpQc0F6U2NuaGlHWkNQcTFQWlc1eVBJRlNhWSswTWxhOW1MY3Zo?= =?utf-8?B?K29XRUhwWVM4KzRaOHIxUGZUby9acXJlVHVZd2hsQWdtV2NxeCtSOUJ0cDlS?= =?utf-8?B?ZjFNSlduamVkVVI1SjFmSDkySVN6dGRDTXdvWndwT29oRHBuWWMvMDlMLzQv?= =?utf-8?B?bzNVZk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?utf-8?B?QUNUdENXQjVEeGdhdElENU1yb1dta3crbldTR29HODlLbis2UTlPcWVHVDZN?= =?utf-8?B?aXU0ZXpFMXNkd0o0dGljakVOS1pSdk83VE5ObS9qR3Z4RnBpUUlHQXlNbk5y?= =?utf-8?B?YWpRWU5CWXBsZVJ4Y0ZFblIrTkpBb0pONnQvZUh6MVFXS3Q2dDUydElzNjBP?= =?utf-8?B?ZWdpbmRXcDlwSWRiNFErZ1VZTzF0TVdKZzJmTG5FTHNrRHpOKytZb2pBNm9C?= =?utf-8?B?MDJ3Q1oyNitSaStGWmxsNU1PVy9VS2ZybVZ3dVBkaXlJYW5DNCtIUkx6TmNn?= =?utf-8?B?OUxxbWk1MTJtSWxuUHF4TU0wc0Jidk1qNElweDg2S2xEU29SVE9KalR6WWMy?= =?utf-8?B?bFlpS09GNEkyRllDR25pRHByUDhCWEYyN0hISEI1SHhaYUdKbDYvbXRmeDkx?= =?utf-8?B?VVFVMCsrTWVjbW1wUVVWOXRRM1ozcEl4WUNybkZhOUcxSko2MFlvVmlnPT0=?= 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?TzZXcWJOSmNYd3FsTEdrRWRQTXJMcGtTdmpXYVU2N2JpdmNmT2JqQ3ZSQUVh?= =?utf-8?B?eWxlM29RU3R1YU1tQUwxdVYrK0VtQlZuaUdlNGpmL0VCbWtQZHdhRzJCT3FD?= =?utf-8?B?dWp3WlFFZUVqNXdXUlJISHB0ejI5TWN2bjVvWk00elZpN0xuVm44TEkwTXpQ?= =?utf-8?B?ZWZpRVkyZ2lzN2JFU3c5enlKT04wL3FLNjdFY3lhcThjVDRSTzhOV0dvc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dE9OTWl2ZWJINHM5dmNwLzhkRlJyZXYrVmxvZnhGMTM0V25r?= =?utf-8?B?M1J1dHJoMEJXNXNwM2tzbngvOCt0c3BuUUxOMGRuaU5uYWlCOGhHeE92U2lB?= =?utf-8?Q?KxV+yDNU2SQE6KjoyK5toy9ZS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 414dadd2-9f49-4fb4-d133-08dc793640a5 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 01:35:10.1101 (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: 0kJy8j+7pAWbBpp9Ftk4QOjHy1U4qjkLShaYu5goIQGESGdYIDEV8wCoX9v3QY+9VATxll1VrM9mF6IQJTIwSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6069 On 5/20/2024 16:07, Rino Andre Johnsen wrote: > [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 > > Signed-off-by: Rino Andre Johnsen > --- > .../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..d275e5522335 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 = NULL; There is no need to initialize dm_crtc_state to NULL. You set it before its first use. > + 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); > } > > /*