From: "Limonciello, Mario" <Mario.Limonciello@amd.com>
To: Alex Deucher <alexdeucher@gmail.com>, "Hung, Alex" <Alex.Hung@amd.com>
Cc: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
"Wentland, Harry" <Harry.Wentland@amd.com>,
"Li, Sun peng (Leo)" <Sunpeng.Li@amd.com>,
"Pillai, Aurabindo" <Aurabindo.Pillai@amd.com>,
"Li, Roman" <Roman.Li@amd.com>, "Lin, Wayne" <Wayne.Lin@amd.com>,
"Chung, ChiaHsuan (Tom)" <ChiaHsuan.Chung@amd.com>,
"Zuo, Jerry" <Jerry.Zuo@amd.com>,
"Wheeler, Daniel" <Daniel.Wheeler@amd.com>,
"Wu, Ray" <Ray.Wu@amd.com>, "LIPSKI, IVAN" <IVAN.LIPSKI@amd.com>
Subject: Re: [PATCH 07/11] drm/amd/display: Attach privacy screen to DRM connector
Date: Mon, 18 Aug 2025 21:18:02 +0000 [thread overview]
Message-ID: <78266d43-9d6e-4e22-84de-e30ea0def90e@amd.com> (raw)
In-Reply-To: <CADnq5_NhgCORJE6YqiWfS8qX2FK6b9y8dHjHf1quXrUP_MrFMw@mail.gmail.com>
On 8/18/25 4:16 PM, Alex Deucher wrote:
> On Wed, Aug 13, 2025 at 7:33 PM Alex Hung <alex.hung@amd.com> wrote:
>>
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> [WHY]
>> If a system has a privacy screen advertised by a driver it should
>> be included in the DRM connector for the eDP panel.
>>
>> [HOW]
>> Detect statically declared privacy screens when creating eDP connector
>> and attach privacy screen DRM properties.
>>
>> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
>> Signed-off-by: Alex Hung <alex.hung@amd.com>
>> ---
>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 25 ++++++++++++++++++-
>> 1 file changed, 24 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index e8cfae2bd2ae..176f420effd9 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -80,6 +80,7 @@
>> #include <linux/component.h>
>> #include <linux/sort.h>
>>
>> +#include <drm/drm_privacy_screen_consumer.h>
>> #include <drm/display/drm_dp_mst_helper.h>
>> #include <drm/display/drm_hdmi_helper.h>
>> #include <drm/drm_atomic.h>
>> @@ -7846,6 +7847,14 @@ amdgpu_dm_connector_atomic_check(struct drm_connector *conn,
>> if (!crtc)
>> return 0;
>>
>> + if (new_con_state->privacy_screen_sw_state != old_con_state->privacy_screen_sw_state) {
>> + new_crtc_state = drm_atomic_get_crtc_state(state, crtc);
>> + if (IS_ERR(new_crtc_state))
>> + return PTR_ERR(new_crtc_state);
>> +
>> + new_crtc_state->mode_changed = true;
>> + }
>> +
>> if (new_con_state->colorspace != old_con_state->colorspace) {
>> new_crtc_state = drm_atomic_get_crtc_state(state, crtc);
>> if (IS_ERR(new_crtc_state))
>> @@ -8541,6 +8550,18 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
>> if (adev->dm.hdcp_workqueue)
>> drm_connector_attach_content_protection_property(&aconnector->base, true);
>> }
>> +
>> + if (connector_type == DRM_MODE_CONNECTOR_eDP) {
>
> Do the privacy screens exist on any old laptops with LVDS? If so, we
> should add DRM_MODE_CONNECTOR_LVDS here as well.
>
> Alex
At least for AMD laptops I don't think so. They're for newer designs
that would solely be connected eDP.
>
>> + struct drm_privacy_screen *privacy_screen;
>> +
>> + privacy_screen = drm_privacy_screen_get(adev_to_drm(adev)->dev, NULL);
>> + if (!IS_ERR(privacy_screen)) {
>> + drm_connector_attach_privacy_screen_provider(&aconnector->base,
>> + privacy_screen);
>> + } else if (PTR_ERR(privacy_screen) != -ENODEV) {
>> + drm_warn(adev_to_drm(adev), "Error getting privacy-screen\n");
>> + }
>> + }
>> }
>>
>> static int amdgpu_dm_i2c_xfer(struct i2c_adapter *i2c_adap,
>> @@ -10265,7 +10286,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
>> unsigned long flags;
>> bool wait_for_vblank = true;
>> struct drm_connector *connector;
>> - struct drm_connector_state *old_con_state, *new_con_state;
>> + struct drm_connector_state *old_con_state = NULL, *new_con_state = NULL;
>> struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state;
>> int crtc_disable_count = 0;
>>
>> @@ -10383,6 +10404,8 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
>> &stream_update);
>> mutex_unlock(&dm->dc_lock);
>> kfree(dummy_updates);
>> +
>> + drm_connector_update_privacy_screen(new_con_state);
>> }
>>
>> /**
>> --
>> 2.43.0
>>
next prev parent reply other threads:[~2025-08-18 21:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 23:18 [PATCH 00/11] DC Patches Aug 13, 2025 Alex Hung
2025-08-13 23:18 ` [PATCH 01/11] drm/amd/display: Add LSDMA Linear Sub Window Copy support Alex Hung
2025-08-13 23:18 ` [PATCH 02/11] drm/amd/display: Refactor DPP enum for backwards compatibility Alex Hung
2025-08-13 23:18 ` [PATCH 03/11] drm/amd/display: Optimize amdgpu_dm_atomic_commit_tail() Alex Hung
2025-08-13 23:18 ` [PATCH 04/11] drm/amd/display: Delete unused functions Alex Hung
2025-08-13 23:18 ` [PATCH 05/11] drm/amd/display: Align LSDMA commands fields Alex Hung
2025-08-13 23:18 ` [PATCH 06/11] drm/amd/display: Setup Second Stutter Watermark Implementation Alex Hung
2025-08-13 23:18 ` [PATCH 07/11] drm/amd/display: Attach privacy screen to DRM connector Alex Hung
2025-08-18 21:16 ` Alex Deucher
2025-08-18 21:18 ` Limonciello, Mario [this message]
2025-08-13 23:18 ` [PATCH 08/11] drm/amd/display: Avoid a NULL pointer dereference Alex Hung
2025-08-13 23:18 ` [PATCH 09/11] drm/amd/display: [FW Promotion] Release 0.1.23.0 Alex Hung
2025-08-13 23:18 ` [PATCH 10/11] drm/amd/display: Fix Xorg desktop unresponsive on Replay panel Alex Hung
2025-08-13 23:18 ` [PATCH 11/11] drm/amd/display: Promote DC to 3.2.346 Alex Hung
2025-08-18 13:38 ` [PATCH 00/11] DC Patches Aug 13, 2025 Wheeler, Daniel
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=78266d43-9d6e-4e22-84de-e30ea0def90e@amd.com \
--to=mario.limonciello@amd.com \
--cc=Alex.Hung@amd.com \
--cc=Aurabindo.Pillai@amd.com \
--cc=ChiaHsuan.Chung@amd.com \
--cc=Daniel.Wheeler@amd.com \
--cc=Harry.Wentland@amd.com \
--cc=IVAN.LIPSKI@amd.com \
--cc=Jerry.Zuo@amd.com \
--cc=Ray.Wu@amd.com \
--cc=Roman.Li@amd.com \
--cc=Sunpeng.Li@amd.com \
--cc=Wayne.Lin@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.