OSDN Git Service

drm/atomic: Add TV subconnector property to get/set_property
authorMaxime Ripard <maxime@cerno.tech>
Thu, 29 Sep 2022 16:31:00 +0000 (18:31 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 10 Oct 2022 11:56:42 +0000 (13:56 +0200)
The subconnector property was created by drm_mode_create_tv_properties(),
but wasn't exposed to the userspace through the generic
atomic_get/set_property implementation, and wasn't stored in any generic
state structure.

Let's solve this.

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v4-6-60d38873f782@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/drm_atomic_uapi.c
include/drm/drm_connector.h

index c74c78a..c06d063 100644 (file)
@@ -688,6 +688,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector,
                return -EINVAL;
        } else if (property == config->tv_select_subconnector_property) {
                state->tv.select_subconnector = val;
+       } else if (property == config->tv_subconnector_property) {
+               state->tv.subconnector = val;
        } else if (property == config->tv_left_margin_property) {
                state->tv.margins.left = val;
        } else if (property == config->tv_right_margin_property) {
@@ -796,6 +798,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector,
                        *val = connector->dpms;
        } else if (property == config->tv_select_subconnector_property) {
                *val = state->tv.select_subconnector;
+       } else if (property == config->tv_subconnector_property) {
+               *val = state->tv.subconnector;
        } else if (property == config->tv_left_margin_property) {
                *val = state->tv.margins.left;
        } else if (property == config->tv_right_margin_property) {
index 60b5662..1d5e3cc 100644 (file)
@@ -693,6 +693,7 @@ struct drm_connector_tv_margins {
 /**
  * struct drm_tv_connector_state - TV connector related states
  * @select_subconnector: selected subconnector
+ * @subconnector: detected subconnector
  * @margins: TV margins
  * @mode: TV mode
  * @brightness: brightness in percent
@@ -704,6 +705,7 @@ struct drm_connector_tv_margins {
  */
 struct drm_tv_connector_state {
        enum drm_mode_subconnector select_subconnector;
+       enum drm_mode_subconnector subconnector;
        struct drm_connector_tv_margins margins;
        unsigned int mode;
        unsigned int brightness;