Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1483360rdb; Wed, 20 Sep 2023 10:16:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEppa1kV8HGuYZdA4B5ksNgrOtzler8IgNEeL3pA8+EuDZzOZf7d0qK75mi95lSSMviHcln X-Received: by 2002:a17:90b:1994:b0:273:e689:8dfc with SMTP id mv20-20020a17090b199400b00273e6898dfcmr3389532pjb.32.1695230205214; Wed, 20 Sep 2023 10:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695230205; cv=none; d=google.com; s=arc-20160816; b=NBEmlhxNjbre5UkDMP3rVOPVLfAAInpSzSF3aMS6ET1+iAgcuo6zHHz1iNEhX2dRzz ErJCl+1C+96tbfICE38746ot4kTXy++5gH9rT5xoufyCaf6q/fbH82Jy2g1iKK9qGxOB /f+kfDRAM4MOapZRoI4rjSJrEXUoeWp7QcuY6zozsqp0ohT2OG7sg1wUSaKmp6FSw9wC hgdpQCQyilM7rjDbpD5go70d1sY5qgdQGd6wdLucWP+k9WIbHHJPy2P/JC5ChGczFrnc /WPWK4YO7+UgZl7QbkKqHceVR+/CcATOoK8Pzj4CZE7r1LH1+PfMlhokFcxRHD6G9b3f kIfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=sQo8vDODXx3fYaCE4WfuBHpjkAu0nWv+Aif1bIm+G0c=; fh=FhiGs3uy0xKhOVeSzKabNoZlbF7tWGsHIs8EAFYaDas=; b=iMZieXy0VaD0AaFSdoeI+LoyY6tIVDUe/nkjeYvYatZIHZUlgPx/YggY9GAGRvOPqo 3kaKTMa4bb8zn+LTmLJyxIwjShRIO09k94zkJp1mK3Z+zoVX5n2SwvJs3YvhOn36vf59 XPUo3iftY/5rfRyF/81zxU3rv+ptjUzaG+8jvKBHGvHXCTOhDi/sqtgF+DknPb5hp1hS djk6NV6O0rIZBgESeUxpfWL+ZuI7Wgxyw8k55xQ/9xtlFCPS1D1wTofMV6d4ZBOQNX3C L06L/GlRg9KeOjZ2GIarQm7Im0qLg9oWEnsc5qw7KiYyQECZYJLBHQXbwJQwqmIYk9wV 2uTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KCzy7X43; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id e15-20020a17090a9a8f00b0026803b4ddfcsi1851993pjp.103.2023.09.20.10.16.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 10:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KCzy7X43; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 717E08220746; Wed, 20 Sep 2023 02:33:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234181AbjITJdP (ORCPT + 99 others); Wed, 20 Sep 2023 05:33:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234153AbjITJdN (ORCPT ); Wed, 20 Sep 2023 05:33:13 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78232B6 for ; Wed, 20 Sep 2023 02:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695202338; 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=sQo8vDODXx3fYaCE4WfuBHpjkAu0nWv+Aif1bIm+G0c=; b=KCzy7X43Ky3iuukcyVTgy1FmssN+P9IW4wqXUj8y1MHwDQHPB1Ii5OHzLZwkgoiTkV6yOW LbpVOT5imfpn0LMrF+dWZVyN4zJO2ZilDndT7aH+JNYR9tclgT9H6SqZTsMe3jPuwLtHAx pIyuq37p0QX6eyRIC9zmouQoavx1IjA= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-359-1H4ehfJzONmpxhIYNT_f0Q-1; Wed, 20 Sep 2023 05:32:17 -0400 X-MC-Unique: 1H4ehfJzONmpxhIYNT_f0Q-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-9a681c3470fso476478166b.1 for ; Wed, 20 Sep 2023 02:32:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695202336; x=1695807136; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sQo8vDODXx3fYaCE4WfuBHpjkAu0nWv+Aif1bIm+G0c=; b=NsBbD35/jDlqmntAHgg8W6fEi2rQ7e/LjTc/7dENb4J43oDjMg1+A7iJk6PYGzAadM dZ4HZEL0DFkY13h02vHtX6yAWsHh+uPxpntEg/dJoSofdv94oYJke/iY4NCBC/Lnu73E SlmAAt4WAe5nnQJQs7HEVh5frLHBF4lnzNoMVQAaZ2gPiN8Ue8OOvhqRLJkDZJwOR6tj EYQpfiOIMsqalv4f0JEsN7GdyUKNLd5WtXJn8tQwBQDSq/5cAk0Np1s94APt8y8BkgFj NpL7gZYpZC6fgMOtWMxdI8U1rNIyRSSGjXc9w9Gm5+QvXqZZT7u7DE3HWldNm0uyBzRj N1Yw== X-Gm-Message-State: AOJu0YxEY+cjqFuEaYcH7UTidbJphOEAgR0l3w2IuRlTFTHZDf6mWMwX 1W6IgsN8Lb0aAmQSrXGhYdgNX92dP/KQHUzzAnFESpiiMauJf7UH9xcsDzieJkd3Rd8pMW0l3UR 8hv7jTgNG9gpA0s5vMaHR4/8S X-Received: by 2002:aa7:c54f:0:b0:530:ccf7:37af with SMTP id s15-20020aa7c54f000000b00530ccf737afmr1655287edr.12.1695202335954; Wed, 20 Sep 2023 02:32:15 -0700 (PDT) X-Received: by 2002:aa7:c54f:0:b0:530:ccf7:37af with SMTP id s15-20020aa7c54f000000b00530ccf737afmr1655263edr.12.1695202335605; Wed, 20 Sep 2023 02:32:15 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id fg5-20020a056402548500b00530aae2d5bfsm6429345edb.9.2023.09.20.02.32.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Sep 2023 02:32:14 -0700 (PDT) Message-ID: Date: Wed, 20 Sep 2023 11:32:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 1/1] backlight: hid_bl: Add VESA VCP HID backlight driver To: Julius Zint Cc: =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= , Lee Jones , Daniel Thompson , Jingoo Han , Jiri Kosina , Benjamin Tissoires , Helge Deller , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-input@vger.kernel.org, linux-fbdev@vger.kernel.org References: <20230820094118.20521-1-julius@zint.sh> <20230820094118.20521-2-julius@zint.sh> <9a5364de-28e1-1d4a-1d3a-d6dcedb7e659@zint.sh> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 20 Sep 2023 02:33:18 -0700 (PDT) Hi, On 9/19/23 19:46, Julius Zint wrote: > > > On Wed, 6 Sep 2023, Hans de Goede wrote: > >> Hi Julius, >> >> On 9/4/23 21:02, Julius Zint wrote: >>> >>> >>> On Mon, 4 Sep 2023, Thomas Weißschuh wrote: >>> >>>> +Cc Hans who ins involved with the backlight subsystem >>>> >>>> Hi Julius, >>>> >>>> today I stumbled upon a mail from Hans [0], which explains that the >>>> backlight subsystem is not actually a good fit (yet?) for external >>>> displays. >>>> >>>> It seems a new API is in the works that would better fit, but I'm not >>>> sure about the state of this API. Maybe Hans can clarify. >>>> >>>> This also ties back to my review question how userspace can figure out >>>> to which display a backlight devices applies. So far it can not. >>>> >>>> [0] https://lore.kernel.org/lkml/7f2d88de-60c5-e2ff-9b22-acba35cfdfb6@redhat.com/ >>>> >>> >>> Hi Thomas, >>> >>> thanks for the hint. I will make sure to give this a proper read and >>> see, if it fits my use case better then the current backlight subsystem. >> >> Note the actual proposal for the new usespace API for display brightness >> control is here: >> >> https://lore.kernel.org/dri-devel/b61d3eeb-6213-afac-2e70-7b9791c86d2e@redhat.com/ >> >> I have finished / stabilized the backlight code refactor which I landed >> in 6.1, which is a prerequisite for the above proposal. But I have not >> been able to make time to actually implement the above proposal; and >> I don't know when I will be able to make time for this. >> >>> Especially since I wasnt able to properly address your other review >>> comments for now. You are right that the name should align better with >>> the kernel module and also, that it is possible for multiple displays to >>> be attached. >>> >>> In its current state, this would mean that you could only control the >>> backlight for the first HID device (enough for me :-). >>> >>> The systemd-backlight@.service uses not only the file name, but also the >>> full bus path for storing/restoring backlights. I did not yet get around >>> to see how the desktops handle brightness control, but since the >>> systemd-backlight@.service already uses the name, its important to stay >>> the same over multiple boots. >>> >>> I would be able to get a handle on the underlying USB device and use the >>> serial to uniquely (and persistently) name the backlight. But it does >>> feel hacky doing it this way. >> >> So mutter (gnome-shell compositor library) has a similar issue when saving >> monitor layouts and I can tell you beforehand that monitor serial numbers >> by themselves are not unique enough. Some models just report 123456789 >> as serial and if you have a dual-monitor setup with 2 such monitors >> and name the backlight class device -vcp-hid or something like that >> you will still end up with 2 identical names. >> >> To avoid this when saving monitor layouts mutter saves both the port >> to which the monitor is attached (e.g. DP-1 DP-2) and the serialnumber >> and on startup / monitor hotplug when it checks to see if it has saved >> layout info for the monitor it checks the port+serialnr combination. >> >> So what I think you should do is figure out a way to map which >> VCP HID device maps to which drm-connector and then use >> the connector-name + serial-nr to generate the backlight device name. >> >> We will need the mapping the a drm-connector object anyway for >> the new brightness API proposal from above. >> >> Note this does NOT solve the fact that registering a new backlight >> class device for an external monitor on a laptop will hopelessly >> confuse userspace, see: >> >> https://lore.kernel.org/lkml/7f2d88de-60c5-e2ff-9b22-acba35cfdfb6@redhat.com/ >> >> Regards, >> >> Hans >> > > Thank you for all this additional information. I have watched the talks > and read up upon the mail threads you`ve linked. Now I wonder which presentation you have watched, did you watch the old XDC2014 presentation ? Note I gave a much more up2date presentation on this at kernel-recipes last year: https://kernel-recipes.org/en/2022/talks/new-userspace-api-for-display-panel-brightness-control/ > I will see if I can make the mapping to the DRM connector and plan to > update this patchset. Sounds good. Regards, Hans