From: Alex Hung <alex.hung@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 2/5] drm/amd: Pass luminance data to amdgpu_dm_backlight_caps
Date: Fri, 28 Feb 2025 15:04:11 -0700 [thread overview]
Message-ID: <b47c433f-1f80-4bd9-b45f-06674a599ca7@amd.com> (raw)
In-Reply-To: <20250228185145.186319-3-mario.limonciello@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
On 2/28/25 11:51, Mario Limonciello wrote:
> The ATIF method on some systems will provide a backlight curve. Pass
> this curve into amdgpu_dm add it to the structures.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v2:
> * Keep ACPI and DM structures separate
> * Add static asserts to ensure structures remain in sync
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 4 ++++
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 20 +++++++++++++++++++
> drivers/gpu/drm/amd/include/amd_acpi.h | 4 +++-
> 3 files changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 515c6f32448d..b7f8f2ff143d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -394,6 +394,10 @@ static int amdgpu_atif_query_backlight_caps(struct amdgpu_atif *atif)
> characteristics.max_input_signal;
> atif->backlight_caps.ac_level = characteristics.ac_level;
> atif->backlight_caps.dc_level = characteristics.dc_level;
> + atif->backlight_caps.data_points = characteristics.number_of_points;
> + memcpy(atif->backlight_caps.luminance_data,
> + characteristics.data_points,
> + sizeof(atif->backlight_caps.luminance_data));
> out:
> kfree(info);
> return err;
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> index f3bc00e587ad..85b64c457ed6 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
> @@ -151,6 +151,18 @@ struct idle_workqueue {
> bool running;
> };
>
> +#define MAX_LUMINANCE_DATA_POINTS 99
> +
> +/**
> + * struct amdgpu_dm_luminance_data - Custom luminance data
> + * @luminance: Luminance in percent
> + * @input_signal: Input signal in range 0-255
> + */
> +struct amdgpu_dm_luminance_data {
> + u8 luminance;
> + u8 input_signal;
> +} __packed;
> +
> /**
> * struct amdgpu_dm_backlight_caps - Information about backlight
> *
> @@ -195,6 +207,14 @@ struct amdgpu_dm_backlight_caps {
> * @dc_level: the default brightness if booted on DC
> */
> u8 dc_level;
> + /**
> + * @data_points: the number of custom luminance data points
> + */
> + u8 data_points;
> + /**
> + * @luminance_data: custom luminance data
> + */
> + struct amdgpu_dm_luminance_data luminance_data[MAX_LUMINANCE_DATA_POINTS];
> };
>
> /**
> diff --git a/drivers/gpu/drm/amd/include/amd_acpi.h b/drivers/gpu/drm/amd/include/amd_acpi.h
> index 2d089d30518f..06badbf0c5b9 100644
> --- a/drivers/gpu/drm/amd/include/amd_acpi.h
> +++ b/drivers/gpu/drm/amd/include/amd_acpi.h
> @@ -61,7 +61,7 @@ struct atif_qbtc_arguments {
>
> struct atif_qbtc_data_point {
> u8 luminance; /* luminance in percent */
> - u8 ipnut_signal; /* input signal in range 0-255 */
> + u8 input_signal; /* input signal in range 0-255 */
> } __packed;
>
> struct atif_qbtc_output {
> @@ -75,6 +75,8 @@ struct atif_qbtc_output {
> u8 number_of_points; /* number of data points */
> struct atif_qbtc_data_point data_points[ATIF_QBTC_MAX_DATA_POINTS];
> } __packed;
> +static_assert(ATIF_QBTC_MAX_DATA_POINTS == MAX_LUMINANCE_DATA_POINTS);
> +static_assert(sizeof(struct atif_qbtc_data_point) == sizeof(struct amdgpu_dm_luminance_data));
>
> #define ATIF_NOTIFY_MASK 0x3
> #define ATIF_NOTIFY_NONE 0
next prev parent reply other threads:[~2025-02-28 22:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 18:51 [PATCH v2 0/5] Add custom brightness curve support Mario Limonciello
2025-02-28 18:51 ` [PATCH v2 1/5] drm/amd: Copy entire structure in amdgpu_acpi_get_backlight_caps() Mario Limonciello
2025-03-03 15:03 ` Alex Hung
2025-02-28 18:51 ` [PATCH v2 2/5] drm/amd: Pass luminance data to amdgpu_dm_backlight_caps Mario Limonciello
2025-02-28 22:04 ` Alex Hung [this message]
2025-02-28 18:51 ` [PATCH v2 3/5] drm/amd/display: Avoid operating on copies of backlight caps Mario Limonciello
2025-02-28 22:04 ` Alex Hung
2025-02-28 18:51 ` [PATCH v2 4/5] drm/amd/display: Add support for custom brightness curve Mario Limonciello
2025-02-28 22:04 ` Alex Hung
2025-02-28 18:51 ` [PATCH v2 5/5] drm/amd/display: Add a new dcdebugmask to allow turning off " Mario Limonciello
2025-02-28 22:04 ` Alex Hung
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=b47c433f-1f80-4bd9-b45f-06674a599ca7@amd.com \
--to=alex.hung@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=mario.limonciello@amd.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