From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94ACAC32796 for ; Wed, 24 Aug 2022 18:12:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239423AbiHXSMY (ORCPT ); Wed, 24 Aug 2022 14:12:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240454AbiHXSMW (ORCPT ); Wed, 24 Aug 2022 14:12:22 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26CB36D9DA for ; Wed, 24 Aug 2022 11:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661364739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=cmdcz3/aE0EiHKXTs/dw6orYmLpo06czB4O9H4wnuNSGtXKOy0KDB04XEUPLOaLLyvYQdZ CUXuNaIMxkJsDMd34BhU/AjxGGSp10EyRIX9H6ZFoZzGTDnZl7RNHCLKXEf72DnzGCgiOh kGMBtbPO7pmMDzafMxB5eGhR8I5Qps0= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-670-esXXTUrVO4m83W9uhCOgJg-1; Wed, 24 Aug 2022 14:12:18 -0400 X-MC-Unique: esXXTUrVO4m83W9uhCOgJg-1 Received: by mail-qk1-f199.google.com with SMTP id bi16-20020a05620a319000b006bc2334be53so7337027qkb.14 for ; Wed, 24 Aug 2022 11:12:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=P1l2hPNhfiMzKtNnSOO36uJAqn+VPt/x8K4Y0XzH5kkJAxKb2PurEieornV43vUk+V j/F2HSPt84AdnMa7Eouv20PsAuMDCJkTiaGKpeSBwlMAJ3EmtN1Hf1lS0jGwSakWBBVC cSEAcKFHWJh1+c3dsswWHnylU11JxwP4hDhGyy2/Ya7YMU4G6Qgzd681bdgNWuM3mdVz 83YkxidjJN6FhboX8BOBQPDtBeSueMFuKoq6A+bFDHn96T0LSe/4N76x273G+s/D4ua0 dzX//70kEheelVyFbRjBz5GPN3eZm+zeBT0ldMy7Nd3N21gbOVKpjtGMnZ6mVx/ny+Cq A9LQ== X-Gm-Message-State: ACgBeo2PMUso+IrYPa3oDXIYKEcoqodR49USq/vHfhw1M7RCt5FI9mwH WKzyVMSfP2hau7G/XL3aSG+sKqjacoUtoTqe30GJ1pUSYg5V7p9ZuvbbMjoJekXyMB4y7cpX3y3 BnxhWrW96sAtDV1h+iLoYuA== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338528qvb.101.1661364737700; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SOi3GajklItGmlUgJlLLhtanN0frscFinRBtNfwg/Jh8eIC0ruh9bVuC+aRmJv5zCKqZZxQ== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338488qvb.101.1661364737427; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) Received: from [192.168.8.139] (pool-100-0-245-4.bstnma.fios.verizon.net. [100.0.245.4]) by smtp.gmail.com with ESMTPSA id u4-20020a05620a454400b006bbe7ded98csm12598653qkp.112.2022.08.24.11.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 11:12:16 -0700 (PDT) Message-ID: <341368d96c5c3bdbcab48d48a0d9b702a930ea05.camel@redhat.com> Subject: Re: [PATCH v4 31/31] drm/todo: Add entry about dealing with brightness control on devices with > 1 panel From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , Pan Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Lukas Wunner , Mark Gross , Andy Shevchenko Cc: nouveau@lists.freedesktop.org, Daniel Vetter , David Airlie , intel-gfx , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Len Brown , linux-acpi@vger.kernel.org, platform-driver-x86@vger.kernel.org Date: Wed, 24 Aug 2022 14:12:15 -0400 In-Reply-To: <20220824121523.1291269-32-hdegoede@redhat.com> References: <20220824121523.1291269-1-hdegoede@redhat.com> <20220824121523.1291269-32-hdegoede@redhat.com> Organization: Red Hat Inc. Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Reviewed-by: Lyude Paul On Wed, 2022-08-24 at 14:15 +0200, Hans de Goede wrote: > Add an entry summarizing the discussion about dealing with brightness > control on devices with more then 1 internal panel. > > The original discussion can be found here: > https://lore.kernel.org/dri-devel/20220517152331.16217-1-hdegoede@redhat.com/ > > Signed-off-by: Hans de Goede > --- > Documentation/gpu/todo.rst | 68 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst > index 7634c27ac562..393d218e4a0c 100644 > --- a/Documentation/gpu/todo.rst > +++ b/Documentation/gpu/todo.rst > @@ -679,6 +679,74 @@ Contact: Sam Ravnborg > > Level: Advanced > > +Brightness handling on devices with multiple internal panels > +============================================================ > + > +On x86/ACPI devices there can be multiple backlight firmware interfaces: > +(ACPI) video, vendor specific and others. As well as direct/native (PWM) > +register programming by the KMS driver. > + > +To deal with this backlight drivers used on x86/ACPI call > +acpi_video_get_backlight_type() which has heuristics (+quirks) to select > +which backlight interface to use; and backlight drivers which do not match > +the returned type will not register themselves, so that only one backlight > +device gets registered (in a single GPU setup, see below). > + > +At the moment this more or less assumes that there will only > +be 1 (internal) panel on a system. > + > +On systems with 2 panels this may be a problem, depending on > +what interface acpi_video_get_backlight_type() selects: > + > +1. native: in this case the KMS driver is expected to know which backlight > + device belongs to which output so everything should just work. > +2. video: this does support controlling multiple backlights, but some work > + will need to be done to get the output <-> backlight device mapping > + > +The above assumes both panels will require the same backlight interface type. > +Things will break on systems with multiple panels where the 2 panels need > +a different type of control. E.g. one panel needs ACPI video backlight control, > +where as the other is using native backlight control. Currently in this case > +only one of the 2 required backlight devices will get registered, based on > +the acpi_video_get_backlight_type() return value. > + > +If this (theoretical) case ever shows up, then supporting this will need some > +work. A possible solution here would be to pass a device and connector-name > +to acpi_video_get_backlight_type() so that it can deal with this. > + > +Note in a way we already have a case where userspace sees 2 panels, > +in dual GPU laptop setups with a mux. On those systems we may see > +either 2 native backlight devices; or 2 native backlight devices. > + > +Userspace already has code to deal with this by detecting if the related > +panel is active (iow which way the mux between the GPU and the panels > +points) and then uses that backlight device. Userspace here very much > +assumes a single panel though. It picks only 1 of the 2 backlight devices > +and then only uses that one. > + > +Note that all userspace code (that I know off) is currently hardcoded > +to assume a single panel. > + > +Before the recent changes to not register multiple (e.g. video + native) > +/sys/class/backlight devices for a single panel (on a single GPU laptop), > +userspace would see multiple backlight devices all controlling the same > +backlight. > + > +To deal with this userspace had to always picks one preferred device under > +/sys/class/backlight and will ignore the others. So to support brightness > +control on multiple panels userspace will need to be updated too. > + > +There are plans to allow brightness control through the KMS API by adding > +a "display brightness" property to drm_connector objects for panels. This > +solves a number of issues with the /sys/class/backlight API, including not > +being able to map a sysfs backlight device to a specific connector. Any > +userspace changes to add support for brightness control on devices with > +multiple panels really should build on top of this new KMS property. > + > +Contact: Hans de Goede > + > +Level: Advanced > + > Outside DRM > =========== > -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 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 560FAC28D13 for ; Thu, 25 Aug 2022 10:15:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 49DAC10FDC6; Thu, 25 Aug 2022 10:15:24 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6AA9910F6B5 for ; Thu, 25 Aug 2022 10:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661422518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=bbzYhp7uYcqHKBc/qC2rD/yg6wDQQbbWk/8CFOmpH5fuSCV0aAWNMlII44t1a2YSvjj+Fz fSfqB2bTMne7JEAtBxRMDvdAjkoVFC+VUOLGrJNJG9L+dPw3whye52R4mY7fI29xHQbt7G n7m4WE1nlKF3AjallLbQmEwx1j8wFxQ= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-52-9QDsveroPuWZInI3NktT1Q-1; Wed, 24 Aug 2022 14:12:18 -0400 X-MC-Unique: 9QDsveroPuWZInI3NktT1Q-1 Received: by mail-qk1-f200.google.com with SMTP id u15-20020a05620a0c4f00b006b8b3f41303so15229169qki.8 for ; Wed, 24 Aug 2022 11:12:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=FCN+YRW4Bavmxte0OGyRTyJ5VffBsIbebTFflgBwwV8/U83M/bzgk7O0G4tb+st71Q 2pzBWsgHig6zhBE40fetLTmcPldQc6VI7ZHyZJpJmLcD3YNOrenZ3Y5a/mcMKqZN6kHA 8+++v5OGVX0VU7fGT9G+PvCfC0ZqS2/CNqd7oHbl4VK2+4iIdo13ef5mfvfltDOY4yUa Xpw5Qyvv1Hrt9SasxyvJX615D0UOPWDVHz6vLNRCgQQlUlvRp+sxNh4vp0XxM18sAP8E Ort+JX8MZGoIqmJj15oPmzrmNIqLztpeHJsqOOxXY7dYrjEVieYXcpF3qqUYKd5NrD7f KwTw== X-Gm-Message-State: ACgBeo0TDIYa3eISNYosO6z/ylG4VGk0ewz4NUIjX9Y21h2+2XHB04n4 Y6EkJUAk8dcn2FOQOdVx1fRMDZZ9ceqnYA5KwZLpqcTFOrqWdKlMrfroRZTg4H08r9fSazBJ0bZ FxBFS0UH/DbGHUcCczhpG4DD6Qg== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338530qvb.101.1661364737701; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SOi3GajklItGmlUgJlLLhtanN0frscFinRBtNfwg/Jh8eIC0ruh9bVuC+aRmJv5zCKqZZxQ== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338488qvb.101.1661364737427; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) Received: from [192.168.8.139] (pool-100-0-245-4.bstnma.fios.verizon.net. [100.0.245.4]) by smtp.gmail.com with ESMTPSA id u4-20020a05620a454400b006bbe7ded98csm12598653qkp.112.2022.08.24.11.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 11:12:16 -0700 (PDT) Message-ID: <341368d96c5c3bdbcab48d48a0d9b702a930ea05.camel@redhat.com> From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , Pan Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Lukas Wunner , Mark Gross , Andy Shevchenko Date: Wed, 24 Aug 2022 14:12:15 -0400 In-Reply-To: <20220824121523.1291269-32-hdegoede@redhat.com> References: <20220824121523.1291269-1-hdegoede@redhat.com> <20220824121523.1291269-32-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Nouveau] [PATCH v4 31/31] drm/todo: Add entry about dealing with brightness control on devices with > 1 panel X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Len Brown Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" Reviewed-by: Lyude Paul On Wed, 2022-08-24 at 14:15 +0200, Hans de Goede wrote: > Add an entry summarizing the discussion about dealing with brightness > control on devices with more then 1 internal panel. > > The original discussion can be found here: > https://lore.kernel.org/dri-devel/20220517152331.16217-1-hdegoede@redhat.com/ > > Signed-off-by: Hans de Goede > --- > Documentation/gpu/todo.rst | 68 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst > index 7634c27ac562..393d218e4a0c 100644 > --- a/Documentation/gpu/todo.rst > +++ b/Documentation/gpu/todo.rst > @@ -679,6 +679,74 @@ Contact: Sam Ravnborg > > Level: Advanced > > +Brightness handling on devices with multiple internal panels > +============================================================ > + > +On x86/ACPI devices there can be multiple backlight firmware interfaces: > +(ACPI) video, vendor specific and others. As well as direct/native (PWM) > +register programming by the KMS driver. > + > +To deal with this backlight drivers used on x86/ACPI call > +acpi_video_get_backlight_type() which has heuristics (+quirks) to select > +which backlight interface to use; and backlight drivers which do not match > +the returned type will not register themselves, so that only one backlight > +device gets registered (in a single GPU setup, see below). > + > +At the moment this more or less assumes that there will only > +be 1 (internal) panel on a system. > + > +On systems with 2 panels this may be a problem, depending on > +what interface acpi_video_get_backlight_type() selects: > + > +1. native: in this case the KMS driver is expected to know which backlight > + device belongs to which output so everything should just work. > +2. video: this does support controlling multiple backlights, but some work > + will need to be done to get the output <-> backlight device mapping > + > +The above assumes both panels will require the same backlight interface type. > +Things will break on systems with multiple panels where the 2 panels need > +a different type of control. E.g. one panel needs ACPI video backlight control, > +where as the other is using native backlight control. Currently in this case > +only one of the 2 required backlight devices will get registered, based on > +the acpi_video_get_backlight_type() return value. > + > +If this (theoretical) case ever shows up, then supporting this will need some > +work. A possible solution here would be to pass a device and connector-name > +to acpi_video_get_backlight_type() so that it can deal with this. > + > +Note in a way we already have a case where userspace sees 2 panels, > +in dual GPU laptop setups with a mux. On those systems we may see > +either 2 native backlight devices; or 2 native backlight devices. > + > +Userspace already has code to deal with this by detecting if the related > +panel is active (iow which way the mux between the GPU and the panels > +points) and then uses that backlight device. Userspace here very much > +assumes a single panel though. It picks only 1 of the 2 backlight devices > +and then only uses that one. > + > +Note that all userspace code (that I know off) is currently hardcoded > +to assume a single panel. > + > +Before the recent changes to not register multiple (e.g. video + native) > +/sys/class/backlight devices for a single panel (on a single GPU laptop), > +userspace would see multiple backlight devices all controlling the same > +backlight. > + > +To deal with this userspace had to always picks one preferred device under > +/sys/class/backlight and will ignore the others. So to support brightness > +control on multiple panels userspace will need to be updated too. > + > +There are plans to allow brightness control through the KMS API by adding > +a "display brightness" property to drm_connector objects for panels. This > +solves a number of issues with the /sys/class/backlight API, including not > +being able to map a sysfs backlight device to a specific connector. Any > +userspace changes to add support for brightness control on devices with > +multiple panels really should build on top of this new KMS property. > + > +Contact: Hans de Goede > + > +Level: Advanced > + > Outside DRM > =========== > -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 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 6AC5EC28D13 for ; Thu, 25 Aug 2022 10:15:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 55A3710F791; Thu, 25 Aug 2022 10:15:22 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6EDBC11306D for ; Thu, 25 Aug 2022 10:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661422515; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=IG40fXr7jL7BIqTDk8/kejnukL8C5sICi/2dR0jNKFcs1s8PYkwI6Peen1ChMV5lHf+cAs FDsAtKA5vrOk2jrFM0izkqgYKRQM8l+zuGIWTixUM+GPTrTDKVBzxBAG1OutXFLAHFHmzv o32I8PC4Bq35USpMHju4yYgausyftrM= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-670-obsEApCJMn-zzkHtwWRifA-1; Wed, 24 Aug 2022 14:12:18 -0400 X-MC-Unique: obsEApCJMn-zzkHtwWRifA-1 Received: by mail-qk1-f198.google.com with SMTP id de4-20020a05620a370400b006a9711bd9f8so15262015qkb.9 for ; Wed, 24 Aug 2022 11:12:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=Weonp72yRhK64q7mYJs11RUASFSp0U8eTBz7yfKXtvQ4EqViWxvdtuOV0cTlfB3G3W kroFI8sQc75A6e0WwvsUz6I453h5amwkfJw/UuGdOad4IKgxDmpVMIP33NQ915Q81ENu mo/ZwWrZsiLFrrkcFX5zkDR5s5ZLceiOScUmN1FJ0q2LRPZ0AngcNlQW0gMMsx/ouBAe 0XxzMuY98bFrA3vHofu7luwWknGEHic5dRwg52b5vx4UikCIDcLaJ8hy5pUOF9N5o+3a Rt+K/qkZ0+5gPzpWK0VDW4Lk7VgGA/qOGAw5bAt8cGdqt+a2Ty7n4vAV5sfvtH2xU/5W jwwQ== X-Gm-Message-State: ACgBeo17oFlpxhdx/M/TjuLMybMu1P6XIkivr7juXKGF4Yi8ipmhqUuA RXbFOQvsNCRDoiUFJEN42DSPwHzdFm6YXkaflA4glAi9eN59xt9s+DyzX3PVh/YWp32MlGyVJVa tW7I8fIQ2cdQuinRonP+5yENVWg9n X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338522qvb.101.1661364737696; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SOi3GajklItGmlUgJlLLhtanN0frscFinRBtNfwg/Jh8eIC0ruh9bVuC+aRmJv5zCKqZZxQ== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338488qvb.101.1661364737427; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) Received: from [192.168.8.139] (pool-100-0-245-4.bstnma.fios.verizon.net. [100.0.245.4]) by smtp.gmail.com with ESMTPSA id u4-20020a05620a454400b006bbe7ded98csm12598653qkp.112.2022.08.24.11.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 11:12:16 -0700 (PDT) Message-ID: <341368d96c5c3bdbcab48d48a0d9b702a930ea05.camel@redhat.com> Subject: Re: [PATCH v4 31/31] drm/todo: Add entry about dealing with brightness control on devices with > 1 panel From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , Pan Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Lukas Wunner , Mark Gross , Andy Shevchenko Date: Wed, 24 Aug 2022 14:12:15 -0400 In-Reply-To: <20220824121523.1291269-32-hdegoede@redhat.com> References: <20220824121523.1291269-1-hdegoede@redhat.com> <20220824121523.1291269-32-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Len Brown Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Reviewed-by: Lyude Paul On Wed, 2022-08-24 at 14:15 +0200, Hans de Goede wrote: > Add an entry summarizing the discussion about dealing with brightness > control on devices with more then 1 internal panel. > > The original discussion can be found here: > https://lore.kernel.org/dri-devel/20220517152331.16217-1-hdegoede@redhat.com/ > > Signed-off-by: Hans de Goede > --- > Documentation/gpu/todo.rst | 68 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst > index 7634c27ac562..393d218e4a0c 100644 > --- a/Documentation/gpu/todo.rst > +++ b/Documentation/gpu/todo.rst > @@ -679,6 +679,74 @@ Contact: Sam Ravnborg > > Level: Advanced > > +Brightness handling on devices with multiple internal panels > +============================================================ > + > +On x86/ACPI devices there can be multiple backlight firmware interfaces: > +(ACPI) video, vendor specific and others. As well as direct/native (PWM) > +register programming by the KMS driver. > + > +To deal with this backlight drivers used on x86/ACPI call > +acpi_video_get_backlight_type() which has heuristics (+quirks) to select > +which backlight interface to use; and backlight drivers which do not match > +the returned type will not register themselves, so that only one backlight > +device gets registered (in a single GPU setup, see below). > + > +At the moment this more or less assumes that there will only > +be 1 (internal) panel on a system. > + > +On systems with 2 panels this may be a problem, depending on > +what interface acpi_video_get_backlight_type() selects: > + > +1. native: in this case the KMS driver is expected to know which backlight > + device belongs to which output so everything should just work. > +2. video: this does support controlling multiple backlights, but some work > + will need to be done to get the output <-> backlight device mapping > + > +The above assumes both panels will require the same backlight interface type. > +Things will break on systems with multiple panels where the 2 panels need > +a different type of control. E.g. one panel needs ACPI video backlight control, > +where as the other is using native backlight control. Currently in this case > +only one of the 2 required backlight devices will get registered, based on > +the acpi_video_get_backlight_type() return value. > + > +If this (theoretical) case ever shows up, then supporting this will need some > +work. A possible solution here would be to pass a device and connector-name > +to acpi_video_get_backlight_type() so that it can deal with this. > + > +Note in a way we already have a case where userspace sees 2 panels, > +in dual GPU laptop setups with a mux. On those systems we may see > +either 2 native backlight devices; or 2 native backlight devices. > + > +Userspace already has code to deal with this by detecting if the related > +panel is active (iow which way the mux between the GPU and the panels > +points) and then uses that backlight device. Userspace here very much > +assumes a single panel though. It picks only 1 of the 2 backlight devices > +and then only uses that one. > + > +Note that all userspace code (that I know off) is currently hardcoded > +to assume a single panel. > + > +Before the recent changes to not register multiple (e.g. video + native) > +/sys/class/backlight devices for a single panel (on a single GPU laptop), > +userspace would see multiple backlight devices all controlling the same > +backlight. > + > +To deal with this userspace had to always picks one preferred device under > +/sys/class/backlight and will ignore the others. So to support brightness > +control on multiple panels userspace will need to be updated too. > + > +There are plans to allow brightness control through the KMS API by adding > +a "display brightness" property to drm_connector objects for panels. This > +solves a number of issues with the /sys/class/backlight API, including not > +being able to map a sysfs backlight device to a specific connector. Any > +userspace changes to add support for brightness control on devices with > +multiple panels really should build on top of this new KMS property. > + > +Contact: Hans de Goede > + > +Level: Advanced > + > Outside DRM > =========== > -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 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 0C365C04AA5 for ; Thu, 25 Aug 2022 10:15:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5FFBC10F6B5; Thu, 25 Aug 2022 10:15:25 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id B42A010FDC6 for ; Thu, 25 Aug 2022 10:15:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661422518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=bbzYhp7uYcqHKBc/qC2rD/yg6wDQQbbWk/8CFOmpH5fuSCV0aAWNMlII44t1a2YSvjj+Fz fSfqB2bTMne7JEAtBxRMDvdAjkoVFC+VUOLGrJNJG9L+dPw3whye52R4mY7fI29xHQbt7G n7m4WE1nlKF3AjallLbQmEwx1j8wFxQ= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-670-xTxwzBhYPk600_PZ2KOu_w-1; Wed, 24 Aug 2022 14:12:18 -0400 X-MC-Unique: xTxwzBhYPk600_PZ2KOu_w-1 Received: by mail-qk1-f197.google.com with SMTP id n15-20020a05620a294f00b006b5768a0ed0so15215999qkp.7 for ; Wed, 24 Aug 2022 11:12:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=cLXdy+v+f6Iie8zsolskEQvNPc5Po8QMiljS6luSLio25ZoATD5aGk5aa4/j/W9zEW h+3uiFKc8Ayg+FQBe40u/vxck5d41XIcpnCghOiW/uqYrrcQx/wp9bHz1fXJDa/RNCer kvpUMfqi4/8wzA/GF/FB0HpfaOqRypeS0eCWGiO3kLJq5HSrqeUSozBUWWgi8jodowr7 GjlGVYPRn8qGGn5xaBfs28rDSCBwAEyxEJM3IQIGjp/iDsa04r9Wbj85odPe/LvBgnPh IGZZ2vLiI0ZoKkzcdJpf3A0cJ7jBLXehHhj8Gmg66Pw+NWvd4rEq2MLh0/6TZ1JVpBpU aGyg== X-Gm-Message-State: ACgBeo21HzKVu/01Jpry/ZLqWxKLMP2vBhgexW2xCyDYQyHF2FkeDJye AGl5Wmun0SMnNEblypuyPl/upOMKcaQbbidQ74ttQB3m+jG8rRSYHb3kZf6T1Zf6RtRYHHz5nUz 19vkezu5zcWmaHEHFAWeC7vqlOgHO X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338523qvb.101.1661364737696; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SOi3GajklItGmlUgJlLLhtanN0frscFinRBtNfwg/Jh8eIC0ruh9bVuC+aRmJv5zCKqZZxQ== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338488qvb.101.1661364737427; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) Received: from [192.168.8.139] (pool-100-0-245-4.bstnma.fios.verizon.net. [100.0.245.4]) by smtp.gmail.com with ESMTPSA id u4-20020a05620a454400b006bbe7ded98csm12598653qkp.112.2022.08.24.11.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 11:12:16 -0700 (PDT) Message-ID: <341368d96c5c3bdbcab48d48a0d9b702a930ea05.camel@redhat.com> From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , Pan Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Lukas Wunner , Mark Gross , Andy Shevchenko Date: Wed, 24 Aug 2022 14:12:15 -0400 In-Reply-To: <20220824121523.1291269-32-hdegoede@redhat.com> References: <20220824121523.1291269-1-hdegoede@redhat.com> <20220824121523.1291269-32-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH v4 31/31] drm/todo: Add entry about dealing with brightness control on devices with > 1 panel X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Len Brown Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Reviewed-by: Lyude Paul On Wed, 2022-08-24 at 14:15 +0200, Hans de Goede wrote: > Add an entry summarizing the discussion about dealing with brightness > control on devices with more then 1 internal panel. > > The original discussion can be found here: > https://lore.kernel.org/dri-devel/20220517152331.16217-1-hdegoede@redhat.com/ > > Signed-off-by: Hans de Goede > --- > Documentation/gpu/todo.rst | 68 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst > index 7634c27ac562..393d218e4a0c 100644 > --- a/Documentation/gpu/todo.rst > +++ b/Documentation/gpu/todo.rst > @@ -679,6 +679,74 @@ Contact: Sam Ravnborg > > Level: Advanced > > +Brightness handling on devices with multiple internal panels > +============================================================ > + > +On x86/ACPI devices there can be multiple backlight firmware interfaces: > +(ACPI) video, vendor specific and others. As well as direct/native (PWM) > +register programming by the KMS driver. > + > +To deal with this backlight drivers used on x86/ACPI call > +acpi_video_get_backlight_type() which has heuristics (+quirks) to select > +which backlight interface to use; and backlight drivers which do not match > +the returned type will not register themselves, so that only one backlight > +device gets registered (in a single GPU setup, see below). > + > +At the moment this more or less assumes that there will only > +be 1 (internal) panel on a system. > + > +On systems with 2 panels this may be a problem, depending on > +what interface acpi_video_get_backlight_type() selects: > + > +1. native: in this case the KMS driver is expected to know which backlight > + device belongs to which output so everything should just work. > +2. video: this does support controlling multiple backlights, but some work > + will need to be done to get the output <-> backlight device mapping > + > +The above assumes both panels will require the same backlight interface type. > +Things will break on systems with multiple panels where the 2 panels need > +a different type of control. E.g. one panel needs ACPI video backlight control, > +where as the other is using native backlight control. Currently in this case > +only one of the 2 required backlight devices will get registered, based on > +the acpi_video_get_backlight_type() return value. > + > +If this (theoretical) case ever shows up, then supporting this will need some > +work. A possible solution here would be to pass a device and connector-name > +to acpi_video_get_backlight_type() so that it can deal with this. > + > +Note in a way we already have a case where userspace sees 2 panels, > +in dual GPU laptop setups with a mux. On those systems we may see > +either 2 native backlight devices; or 2 native backlight devices. > + > +Userspace already has code to deal with this by detecting if the related > +panel is active (iow which way the mux between the GPU and the panels > +points) and then uses that backlight device. Userspace here very much > +assumes a single panel though. It picks only 1 of the 2 backlight devices > +and then only uses that one. > + > +Note that all userspace code (that I know off) is currently hardcoded > +to assume a single panel. > + > +Before the recent changes to not register multiple (e.g. video + native) > +/sys/class/backlight devices for a single panel (on a single GPU laptop), > +userspace would see multiple backlight devices all controlling the same > +backlight. > + > +To deal with this userspace had to always picks one preferred device under > +/sys/class/backlight and will ignore the others. So to support brightness > +control on multiple panels userspace will need to be updated too. > + > +There are plans to allow brightness control through the KMS API by adding > +a "display brightness" property to drm_connector objects for panels. This > +solves a number of issues with the /sys/class/backlight API, including not > +being able to map a sysfs backlight device to a specific connector. Any > +userspace changes to add support for brightness control on devices with > +multiple panels really should build on top of this new KMS property. > + > +Contact: Hans de Goede > + > +Level: Advanced > + > Outside DRM > =========== > -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat From mboxrd@z Thu Jan 1 00:00:00 1970 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 96584C04AA5 for ; Thu, 25 Aug 2022 10:15:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7F1811333E; Thu, 25 Aug 2022 10:15:36 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 46E5E10F6B5 for ; Thu, 25 Aug 2022 10:15:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661422521; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=PMUxoxp6gzyNGNYJRr3sLdnzhioh/fgCs5WRHzPZcy/vK/MnPXFDH4d2VpGQZ6c7qg/hts uVuwJLisOliPJUYjP9e5uszTC1rK8NkJzYwDDyHPVL5Q/151O8nIe76fU0abvbbqx9vNHR o164lQnDIVb2+g8c63bS+S3lkmVXP0o= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-631-hqwKJwivOzGSyn806z9SeA-1; Wed, 24 Aug 2022 14:12:18 -0400 X-MC-Unique: hqwKJwivOzGSyn806z9SeA-1 Received: by mail-qt1-f200.google.com with SMTP id fc18-20020a05622a489200b00344b09d2578so9083055qtb.13 for ; Wed, 24 Aug 2022 11:12:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:organization :references:in-reply-to:date:cc:to:from:subject:message-id :x-gm-message-state:from:to:cc; bh=zQ3qZtEYF9kIZvb5A1H9IxOTwvdPfHqi1+4CI8j2JWY=; b=cw5DhAeeB+0svbh6SbncV+NV7wOg+XBLeqroLErmZzi2DLUti20fQ5uKU8ZCBUUh6F ZLtcVUe01pWIsBZ6BlVQKxq9c6d8JZgnK0GcRzZc75d/GGqjW1yKZdsdWldwDCK/dZMo MPZQ+cFI5dpjb/DczmYfCXAbYoF0/iL8J26E78eZrez+siRwSIMtgyDanOrvJeEP9E8/ aeP3hMMOTHxwOpzpkj6zpCBVL/swlvq+XDoelL7fAUJvMTOJxmZS/sCiWYxnqkAWt2a6 vbPwSQu2aPcJXfF17VeN5Lp8VGRCKbkoX31HXoNMBRiFntG1cUYYB3Tk8vjXS1Z5xYO6 KOJQ== X-Gm-Message-State: ACgBeo0RKWivduPAujLiaJMWLzbXYndRirC+gtmnQSctvn26VLUK2GfO YbDOQEUH9TKojczINMacghayTKzWiPEntSMxK2vgKHc9HNRmi8hFEPbBuwOny7HbWbsWvDYACOU D91xCtAsZfdROqkNCpwDZIFdxPw== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338531qvb.101.1661364737702; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4SOi3GajklItGmlUgJlLLhtanN0frscFinRBtNfwg/Jh8eIC0ruh9bVuC+aRmJv5zCKqZZxQ== X-Received: by 2002:a05:6214:27ee:b0:496:f17b:7459 with SMTP id jt14-20020a05621427ee00b00496f17b7459mr338488qvb.101.1661364737427; Wed, 24 Aug 2022 11:12:17 -0700 (PDT) Received: from [192.168.8.139] (pool-100-0-245-4.bstnma.fios.verizon.net. [100.0.245.4]) by smtp.gmail.com with ESMTPSA id u4-20020a05620a454400b006bbe7ded98csm12598653qkp.112.2022.08.24.11.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Aug 2022 11:12:16 -0700 (PDT) Message-ID: <341368d96c5c3bdbcab48d48a0d9b702a930ea05.camel@redhat.com> Subject: Re: [PATCH v4 31/31] drm/todo: Add entry about dealing with brightness control on devices with > 1 panel From: Lyude Paul To: Hans de Goede , Ben Skeggs , Karol Herbst , Daniel Dadap , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Alex Deucher , Christian =?ISO-8859-1?Q?K=F6nig?= , Pan Xinhui , "Rafael J . Wysocki" , Mika Westerberg , Lukas Wunner , Mark Gross , Andy Shevchenko Date: Wed, 24 Aug 2022 14:12:15 -0400 In-Reply-To: <20220824121523.1291269-32-hdegoede@redhat.com> References: <20220824121523.1291269-1-hdegoede@redhat.com> <20220824121523.1291269-32-hdegoede@redhat.com> Organization: Red Hat Inc. User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , nouveau@lists.freedesktop.org, intel-gfx , amd-gfx@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Len Brown Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" Reviewed-by: Lyude Paul On Wed, 2022-08-24 at 14:15 +0200, Hans de Goede wrote: > Add an entry summarizing the discussion about dealing with brightness > control on devices with more then 1 internal panel. > > The original discussion can be found here: > https://lore.kernel.org/dri-devel/20220517152331.16217-1-hdegoede@redhat.com/ > > Signed-off-by: Hans de Goede > --- > Documentation/gpu/todo.rst | 68 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 68 insertions(+) > > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst > index 7634c27ac562..393d218e4a0c 100644 > --- a/Documentation/gpu/todo.rst > +++ b/Documentation/gpu/todo.rst > @@ -679,6 +679,74 @@ Contact: Sam Ravnborg > > Level: Advanced > > +Brightness handling on devices with multiple internal panels > +============================================================ > + > +On x86/ACPI devices there can be multiple backlight firmware interfaces: > +(ACPI) video, vendor specific and others. As well as direct/native (PWM) > +register programming by the KMS driver. > + > +To deal with this backlight drivers used on x86/ACPI call > +acpi_video_get_backlight_type() which has heuristics (+quirks) to select > +which backlight interface to use; and backlight drivers which do not match > +the returned type will not register themselves, so that only one backlight > +device gets registered (in a single GPU setup, see below). > + > +At the moment this more or less assumes that there will only > +be 1 (internal) panel on a system. > + > +On systems with 2 panels this may be a problem, depending on > +what interface acpi_video_get_backlight_type() selects: > + > +1. native: in this case the KMS driver is expected to know which backlight > + device belongs to which output so everything should just work. > +2. video: this does support controlling multiple backlights, but some work > + will need to be done to get the output <-> backlight device mapping > + > +The above assumes both panels will require the same backlight interface type. > +Things will break on systems with multiple panels where the 2 panels need > +a different type of control. E.g. one panel needs ACPI video backlight control, > +where as the other is using native backlight control. Currently in this case > +only one of the 2 required backlight devices will get registered, based on > +the acpi_video_get_backlight_type() return value. > + > +If this (theoretical) case ever shows up, then supporting this will need some > +work. A possible solution here would be to pass a device and connector-name > +to acpi_video_get_backlight_type() so that it can deal with this. > + > +Note in a way we already have a case where userspace sees 2 panels, > +in dual GPU laptop setups with a mux. On those systems we may see > +either 2 native backlight devices; or 2 native backlight devices. > + > +Userspace already has code to deal with this by detecting if the related > +panel is active (iow which way the mux between the GPU and the panels > +points) and then uses that backlight device. Userspace here very much > +assumes a single panel though. It picks only 1 of the 2 backlight devices > +and then only uses that one. > + > +Note that all userspace code (that I know off) is currently hardcoded > +to assume a single panel. > + > +Before the recent changes to not register multiple (e.g. video + native) > +/sys/class/backlight devices for a single panel (on a single GPU laptop), > +userspace would see multiple backlight devices all controlling the same > +backlight. > + > +To deal with this userspace had to always picks one preferred device under > +/sys/class/backlight and will ignore the others. So to support brightness > +control on multiple panels userspace will need to be updated too. > + > +There are plans to allow brightness control through the KMS API by adding > +a "display brightness" property to drm_connector objects for panels. This > +solves a number of issues with the /sys/class/backlight API, including not > +being able to map a sysfs backlight device to a specific connector. Any > +userspace changes to add support for brightness control on devices with > +multiple panels really should build on top of this new KMS property. > + > +Contact: Hans de Goede > + > +Level: Advanced > + > Outside DRM > =========== > -- Cheers, Lyude Paul (she/her) Software Engineer at Red Hat