Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1203682rdb; Fri, 16 Feb 2024 08:13:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU07dxkeAekNG3N3ZPvp+x24HL5QQcqqsUjT+vqhMpXcs6jLU0cy6zusAVMfohD3+IehVLB7xnlxLWnZLGXH2I3qxH8vjvqomAciHNFog== X-Google-Smtp-Source: AGHT+IEu0MfBdByK2llXhCRkNqI+XH8awD94NszOM+CpH5UhyG512tF3XetBiFGN7G03djjLm4c7 X-Received: by 2002:a17:906:2799:b0:a3d:f2fa:d98a with SMTP id j25-20020a170906279900b00a3df2fad98amr1088723ejc.64.1708100039448; Fri, 16 Feb 2024 08:13:59 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k18-20020a1709065fd200b00a3d82a3ecf2si69539ejv.113.2024.02.16.08.13.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 08:13:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=BGr+sj5u; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-68942-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68942-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 0C6FD1F23843 for ; Fri, 16 Feb 2024 16:13:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8818212FB39; Fri, 16 Feb 2024 16:13:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="BGr+sj5u" Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2044.outbound.protection.outlook.com [40.107.243.44]) (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 9123912F5A9 for ; Fri, 16 Feb 2024 16:13:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.44 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708100031; cv=fail; b=vAOmJ8E6hafZGUxwIka5nweY3wAoDIdtYCvqkjEh4KeTazvMbWA3z/BpixX8sCr+wX8N2iVew4okjIiThqZxzmhtzeJ/LmJif0oJEbYvPtR+0vVIG1av1KOIv/m2U2AHgx94ptnrXWfeSbDG0cdsywK8B7gF+YvSlyBKI51AKpI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708100031; c=relaxed/simple; bh=9h7L4Z850jVg1KjionmaGxKJ+9FN5kXNjVbCSwSF+G8=; h=Message-ID:Date:Subject:From:To:Cc:References:In-Reply-To: Content-Type:MIME-Version; b=BcEVjo8iryqgabfVMxJGbbNJIq5WxzPvDrqUc59WDr/qgglZiMB3se8sOWfZSVsR2vVcfS/6LqusO0zeXCSs8v+zSiNR0UsJD+2jFYufaFwhggI/5UxacIbimFBXcQ1i9ZANfI7zKOilPHJ1K3KA+aVta1lnGHaKQCgICXltx9I= 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=BGr+sj5u; arc=fail smtp.client-ip=40.107.243.44 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=EJhZETIh2m+VfBcEiDcsrNbcvR9Ms1gsxQWcROCDG3I43MOQJYNxq2kmXjAxBb4CcXSYaPovdLOXDPNJpuFgRhFv/IgcVK3lJpWt6D04BCm0grJJDlm4EvsRPNy8Uf1Jppf7jGMXcNDMU/31zbfRmIP/fpimM0VYUyAFkSJCEBVOz/LT8SNpYAB5J1g55eK5Eua2OhF5eIdCosgWWh4Uk96PeL4aRU5Sv6XAPr1wznx4p6EaAKHKSoCRd0w9XKqY0fqNQNU8QJDi5uuqjTU+ySihWRrKMzy9gGYilTlLv2NIQZwfDxXp10d6s+W9l+hJo7isrx2WZfz8rVq4hFUm/Q== 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=FFQ/bj6GQDTICITZ6xjvVphNMCXiOGVFxgnXgd2q9dE=; b=PB3ZNqvt/D2ETD2OIiqj6LPrUlUYIYcj2rM+TnyNWhU06HeLHeIoqhoGYUexfi6n/ZMh3B4O07Xni1LiboC/glyDUjPmumtYWS24c1Zd4FQSVSkM9Yckubm5ft4iHRgtpVJtSArwVRKn1jpheYiFNDSqNuzk6NzBV/h6JP8NmnVdDK8v9Kend/6ty7rZzzIVU/mdC2QqPgdHLsOEXN5y3nIIE8xfNOU+NZqLw2+qM5EmsVNoN066cFo+Eq0MmA3wt39lRB13jxicuAvGM9txiIcBaV9zSkmgGB57h8GZuWn/dxMlY0+0BTElbQ1nQQMQF16vlpADlCpSJmmsn2LedQ== 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=FFQ/bj6GQDTICITZ6xjvVphNMCXiOGVFxgnXgd2q9dE=; b=BGr+sj5uKah0Afdox3BUVYONBt53tS2K+COEbfChSx4bxcLC3Rk5MNjD7LmAWVvRrpa7qL6wTCf/HY3yIn2XUyF04BS0gHXRjklhnQPKQ4NxtW7/Sq//KeY/RHY0ggD2JybLtV/xebJLF+M15ntFFMKNZtJoLL03lqjYiETVUHY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CO6PR12MB5427.namprd12.prod.outlook.com (2603:10b6:5:358::13) by PH8PR12MB7025.namprd12.prod.outlook.com (2603:10b6:510:1bc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.15; Fri, 16 Feb 2024 16:13:44 +0000 Received: from CO6PR12MB5427.namprd12.prod.outlook.com ([fe80::3f6b:792d:4233:f994]) by CO6PR12MB5427.namprd12.prod.outlook.com ([fe80::3f6b:792d:4233:f994%6]) with mapi id 15.20.7316.012; Fri, 16 Feb 2024 16:13:44 +0000 Message-ID: Date: Fri, 16 Feb 2024 11:13:40 -0500 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] drm/amd/display: add panel_power_savings sysfs entry to eDP connectors Content-Language: en-US From: Harry Wentland To: Pekka Paalanen Cc: Hamza Mahfooz , amd-gfx@lists.freedesktop.org, Mario Limonciello , Leo Li , Rodrigo Siqueira , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Alex Hung , Srinivasan Shanmugam , Wayne Lin , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20240202152837.7388-1-hamza.mahfooz@amd.com> <20240216101936.2e210be2@eldfell> <82280a39-4e1d-41ee-82fb-758ceed953e4@amd.com> <20240216174242.15d07657@eldfell> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YQBPR01CA0023.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01::31) To CO6PR12MB5427.namprd12.prod.outlook.com (2603:10b6:5:358::13) 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: CO6PR12MB5427:EE_|PH8PR12MB7025:EE_ X-MS-Office365-Filtering-Correlation-Id: b4193c45-8e1e-4c18-56c9-08dc2f0a3fb6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +d48l5cySRbOcFFHE3uKhn5D6hENyX0LoUFZKoDMbqiVtOn7s+9LKVgY9w3th5pfWejhYVlvMpOy6DSZr3o/vHFDADqkWowkYnCK83AaTczj8K0uClkX0BIG5sWtTgi3IFRKeGAgkxiPYeyGA4wy7PaQ2DHUKBGNwqpuZo6vrqUGySVQNXSW8w2YX4t5p30d9JLvqggRNWy532TjJaLmlJwfadzoc9RBBr9ZyJ6COcmblqel1yUsvhIvDFWGrDnwraOK3I9w9dWnuY1Ig0InbYqakj0KH7tykmYt4N5eqF53kCTCboYIvJtvo1VAEVWQdqmxBYx35SuX9s4UjoOWE4RAMYPJF42OFpAhkNQAdpHirfnN83IFAspv+7UcbK9Ta56QSnGbjIERbfl9zLYXOYe3aDh9CiyqJv4lcnKqrHeXdimVVR10aXAH9KdavivGEaZyR4+ONtSu4PD8p5eqdFQD4KJ/JaDkTRVsMAbjTHL/Cfby/LvO83aHWLei48GvcsrTBuog9ZticZr5lT/n/jWBo2dqtV2thLENCf4M0GQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO6PR12MB5427.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(346002)(376002)(396003)(39860400002)(136003)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(8676002)(66946007)(5660300002)(44832011)(31686004)(8936002)(2906002)(66556008)(66476007)(6916009)(4326008)(54906003)(316002)(6666004)(6512007)(6506007)(966005)(478600001)(53546011)(41300700001)(6486002)(83380400001)(86362001)(36756003)(38100700002)(2616005)(26005)(31696002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MGloNldJTHdSQ3J3S3JLaVZZdUl3QWtZRFhickxncnBiOWZ1a0xNMHA0L2ZB?= =?utf-8?B?T1BXMTVCQ1paWjladlJLUVNpeDh1UVNqeit4OWZKR2ptVFJyOTF6RnRLV1o2?= =?utf-8?B?eEI4UTcyL0pyT3FqNGovbjRJY2NnMlBGR3dnb3NuV1d4Mm9Kb2VhRDBZRWkw?= =?utf-8?B?OWVzdVdob1FZa2RMZzZlZzBiWEJhYWxmdXNQWHhGa25wYk9FQzhOOTBhSWEy?= =?utf-8?B?RHpONFdtaXlXa2xmUHBVWWtrQlpkOTFZRHNBZFZGZ1hxVS9XdDhJcUZqUkFi?= =?utf-8?B?a0VMZU5BNkg1M3JDeEtqU1pYTC9mTDBzaUVKSHV6MGwyMFBkTStvV1k4ZnZY?= =?utf-8?B?NVpIcmM0aUZDKzROQWlVYVVJcGhJUlFBcWZpWC8vb21xUnVGcW1iZHFDaHZz?= =?utf-8?B?VE96MjVhYTd2UVh6UTlrb00yZUk3WXN6MEtGa1A0RGRDeVRBRHpObTd4ODNR?= =?utf-8?B?SmRZWmx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?utf-8?B?dDBvbmovdnBvUGJqUUowRWJHcmFDcVF6OFArRkFTVGM4NU8wWklOT0phWkdq?= =?utf-8?B?UU5CdUpQR3h1M25RbXlYb05Ea1FRTVlMOW5YeDZreDNjMlZHRm93KzRlK0JV?= =?utf-8?B?akxudVVIenFweCtZWDJNaFAzSEdSQ21aQWRTR0ZYSlp2ekhsWkcrVjMrOHdG?= =?utf-8?B?Z3FzK0M3aE9GWHQzcHNpNEtNRnN1eVRDK3FxS0ExOUJrQ2hkWS94QmNvbWM3?= =?utf-8?B?clNwQ2I5RzlvM0Q4Y1FaR05RbnIwVU1Id21GeEZYZHlaYkZGc2dxSk81eUVD?= =?utf-8?B?dHdOS0JaRVZXbzI0VnVhZ3o5SUU5YTVuN2VWclRLUEpSTXliYzNvZHFRaXp1?= =?utf-8?B?Y0JGakRHRytWZG42eitFQUJsNXRNQ0lmbkRWN1B1WGJuT1RWZDJrVWxxWmFC?= =?utf-8?B?YklUS3ZyQTVSQ252YVlyVkFpYllMYkZxYUQ4RnNTV3E0dm1xUzQrRWN5VnBV?= =?utf-8?B?cVZWSWlUVm1jTG9jOEIrbUpZc2wrUWtYT1hvWmM0YnNOYzJya0tJS1d5NlA4?= =?utf-8?B?dkNZQTNmazhaTklLVjFaZ3labm9tVWdkMWhXL1RJQTVxRlI5eWxyVmRLM1dx?= =?utf-8?B?NlRLSUdwcS84V1JKbWtTS1VLbVV0S0dmRlp6QlJmTmdGMVFhQVF3ZUlweU9F?= =?utf-8?B?cEV1SWIxRTk1NEZ6ZHhwQXRHbEpXeDh5anRDSHZoZWdGTm1ScytlRUZZbzYw?= =?utf-8?Q?SH1rn+PVDFxluKz41u03pnwwn?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4193c45-8e1e-4c18-56c9-08dc2f0a3fb6 X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5427.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 16:13:44.6385 (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: 8h0HCLhdFv433QKt3nhTZFUATlZPzFQoXbc4iMUgcQ2KjFjbWW0AC8rdJ5zntZIlaRRB/8CNDBQ5+Oc7PMNF/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7025 On 2024-02-16 11:11, Harry Wentland wrote: > > > On 2024-02-16 10:42, Pekka Paalanen wrote: >> On Fri, 16 Feb 2024 09:33:47 -0500 >> Harry Wentland wrote: >> >>> On 2024-02-16 03:19, Pekka Paalanen wrote: >>>> On Fri, 2 Feb 2024 10:28:35 -0500 >>>> Hamza Mahfooz wrote: >>>> >>>>> We want programs besides the compositor to be able to enable or disable >>>>> panel power saving features. >>>> >>>> Could you also explain why, in the commit message, please? >>>> >>>> It is unexpected for arbitrary programs to be able to override the KMS >>>> client, and certainly new ways to do so should not be added without an >>>> excellent justification. >>>> >>>> Maybe debugfs would be more appropriate if the purpose is only testing >>>> rather than production environments? >>>> >>>>> However, since they are currently only >>>>> configurable through DRM properties, that isn't possible. So, to remedy >>>>> that issue introduce a new "panel_power_savings" sysfs attribute. >>>> >>>> When the DRM property was added, what was used as the userspace to >>>> prove its workings? >>>> >>> >>> I don't think there ever was a userspace implementation and doubt any >>> exists today. Part of that is on me. In hindsight, the KMS prop should >>> have never gone upstream. >>> >>> I suggest we drop the KMS prop entirely. >> >> Sounds good. What about the sysfs thing? Should it be a debugfs thing >> instead, assuming the below question will be resolved? >> > > > It's intended to be used by the power profiles daemon (PPD). I don't think > debugfs is the right choice. See > https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/41ed5d33a82b0ceb7b6d473551eb2aa62cade6bc > >>> As for the color accuracy topic, I think it is important that compositors >>> can have full control over that if needed, while it's also important >>> for HW vendors to optimize for power when absolute color accuracy is not >>> needed. An average end-user writing code or working on their slides >>> would rather have a longer battery life than a perfectly color-accurate >>> display. We should probably think of a solution that can support both >>> use-cases. >> >> I agree. Maybe this pondering should start from "how would it work from >> end user perspective"? >> >> "Automatically" is probably be most desirable answer. Some kind of > > I agree > >> desktop settings with options like "save power at the expense of image >> quality": >> - always >> - not if watching movies/gaming >> - on battery >> - on battery, unless I'm watching movies/gaming >> - never >> > > It's interesting that you split out movies/gaming, specifically. AMD's > ABM algorithm seems to have considered movies in particular when > evaluating the power/fidelity trade-off. > > I wouldn't think consumer media is very particular about a specific > color fidelity (despite what HDR specs try to make you believe). Where > color fidelity would matter to me is when I'd want to edit pictures or > video. > > The "abm_level" property that we expose is really just that, a setting > for the strength of the power-savings effect, with 0 being off and 4 being > maximum strength and power saving, at the expense of fidelity. > > Mario's work is to let the PPD control it and set the ABM levels based on > the selected power profile: > 0 - Performance > 1 - Balance > 3 - Power > > And I believe we've looked at disabling ABM (setting it to 0) automatically > if we know we're on AC power. > >> Or maybe there already is something like that, and it only needs to be >> plumbed through? >> >> Which would point towards KMS clients needing to control it, which >> means a generic KMS prop rather than vendor specific? >> >> Or should the desktop compositor be talking to some daemon instead of >> KMS for this? Maybe they already are? >> > > I think the intention is for the PPD to be that daemon. Mario can elaborate. > Some more details and screenshots on how the PPD is expected to work and look: https://linuxconfig.org/how-to-manage-power-profiles-over-d-bus-with-power-profiles-daemon-on-linux Harry > Harry > >> >> Thanks, >> pq >