]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm: add dp helper to initialize remote aux channel.
authorDavid (Dingchen) Zhang <dingchen.zhang@amd.com>
Fri, 6 Dec 2019 22:56:37 +0000 (17:56 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Jan 2020 23:07:48 +0000 (18:07 -0500)
[why]
We need to minimally initialize the remote aux channel, e.g. the
crc work struct of remote aux to dump the sink's DPRX CRCs in MST
setup.

[how]
Add helper that only initializes the crc work struct of the remote
aux, hooke crc work queue to 'drm_dp_aux_crc_work'. Then call this
helper in DP MST port initialization.
This, plus David Francis' patch [1], fix the issue of MST remote
aux DPCD CRCs read.

[1] https://patchwork.kernel.org/patch/11217941/

Cc: Leo Li <sunpeng.li@amd.com>
Cc: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: David (Dingchen) Zhang <dingchen.zhang@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_dp_helper.c
drivers/gpu/drm/drm_dp_mst_topology.c
include/drm/drm_dp_helper.h

index 374cedc6c2ac8949874c623b7cacaebdd96af9a4..a5364b5192b8366907bf39438bd059ce474c27ce 100644 (file)
@@ -978,6 +978,19 @@ static void drm_dp_aux_crc_work(struct work_struct *work)
        }
 }
 
+/**
+ * drm_dp_remote_aux_init() - minimally initialise a remote aux channel
+ * @aux: DisplayPort AUX channel
+ *
+ * Used for remote aux channel in general. Merely initialize the crc work
+ * struct.
+ */
+void drm_dp_remote_aux_init(struct drm_dp_aux *aux)
+{
+       INIT_WORK(&aux->crc_work, drm_dp_aux_crc_work);
+}
+EXPORT_SYMBOL(drm_dp_remote_aux_init);
+
 /**
  * drm_dp_aux_init() - minimally initialise an aux channel
  * @aux: DisplayPort AUX channel
index 7d174ba78ebae49032f6e5201e2ebbbee3e6f00a..fa0656697c72e30b9039c392bed463d6984cddb1 100644 (file)
@@ -2200,6 +2200,9 @@ drm_dp_mst_add_port(struct drm_device *dev,
        port->aux.dev = dev->dev;
        port->aux.is_remote = true;
 
+       /* initialize the MST downstream port's AUX crc work queue */
+       drm_dp_remote_aux_init(&port->aux);
+
        /*
         * Make sure the memory allocation for our parent branch stays
         * around until our own memory allocation is released
index 0aeaf4a8951cf8c4c66190639f426ca8571b4e80..bc04467f7c3a563ba2cf54c704a3ff9116d25d6c 100644 (file)
@@ -1465,6 +1465,7 @@ int drm_dp_downstream_id(struct drm_dp_aux *aux, char id[6]);
 void drm_dp_downstream_debug(struct seq_file *m, const u8 dpcd[DP_RECEIVER_CAP_SIZE],
                             const u8 port_cap[4], struct drm_dp_aux *aux);
 
+void drm_dp_remote_aux_init(struct drm_dp_aux *aux);
 void drm_dp_aux_init(struct drm_dp_aux *aux);
 int drm_dp_aux_register(struct drm_dp_aux *aux);
 void drm_dp_aux_unregister(struct drm_dp_aux *aux);