diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-10-03 01:02:29 +0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-11-08 09:36:06 +0400 |
commit | 51cb4b392a307a8293b4f1f300ab803d7ad3b036 (patch) | |
tree | 8d3015ce594c93d63d1f4fbf025a9ceaad92ebb5 /drivers/gpu/drm/nouveau/nouveau_connector.c | |
parent | 7589563eb34527fd1f357a1ef0dbb7ee6b02af1c (diff) | |
download | linux-51cb4b392a307a8293b4f1f300ab803d7ad3b036.tar.xz |
drm/nouveau/core: convert event handler apis to split create/enable semantics
This is a necessary step towards being able to work with the insane locking
requirements of the DRM core's vblank routines, and a nice cleanup as a
side-effect.
This is similar in spirit to the interfaces that Peter Hurley arrived at
with his nouveau_event rcu conversion series.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_connector.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_connector.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 2136d0038252..1aa682494a18 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c @@ -100,6 +100,7 @@ static void nouveau_connector_destroy(struct drm_connector *connector) { struct nouveau_connector *nv_connector = nouveau_connector(connector); + nouveau_event_ref(NULL, &nv_connector->hpd_func); kfree(nv_connector->edid); drm_sysfs_connector_remove(connector); drm_connector_cleanup(connector); @@ -932,10 +933,9 @@ nouveau_connector_hotplug_work(struct work_struct *work) } static int -nouveau_connector_hotplug(struct nouveau_eventh *event, int index) +nouveau_connector_hotplug(void *data, int index) { - struct nouveau_connector *nv_connector = - container_of(event, struct nouveau_connector, hpd_func); + struct nouveau_connector *nv_connector = data; schedule_work(&nv_connector->hpd_work); return NVKM_EVENT_KEEP; } @@ -1007,10 +1007,16 @@ nouveau_connector_create(struct drm_device *dev, int index) ret = gpio->find(gpio, 0, hpd[ffs((entry & 0x07033000) >> 12)], DCB_GPIO_UNUSED, &nv_connector->hpd); - nv_connector->hpd_func.func = nouveau_connector_hotplug; if (ret) nv_connector->hpd.func = DCB_GPIO_UNUSED; + if (nv_connector->hpd.func != DCB_GPIO_UNUSED) { + nouveau_event_new(gpio->events, nv_connector->hpd.line, + nouveau_connector_hotplug, + nv_connector, + &nv_connector->hpd_func); + } + nv_connector->type = nv_connector->dcb[0]; if (drm_conntype_from_dcb(nv_connector->type) == DRM_MODE_CONNECTOR_Unknown) { |