dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Louis Chauvet <louis.chauvet@bootlin.com>,
	dri-devel@lists.freedesktop.org
Cc: harry.wentland@amd.com, Xaver Hugl <xaver.hugl@gmail.com>,
	amd-gfx@lists.freedesktop.org,
	Marta Lofstedt <marta.lofstedt@intel.com>
Subject: Re: [PATCH v3 2/8] backlight: expose the current brightness in the new kernel API
Date: Mon, 4 May 2026 12:46:01 -0500	[thread overview]
Message-ID: <9e14facc-de6f-4e73-a294-e7b197c90854@amd.com> (raw)
In-Reply-To: <58e0de7b-8c1b-4d93-848d-c5afebb678f7@bootlin.com>



On 5/4/26 08:55, Louis Chauvet wrote:
> [You don't often get email from louis.chauvet@bootlin.com. Learn why 
> this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> On 4/25/26 00:09, Mario Limonciello wrote:
>> From: Marta Lofstedt <marta.lofstedt@intel.com>
>>
>> Current brightness needs to be queried from drivers.
>>
>> Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
>> v3:
>>   * Rebase
>>   * Add description
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> ---
>>   drivers/video/backlight/backlight.c | 6 ++++++
>>   include/linux/backlight.h           | 1 +
>>   2 files changed, 7 insertions(+)
>>
>> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/ 
>> backlight/backlight.c
>> index c3673bee6d9cf..9bbfc16cf2d74 100644
>> --- a/drivers/video/backlight/backlight.c
>> +++ b/drivers/video/backlight/backlight.c
>> @@ -206,6 +206,12 @@ int backlight_device_set_brightness(struct 
>> backlight_device *bd,
>>   }
>>   EXPORT_SYMBOL(backlight_device_set_brightness);
>>
>> +int backlight_device_get_brightness(struct backlight_device *bd)
>> +{
>> +     return bd->props.brightness;
> 
> Hello,
> 
> The function backlight_get_brightness already exists and is already
> public, maybe you can use the existing function?
> 

Thanks for the suggestion.  I'll have a try with this.

> 
>> +}
>> +EXPORT_SYMBOL(backlight_device_get_brightness);
>> +
>>   static ssize_t brightness_store(struct device *dev,
>>               struct device_attribute *attr, const char *buf, size_t 
>> count)
>>   {
>> diff --git a/include/linux/backlight.h b/include/linux/backlight.h
>> index 7e4fee65fddd9..851570b39d041 100644
>> --- a/include/linux/backlight.h
>> +++ b/include/linux/backlight.h
>> @@ -412,6 +412,7 @@ struct backlight_device 
>> *backlight_device_get_by_name(const char *name);
>>   struct backlight_device *backlight_device_get_by_type(enum 
>> backlight_type type);
>>   int backlight_device_set_brightness(struct backlight_device *bd,
>>                                   unsigned long brightness);
>> +extern int backlight_device_get_brightness(struct backlight_device *bd);
>>
>>   #if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
>>   void backlight_notify_blank(struct backlight_device *bd,
> 


  reply	other threads:[~2026-05-04 17:46 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 [this message]
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
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=9e14facc-de6f-4e73-a294-e7b197c90854@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=louis.chauvet@bootlin.com \
    --cc=marta.lofstedt@intel.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