drm/connector: Add a drm_connector privacy-screen helper functions (v2)
authorHans de Goede <hdegoede@redhat.com>
Tue, 5 Oct 2021 20:23:17 +0000 (22:23 +0200)
committerHans de Goede <hdegoede@redhat.com>
Thu, 14 Oct 2021 11:12:26 +0000 (13:12 +0200)
commit334f74ee85dc26a50c1a2b0da82517595191f92f
treeb527bcca03e86d3d6bddcd255550145510cc0afd
parent8a12b170558aabb31cc98fda0da6a56b518cadaa
drm/connector: Add a drm_connector privacy-screen helper functions (v2)

Add 2 drm_connector privacy-screen helper functions:

1. drm_connector_attach_privacy_screen_provider(), this function creates
and attaches the standard privacy-screen properties and registers a
generic notifier for generating sysfs-connector-status-events on external
changes to the privacy-screen status.

2. drm_connector_update_privacy_screen(), update the privacy-screen's
sw_state if the connector has a privacy-screen.

Changes in v2:
- Do not update connector->state->privacy_screen_sw_state on
  atomic-commits.
- Change drm_connector_update_privacy_screen() to take drm_connector_state
  as argument instead of a full drm_atomic_state. This allows the helper
  to be called by drivers when they are enabling crtcs/encoders/connectors.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-6-hdegoede@redhat.com
drivers/gpu/drm/drm_connector.c
include/drm/drm_connector.h