dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org, harry.wentland@amd.com,
	Xaver Hugl <xaver.hugl@gmail.com>,
	amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 4/8] DRM: Add support for client and driver indicating support for luminance
Date: Sat, 25 Apr 2026 09:45:30 -0500	[thread overview]
Message-ID: <cb1ab06a-630b-4bd7-95a3-5f679b84dbe2@amd.com> (raw)
In-Reply-To: <5trcw3bcadvk2ltmat5axlezuznylsgm5xr7dmo66o5ijcrpdz@fhv7yhmlklub>



On 4/25/26 07:17, Dmitry Baryshkov wrote:
> On Fri, Apr 24, 2026 at 05:09:49PM -0500, Mario Limonciello wrote:
>> The legacy backlight control interface can only be disabled when both
>> the client and driver have agreed that the luminance can be set during
>> a modeset. Add capability for the client to register and for the driver
>> to indicate support.
> 
> Please describe, why do we need DRM_CLIENT_CAP_LUMINANCE.
> 
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   drivers/gpu/drm/drm_atomic_uapi.c | 24 ++++++++++++++++++++++++
>>   drivers/gpu/drm/drm_connector.c   |  4 ++--
>>   drivers/gpu/drm/drm_ioctl.c       | 10 ++++++++++
>>   include/drm/drm_connector.h       |  5 +++++
>>   include/drm/drm_drv.h             |  7 +++++++
>>   include/drm/drm_file.h            |  8 ++++++++
>>   include/uapi/drm/drm.h            | 10 ++++++++++
>>   7 files changed, 66 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
>> index 27cc159c1d275..b5e6d940f2816 100644
>> --- a/include/uapi/drm/drm.h
>> +++ b/include/uapi/drm/drm.h
>> @@ -921,6 +921,16 @@ struct drm_get_cap {
>>    */
>>   #define DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE	7
>>   
>> +/**
>> + * DRM_CLIENT_CAP_LUMINANCE
>> + *
>> + * If set to 1, legacy sysfs interface for controlling backlight brightness will
>> + * be disabled.  The client will include luminance values as part of the modeset.
> 
> I don't think this is accurate (anymore?). The sysfs doesn't seem to be
> disabled. Rather the DRM updates it internally. Which might mean that we
> don't need an extra client cap.

I had code in my tree for doing it and decided to defer that (see cover 
letter) but forgot to drop the cap.

I suppose this is an area that would be good to discuss if it's worth 
getting some of it done in the same series or should be deferred.

The overally idea I have is:

1) Allow both sysfs and DRM master to do writes initially (allow 
transitioning and PoC)
2) Userspace changes to DRM master
3) Introduce client cap for it and block off sysfs writes when DRM 
master indicates it.
4) Move sysfs compat behind a kconfig
5) Drop Kconfig

The timescale between steps 3 and 5 is "many kernel cycles".

> 
>> +
>> + * This capability is supported starting in kernel 7.2
>> + */
>> +#define DRM_CLIENT_CAP_LUMINANCE		8
>> +
>>   /* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
>>   struct drm_set_client_cap {
>>   	__u64 capability;
>> -- 
>> 2.43.0
>>
> 


  reply	other threads:[~2026-04-25 14:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 22:09 [PATCH v3 0/8] Add support for a DRM backlight capability Mario Limonciello
2026-04-24 22:09 ` [PATCH v3 1/8] backlight: add kernel-internal backlight API Mario Limonciello
2026-05-04 13:55   ` Louis Chauvet
2026-05-04 17:55     ` Mario Limonciello
2026-05-08  0:53       ` Louis Chauvet
2026-04-24 22:09 ` [PATCH v3 2/8] backlight: expose the current brightness in the new kernel API Mario Limonciello
2026-05-04 13:55   ` Louis Chauvet
2026-05-04 17:46     ` Mario Limonciello
2026-04-24 22:09 ` [PATCH v3 3/8] drm: link connectors to backlight devices Mario Limonciello
2026-04-25 12:41   ` Dmitry Baryshkov
2026-04-25 14:40     ` Mario Limonciello
2026-04-25 21:46       ` Dmitry Baryshkov
2026-04-24 22:09 ` [PATCH v3 4/8] DRM: Add support for client and driver indicating support for luminance Mario Limonciello
2026-04-25 12:17   ` Dmitry Baryshkov
2026-04-25 14:45     ` Mario Limonciello [this message]
2026-04-25 22:38       ` Dmitry Baryshkov
2026-05-08  0:53   ` Louis Chauvet
2026-04-24 22:09 ` [PATCH v3 5/8] drm/amd/display: Pass up errors reading actual brightness Mario Limonciello
2026-04-24 22:09 ` [PATCH v3 6/8] drm/amd: Indicate driver supports luminance Mario Limonciello
2026-04-24 22:09 ` [PATCH v3 7/8] drm/amd/display: Allow backlight registration to fail Mario Limonciello
2026-04-24 22:09 ` [PATCH v3 8/8] drm/amd/display: use drm backlight Mario Limonciello
2026-05-04 13:55 ` [PATCH v3 0/8] Add support for a DRM backlight capability Louis Chauvet
2026-05-04 18:21   ` Mario Limonciello

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb1ab06a-630b-4bd7-95a3-5f679b84dbe2@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=xaver.hugl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox