thinkpad_acpi: Support privacy-screen

Bug #1966061 reported by Bin Li
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
New
High
Unassigned
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

On 5.15.0-23-generic, the lcdshadow is not synced.

$ cat /proc/acpi/ibm/lcdshadow
status: 0
commands: 0, 1

And after press the Fn + D, the screen display angle changed, but the content of /proc/acpi/ibm/lcdshadow d0 not change.

Revision history for this message
Bin Li (binli) wrote :

Found a patch, not verified yet.

commit e8b7eb66738f559da1688ef3e4038180d7343547
Author: Hans de Goede <email address hidden>
Date: Tue Oct 5 22:23:19 2021 +0200

    platform/x86: thinkpad_acpi: Get privacy-screen / lcdshadow ACPI handles only once

    Get the privacy-screen / lcdshadow ACPI handles once and cache them,
    instead of retrieving them every time we need them.

    Reviewed-by: Emil Velikov <email address hidden>
    Reviewed-by: Lyude Paul <email address hidden>
    Reviewed-by: Mark Pearson <email address hidden>
    Signed-off-by: Hans de Goede <email address hidden>
    Link: https://patchwork<email address hidden>

tags: added: oem-priority originate-from-1956808 sutton
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1966061

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Bin Li (binli)
Changed in linux (Ubuntu):
status: Incomplete → New
status: New → Confirmed
Revision history for this message
Bin Li (binli) wrote :

With the 10 patches on 5.15.0-25-generic kernel, this issue is fixed.

6306d8dbfae6abbc049cb92fc7cf2acbcd983f8d
Tue Oct 5 22:23:22 2021 +0200 - Hans de Goede: drm/i915: Add privacy-screen support (v3)
94b541f53db1ec6b99fc2186b084177cf6e18824
Tue Oct 5 22:23:21 2021 +0200 - Hans de Goede: drm/i915: Add intel_modeset_probe_defer() helper

f809891ee51b706e1a2a42998d8766c120660796
Tue Oct 5 22:23:20 2021 +0200 - Hans de Goede: platform/x86: thinkpad_acpi: Register a privacy-screen device
e8b7eb66738f559da1688ef3e4038180d7343547
Tue Oct 5 22:23:19 2021 +0200 - Hans de Goede: platform/x86: thinkpad_acpi: Get privacy-screen / lcdshadow ACPI handles only once
1b8101d51873d4644f0ff15f6eac46614542a76b
Tue Oct 5 22:23:18 2021 +0200 - Hans de Goede: platform/x86: thinkpad_acpi: Add hotkey_notify_extended_hotkey() helper

334f74ee85dc26a50c1a2b0da82517595191f92f
Tue Oct 5 22:23:17 2021 +0200 - Hans de Goede: drm/connector: Add a drm_connector privacy-screen helper functions (v2)
8a12b170558aabb31cc98fda0da6a56b518cadaa
Tue Oct 5 22:23:16 2021 +0200 - Hans de Goede: drm/privacy-screen: Add notifier support (v2)
befe5404a00b3b1547c944738df4a9229909bdc9
Tue Oct 5 22:23:15 2021 +0200 - Hans de Goede: drm/privacy-screen: Add X86 specific arch init code 0002
a1a98689301b9af0313e4c1ba44558e8b67ff76e
Tue Oct 5 22:23:14 2021 +0200 - Hans de Goede: drm: Add privacy-screen class (v4) 0001

107fe904302092c683cf5462b4af3cb3cfa40998
Tue Oct 5 22:23:13 2021 +0200 - Rajat Jain: drm/connector: Add support for privacy-screen properties (v4)

Revision history for this message
Bin Li (binli) wrote :

Tested on 5.17.0-1003-oem kernel, this privacy item could be showed.

But it couldn't sync with 'Fn + D', if it is disabled, click the 'Fn + D', it changed enabled, and changed back to disabled quickly. Looks like it's a kind of bug.

Tested my own build image based on 5.15.0-27-generic with upstream patches, it works perfectly. So the new issue might be related kernel side.

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1966061/comments/3

Tested kernel are here.
https://people.canonical.com/~binli/5.15.0-27.28binli1/

Revision history for this message
Bin Li (binli) wrote :

There is one rejection for emerge, so I updated the patch.

commit 334f74ee85dc26a50c1a2b0da82517595191f92f
Author: Hans de Goede <email address hidden>
Date: Tue Oct 5 22:23:17 2021 +0200

    drm/connector: Add a drm_connector privacy-screen helper functions (v2)

--- drivers/gpu/drm/drm_connector.c
+++ drivers/gpu/drm/drm_connector.c
@@ -549,6 +555,10 @@ int drm_connector_register(struct drm_connector *connector)
        /* Let userspace know we have a new connector */
        drm_sysfs_hotplug_event(connector->dev);

+ if (connector->privacy_screen)
+ drm_privacy_screen_register_notifier(connector->privacy_screen,
+ &connector->privacy_screen_notifier);
+
        mutex_lock(&connector_list_lock);
        list_add_tail(&connector->global_connector_list_entry, &connector_list);
        mutex_unlock(&connector_list_lock);

Revision history for this message
Bin Li (binli) wrote :

There is one rejection for below commit, so I updated it.

commit 6306d8dbfae6abbc049cb92fc7cf2acbcd983f8d
Author: Hans de Goede <email address hidden>
Date: Tue Oct 5 22:23:22 2021 +0200

    drm/i915: Add privacy-screen support (v3)

--- drivers/gpu/drm/i915/display/intel_ddi.c
+++ drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3113,6 +3115,7 @@ static void intel_ddi_update_pipe_dp(struct intel_atomic_state *state,
        intel_drrs_update(intel_dp, crtc_state);

        intel_backlight_update(state, encoder, crtc_state, conn_state);
+ drm_connector_update_privacy_screen(conn_state);
 }

 void intel_ddi_update_pipe(struct intel_atomic_state *state,

Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :
Revision history for this message
Bin Li (binli) wrote :

All the other patches could be applied on 5.15.0-27-generic.

Revision history for this message
Bin Li (binli) wrote (last edit ):

In oem kernel, looks all the patches are in 1003, need more time to check the rootcause.

tags: added: patch
Rex Tsai (chihchun)
Changed in oem-priority:
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.